function set_focus()
{
	document.getElementById("znajdz").focus();
}
//----------------------------------------------------------------------------------------
function over(ten){
  	ten.src = "img/site/"+ten.id+".gif";
}
//-----------------------------------------------------------------------------------------
function out(ten){
  	ten.src = "img/site/" + ten.id + "_bw.gif";
}
//-----------------------------------------------------------------------------------------
function YesNo2(pytanie, strona)
{
	odp = confirm(pytanie);
	
	if(odp == true)
	{
		location = strona;
	}
}
//------------------------------------------------------------------------------------------
function pokaz(id)
{
	switch(id)
	{
		case "adrdost":
			document.getElementById(id).style.display="inline";
			document.getElementById("adrdost1").style.display="none";
		 break;
	 	case "adfakt":
			document.getElementById(id).style.display="block";
			document.getElementById("adfakt1").style.display="none";
		 break;
/*		 case "a_rej":
		 	 document.getElementById("pic1").style.visibility="visible";
		 	 document.getElementById("pic2").style.visibility="visible";
	 		 document.getElementById(id).style.margin="0 35px";
		 break;
 		 case "a_przyp":
		 	 document.getElementById("pic3").style.visibility="visible";
		 	 document.getElementById("pic4").style.visibility="visible";
 	 		 document.getElementById(id).style.margin="0 20px";
		 break;*/
	}

}
//--------------------------------------------------------------------------------
function check_form(nazwa)
{
	switch(nazwa.name)
	{
		case "edit":
			if( nazwa.elements[1].value=="" || nazwa.elements[2].value=="" )
			{
				alert('Aby zmienić dane musisz wpisać i powtórzyć hasło.');
				return false;
			}
			if( nazwa.elements[1].value!=nazwa.elements[2].value )
			{
				alert('Pola hasło i powtórz hasło różnią się.');
				return false;
			}
			return true;
		break;
		
		case "passwd":
			if( nazwa.elements[1].value=="" || nazwa.elements[2].value=="" || nazwa.elements[3].value=="")
			{
				alert('Pola nie mogą być puste.');
				return false;
			}
			if( nazwa.elements[1].value==nazwa.elements[2].value )
			{
				alert('Stare i nowe hasło muszą się różnić.');
				return false;
			}
			if( nazwa.elements[3].value!=nazwa.elements[2].value )
			{
				alert('Pola nowe hasło i powtórz nowe hasło różnią się .');
				return false;
			}
			return true;
		break;
		
		case "send":
			if( nazwa.elements[0].value=="0" || nazwa.elements[1].value=="0")
			{
				alert('Wybierz sposób przesyłki oraz sposób płatnośći.');
				return false;
			}
			return true;
		
		break;
	}
}
//---------------------------------------------------------------------------------------------------------
function schowaj(id)
{
	switch(id)
	{
		case "logowanie1":
			document.getElementById(id).style.display="none";
		 break;
		 case "a_rej":
		 			document.getElementById("pic1").style.visibility="hidden";
		 			document.getElementById("pic2").style.visibility="hidden";
		 break;
 		 case "a_przyp":
		 			document.getElementById("pic3").style.visibility="hidden";
		 			document.getElementById("pic4").style.visibility="hidden";
		 break;		 
	}
}
//------------------------------------------------------------------------------------------
function schowaj_menu()
{
	document.getElementById("podmenu1").style.display="none";
}
//---------------------------------------------------------------------------------------
function pokaz_menu(ten)
{
//	document.onmousemowe = 
	posX = e.pageX;
	posY = e.pageY;
	alert(posX+" "+posY);
	try
	{
		id = ten.nextSibling.id;
		//alert(ten.id);
		document.getElementById(id).style.display="block";
		document.getElementById(id).style.zIndex="1000";
	}
	catch(ev)
	{}
}
//--------------------------------------------------------------------------------------
function lapa(ten)
{
	document.getElementById(ten).src="img/site/onmouseover_szary.jpg";	
}
//--------------------------------------------------------------------------------------
function lapa2(ten)
{
	document.getElementById(ten).src="img/site/onmouseover.jpg";	
}

//--------------------------------------------------------------------------------------
function OpenPage(strona, wysokosc, szerokosc)
{
  window.open(strona,'Powiększenie','width='+(szerokosc+50)+',height='+(wysokosc+50)+',toolbar=no,menubar=no,personalbar=no,directories=no,resizable=yes');
}
//---------------------------------------------------------------------------------------
function selecturl(s)
{
	var gourl = s.options[s.selectedIndex].value;
	if(gourl!=0)
	{
		window.top.location.href = gourl;
	}
}
//-----------------------------------------------------------------------------------------
function radio(ten)
{
	document.getElementById("waga_kosz").value=ten.value;
	//alert(document.getElementById("waga_kosz").value);
}
//-------------------------------------------------------------------------------------------
function radio2(ten)
{
	document.getElementById("wysylka").value=ten.value;
	//alert(document.getElementById("wysylka").value);
}
//-------------------------------------------------------------------------------------------
function radio3(ten)
{
	document.getElementById("platnosc").value=ten.value;
	//alert(document.getElementById("platnosc").value);
}