function showLoading(element)
{
	document.getElementById(element).style.display = '';
}
function wysrodkujManage()
{var obj=document.getElementById('windowMain');var x=(screen.availWidth/2)-Math.floor((parseInt(obj.style.width)/2));var y=f_scrollTop()+20;obj.style.left=x+"px";obj.style.top=y+"px";var h=wysokosc();var hFrame=wysokosc();var w=f_clientWidth()-5;h=h+10;hFrame=hFrame+10;document.getElementById("windowPageBody").style.height=h+"px";document.getElementById("windowPageBodyIframe").style.height=hFrame+"px";document.getElementById("windowPageBodyIframe").style.width=w+"px";}
function wysrodkuj(element)
{var obj=document.getElementById(element);var x=(screen.availWidth/2)-Math.floor((parseInt(obj.style.width)/2));var y=f_scrollTop()+120;obj.style.left=x+"px";obj.style.top=y+"px";var h=wysokosc();var hFrame=wysokosc();var w=f_clientWidth()-5;h=h+10;hFrame=hFrame+10;document.getElementById("windowPageBody").style.height=h+"px";document.getElementById("windowPageBodyIframe").style.height=hFrame+"px";document.getElementById("windowPageBodyIframe").style.width=w+"px";}
function wysokosc()
{var theHeight=0
if(window.innerHeight)
{theHeight=window.innerHeight}
if(document.documentElement.clientHeight>theHeight)
{theHeight=document.documentElement.clientHeight}
if(document.body.clientHeight>theHeight)
{theHeight=document.body.clientHeight}
return theHeight;}
function f_scrollTop(){return f_filterResults(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0);}
function f_clientWidth()
{return f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0);}
function f_filterResults(n_win,n_docel,n_body){var n_result=n_win?n_win:0;if(n_docel&&(!n_result||(n_result>n_docel)))
n_result=n_docel;return n_body&&(!n_result||(n_result>n_body))?n_body:n_result;}
function windowMainToggle()
{Effect.toggle('windowMain','appear');document.getElementById('windowPageBody').style.display='none';document.getElementById('windowDiv').style.display='none';}
function srodek()
{var s=(screen.availWidth/2)-(305);document.getElementById("okienko2").style.left=s+"px";var w=document.body.scrollHeight;w=w+10;document.getElementById("okienko").style.height=w+"px";}
function obslugaDrop(idOfDraggedItem,targetId,x,y)
{var lista=new String(targetId);var produkt=new String(idOfDraggedItem);var znacznikUser=lista.indexOf("user_");var doListyId=lista.substring(6,znacznikUser);var idUser=lista.substring(znacznikUser+5);var znacznikLista=produkt.indexOf("naliscie_");var idProdukt=produkt.substring(8,znacznikLista);var zListyId=produkt.substring(znacznikLista+9);if(zListyId!=doListyId)
{xajax_przeniesProdukt(idUser,idProdukt,zListyId,doListyId);xajax_showWindow('manage');xajax_menuProdukty(idUser,zListyId);xajax_menuProdukty(idUser,doListyId);};}
var inames=new Array('star');if(document.images)
{var on=new Array();var off=new Array();for(i=0;i<inames.length;i++)
{on[i]=new Image();on[i].src="./Templates/photos/"+inames[i]+"1.gif";off[i]=new Image();off[i].src="./Templates/photos/"+inames[i]+"2.gif";}}
function fwyglad(num) 
{	
	var i=0;
	
	if (num==0 && document.myform.wyglad.value==1)
	{
		document.myform.wyglad.value = 0;
		document.images["wyglad0"].src = off[0].src;
	}
	else
	{
		for (i;i<5;i++)
		{
			document.images["wyglad"+i].src = off[0].src;
		}
		i=0;
		for (i;i<=num;i++)
		{
			document.images["wyglad"+i].src = on[0].src;
		}
		
		document.myform.wyglad.value = num+1;
	}

}

function fjakosc(num) 
{	
	var i=0;
	
	if (num==0 && document.myform.jakosc.value==1)
	{
		document.myform.jakosc.value = 0;
		document.images["jakosc0"].src = off[0].src;
	}
	else
	{
		for (i;i<5;i++)
		{
			document.images["jakosc"+i].src = off[0].src;
		}
		i=0;
		for (i;i<=num;i++)
		{
			document.images["jakosc"+i].src = on[0].src;
		}
		
		document.myform.jakosc.value = num+1;
	}

}

