function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no, left=10,top=10' );
}

function validateform() {
 for(var i=0; i<fields.length; i++) {
  if (document.f.elements[fields[i]].value == '' || document.f.elements[fields[i]].value == 0) {
   alert(fields_info[i]);
   document.f.elements[fields[i]].focus();
   return false;
  }
 }
 if (validateemail(document.f.elements['email'].value)) {
  return true;
 } else {
  return false;
 } 
}

function validateemail(t) {
  maska = /^[0-9a-z_.-]+@([0-9a-z-]+.)+[a-z]{2,4}$/;
  if (maska.test(t)==false) { 
    alert("Podaj poprawny adres e-mail");
    document.f.elements['email'].focus();
    return false;
  }
  return true;
}

function se(a,b) {
	window.location.href = 'mailto:'+a+'@'+b+'.pl';
}

function opensmallwindow(w,h) {
 smallwindow = window.open("", "smallwindow", "width="+w+", height="+h+", toolbar=no, scrollbars=no");
 x = (screen.Width/2)-(w/2);
 y = (screen.Height/2)-(h/2);
 smallwindow.moveTo(x,y);
 smallwindow.focus();
}

function opensmallwindowa(w,h) {
 smallwindow = window.open("", "smallwindow", "width="+w+", height="+h+", toolbar=no, scrollbars=yes");
 x = (screen.Width/2)-(w/2);
 y = (screen.Height/2)-(h/2);
 smallwindow.moveTo(x,y);
 smallwindow.focus();
}
