/*
	Murator Expo, Targi Mieszkaniowe - JavaScripts
	gka@emarketingexperts.pl / www.emarketingexperts.pl
	v1.0, 05.03.2007
*/
function valid_mail(co) { return (/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(co)); }
function check_email() {
            
            var x=0;
            var msg='';
            var email=document.forms.newsletter_form.email.value;
            if (email=='') {
              msg+='Nie podano adresu email'+'\n';
              x++;
            }
            else {
              if (!valid_mail(email)) {
                msg+='Podano niepoprawny adres email'+'\n'+email;
                x++;
              }
            }
            if (x>0) {
              alert(msg);
              return false;
            }
            else return true;
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
popup="";
function okno(arg,s,x,y) {
  if (popup == '[object]') {popup.close()} else {}
  scr_width = screen.availWidth;
  scr_height = screen.availHeight;
  left_align = eval(scr_width/2)-eval(x/2);
  top_align = eval(scr_height/2)-eval(y/2);
  popup=window.open(arg,'szczegoly','toolbar=0,location=0,direction=0,status=0,resize=1,menubar=0,scrollbars='+s+',width='+x+',height='+y+',left='+left_align+',top='+top_align);
}


function showSelect(id_div,id_ul) {
	if (!document.getElementById) return false;
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById(id_div)) return false;
	if (!document.getElementById(id_ul)) return false;
	var f_select = document.getElementById(id_div);
	var nav = document.getElementById(id_ul);
	f_select.onmousemove =  function() {
		nav.style.display = "block";
	}
	f_select.onmouseout =  function() {
		nav.style.display = "none";
	}
	var lis = nav.getElementsByTagName("li");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover = function() {
			nav.style.display = "block";
		}
	}
	nav.onmouseout =  function() {
		nav.style.display = "none";
	}
}


addLoadEvent(function(){
	showSelect("fs-projects","fs-n_projects");
	showSelect("fs-sites","fs-n_sites");
});

// addLoadEvent(newsletterLabel);