<!--

function formCheckEmail(myForm) {
  
  if (myForm.email.value == ""){
  	alert ("Proszę podać adres e-mail.");
  	myForm.email.focus();
  	return false;
  	}
  else if (!valid_email(myForm.email.value)) {
  	alert ("Niepoprawny adres e-mail.");
 	 myForm.email.focus();
  	return false;
  }  

}

function valid_email(email) {
		var bad_char;
		
      if (email == "") { 
			return false; 
		}
		
		var bad_chars = " ~!#$%^&*()+|\=?/:,;";
      for (i=0; i<bad_chars.length; i++) {		
      	bad_char=bad_chars.charAt(i)
	      if (email.indexOf(bad_char) != -1) {
	         return false;
	      }
      }
		
		if (email.indexOf("@") <= 0){
			return false;
		}
		
		 if (email.indexOf("@", email.indexOf("@")+1) != -1) { 
		 	return false; 
		}
		
		if (email.indexOf(".",email.indexOf("@")+1) == email.indexOf("@")+1) { // znak . zaraz po znaku @ w adresie email
   			 return false; 
		 }

		
		if (email.indexOf(".") <= 0){
			return false;
		}
		
      if((email.indexOf(".")+3) > email.length) { 
			return false; 
		} 

      return true
}

function CheckSubscribe(myForm) 
{
  
  if (myForm.email.value == "")
  {
  	alert ("Proszę podać adres e-mail.");
  	myForm.email.focus();
  	return false;
  }
  else if (!valid_email(myForm.email.value)) {
  	alert ("Niepoprawny adres e-mail.");
 	 myForm.email.focus();
  	return false;
  } 
   
  return true;
}

function collapse(field) { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
		if (document.getElementById(field).style.display == 'none') {
			document.getElementById(field).style.display = 'block';
			//document.getElementById(field + '_img').src = 'images/minus.gif';
		} else {
			document.getElementById(field).style.display = 'none';
			//document.getElementById(field + '_img').src = 'images/plus.gif';
		}
	} else {
		if (document.layers) { // Netscape 4 
			if (document.layers[field].display == 'none') {
				document.layers[field].display = 'block';
				//document.layers[field + '_img'].src = 'images/minus.gif';
			} else {
				document.layers[field].display = 'none'; 
				//document.layers[field + '_img'].src = 'images/plus.gif';
			}
		} else { // IE 4 
			if (document.all[field].style.display == 'none') {
				document.all[field].style.display = 'block'; 
				//document.all[field + '_img'].src = 'images/minus.gif'; 
			} else {
				document.all[field].style.display = 'none'; 
				//document.all[field + '_img'].src = 'images/plus.gif'; 
			}
		}
	} 
}

function otworz(adres,param)
{
newwin =
window.open("","newwin",param+"toolbar=0,menubar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0");
var tmp="";
tmp += "<html><head><title>Fotka</title>" ;
tmp += "<script language='javascript'>";
tmp += "var NS = (navigator.appName==\"Netscape\")?true:false;" ;
tmp += "function fitpic() {" ;
tmp += "iWidth = (NS)?window.innerWidth:document.body.clientWidth;" ;
tmp += "iHeight = (NS)?window.innerHeight:document.body.clientHeight;" ;
tmp += "iWidth = document.images[0].width - iWidth;" ;
tmp += "iHeight = document.images[0].height - iHeight;" ;
tmp += "window.resizeBy(iWidth, iHeight);" ;
tmp += "self.focus();" ;
tmp += "}" ;
tmp += "<\/script>" ;
tmp += "<\/head><body onload=\"fitpic()\" style='margin: 0;padding:0'>" ;
tmp += "<img src=\""+adres+"\" > " ;
tmp += "<\/body><\/html>" ;
newwin.tmp=tmp;
if (document.all)
{
newwin.moveTo(0,0);
} 
newwin.location.href='javascript:tmp';
}

//-->