function MM_swapImgRestore() { //v3.0
  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_preloadImages() { //v3.0
  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];}}
}
function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function erydianchecker1() {

var email=document.forms["zamowienie"].elements["email"].value;
var malpa=email.indexOf('@');
var kropka=email.lastIndexOf('.');

if(document.forms["zamowienie"].elements["firma"].value==""){
    alert('Proszę podać  nazwę firmy');
	document.forms["zamowienie"].elements["firma"].focus();
  	return false;
}
if(document.forms["zamowienie"].elements["osoba"].value==""){
    alert('Proszę podać: Osoba kontaktowa');
	document.forms["zamowienie"].elements["osoba"].focus();
  return false;
}
if(document.forms["zamowienie"].elements["adres"].value==""){
    alert('Proszę podać  ulicę i nr domu');
	document.forms["zamowienie"].elements["adres"].focus();
  return false;
}
if(document.forms["zamowienie"].elements["miasto"].value==""){
    alert('Proszę podać  miasto');
	document.forms["zamowienie"].elements["miasto"].focus();
  return false;
}
if(document.forms["zamowienie"].elements["kod"].value==""){
    alert('Proszę podać kod pocztowy');
	document.forms["zamowienie"].elements["kod"].focus();
  return false;
}
if(document.forms["zamowienie"].elements["telefon"].value==""){
    alert('Proszę podać  telefon kontaktowy');
	document.forms["zamowienie"].elements["telefon"].focus();
  return false;
}
if(email== ""){
	alert("Proszę wpisać swój adres e-mail ");
	document.forms["zamowienie"].elements["email"].focus();
  return false;
}
if (malpa<2 || malpa>kropka){
   alert("Podany adres e-mail jest niepoprawny ");
   document.forms["zamowienie"].elements["email"].focus();
  return false;
}

return true;
}


function erydianchecker() {
if(document.forms["powiadom"].elements["wysylajacy"].value==""){
    alert('Proszę podać imię');
  return false;
}
if(document.forms["powiadom"].elements["odbiorca"].value==""){
    alert('Proszę podać imię odbiorcy');
  return false;
}
return true;
}


function erydianantyspam(alias,domena) {
                locationstring = "mailto:" + alias + "@" + domena ;
                window.location = locationstring;
                }

       function poprawnyAdres(emailAdr) {
         zleZnaki = " /:,;"
         if (emailAdr == "") {                           // nie może być pusty
            return false
         }
         for (i=0; i<zleZnaki.length; i++) {             // czy zawiera nierawidłowe znaki?            
            zlyZnak=zleZnaki.charAt(i)
            if (emailAdr.indexOf(zlyZnak,0) != -1) {
               return false
            }
         }
         malpaPoz=emailAdr.indexOf("@",0)                // musi zawierać symbol "@"
         if (malpaPoz == -1 || malpaPoz == 0) {
            return false
         }
         if (emailAdr.indexOf("@", malpaPoz+1) != -1) {  // może być tylko jedno "@"
            return false
         }
         kropkaPoz = emailAdr.indexOf(".",malpaPoz)      // musi być conajmniej jedna kropka
         if(kropkaPoz==-1 || kropkaPoz==malpaPoz+1) {
            return false
         }
         if(kropkaPoz+3 > emailAdr.length) {              // po kropce muszą być conajmniej 2 znaki
            return false
         }
         return true
      }
      function wyslijDane(form) {      
         if(!poprawnyAdres(form.emailAdr.value)) {
            alert("Podany adres e-mail nie jest poprawny!")
            form.emailAdr.focus()
            form.emailAdr.select()
            return false
         }
         return true
      }