function fcena(num) 
{	
	var i=0;
	
	if (num==0 && document.myform.cena.value==1)
	{
		document.myform.cena.value = 0;
		document.images["cena0"].src = off[0].src;
	}
	else
	{	
		for (i;i<5;i++)
		{
			document.images["cena"+i].src = off[0].src;
		}
		i=0;
		for (i;i<=num;i++)
		{
			document.images["cena"+i].src = on[0].src;
		}
		
		document.myform.cena.value = num+1;
	}
}
function toggleComplete(){var button1=document.getElementById("buttonWrapper");var display=document.getElementById("display");var button2=document.getElementById("buttonWrapper2");if(button1.className==""){display.dataSrc="#rights_raw"
display.dataFld="column1"
display.dataFormatAs="text"
button1.className="hiddenControl"}else{display.dataSrc="#rights_html"
display.dataFld="Article1"
display.dataFormatAs="text"
button1.className=""}
if(button2.className==""){display.dataSrc="#rights_raw"
display.dataFld="column1"
display.dataFormatAs="text"
button2.className="hiddenControl"}else{display.dataSrc="#rights_html"
display.dataFld="Article1"
display.dataFormatAs="text"
button2.className=""}}
function changeView(i)
{var divek=document.getElementById("d"+i);if(divek.className=="")
{divek.className="hiddenControl";document.images["i"+i].src='minus.gif';}
else
{divek.className="";document.images["i"+i].src='plus.gif';}}
function addIE7()
{window.external.AddSearchProvider('http://www.hitcenowy.pl/opensearch.xml');}
function addFF()
{window.sidebar.addSearchEngine("http://www.hitcenowy.pl/hitcenowy.src","http://www.hitcenowy.pl/hitcenowy.gif","hitcenowy.pl","porównywarka cen");}
function textCounter(field,maxlimit)
{if(field.value.length>maxlimit)
{field.value=field.value.substring(0,maxlimit);return false;}
else
{}}
var menu1=new Array()
menu1[0]='<a href="Muzyka_i_Film-5">Muzyka i film</a>'
menu1[1]='<a href="Odziez-6">Odzież</a>'
menu1[2]='<a href="Telefony-7">Telefony</a>'
menu1[3]='<a href="Zdrowie_i_uroda-8">Zdrowie i uroda</a>'
menu1[5]='<a href="Sport-10">Sport</a>'
menu1[6]='<a href="Gry_i_programy-11">Gry i programy</a>'
menu1[7]='<a href="Upominki-12">Upominki</a>'
menu1[8]='<a href="Dziecko_i_mama-13">Dziecko i mama</a>'
menu1[12]='<a href="Dom_i_ogrod-17">Dom i ogród</a>'
menu1[13]='<a href="index.php?page=Over18&direction=Erotyka&value=18">Erotyka</a>'
var menuwidth='125px'
var menubgcolor='lightyellow'
var disappeardelay=250
var hidemenu_onclick="yes"
var ie4=document.all
var ns6=document.getElementById&&!document.all
if(ie4||ns6)
document.write('<div id="dropmenudiv" style="z-index: 100; visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
function getposOffset(what,offsettype)
{var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null)
{totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;}
function showhide(obj,e,visible,hidden,menuwidth)
{if(ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if(menuwidth!="")
{dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth}
if(e.type=="click"&&obj.visibility==hidden||e.type=="mouseover")
obj.visibility=visible
else if(e.type=="click")
obj.visibility=hidden}
function iecompattest()
{return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function clearbrowseredge(obj,whichedge)
{var edgeoffset=0
if(whichedge=="rightedge")
{var windowedge=ie4&&!window.opera?iecompattest().scrollLeft+iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if(windowedge-dropmenuobj.x<dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth}
else
{var topedge=ie4&&!window.opera?iecompattest().scrollTop:window.pageYOffset
var windowedge=ie4&&!window.opera?iecompattest().scrollTop+iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if(windowedge-dropmenuobj.y<dropmenuobj.contentmeasure)
{edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge}}
return edgeoffset}
function populatemenu(what)
{if(ie4||ns6)
dropmenuobj.innerHTML=what.join("")}
function dropdownmenu(obj,e,menucontents,menuwidth)
{if(window.event)
event.cancelBubble=true
else if(e.stopPropagation)
e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById?document.getElementById("dropmenudiv"):dropmenudiv
populatemenu(menucontents)
if(ie4||ns6)
{showhide(dropmenuobj.style,e,"visible","hidden",menuwidth)
dropmenuobj.x=getposOffset(obj,"left")
dropmenuobj.y=getposOffset(obj,"top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj,"rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+"px"}
return clickreturnvalue()}
function clickreturnvalue()
{if(ie4||ns6)
return false
else
return true}
function contains_ns6(a,b)
{while(b.parentNode)
if((b=b.parentNode)==a)
return true;return false;}
function dynamichide(e)
{if(ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if(ns6&&e.currentTarget!=e.relatedTarget&&!contains_ns6(e.currentTarget,e.relatedTarget))
delayhidemenu()}
function hidemenu(e)
{if(typeof dropmenuobj!="undefined")
{if(ie4||ns6)
dropmenuobj.style.visibility="hidden"}}
function delayhidemenu()
{if(ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)}
function clearhidemenu()
{if(typeof delayhide!="undefined")
clearTimeout(delayhide)}
if(hidemenu_onclick=="yes")
document.onclick=hidemenu
