function id(label) {
	if(document.getElementById) o = document.getElementById(label);
		else o = document.all[label];
	return o;
}

function przelacz(tab) {

	if (document.getElementById('tech')) document.getElementById('tech').style.display='none';
	if (document.getElementById('gallery')) document.getElementById('gallery').style.display='none';
	if (document.getElementById('formul')) document.getElementById('formul').style.display='none';
	if (document.getElementById('kolory')) document.getElementById('kolory').style.display='none';
	if (document.getElementById('realizacje')) document.getElementById('realizacje').style.display='none';
	if (document.getElementById('schematy')) document.getElementById('schematy').style.display='none';	
	
	document.getElementById(tab).style.display='block';
}

function show_mail(user,domena,kraj) {
  var start = "<a href=\"mailto:"+user+"@"+domena+"."+kraj+"\" title=\"\">";
  var end = "</a>";
    document.write(start+user+"@"+domena+"."+kraj+end);
  return 0;
}


function swf_insert_main(filename,w,h) {
			var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'width="'+w+'" height="'+h+'"'
			+ 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">'
			+ '<param name="movie" value="'+filename+'" /><param name="quality" value="high" /><param name="bgcolor" value="#696969" /><param name="wmode" value="opaque" />'
			+ '<embed src="'+filename+'" quality="high" bgcolor="#696969" '
			+ 'width="'+w+'" height="'+h+'" name="MapViewer9" align="middle"'
			+ 'play="true"'

			+ 'loop="false"'
			+ 'quality="high"'
			+ 'wmode="opaque"'
			+ 'allowScriptAccess="sameDomain"'
			+ 'type="application/x-shockwave-flash"'
			+ '>'
			+ '<\/embed>'
			+ '<\/object>';
		majorVersion=8;
		minorVersion=8;
		installinfo='<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><a href="https://www.macromedia.com/go/getflashplayer" class="black" target="_blank" style="text-decoration: none; font-family: tahoma; font-size: 11px;"><img src="images/get_flash.png" alt="pobierz Flash Playera" border="0" /><br/>Pobierz wtyczkę <strong>Flash Player</strong></a>'; // URL zawierajacy informacje o potrzebie instalacji
		if(navigator.product=='Gecko' || navigator.userAgent.indexOf('Opera')!=-1) {
		 if(plugin=navigator.plugins["Shockwave Flash"]) {
		  if(majorVersion > parseInt(plugin.description.substr(plugin.description.indexOf(".")-2, 2))
		  || minorVersion > parseInt(plugin.description.substr(plugin.description.length-2)) )
			document.write(installinfo);  // pobieranie flasha
		  else document.write(oeTags);
		 } else {
			document.write(installinfo);  // pobieranie flasha 
		 }
		}
		else document.write(oeTags);
		//-->
}


function swf_insert(filename,w,h) {
			var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'width="'+w+'" height="'+h+'"'
			+ 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">'
			+ '<param name="movie" value="'+filename+'" /><param name="quality" value="high" /><param name="bgcolor" value="#329DD4" /><param name="wmode" value="transparent" />'
			+ '<embed src="'+filename+'" quality="high" bgcolor="#329DD4" '
			+ 'width="'+w+'" height="'+h+'" name="MapViewer9" align="middle"'
			+ 'play="true"'
//			+ 'wmode="transparent"'
			+ 'loop="false"'
			+ 'quality="high"'
			+ 'allowScriptAccess="sameDomain"'
			+ 'type="application/x-shockwave-flash"'
			+ '>'
			+ '<\/embed>'
			+ '<\/object>';
		majorVersion=8;
		minorVersion=8;
		installinfo='<br/><br/><br/><a href="https://www.macromedia.com/go/getflashplayer" class="black" target="_blank" style="text-decoration: none; font-family: tahoma; font-size: 11px;"><img src="images/get_flash.png" alt="pobierz Flash Playera" border="0" /><br/>Pobierz wtyczkę <strong>Flash Player</strong></a>'; // URL zawierajacy informacje o potrzebie instalacji
		if(navigator.product=='Gecko' || navigator.userAgent.indexOf('Opera')!=-1) {
		 if(plugin=navigator.plugins["Shockwave Flash"]) {
		  if(majorVersion > parseInt(plugin.description.substr(plugin.description.indexOf(".")-2, 2))
		  || minorVersion > parseInt(plugin.description.substr(plugin.description.length-2)) )
			document.write(installinfo);  // pobieranie flasha
		  else document.write(oeTags);
		 } else {
			document.write(installinfo);  // pobieranie flasha 
		 }
		}
		else document.write(oeTags);
		//-->
}

