	// Załaduj fotki
	if (document.images)
	{
		// Grafika Strony
		pic0 = new Image(2550, 269);
		pic0.src = "templates/layout/bg-top.jpg";
		pic1 = new Image(985, 95);
		pic1.src = "templates/layout/header-bg.gif";
		pic2 = new Image(271, 200);
		pic2.src = "templates/layout/arttop-bg.gif";
		pic3 = new Image(232, 174);
		pic3.src = "templates/layout/baza-firm-bg.gif";
		pic4 = new Image(232, 176);
		pic4.src = "templates/layout/baza-firm-image-bg.gif";
		pic6 = new Image(247, 180);
		pic6.src = "templates/layout/art-index-bg.gif";
		pic6 = new Image(165, 200);
		pic6.src = "templates/layout/topbox-bg.gif";
		pic7 = new Image(142, 17);
		pic7.src = "templates/layout/top-box-input-bg.gif";
		pic8 = new Image(146, 14);
		pic8.src = "templates/layout/btn-login.gif";
		pic9 = new Image(146, 14);
		pic9.src = "templates/layout/btn-search.gif";
	
	}

	// 
	function ask(url, txt)
	{	
		var where_to= confirm(txt);
		if (where_to== true)
			{	window.location=url;	}
	}
	// 

	function phpads_deliverActiveX(content)
	{
		document.write(content);	
	}

	function zamykajdiva(elementID) 
	{ 
		if (document.getElementById) 
		{ // DOM3 = IE5, NS6 
		  document.getElementById(elementID).style.visibility = 'hidden'; 
		} 
	} 
	
 	function zdjecia(file,gal,typ,w1,h1)
	{
		// z flashem
		//w1a = parseInt(w1) + 20;
		//h1a = parseInt(h1) + 230;
		//bez flasha
		w1a = parseInt(w1) + 20;
		h1a = parseInt(h1) + 100;
		
		//alert(w1a+" "+h1a);
		plik="flash/galeria.php?nr="+file+"&gal="+gal+"&typ="+typ+"&wys="+parseInt(h1)+"&szer="+parseInt(w1);
		dane="toolbar=no,menubar=no,scrollbars=no,resizable=no,status=no,location=no,directories=no,top=100,bottom=30,left=100,fullscreen=0,width="+w1a+",height="+h1a+"";
		window.open(plik, "info", dane);
	}

	function druk(id,kat,imag)
	{
		plik="templates/druk.php?id="+id+"&kat="+kat+"&imag=1";
		dane="toolbar=no,menubar=yes,scrollbars=yes,resizable=yes,status=no,location=no,directories=no,top=100,bottom=30,left=100,fullscreen=0,width=760";
		window.open(plik, "info", dane);
	}

	function wyslij(id,kat)
	{
		plik="templates/wyslij.php?id="+id+"&kat="+kat;
		dane="toolbar=no,menubar=no,scrollbars=no,resizable=no,status=no,left=400,top=140,height=200,width=272";
		window.open(plik, "info", dane);
 	}

	function zgloskomentarz(id,kat)
	{
		plik="templates/zgloskomentarz.php?id="+id;
		dane="toolbar=no,menubar=no,scrollbars=no,resizable=no,status=no,left=400,top=140,height=200,width=272";
		window.open(plik, "info", dane);
 	}


	function powiekszenie(x,y,file)
	{
		plik="templates/powiekszenie.php?zdjecie="+file;
		dane="toolbar=no,menubar=no,scrollbars=yes, resizable=no,status=no,location=no, directories=no,top=50,left=50,fullscreen=0,height="+y+", width="+x;
		window.open(plik, x, dane);
	}
	
	function panorama(nr)
	{
		plik='../panoramy/'+nr;
		window.open(plik, '', 'toolbar=no, menubar=no, scrollbars=no, resizable=no, status=no,location=no,directories=no, top=100, left=100, fullscreen=0, height=211, width=400');
	}

	// Dodawanie Komentarzy - sprawdzanie poprawności formularza
	function CheckAddCommentForm(form)
	{
		//if(form == "rform") { 
	
 			var tresc = document.getElementById('tresc');
			var dane = document.getElementById('dane');
			var email = document.getElementById('email');
			var kodobrazkowy = document.getElementById('kodobrazkowy');
			
 			if((tresc.value == "") || (tresc.value == "Twój komentarz"))
			{
				alert("Podaj treść komentarza");
				//password.focus();
					tresc.style.borderColor  = '#da251d';
					tresc.style.background = '#ffe3e1';
					tresc.focus();
	
				return false;
				
			} else {
				
				tresc.style.borderColor  = '#cccccc';
				tresc.style.background = '#ffffff';
				
			}
 
 			if(kodobrazkowy.value == "")
			{
				alert("Podaj kod z obrazka");
				//password.focus();
					kodobrazkowy.style.borderColor  = '#da251d';
					kodobrazkowy.style.background = '#ffe3e1';
					kodobrazkowy.focus();
	
				return false;
				
			} else {
				
				kodobrazkowy.style.borderColor  = '#cccccc';
				kodobrazkowy.style.background = '#ffffff';
				
			}


			if((dane.value == "") || (dane.value == "Twój podpis"))
			{
				alert('Podpisz się pod komentarzem');
 
					dane.style.borderColor  = '#da251d';
					dane.style.background = '#ffe3e1';
					dane.focus();
					
				return false;
				
			} else {
				
				tresc.style.borderColor  = '#cccccc';
				tresc.style.background = '#ffffff';
				
			}
			
			/*
			if((email.value == "") || (email.value == "Twój e-mail"))
			{
				alert('Podaj swój adres email');

					email.style.borderColor  = '#da251d';
					email.style.background = '#ffe3e1';
					email.focus();
					
				return false;
				
			} else {
				
				email.style.borderColor  = '#cccccc';
				email.style.background = '#ffffff';
				email.focus();
				
			}
			*/
			
			/*
			if(email.value.indexOf('.') == -1 || email.value.indexOf('@') == -1)
			{
				alert('Adres Email jest niepoprawny !');
 
 					email.style.borderColor  = '#da251d';
					email.style.background = '#ffe3e1';
					email.focus();
	
				return false;
			} else {
				
				email.style.borderColor  = '#cccccc';
				email.style.background = '#ffffff';
				email.focus();
			}
			*/
	
		//} else {
		//	alert("Form Error...")
		//}
	
		return true;
	}
	
	function SprawdzFormularzRejestracji(form,co)
	{
	
			var username = document.getElementById('rUsername');
			var password = document.getElementById('rPassword');
			var passwordc = document.getElementById('rPasswordConfirm');
  			var email = document.getElementById('rEmail');
		
				
			if(password.value == "")
			{
				alert('Nie potwierdziłeś hasła.');
					
					password.focus();
					password.style.borderColor  = '#da251d';
					password.style.background = '#ffe3e1';
	
				return false;
			}
		
			if(password.value != passwordc.value)
			{
				alert('Hasło potwierdzone jest inne od hasła.');
					
					password.focus();
					password.style.borderColor  = '#da251d';
					passwordc.style.borderColor  = '#da251d';
						
				return false;
			}	
 			
			if((email.value == "") || (email.value == "Twój e-mail"))
			{
				alert('Podaj swój adres email');

					email.style.borderColor  = '#da251d';
					email.style.background = '#ffe3e1';
					email.focus();
					
				return false;
				
			} else {
				
				email.style.borderColor  = '#cccccc';
				email.style.background = '#ffffff';
				email.focus();
				
			}
			
			if(co == 1)
			{
				if(email.value.indexOf('.') == -1 || email.value.indexOf('@') == -1)
				{
					alert('Adres Email jest niepoprawny !');
	 
						email.style.borderColor  = '#da251d';
						email.style.background = '#ffe3e1';
						email.focus();
		
					return false;
					
				} else {
					
					email.style.borderColor  = '#cccccc';
					email.style.background = '#ffffff';
					email.focus();
				}
			}
		//} else {
		//	alert("Form Error...")
		//}
	
		return true;
		
	}

	function SprawdzFormularzogloszenia(form)
	{
 		var tytul = document.getElementById('rTytul');
		//var tresc = document.getElementById('rTresc');
		var kategoria = document.getElementById('rKategoria');
  		var rodzaj = document.getElementById('rRodzaj');
 			
		if(tytul.value == "")
		{
			alert('Podaj tytuł ogłoszenia.');
				
			tytul.focus();
			tytul.style.borderColor  = '#da251d';
			tytul.style.background = '#ffe3e1';
			return false;
		}
		
		/*
		if(tresc.value == "")
		{
			alert('Podaj treść ogłoszenia.');
				
				tresc.focus();
				tresc.style.borderColor  = '#da251d';
				tresc.style.borderColor  = '#da251d';
					
			return false;
		}	
 		*/
		
	//} else {
	//	alert("Form Error...")
	//}
		return true;
 	}
	
	
	//
	function setBg(elem) 
	{
		if (document.getElementById) {
			elem.style.borderColor  = '#333333';
			elem.style.fontWeight  = 'bold';
		}
		
		if (elem.value == elem.defaultValue)
			elem.value = ""
	
	}
	
	
	//
	function setRedBg(elem) 
	{
			if (document.getElementById) {
				elem.style.borderColor  = '#ff0000';
			}
	}
	
	
	//
	function removeBg(elem) 
	{ 
		//clearall(); 
		//var bg2 = "#ffcccc"; 	
		elem.style.borderColor = "";
		elem.style.fontWeight  = "";
	
		if (elem.value == '')
			elem.value = elem.defaultValue;
		else 
			elem.value = elem.value;
	} 

	
	// - - - - - - - - - - - - - -
	function showHide(elementid)
	{
	   if (document.getElementById(elementid).style.display == 'none')
	   {
	   		document.getElementById(elementid).style.display = '';
	   } else {
	   		document.getElementById(elementid).style.display = 'none';
	   }
	} 
	// -
	
	
	//
	function zamknij()
	{
		Close();
	}
	
	// galeria
	
 
