
function menu_categories_toggle(id){if(document.getElementById(id).style.display=='block'){document.getElementById(id).style.display='none'}else{document.getElementById(id).style.display='block'}}
function client_addresses_list_confirmdelete(){return confirm('Are you sure you want to delete the selected delivery address?');}
function orderpayment(id){document.getElementById('idle_payment').style.display='none';allDivs=document.getElementsByTagName("div");for(i=0;i<allDivs.length;i++){if((/^newpayment_form_/).test(allDivs[i].id)==true){allDivs[i].style.display='none';}}
if(document.getElementById('newpayment_form_'+id)){document.getElementById('newpayment_form_'+id).style.display='block';}}
function projector_button_switch(cont){if(cont=='component_projector_suggestproduct'){if(document.getElementById('component_projector_askforproduct')){document.getElementById('component_projector_askforproduct').style.display='none';}
if(document.getElementById('component_projector_suggestproduct')){document.getElementById('component_projector_suggestproduct').style.display='block';}}
if(cont=='component_projector_askforproduct'){if(document.getElementById('component_projector_suggestproduct')){document.getElementById('component_projector_suggestproduct').style.display='none';}
if(document.getElementById('component_projector_askforproduct')){document.getElementById('component_projector_askforproduct').style.display='block';}}}
var ns6=document.getElementById&&!document.all;var html=document.getElementsByTagName("html");var Popup={link:'',width:0,height:0,loaded:0,show:function(link,x,y){Popup.link=link;Popup.width=x;Popup.height=y;Popup.loaded=1;if(document.getElementById('big_photo')){document.getElementById('big_photo').style.display="none";document.getElementById('big_photo').src=Popup.link;}
if(!ns6){Popup.hideSelects(1);}
Popup.creatLayers();},reload:function(){if(Popup.loaded){Popup.show(Popup.link,Popup.width,Popup.height);}},hide:function(){var edit=document.getElementById('show_popup_photo');var cover=document.getElementById('cover');edit.style.display="none";cover.style.display="none";Popup.loaded=0;if(!ns6){Popup.hideSelects(0);}},creatLayers:function(){var edit=document.getElementById('show_popup_photo');edit.style.position='absolute';edit.style.display="block";edit.style.width=(Popup.width+10)+"px";edit.style.height=(Popup.height+40)+"px";edit.style.left=ns6?(Popup.pageSizes()[2]-(Popup.width+10))/2+html[0].scrollLeft+"px":(Popup.pageSizes()[2]-(Popup.width+10))/2+"px";if(ns6){edit.style.top=((((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop)<0)?"0px":(((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop)+"px"}else{edit.style.top=(((Popup.pageSizes()[3]-(Popup.height+10))/2-100)<0)?"0px":(Popup.pageSizes()[3]-(Popup.height+10))/2-100+"px";}
edit.style.zIndex=1000;edit.style.Background='#FFFFFF';var cover=document.getElementById('cover');cover.style.display="block";cover.style.position="absolute";cover.style.zIndex=900;ns6?cover.style.opacity=.5:cover.style.filter="alpha(opacity=50)";if(window.opera){cover.style.opacity=.5;}
cover.style.left="0px";cover.style.top="0px";offsetX=0;if(!ns6&&!window.opera){offsetX=20;}
cover.style.width=ns6?(Popup.pageSizes()[0]-16)+"px":Popup.pageSizes()[0]-offsetX+"px";cover.style.height=Popup.pageSizes()[1]+"px"},pageSizes:function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;},hideSelects:function(flag){var selects=document.getElementsByTagName('SELECT');if(flag==1){for(i=0;i<selects.length;i++){selects[i].style.display='none';}}else{for(i=0;i<selects.length;i++){selects[i].style.display='';}}}}
window.onresize=function(){if(Popup.loaded==1){Popup.reload();}}
var IAI_Ajax={cO:function()
{var r;try{r=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{r=new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){r=null;}}
if(!r&&typeof XMLHttpRequest!="undefined"){r=new XMLHttpRequest();}
return r;},Request:function(url,pd,fun)
{var x;x=IAI_Ajax.cO();x.open("POST",url,true);x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");x.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");x.setRequestHeader("X-IAI-Version","1.0");x.onreadystatechange=function()
{if(x.readyState==4){if(x.status>=200&&x.status<300){if(fun){if(fun.onSuccess){if(fun.arg){eval(fun.onSuccess+'(\''+x.responseText+'\', \''+fun.arg+'\');');}else{eval(fun.onSuccess+'(\''+x.responseText+'\');');}}}}else{}}}
x.send(pd);delete x;}}
function countAnnuityZagiel(account,amount)
{window.open('http://www.zagiel.com.pl/kalkulator/index_smart.php?action=getklientdet_si_rata&shopNo='+account+'&goodsValue='+amount,'count_zagiel','width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');}
function validate_Zagiel()
{var zagielconfirm=document.getElementById('zagiel_confirm');if(zagielconfirm.checked){return true;}else{alert(zagielnotconfirmed)
return false;}}
function clientnew_delivery_addr(){if(document.getElementById('deliver_to_billingaddr').checked){document.getElementById('delivery_address_form').style.display='none';}else{document.getElementById('delivery_address_form').style.display='block';}}
function clientnew_firm(){if(document.getElementById('firm_data').checked){document.getElementById('firm_data_inputs').style.display='block';}else{document.getElementById('firm_data_inputs').style.display='none';}}
function order1_shop_payformdiv(show)
{if(show){document.getElementById('payform_div').style.display='block';}else{document.getElementById('payform_div').style.display='none';document.getElementById('payform_id').selectedIndex=0;allDivs=document.getElementsByTagName("div");for(i=0;i<allDivs.length;i++){if((/^newpayment_form_/).test(allDivs[i].id)==true){allDivs[i].style.display='none';}}}}
function order1_changepayform()
{selVal=document.getElementById('payform_id').value;allDivs=document.getElementsByTagName("div");for(i=0;i<allDivs.length;i++){if((/^newpayment_form_/).test(allDivs[i].id)==true){allDivs[i].style.display='none';}}
if(document.getElementById('newpayment_form_'+selVal)){document.getElementById('newpayment_form_'+selVal).style.display='block';}}
var components=new Array("component_projector_opinions","component_projector_photos","component_projector_ordered","component_projector_associated","component_projector_incategory","component_projector_suggestproduct","component_projector_askforproduct");function showButtons()
{var i=0;var activeButtons=components.length;for(i=0;i<components.length;i++){if(document.getElementById(components[i])){document.getElementById('projector_components_hidding').style.display='block';if(document.getElementById('hide_'+components[i])){document.getElementById('hide_'+components[i]).style.display='block';}}}
setTimeout("showButtons()",2000);}
function components_hidding(component)
{if(document.getElementById(component)){for(i=0;i<components.length;i++){if(document.getElementById(components[i])){document.getElementById(components[i]).style.display='none';}}
document.getElementById(component).style.display='block';}}
showButtons();var HliderClass=function(){var obj=this;this.Hlider_mainID=0;this.Hlider_naviID=0;this.Hlider_naviclass=0;this.Hlider_speed=3;this.Hlider_jump=0;this.lilist=0;this.mainwidth=0;this.mainID='';this.width_pasek=0;this.elements_count=0;this.navi_count=0;this.element_width=0;this.scroll_width=0;this.scroll_width_tmp=0;this.Time=0;this.Scroll=0;this.SI=0;this.Navi=function(num,id,id2,clas,nullek)
{this.Hlider_jump=num;this.Hlider_mainID=id;this.Hlider_naviID=id2;this.Hlider_naviclass=clas;this.mainID=document.getElementById(this.Hlider_mainID);this.mainwidth=this.mainID.clientWidth;this.lilist=document.getElementById(this.Hlider_mainID).firstChild;this.mainwidth=this.mainID.clientWidth;var elements=this.lilist.getElementsByTagName('li');this.elements_count=elements.length;this.navi_count=Math.ceil(this.elements_count/this.Hlider_jump);var naviID=document.getElementById(this.Hlider_naviID);if(nullek!='NULL')
{this.width_pasek=0;naviID.innerHTML='';for(i=1;i<=this.navi_count;i++)
{var newDiv=document.createElement('div');newDiv.className=this.Hlider_naviclass;if(i==1)newDiv.className=this.Hlider_naviclass+"_on";newDiv.id=this.Hlider_mainID+"|"+this.Hlider_naviclass;newDiv.onclick=this.Start;newDiv.innerHTML='<span>'+i+'</span>';naviID.appendChild(newDiv);}
this.mainID.scrollLeft=0;var elements=this.lilist.getElementsByTagName('li');this.elements_count=elements.length;for(n=0;n<this.elements_count;n++)
{this.width_pasek+=elements[n].clientWidth;this.element_width=elements[n].clientWidth;}
if(this.element_width==0)
{setTimeout(function(){obj.Navi(num,id,id2,clas)},500);return false;}}}
this.Clear=function(num)
{var naviID=document.getElementById(this.Hlider_naviID);var elements=naviID.getElementsByTagName('div');for(i=0;i<elements.length;i++)
{if(elements[i].firstChild.innerHTML==num)
{elements[i].className=this.Hlider_naviclass+"_on";}
else
{elements[i].className=this.Hlider_naviclass;}}}
this.Start=function(num)
{var num=parseInt(this.firstChild.innerHTML);var table_id=this.id.split("|");this.Hlider_naviID=this.parentNode.id;this.Hlider_mainID=table_id[0];this.Hlider_naviclass=table_id[1];this.mainID=document.getElementById(this.Hlider_mainID);obj.Move(num);}
this.Move=function(num)
{obj.Clear(num);clearInterval(obj.Time);this.scroll_width=0;for(n=1;n<=num;n++)
{this.scroll_width+=(this.element_width*this.Hlider_jump);}
this.scroll_width=this.scroll_width_tmp=this.scroll_width-(this.element_width*this.Hlider_jump);this.Time=setInterval(function(){obj.Anim()},40);}
this.Anim=function()
{this.scroll_width=Math.abs(this.mainID.scrollLeft-this.scroll_width_tmp);if(this.mainID.scrollLeft<this.scroll_width_tmp)
{this.Scroll=Math.ceil((this.mainID.scrollLeft)+(this.scroll_width/this.Hlider_speed));}
else
{this.Scroll=Math.floor((this.mainID.scrollLeft)-(this.scroll_width/this.Hlider_speed));this.Scroll=Math.floor((this.mainID.scrollLeft)-(this.scroll_width/this.Hlider_speed));}
this.scroll_width=Math.round(this.scroll_width/this.Hlider_speed);if(Math.round(this.Scroll)==this.scroll_width_tmp)
{clearInterval(this.Time);}
this.mainID.scrollLeft=this.Scroll;}
this.Left=function(num,id,id2,clas,nullek)
{this.Navi(num,id,id2,clas,nullek);clearInterval(this.Time);this.scroll_width=0;var number=Math.round((this.mainID.scrollLeft/this.element_width)/this.Hlider_jump);if(number==0)
{number=this.navi_count;}
obj.Move(number);}
this.Right=function(num,id,id2,clas,nullek)
{obj.Navi(num,id,id2,clas,nullek);clearInterval(this.Time);this.scroll_width=0;var number=Math.round((this.mainID.scrollLeft/this.element_width)/this.Hlider_jump);number++;number++;if(number>this.navi_count)
{number=1;}
obj.Move(number);}}
var Hlider=new HliderClass();var newstxt='Twój e-mail';function newsletter_blur(x){if(x.value==''){x.value=newstxt;}}
function newsletter_focus(x){if(x.value==newstxt){x.value='';}}
if(typeof(newstxt)=="undefined"){}
function newsletter_blur(x){if(x.value==''){x.value=contact_newstxt;}}
function newsletter_focus(x){if(x.value==contact_newstxt){x.value='';}}
function askforproduct()
{if(document.getElementById("askforproduct_email")){if((/^[0-9a-zA-Z.-_]+@[0-9a-zA-Z.-_]+.[0-9a-zA-Z]+$/).test(document.getElementById("askforproduct_email").value)==false||document.getElementById("email").value.length==0){alert('Nie wpisałeś poprawnie adresu e-mail na który mielibyśmy wysłać Ci odpowiedź.');return false;}else{return true;}}}
function hideaskforproduct()
{if(document.getElementById('projector_askforproduct_table').style.display=='none'){document.getElementById('projector_askforproduct_table').style.display='block';}else{document.getElementById('projector_askforproduct_table').style.display='none';}}