function checkEmail(adres) {
if (adres != "") {
	var re = new RegExp("[^@]{1,}[@]{1}[^@.]{1,}[.]{1}[^@]{1,}","gi");
	var wynik = re.test(adres);
	}
else wynik = false;
return wynik;
}
function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
browserversion = parseInt(navigator.appVersion);
}

function rollOutFlash(myToggle)
{
window.document.banner.SetVariable ("_root.myToggle"," " + myToggle);
}

curToggle = 0;
window.status = 'Copyrights 2006 Boba sp.j. realizacja: 4n.pl';

function FirmaRoll(Nazwa) {
objFirma = window.document.getElementById(Nazwa);
if (objFirma.style.display=="block") objFirma.style.display="none";
else objFirma.style.display="block";
}
function openNew(id) {
window.open("popup.php?id="+id,"","width=300,height=435");
return 0;
}
function submitForm(Nazwa)
{
objForm = window.document.getElementById(Nazwa);
objForm.submit();
}
function openNewGaleria(id,position,szerokosc) {
window.open("popup.php?id_p="+id+"&position="+position,"","width="+szerokosc+",height=435,resizable=1");
return 0;
}
function chkForm() {
alertMSG = 'Wystąpił błąd:'
Error = 0;
objIn = document.getElementById("Formularz");
temat = objIn.temat.value;
wiadomosc = objIn.tresc.value;
telefon = objIn.telefon.value;
email = objIn.email.value;
if ((checkEmail(email)==false)&&(email!='')) {Error = 1; alertMSG += "\nPodany e-mail jeset nie poprawny";}
if (temat=='') {Error = 1; alertMSG += "\nProszę uzupełnić temat wiadomości";}
if (wiadomosc=='') {Error = 1; alertMSG += "\nProszę uzupełnić wiadomość";}
if ((email=='')&&(telefon==''))  {Error = 1; alertMSG += "\nProszę podać telefon lub adres e-mail";}
if (Error==1) {alert(alertMSG); return false;}
else return true;
}