
	function sprawdzIleZnakow(ile){
		if(ile.length<1){
		    alert('Nic nie wpisałe¶ !');
		    return false;
		}
		else if(ile.length<20){
		    
		    alert('Wpisany komentarz jest za krótki - min 20 znaków!');
		    return false;
		}
		else
			return true;
	}
	
	function check_email(email){
	               invalid = " /:,;";
	               if(email == "") { return false }
	               for(i=0; i < invalid.length; i++) {
	               bad = invalid.charAt(i);
	               if (email.indexOf (bad, 0) != -1) { return false }
	               }
	               at = email.indexOf("@", 0);
	               if( (at == -1) || (at == 0) ) { return false }
	               if(email.indexOf("@", at+1) != -1) { return false }
	               period = email.indexOf(".", at);
	               if( (period == -1) || (period == at+1) ) { return false }
	               if(period+3 > email.length == -1) { return false }
	               
	
	               //if(tresc == "") { return false }
	               //if(temat == "") { return false }
	               
	               return true;
	            }
	
	
	   
	         function subsctibe(form) {
	                
	                if (!(check_email(form._to.value))) {
	                               
	                alert('Nie podałe poprawnego adresu e-mail');
	                form._to.focus();
	                
	            } else {               
	                form.action="http://newsletter.5m.pl/aplc/save2.php?redir=http://www.webfestival.pl/?potwierdzenie_newslettera=1";
	                form.submit();
	            	}
	
	            }
	

function zapros(form) {
	                
	             if (!(check_email(form.mail_do_znajomego.value))) {
	                               
	                alert('Nie podałe¶ poprawnego adresu e-mail');
	                form.mail_do_znajomego.focus();
	                
	            } else {               
	                form.action="/?id=zapros";
	                form.submit();
	            	}
	
}
	
function wyslijZaproszenie(form) {
	                
	              if (!(check_email(form.adresZnajomego.value))) {
	                               
	                
	                form.adresZnajomego.focus();
	                
	            } else {                
	                
	                form.action="/wyslij.php";
	                form.submit();
	            	
	            	}
	            	
}
	


function dodajKomentarz(form) {
	                
	              if (!(sprawdzIleZnakow(form.trescKomentarza.value))) {
	                               
	                
	                form.trescKomentarza.focus();
	                
	            } else {                
	                
	                form.action="/wyslijKomentarz.php";
	                form.submit();
	            	
	            	}
	            	
}
	            
	            
function poczta(){
pr_1 = "mai";
pr_2 = "lto:";
ln = "info";
at = "&#64;";
sr = "webfestival.pl";
//alert('aa');
document.write('<a class=pelna_txt href=');
document.write(pr_1+pr_2+ln+at+sr);
document.write('>');
document.write(ln+at+sr); 
document.write('<\/a>'); 
}

function poczta2(){
pr_1 = "mai";
pr_2 = "lto:";
ln = "info";
at = "&#64;";
sr = "webfestival.pl";
sr2 = "napisz do nas";
//alert('aa');
document.write('<a class=pelna_txt href=');
document.write(pr_1+pr_2+ln+at+sr);
document.write('>');
document.write(sr2); 
document.write('<\/a>'); 
}


function foto ( url ) {
//            options="top=10,left=10";
            options="status=no,scrollbars=yes,width=1035,height=700,top=0,left=0";
            window.open (url,"",options);
            //alert(url);
}





///////////////////////////// Bannery 


function czytaj_ciacho(nazwa)
 {
  nazwa+="="; //uzupełnia nazwę
  startCookie=document.cookie.indexOf(nazwa); //sprawdza czy istnieje cookie o podanej nazwie
  if (startCookie==-1) {return ""} //jeżeli nie istnieje
  startCookie+=nazwa.length; //początek treści cookie
  if (document.cookie.indexOf(";",startCookie)==-1) //jeżeli jest więcej cookie
   {
    koniecCookie=document.cookie.length; //jeżeli nie ma podstawia jako koniec cookie, koniec całego tekstu
   }
  else
   {
    koniecCookie=document.cookie.indexOf(";",startCookie); // podstawia pod koniec miejsce występowania ";" (czyli początek następnego cookie)
   }
  textCookie=document.cookie.substring(startCookie,koniecCookie); //kopiuje treść cookie
  textCookie=unescape(textCookie); //rozkodowuje treść
  return textCookie; //zwraca wartość
}


function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}





function zamknij() {
  widoczne=false;
  //document.cookie ='widoczne2=x';
  setCookie("widoczne2","ok",7);
  obj.style.visibility = "hidden"; 
 // alert( czytaj_ciacho("widoczne2"));
}

function go() {
  docelowax = document.body.scrollLeft + pozycjax;
  doceloway = document.body.scrollTop + pozycjay;

  i = 0.7; //inercja
  s = 0.3; //sprezystosc
  yd = yd * i + s * (doceloway - parseInt(obj.style.top));
  xd = xd * i + s * (docelowax - parseInt(obj.style.left));

  obj.style.left = parseInt(obj.style.left) + xd;
  obj.style.top = parseInt(obj.style.top) + yd;

  if (czytaj_ciacho("widoczne2")=='ok') {
  	obj.style.visibility = "hidden";
  }
  
  
  if (widoczne) {
  //	 setTimeout("go()", 50); 
  }
  else {
  	// obj.style.visibility = "hidden"; 
}

  
}



///////////////////////////// Bannery end