<!-- 
$(document).ready(function()
{	
	
	$('#tytul').keyup(function(e)
   {
	 	zliczaj_znaki('#tytul','50','#ilosc_znakow2');
	});
	$('#opis').keyup(function(e)
   {
	 	zliczaj_znaki('#opis','255','#ilosc_znakow');
	});
	
	$('#tytul_e').keyup(function(e)
   {
	 	zliczaj_znaki('#tytul_e','50','#ilosc_znakow2_e');
	});
	$('#opis_e').keyup(function(e)
   {
	 	zliczaj_znaki('#opis_e','255','#ilosc_znakow_e');
	});
	
});

 function dodaj() { 	
	 if (document.formularz2.opis.value == "") {
	   alert("Wypełnij pole OPIS STRONY");
	   document.formularz2.opis.focus();
	   document.formularz2.opis.select();
	   return false;
	 }
	 if (document.formularz2.tytul.value == "") {
	   alert("Wypełnij pole TYTUŁ STRONY");
	   document.formularz2.tytul.focus();
	   document.formularz2.tytul.select();
	   return false;
	 }
	 if (document.formularz2.adres1.value == "") {
	   alert("Wypełnij pole ADRES BANERA \nWpisz np. http://adrestwojejstrony.pl/baner.gif");
	   document.formularz2.adres1.focus();
	   document.formularz2.adres1.select();
	   return false;
	 }
	 if (document.formularz2.adres2.value == "") {
	   alert("Wypełnij pole ADRES STRONY WWW \nWpisz np. http://www.adrestwojejstrony.pl");
	   document.formularz2.adres2.focus();
	   document.formularz2.adres2.select();
	   return false;
	 }
	 if(document.formularz2.adres1.value.indexOf('gif', 0) < 1 && document.formularz2.adres1.value.indexOf('jpg', 0) < 1){
	 	alert("Wpisany adres banera musi zawierać link do pliku GIF lub JPG \nWpisz np. www.guitarnet.pl/baner.gif");
		document.formularz2.adres1.focus();
	   document.formularz2.adres1.select();
	   return false;
	 }
	 return true; 	 	 
 }  
 function edytuj() { 	
	 if (document.formularz2_e.opis_e.value == "") {
	   alert("Wypełnij pole OPIS STRONY");
	   document.formularz2_e.opis_e.focus();
	   document.formularz2_e.opis_e.select();
	   return false;
	 }
	 if (document.formularz2_e.tytul_e.value == "") {
	   alert("Wypełnij pole TYTUŁ STRONY");
	   document.formularz2_e.tytul_e.focus();
	   document.formularz2_e.tytul_e.select();
	   return false;
	 }
	 if (document.formularz2_e.adres1_e.value == "") {
	   alert("Wypełnij pole ADRES BANERA \nWpisz np. http://adrestwojejstrony.pl/baner.gif");
	   document.formularz2_e.adres1_e.focus();
	   document.formularz2_e.adres1_e.select();
	   return false;
	 }
	 if (document.formularz2_e.adres2_e.value == "") {
	   alert("Wypełnij pole ADRES STRONY WWW \nWpisz np. http://www.adrestwojejstrony.pl");
	   document.formularz2_e.adres2_e.focus();
	   document.formularz2_e.adres2_e.select();
	   return false;
	 }
	 if(document.formularz2_e.adres1_e.value.indexOf('gif', 0) < 1 && document.formularz2_e.adres1_e.value.indexOf('jpg', 0) < 1){
	 	alert("Wpisany adres banera musi zawierać link do pliku GIF lub JPG \nWpisz np. www.guitarnet.pl/baner.gif");
		document.formularz2_e.adres1_e.focus();
	   document.formularz2_e.adres1_e.select();
	   return false;
	 }
	 return true; 	 	 
 }  
 function testuj_baner(){
 	if(document.formularz2.adres1.value==""){
 		alert("Wypełnij pole ADRES BANERA i kliknij przycisk TESTUJ BANER"); 	
 		document.formularz2.adres1.focus();
	   document.formularz2.adres1.select();	
	}else{
		if(document.formularz2.adres1.value.indexOf('gif', 0) < 1 && document.formularz2.adres1.value.indexOf('jpg', 0) < 1){
			alert("Wpisany adres musi zawierać link do pliku GIF lub JPG \nWpisz np. www.guitarnet.pl/baner.gif");
			document.formularz2.adres1.focus();
	   	document.formularz2.adres1.select();
		}else{
			theURL = "http://" + document.formularz2.adres1.value;
	      window.open(theURL,'Test_banera');
		}		
	}
 }
 function testuj_link(){
 	if(document.formularz2.adres2.value==""){
 		alert("Wypełnij pole ADRES STRONY i kliknij przycisk TESTUJ ADRES");
 		document.formularz2.adres2.focus();
	   document.formularz2.adres2.select();
	}else{
 		theURL = "http://" + document.formularz2.adres2.value;
	   window.open(theURL,'Test_linka');
	}
 }
 function testuj_baner_e(){
 	if(document.formularz2_e.adres1_e.value==""){
 		alert("Wypełnij pole ADRES BANERA i kliknij przycisk TESTUJ BANER"); 	
 		document.formularz2_e.adres1_e.focus();
	   document.formularz2_e.adres1_e.select();	
	}else{
		if(document.formularz2_e.adres1_e.value.indexOf('gif', 0) < 1 && document.formularz2_e.adres1_e.value.indexOf('jpg', 0) < 1){
			alert("Wpisany adres musi zawierać link do pliku GIF lub JPG \nWpisz np. www.guitarnet.pl/baner.gif");
			document.formularz2_e.adres1_e.focus();
	   	document.formularz2_e.adres1_e.select();
		}else{
			theURL = "http://" + document.formularz2_e.adres1_e.value;
	      window.open(theURL,'Test_banera');
		}		
	}
 }
 function testuj_link_e(){
 	if(document.formularz2_e.adres2_e.value==""){
 		alert("Wypełnij pole ADRES STRONY i kliknij przycisk TESTUJ ADRES");
 		document.formularz2_e.adres2_e.focus();
	   document.formularz2_e.adres2_e.select();
	}else{
 		theURL = "http://" + document.formularz2_e.adres2_e.value;
	   window.open(theURL,'Test_linka');
	}
 }
 function potwierdzenie_usun(id) {
	 if (confirm('Czy na pewo chcesz usun±ć baner z rankingu?/n')){ 
	 	adres = 'ranking.php?akcja=uzytkownik_usuwa&ranking=' + id;
		document.location.href=adres; 
	 }
 } 
-->