function swf_insert_transparent(filename,w,h) {
			var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'width="'+w+'" height="'+h+'"'
			+ 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">'
			+ '<param name="movie" value="'+filename+'" /><param name="quality" value="high" /><param name="bgcolor" value="#329DD4" /><param name="wmode" value="transparent" />'
			+ '<embed src="'+filename+'" quality="high" bgcolor="#329DD4" '
			+ 'width="'+w+'" height="'+h+'" name="MapViewer9" align="middle"'
			+ 'play="true"'
			+ 'wmode="transparent"'
			+ 'loop="false"'
			+ 'quality="high"'
			+ 'allowScriptAccess="sameDomain"'
			+ 'type="application/x-shockwave-flash"'
			+ '>'
			+ '<\/embed>'
			+ '<\/object>';
		majorVersion=8;
		minorVersion=8;
		installinfo='<br/><br/><br/><a href="https://www.macromedia.com/go/getflashplayer" class="black" target="_blank" ><img src="images/GET_FLA.png" alt="pobierz Flash Playera" border="0" /><br/>pobierz wtyczke <strong>flash player</strong></a>'; // URL zawierajacy informacje o potrzebie instalacji
		if(navigator.product=='Gecko' || navigator.userAgent.indexOf('Opera')!=-1) {
		 if(plugin=navigator.plugins["Shockwave Flash"]) {
		  if(majorVersion > parseInt(plugin.description.substr(plugin.description.indexOf(".")-2, 2))
		  || minorVersion > parseInt(plugin.description.substr(plugin.description.length-2)) )
			document.write(installinfo);  // pobieranie flasha
		  else document.write(oeTags);
		 } else {
			document.write(installinfo);  // pobieranie flasha 
		 }
		}
		else document.write(oeTags);
		//-->
}

function testuj() {
var form = document.kontakt;
var Wzor2=/^[0-9a-zA-Z._-]+\@[0-9a-zA-Z_-]+\.[0-9a-zA-Z.]+$/;

	if (form.imie.value.length < 3) {
		alert("Imię i nazwisko: proszę wypenić!");
		form.imie.focus();
		return false;
    }
		if (form.miejscowosc.value.length < 3) {
			alert("Miejscowość: proszę wypełnić!");
			form.miejscowosc.focus();
			return false;
    	}
	if(Wzor2.test(form.mail.value)==false) {
		alert("E-mail: proszę wypenić prawidłowo!");
		form.mail.focus();
		return false;
    }	
	if (form.telefon.value.length < 7) {
		alert("Telefon: proszę wypełnić!");
		form.telefon.focus();
		return false;
    }	
	if (form.wiadomosc.value.length < 3) {
		alert("Wiadomość: proszę wypełnić!");
		form.wiadomosc.focus();
		return false;
    }
	if(form.ulotka.checked) {
		if (form.ulica.value.length < 3) {
			alert("Ulica: proszę wypełnić!");
			form.ulica.focus();
			return false;
    	}
		if (form.kod.value.length < 5) {
			alert("Kod: proszę wypełnić!");
			form.kod.focus();
			return false;
    	}
	}
return true;		
}
