function schowaj(identyf) 
{ 
	if (document.getElementById)
	{
		document.getElementById(identyf).style.display='none';
	}
	else if (document.all)
	{
		document.all[identyf].style.display='none'; 
	}
} 


function pokaz(identyf) 
{ 
	if (document.getElementById)
	{
		document.getElementById(identyf).style.display='block';
	}
	else if (document.all)
	{
		document.all[identyf].style.display='block';
	}
} 



function wpisz(gdzie, co)
{
	if (document.getElementById)
	{
		document.getElementById(gdzie).innerHTML=co;
	}
	else if (document.all)
	{
		document.all[identyf].innerHTML=co;
	}
} 

function zmien_on(id, kolor1, kolor2)
{
	if (document.getElementById)
	{
		document.getElementById("menu_id_" + id + "a").style.background = kolor1;
		document.getElementById("menu_id_" + id + "b").style.background = kolor2;
	}
	else if (document.all)
	{
		document.all["menu_id_" + id + "a"].style.background = kolor1;
		document.all["menu_id_" + id + "b"].style.background = kolor2;
	}
}

function zmien_off(id, kolor1, kolor2)
{
	if (document.getElementById)
	{
		document.getElementById("menu_id_" + id + "a").style.background = kolor1;
		document.getElementById("menu_id_" + id + "b").style.background = kolor2;
	}
	else if (document.all)
	{
		document.all["menu_id_" + id + "a"].style.background = kolor1;
		document.all["menu_id_" + id + "b"].style.background = kolor2;
	}
}

function do_koszyka()
{
	if (document.form_dodaj.ilosc.value.length == 0)
	{
		alert('Podaj ilość sztuk !');
		return false;
	}
	
	if (isNaN(document.form_dodaj.ilosc.value))
	{
		alert('Pole Ilość musi być liczbą !');
		return false;
	}
	
	document.form_dodaj.submit();
}

function przelicz()
{
	document.form_przelicz.submit();
}

function WyslijZamowienie()
{
	if (document.form_zamowienie.imie.value == '')
	{
		alert('Pole Imię musi być wypełnione !');
		
		document.form_zamowienie.imie.focus();
		
		return false;
	}
	
	if (document.form_zamowienie.nazwisko.value == '')
	{
		alert('Pole Nazwisko musi być wypełnione !');
		
		document.form_zamowienie.nazwisko.focus();
		
		return false;
	}
	
	if (document.form_zamowienie.telefon.value == '')
	{
		alert('Pole Telefon musi być wypełnione !');
		
		document.form_zamowienie.telefon.focus();
		
		return false;
	}	
	
	if (document.form_zamowienie.email.value == '')
	{
		alert('Pole E-mail musi być wypełnione !');
		
		document.form_zamowienie.email.focus();
		
		return false;
	}		
	
	if (document.form_zamowienie.miasto.value == '')
	{
		alert('Pole Miasto musi być wypełnione !');
		
		document.form_zamowienie.miasto.focus();
		
		return false;
	}		
	
	if (document.form_zamowienie.kod.value == '')
	{
		alert('Pole Kod pocztowy musi być wypełnione !');
		
		document.form_zamowienie.kod.focus();
		
		return false;
	}		
	
	if (document.form_zamowienie.ulica.value == '')
	{
		alert('Pole Ulica musi być wypełnione !');
		
		document.form_zamowienie.ulica.focus();
		
		return false;
	}		
	
	if (document.form_zamowienie.zgoda1.checked == false)
	{
		alert('Przed zgłoszeniem zamówienia musisz wyrazić zgodę na przetwarzanie Twoich danych osobowych !');
		return false;
	}		
	
	if (document.form_zamowienie.zgoda2.checked == false)
	{
		alert('Przed zgłoszeniem zamówienia musisz potwierdzić, że zapoznałeś się z regulaminem sklepu alan.pl !');
		return false;
	}	
	
	document.form_zamowienie.submit();
}

 function foto(adres,wid,hei,tytul)
 {
     var wid2 = wid +80;
     var hei2 = hei +80;
     tx=(screen.availWidth-wid2)/2;
     ty=(screen.availHeight-hei2)/2;
     var Win = window.open(adres,"",'width=' + wid2 + ',height=' + hei2 + ',resizable=1,top='+ty+',left='+tx+',scrollbars=no,menubar=no,resizable=no');
     Win.focus();
     Win.document.write('<html><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-2"><title>',tytul,'</title></head><BODY bgcolor="#FFFFFF" onclick="self.close()">');
     Win.document.write('<center>');
     Win.document.write('<A href="#" onclick="self.close();return false;"><img src="',adres,'" width=',wid,' height=',hei,' vspace=5 border=0 alt="',tytul,'"></A><br clear="all"><font face="Arial CE, Arial" size="2" color="#000000"><b>',tytul,'</b><br><br><br><br><br></center></body></html>');
     Win.document.close();
 }