
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 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 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';}}
search_txt='wpisz szukane wyrażenie';function newsletter2_blur(x){if(x.value==''){x.value=newsletter_txt;}}
function newsletter2_focus(x){if(x.value!=''){x.value='';}}
var Projector_txt_maksymalnie='Maksymalnie możesz zamówić: ';var Projector_txt_brak_magazyn='Brak na magazynie';var Projector_txt_produkt_niedostepny='Produkt niedostępny';var Projector_txt_podajilosc='Podaj ilość dla wybranego rozmiaru';var Projector_txt_zalogujsie='Zaloguj się';var Alertek={alert_cover:'',Start:function(txt)
{var cloudID=document.getElementById('alert_cover');if(txt){cloudID.innerHTML=txt;var coors;coors=Alertek.FindPos();cloudID.style.display="block";cloudID.style.opacity="0";cloudID.style.filter="alpha(Opacity=0)";cloudID.style.position="absolute";cloudID.style.zIndex="1000";Alertek.X=40;Alertek.Top=coors[1]-cloudID.clientHeight-Alertek.X-1;Alertek.I=0;if((coors[1]-cloudID.clientHeight)<0)
{Alertek.X=10;Alertek.Top=coors[1]+id.clientHeight+Alertek.X;}
cloudID.style.top=Alertek.Top+'px';var cloudLeft=document.body.clientWidth;if(cloudLeft<(cloudID.clientWidth+coors[0]))
{cloudID.style.left=coors[0]-cloudID.clientWidth+id.clientWidth+'px';}
else
{cloudID.style.left=coors[0]+'px';}
clearInterval(Alertek.Time);clearTimeout(Alertek.Time2);clearInterval(Alertek.Time3);Alertek.Attribute=0;Alertek.Time=setInterval("Alertek.Move()",40);Alertek.Time2=setTimeout("Alertek.End()",3000);}else{return false;}},End:function()
{var cloudID=document.getElementById('alert_cover');var coors;coors=Alertek.FindPos();Alertek.X=40;if((coors[1]-cloudID.clientHeight)<0)
{Alertek.X=10;}
Alertek.Top=coors[1]-cloudID.clientHeight;Alertek.I=100;clearInterval(Alertek.Time);clearTimeout(Alertek.Time2);clearInterval(Alertek.Time3);Alertek.Attribute=1;Alertek.Time=setInterval("Alertek.Move()",40);},Move:function()
{var cloudID=document.getElementById('alert_cover');if(Alertek.Attribute==0){Alertek.Top=Math.round(Alertek.Top)+(Alertek.X/2);}
if(Alertek.Attribute==1){Alertek.Top=Math.round(Alertek.Top)-(Alertek.X/2);}
Alertek.X=Math.round(Alertek.X/2);if(Alertek.Attribute==0){Alertek.I=Alertek.I+15;}
if(Alertek.Attribute==1){Alertek.I=Alertek.I-15;}
cloudID.style.top=Alertek.Top+'px';if(Alertek.I<100){cloudID.style.opacity="0."+Alertek.I;cloudID.style.filter="alpha(Opacity="+Alertek.I+")";}else{cloudID.style.opacity="1";cloudID.style.filter="alpha(Opacity=100)";}
if(Alertek.X==1){if(Alertek.Attribute==0){Alertek.Time3=setInterval("Alertek.MoveAlways()",1);cloudID.style.opacity="1";cloudID.style.filter="alpha(Opacity=100)";}else if(Alertek.Attribute==1){cloudID.style.opacity="0";cloudID.style.filter="alpha(Opacity=0)";cloudID.style.display="none";}
clearInterval(Alertek.Time);}},MoveAlways:function()
{var coors;coors=Alertek.FindPos();document.getElementById('alert_cover').style.top=coors[1]-document.getElementById('alert_cover').clientHeight+'px';},FindPos:function()
{var cloudID=document.getElementById('alert_cover');var curleft=ns6?((Popup.pageSizes()[2]/2)-(cloudID.clientWidth/2))+"px":((Popup.pageSizes()[2]/2)-(cloudID.clientWidth/2));var curtop=Alertek.pageHeight();return[curleft,curtop];},Time:0,Time2:0,Time3:0,Top:0,X:0,I:0,Attribute:0,getScrollXY:function(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return scrOfY;},pageHeight:function(){var _docHeight=self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight);var heighter=(_docHeight/2)+Alertek.getScrollXY();return heighter;},show_alert:function(txt){Alertek.Start(txt);},hide_alert:function(){Alertek.End();}}
var Projector={search_dosubmit:function(id){var formularz=document.getElementById(id);var sumka=0;var sumka2=0;var counter=0;var elems=document.getElementsByTagName('input');for(i=0;i<elems.length;i++)
{if(elems[i].name.match('number')=='number')
{if(elems[i].value!='')sumka=1;if(elems[i].disabled==false)sumka2=1;}}
if(sumka==0)
{if(sumka2==1)
{Alertek.show_alert(Projector_txt_podajilosc);}
else
{Alertek.show_alert(Projector_txt_produkt_niedostepny);}
return false;}
else
{formularz.submit();}},show_additional_table:function(ident)
{if(document.getElementById(ident).style.display=='none'){document.getElementById(ident).style.display='block';}
else
{document.getElementById(ident).style.display='none';}},number_up:function(idek,amount)
{var idek=document.getElementById(idek);if(isNaN(parseInt(idek.value)))idek.value=0;if(amount)
{if(idek.value>=parseInt(amount)&&isFinite(amount)&&amount!='-1')
{Alertek.show_alert(Projector_txt_maksymalnie+amount);return false;}
else
{idek.value=parseInt(idek.value)+1;}}
else
{Alertek.show_alert(Projector_txt_brak_magazyn);return false;}},number_down:function(idek,amount)
{var idek=document.getElementById(idek);if(isNaN(parseInt(idek.value)))idek.value=0;if(idek.value>1)
{idek.value=parseInt(idek.value)-1;}},numbercheck:function(number,amount){if(!isNaN(parseFloat(number)))
{if(number.match("^[0-9]{1}[0-9]{0,9}$")||number==''){if(number<=parseInt(amount)||amount==-1)
{return number;}
else
{if(amount)
{Alertek.show_alert(Projector_txt_maksymalnie+amount);}
else
{Alertek.show_alert(Projector_txt_brak_magazyn);}
return amount;}}
else
{number=number.substring(0,number.length-1);return number;}}
else
{return"";}}}
var ns6=document.getElementById&&!document.all;var ie=document.all;var html=document.getElementsByTagName("html");var Popup={url:'http://'+location.host,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(basecount<2||!basecount){document.getElementById('popup_next_prev').style.visibility="hidden";}
var edit=document.getElementById('show_popup_photo_sub');edit.style.width=parseInt(x)+"px";edit.style.height=parseInt(y)+"px";if(!ns6){Popup.hideSelects(1);}
Popup.creatLayers();},reload:function(){if(Popup.loaded){Popup.resize(Popup.link,Popup.width,Popup.height);}},next_img:function(){Popup.link=document.getElementById('big_photo').src;if(Popup.link.indexOf(Popup.url)!='-1')Popup.link=Popup.link.substr(Popup.url.length+1,Popup.link.length);for(n=1;n<=basecount;n++)
{if(Popup_enclosures[n][0]==Popup.link){n++;if(n<=basecount){Popup.resize(Popup_enclosures[n][0],Popup_enclosures[n][1],Popup_enclosures[n][2]);Popup.link=Popup_enclosures[n][0];return false;}
else
{Popup.resize(Popup_enclosures[1][0],Popup_enclosures[1][1],Popup_enclosures[1][2]);Popup.link=Popup_enclosures[1][0];return false;}}}},prev_img:function(){Popup.link=document.getElementById('big_photo').src;if(Popup.link.indexOf(Popup.url)!='-1')Popup.link=Popup.link.substr(Popup.url.length+1,Popup.link.length);for(n=basecount;n<=basecount;n--)
{if(Popup_enclosures[n][0]==Popup.link){n--;if(n>=1){Popup.resize(Popup_enclosures[n][0],Popup_enclosures[n][1],Popup_enclosures[n][2]);Popup.link=Popup_enclosures[n][0];return false;}
else
{Popup.resize(Popup_enclosures[basecount][0],Popup_enclosures[basecount][1],Popup_enclosures[basecount][2]);Popup.link=Popup_enclosures[basecount][0];return false;}}}},resize:function(sciezka,width,height){document.getElementById('big_photo').style.display='none';var edit=document.getElementById('show_popup_photo_sub');var edit2=document.getElementById('show_popup_photo');document.getElementById('big_photo').src=sciezka;edit.style.width=parseInt(width)+"px";edit2.style.width=parseInt(width)+"px";edit.style.height=parseInt(height)+"px";edit2.style.left=ns6?(Popup.pageSizes()[2]-(edit2.clientWidth+10))/2+html[0].scrollLeft+"px":(Popup.pageSizes()[2]-(edit2.clientWidth+10))/2+"px";},hide:function(){var edit=document.getElementById('show_popup_photo');var edit_close=document.getElementById('show_popup_photo_close');var cover=document.getElementById('cover');edit.style.display="none";edit_close.style.display="none";cover.style.display="none";Popup.loaded=0;if(!ns6){Popup.hideSelects(0);}},cover:function(wartosc){var cover=document.getElementById('cover');ns6?cover.style.opacity='.'+wartosc:cover.style.filter="alpha(Opacity="+wartosc+")";if(window.opera){cover.style.opacity='.'+wartosc;}},creatLayers:function(){var edit=document.getElementById('show_popup_photo');var edit_close=document.getElementById('show_popup_photo_close');edit.style.position='absolute';edit.style.display="block";edit_close.style.display="block";edit.style.width=(Popup.width)+"px";edit.style.left=ns6?(Popup.pageSizes()[2]-(Popup.width+10))/2+html[0].scrollLeft+"px":(Popup.pageSizes()[2]-(Popup.width+10))/2+"px";var ver_brow=0;if(navigator.appVersion.indexOf("MSIE")!=-1){temp=navigator.appVersion.split("MSIE");ver_brow=parseFloat(temp[1]);if(ver_brow<7.0)
{edit.style.top=((((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+document.body.scrollTop)<0)?"50px":(((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+document.body.scrollTop+50)+"px";}
else
{edit.style.top=((((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop)<0)?"50px":(((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop+50)+"px";}}
else
{edit.style.top=((((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop)<0)?"50px":(((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop+50)+"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 displayed='';function ImageRotate(id,id2)
{if(displayed==''){document.getElementById('img_1').style.display='none';}else{document.getElementById(displayed).style.display='none';}
document.getElementById(id).style.display='';displayed=id;var imglist=document.getElementById('photos_list');imglist=imglist.getElementsByTagName('img');i=0;while(i<imglist.length){imglist[i].className="miniatura";i++;}
id2.className="miniatura_on";}
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;}}
var client_new_txt1='Wysyłka na adres zamawiającego';var client_new_txt1b='Wysyłka na adres z faktury';var client_new_txt2='Adres zamawiającego';var client_new_txt2b='Dane do faktury';var client_new_txt3='Dane kontaktowe';var client_new_txt3b='Dane kontaktowe';var client_new_texts;var ClientNew_status=true;var ClientNew_firma=false;var ClientNew_adres=true;var ClientNewMandatoryMail=false;var ClientNewMandatoryPhone=false;var ClientSender=new Array();var RemoveAddresLink;var ClientNew={switchDiVDeliveryAddres:function()
{document.getElementById("selectDeliveryAddress").style.display="none";document.getElementById("selectDeliveryAddress2").style.display="block";},switchDeliveryAddres:function(id,obj)
{var IdAddress=id;if(IdAddress){document.getElementById('delivery_id').value=IdAddress;document.getElementById("selectDeliveryAddress").innerHTML=obj.firstChild.innerHTML;document.getElementById("selectDeliveryAddress2").style.display="none";document.getElementById("selectDeliveryAddress").style.display="block";document.getElementById('additional_firstname').value=document.getElementById('cda_'+IdAddress+'_firstname').innerHTML;document.getElementById('additional_lastname').value=document.getElementById('cda_'+IdAddress+'_lastname').innerHTML;document.getElementById('additional_city').value=document.getElementById('cda_'+IdAddress+'_city').innerHTML;document.getElementById('additional_additional').value=document.getElementById('cda_'+IdAddress+'_additional').innerHTML;document.getElementById('additional_street').value=document.getElementById('cda_'+IdAddress+'_street').innerHTML;document.getElementById('additional_zipcode').value=document.getElementById('cda_'+IdAddress+'_zipcode').innerHTML;document.getElementById('additional_phone').value=document.getElementById('cda_'+IdAddress+'_phone').innerHTML;if(document.getElementById('additional_region')&&document.getElementById('additional_region').options){for(i=0;i<document.getElementById('additional_region').options.length;i++){if(document.getElementById('additional_region').options[i].value==document.getElementById('cda_'+IdAddress+'_region_id').innerHTML){document.getElementById('additional_region').selectedIndex=i;break;}}}
if(document.getElementById('cda_'+IdAddress+'_removable').innerHTML=='yes'){document.getElementById('delete_delivery_address').style.display='';RemoveAddresLink=document.getElementById('cda_'+IdAddress+'_removelink').innerHTML;}else{document.getElementById('delete_delivery_address').style.display='none';RemoveAddresLink='';}}else{document.getElementById('delete_delivery_address').style.display='none';RemoveAddresLink='';document.getElementById('additional_firstname').value='';document.getElementById('additional_lastname').value='';document.getElementById('additional_city').value='';document.getElementById('additional_additional').value='';document.getElementById('additional_street').value='';document.getElementById('additional_zipcode').value='';document.getElementById('additional_phone').value='';}
if(document.getElementById('cda_'+IdAddress+'_editable').innerHTML=='no'){document.getElementById('additional_firstname').disabled='disabled';document.getElementById('additional_lastname').disabled='disabled';document.getElementById('additional_city').disabled='disabled';document.getElementById('additional_additional').disabled='disabled';document.getElementById('additional_street').disabled='disabled';document.getElementById('additional_zipcode').disabled='disabled';document.getElementById('additional_phone').disabled='disabled';document.getElementById('additional_region').disabled='disabled';}else{document.getElementById('additional_firstname').disabled='';document.getElementById('additional_lastname').disabled='';document.getElementById('additional_city').disabled='';document.getElementById('additional_additional').disabled='';document.getElementById('additional_street').disabled='';document.getElementById('additional_zipcode').disabled='';document.getElementById('additional_phone').disabled='';document.getElementById('additional_region').disabled='';}},removeDeliveryAddress:function()
{if(RemoveAddresLink){if(confirm("Czy na pewno chcesz usunąć ten adres dostawy?")){IAI_Ajax.Request('ajax/client-new.php?removeAddres=true','address='+document.getElementById('delivery_id').value,{onSuccess:'ClientNew.deleteAddress'});}}},newDeliveryAddress:function()
{document.getElementById('delivery_id').value='';document.getElementById('selectDeliveryAddress').style.display='none';document.getElementById('selectDeliveryAddress2').style.display='none';document.getElementById('additional_address_list_txt').style.display='none';document.getElementById('delete_delivery_address').style.display='none';document.getElementById('newDeliveryAddress').style.display='none';document.getElementById('saveDeliveryAddress').style.display='block';RemoveAddresLink='';document.getElementById('additional_firstname').value='';document.getElementById('additional_lastname').value='';document.getElementById('additional_city').value='';document.getElementById('additional_additional').value='';document.getElementById('additional_street').value='';document.getElementById('additional_zipcode').value='';document.getElementById('additional_phone').value='';document.getElementById('additional_firstname').disabled='';document.getElementById('additional_lastname').disabled='';document.getElementById('additional_city').disabled='';document.getElementById('additional_additional').disabled='';document.getElementById('additional_street').disabled='';document.getElementById('additional_zipcode').disabled='';document.getElementById('additional_phone').disabled='';document.getElementById('additional_region').disabled='';},deleteAddress:function(x)
{try{var response=eval('('+x+')');}catch(e){return false;}
xr=response;document.getElementById('delivery_list_id_'+response.remove).style.display="none";ClientNew.switchDeliveryAddres(response.selected,document.getElementById('delivery_list_id_'+response.selected));},copyDeliveryAddres:function()
{if(document.getElementById('deliver_to_billingaddr').checked){document.getElementById('delivery_additional').value=ClientNew_firma?document.getElementById('client_firm').value:'';document.getElementById('delivery_firstname').value=document.getElementById('client_firstname').value;document.getElementById('delivery_lastname').value=document.getElementById('client_lastname').value;document.getElementById('delivery_zipcode').value=document.getElementById('client_zipcode').value;document.getElementById('delivery_street').value=document.getElementById('client_street').value;document.getElementById('delivery_city').value=document.getElementById('client_city').value;document.getElementById('delivery_phone').value=document.getElementById('client_phone').value;document.getElementById('box_4').className='n56203_box_idle';document.getElementById('delivery_additional').disabled='disabled';document.getElementById('delivery_firstname').disabled='disabled';document.getElementById('delivery_lastname').disabled='disabled';document.getElementById('delivery_zipcode').disabled='disabled';document.getElementById('delivery_street').disabled='disabled';document.getElementById('delivery_city').disabled='disabled';if(document.getElementById('delivery_region')){document.getElementById('delivery_region').value=document.getElementById('client_region').value;document.getElementById('delivery_region').disabled='disabled';}}else{document.getElementById('box_4').className='n56203_box';document.getElementById('delivery_additional').disabled='';document.getElementById('delivery_firstname').disabled='';document.getElementById('delivery_lastname').disabled='';document.getElementById('delivery_zipcode').disabled='';document.getElementById('delivery_street').disabled='';document.getElementById('delivery_city').disabled='';document.getElementById('delivery_phone').disabled='';document.getElementById('delivery_additional_img_off').style.display=document.getElementById('client_firm_img_off').style.display;document.getElementById('delivery_additional_img_on').style.display=document.getElementById('client_firm_img_on').style.display;document.getElementById('delivery_firstname_img_off').style.display=document.getElementById('client_firstname_img_off').style.display;document.getElementById('delivery_firstname_img_on').style.display=document.getElementById('client_firstname_img_on').style.display;document.getElementById('delivery_lastname_img_off').style.display=document.getElementById('client_lastname_img_off').style.display;document.getElementById('delivery_lastname_img_on').style.display=document.getElementById('client_lastname_img_on').style.display;document.getElementById('delivery_zipcode_img_off').style.display=document.getElementById('client_zipcode_img_off').style.display;document.getElementById('delivery_zipcode_img_on').style.display=document.getElementById('client_zipcode_img_on').style.display;document.getElementById('delivery_street_img_off').style.display=document.getElementById('client_street_img_off').style.display;document.getElementById('delivery_street_img_on').style.display=document.getElementById('client_street_img_on').style.display;document.getElementById('delivery_city_img_off').style.display=document.getElementById('client_city_img_off').style.display;document.getElementById('delivery_city_img_on').style.display=document.getElementById('client_city_img_on').style.display;document.getElementById('delivery_phone_img_off').style.display=document.getElementById('client_phone_img_off').style.display;document.getElementById('delivery_phone_img_on').style.display=document.getElementById('client_phone_img_on').style.display;if(document.getElementById('delivery_region')){document.getElementById('delivery_region').disabled='';}}},use_vat:function(){if(document.getElementById('firm_data2').checked){var idr=document.getElementById('client_region').value;if(countryVatArray[idr]=='n'){document.getElementById('vat_ue').style.display='';}else{document.getElementById('vat_ue').style.display='none';}}else{document.getElementById('vat_ue').style.display='none';}},check_inp:function(idd,name,delay){if(document.getElementById(idd)){idd=document.getElementById(idd);}
ClientNew.use_vat();var value=idd.value;if(ClientSender[name]>5){ClientSender[name]=1;if(name=='client_zipcode'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','client_zipcode='+value+'&client_region='+document.getElementById('client_region').value,{onSuccess:'ClientNew.info',arg:idd.id});}else if(name=='delivery_zipcode'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','delivery_zipcode='+value+'&delivery_region='+document.getElementById('delivery_region').value,{onSuccess:'ClientNew.info',arg:idd.id});}else if(name=='additional_zipcode'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','additional_zipcode='+value+'&additional_region='+document.getElementById('additional_region').value,{onSuccess:'ClientNew.info',arg:idd.id});}else if(name=='client_region'){ClientNew.check_inp(document.getElementById('client_zipcode'),'client_zipcode');}else if(name=='delivery_region'){ClientNew.check_inp(document.getElementById('delivery_zipcode'),'delivery_zipcode');}else if(name=='additional_region'){ClientNew.check_inp(document.getElementById('additional_zipcode'),'additional_zipcode');}else if(name=='client_password'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','client_password='+value+'&client_login='+document.getElementById('client_login').value,{onSuccess:'ClientNew.info',arg:idd.id});}else if(name=='repeat_password'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','repeat_password='+value+'&client_password='+document.getElementById('client_password').value,{onSuccess:'ClientNew.info',arg:idd.id});}else{if(value){IAI_Ajax.Request('ajax/client-new.php?validAjax=true',name+'='+value,{onSuccess:'ClientNew.info',arg:idd.id});}else{ClientNew.error(idd.id,0);document.getElementById(idd.id+'_img_off').style.display="none";document.getElementById(idd.id+'_img_on').style.display="none";}}}else{if(delay){if(ClientSender[name]>1){ClientSender[name]++;delay++;}else{return false;}}else{if(ClientSender[name]>2){ClientSender[name]=2;return false;}else{ClientSender[name]=2;delay=1;}}
setTimeout('ClientNew.check_inp("'+idd.id+'", "'+name+'", "'+delay+'")',100);}
if(name=='client_login'){document.getElementById('client_login').value=document.getElementById('client_login').value.toLowerCase();}
if(document.getElementById('deliver_to_billingaddr')){if(document.getElementById('deliver_to_billingaddr').checked){ClientNew.copyDeliveryAddres();}}},info:function(x,obj){try{var response=eval('('+x+')');}catch(e){return false;}
xr=response;if(response.errno==0){new ClientNew.error(obj,0);}else{if(response.message.error_code){document.getElementById(obj+'_help').innerHTML='<div>'+clientNewErrorCode[response.message.error_code]+'</div>';}
new ClientNew.error(obj,1);}},button:function(num){if(num==0&&document.getElementById('terms_agree').checked){document.getElementById('submit_register').className='act';}else{document.getElementById('submit_register').className='idle';}},submitform:function(){ClientNew_status=true;if(!document.getElementById("client_firstname").value){ClientNew_status=false;}
if(!document.getElementById("client_lastname").value){ClientNew_status=false;}
if(!document.getElementById("client_city").value){ClientNew_status=false;}
if(!document.getElementById("client_zipcode").value){ClientNew_status=false;}
if(!document.getElementById("client_street").value){ClientNew_status=false;}
if(document.getElementById("firm_data2")){if(document.getElementById("firm_data2").checked&&(!document.getElementById("client_firm").value||!document.getElementById("client_nip").value)){ClientNew_status=false;}}
if(document.getElementById("client_login")){if(!document.getElementById("client_login").value){ClientNew_status=false;}}
if(document.getElementById("client_password")){if(!document.getElementById("client_password").value||!document.getElementById("repeat_password").value){ClientNew_status=false;}}
if(document.getElementById("deliver_to_billingaddr")){if(!document.getElementById("deliver_to_billingaddr").checked){if((!document.getElementById("delivery_firstname").value||!document.getElementById("delivery_lastname").value)&&!document.getElementById("delivery_additional").value){ClientNew_status=false;}
if(!document.getElementById("delivery_zipcode").value){ClientNew_status=false;}
if(!document.getElementById("delivery_street").value){ClientNew_status=false;}
if(!document.getElementById("delivery_city").value){ClientNew_status=false;}}}
if(ClientNewMandatoryPhone){if(!document.getElementById('client_phone').value){ClientNew_status=false;}
if(document.getElementById('additional_phone')){if((!document.getElementById('additional_phone').value)&&!document.getElementById('additional_phone').disabled){ClientNew_status=false;}}else if(document.getElementById('delivery_phone')){if((!document.getElementById('delivery_phone').value)&&!document.getElementById('delivery_phone').disabled){ClientNew_status=false;}}}
if(ClientNewMandatoryMail){if(!document.getElementById('client_email').value){ClientNew_status=false;}}
if(document.getElementById('terms_agree')){if((!document.getElementById('terms_agree').checked)&&document.getElementById('terms_agree').type!='hidden'){ClientNew_status=false;}}
if(ClientNew_status==true){if(document.getElementById("button_alert")){document.getElementById("button_alert").style.display="none";}
return true;}else{if(document.getElementById("button_alert")){document.getElementById("button_alert").style.display="block";setTimeout('ClientNew.AlertOff()',5000);}
return false;}
if(document.getElementById('vat_ue').style.display!='none'&&!document.getElementById('vat_company').checked){document.getElementById("button_alert").style.display="block";setTimeout('ClientNew.AlertOff()',5000);return false;}},ramka:function(){if(!document.getElementById('terms_agree').checked){document.getElementById('terms_agree_box').className='ramka_ON';}else{document.getElementById('terms_agree_box').className='ramka_OFF';}},AlertOff:function(){document.getElementById("button_alert").style.display="none";},copy_adres:function(type){var CopyData=false;if(document.getElementById("firm_data")){CopyData=document.getElementById("firm_data").checked;}
if(CopyData&&type==1){document.getElementById('client_firstname').value=document.getElementById('client_firstname_copy').value;document.getElementById('client_firstname_img_off').style.display=document.getElementById('client_firstname_copy_img_off').style.display;document.getElementById('client_firstname_img_on').style.display=document.getElementById('client_firstname_copy_img_on').style.display;document.getElementById('client_lastname').value=document.getElementById('client_lastname_copy').value;document.getElementById('client_lastname_img_off').style.display=document.getElementById('client_lastname_copy_img_off').style.display;document.getElementById('client_lastname_img_on').style.display=document.getElementById('client_lastname_copy_img_on').style.display;}else if(type==2){document.getElementById('client_firstname_copy').value=document.getElementById('client_firstname').value;document.getElementById('client_firstname_copy_img_off').style.display=document.getElementById('client_firstname_img_off').style.display;document.getElementById('client_firstname_copy_img_on').style.display=document.getElementById('client_firstname_img_on').style.display;document.getElementById('client_lastname_copy').value=document.getElementById('client_lastname').value;document.getElementById('client_lastname_copy_img_off').style.display=document.getElementById('client_lastname_img_off').style.display;document.getElementById('client_lastname_copy_img_on').style.display=document.getElementById('client_lastname_img_on').style.display;}},error:function(idd,err){if(err==1){document.getElementById(idd+'_img_off').style.display="block";document.getElementById(idd+'_img_on').style.display="none";if(document.getElementById(idd+'_help')){document.getElementById(idd+'_help').style.display="block";ClientNew.hide_info_help(idd,10);}
return false;}else{document.getElementById(idd+'_img_off').style.display="none";document.getElementById(idd+'_img_on').style.display="block";if(document.getElementById(idd+'_help')){document.getElementById(idd+'_help').style.display="none";ClientNew.hide_info_help(idd,10);}
return false;}},hide_info_help:function(idd,licznik){if(licznik>1){setTimeout("ClientNew.hide_info_help('"+idd+"', '"+(licznik-1)+"');",1000);}else if(document.getElementById(idd+'_help')){document.getElementById(idd+'_help').style.display="none";}}}
var xr;function agree(){if(document.getElementById('terms_agree').checked&&ClientNew_status==true){document.getElementById('submit_register').className='act';}else{document.getElementById('submit_register').className='idle';}}
function clientnew_firm(){ClientNew.use_vat();if(document.getElementById('firm_data').checked){ClientNew_firma=false;document.getElementById('client_firm_div').style.display='none';document.getElementById('box_3_header').innerHTML=client_new_txt2;document.getElementById('box_1_header').innerHTML=client_new_txt3;if(document.getElementById('send_to')){document.getElementById('send_to').innerHTML=client_new_txt1;}
document.getElementById('client_firstname_copy_txt').className='';document.getElementById('client_firstname_copy').className='';document.getElementById('client_lastname_copy_txt').className='';document.getElementById('client_lastname_copy').className='';}else{ClientNew_firma=true;document.getElementById('client_firm_div').style.display='block';document.getElementById('box_3_header').innerHTML=client_new_txt2b;document.getElementById('box_1_header').innerHTML=client_new_txt3b;if(document.getElementById('send_to')){document.getElementById('send_to').innerHTML=client_new_txt1b;}
document.getElementById('client_firstname_copy_txt').className='hidden';document.getElementById('client_firstname_copy').className='hidden';document.getElementById('client_lastname_copy_txt').className='hidden';document.getElementById('client_lastname_copy').className='hidden';}}
var client_new_txt1='Wysyłka na adres zamawiającego';var client_new_txt1b='Wysyłka na adres z faktury';var client_new_txt2='Adres zamawiającego';var client_new_txt2b='Dane do faktury';var client_new_txt3='Dane kontaktowe';var client_new_txt3b='Dane kontaktowe';var ClientNew_status=true;var ClientNew_firma=false;var ClientNew_adres=true;var ClientNewMandatoryMail=false;var ClientNewMandatoryPhone=false;var ClientSender=new Array();var ClientNewWholesale={use_vat:function(){var idr=document.getElementById('client_region').value;if(countryVatArray[idr]=='n'){document.getElementById('vat_ue').style.display='';}else{document.getElementById('vat_ue').style.display='none';}},check_inp:function(idd,name,delay){if(document.getElementById(idd)){idd=document.getElementById(idd);}
ClientNewWholesale.use_vat();var value=idd.value;if(ClientSender[name]>5){ClientSender[name]=1;if(name=='client_zipcode'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','client_zipcode='+value+'&client_region='+document.getElementById('client_region').value,{onSuccess:'ClientNewWholesale.info',arg:idd.id});}else if(name=='delivery_zipcode'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','delivery_zipcode='+value+'&delivery_region='+document.getElementById('delivery_region').value,{onSuccess:'ClientNewWholesale.info',arg:idd.id});}else if(name=='client_region'){ClientNewWholesale.check_inp(document.getElementById('client_zipcode'),'client_zipcode');}else if(name=='delivery_region'){ClientNewWholesale.check_inp(document.getElementById('delivery_zipcode'),'delivery_zipcode');}else if(name=='client_password'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','client_password='+value+'&client_login='+document.getElementById('client_login').value,{onSuccess:'ClientNewWholesale.info',arg:idd.id});}else if(name=='repeat_password'){IAI_Ajax.Request('ajax/client-new.php?validAjax=true','repeat_password='+value+'&client_password='+document.getElementById('client_password').value,{onSuccess:'ClientNewWholesale.info',arg:idd.id});}else{if(value){IAI_Ajax.Request('ajax/client-new.php?validAjax=true',name+'='+value,{onSuccess:'ClientNewWholesale.info',arg:idd.id});}else{ClientNewWholesale.error(idd.id,0);document.getElementById(idd.id+'_img_off').style.display="none";document.getElementById(idd.id+'_img_on').style.display="none";}}}else{if(delay){if(ClientSender[name]>1){ClientSender[name]++;delay++;}else{return false;}}else{if(ClientSender[name]>2){ClientSender[name]=2;return false;}else{ClientSender[name]=2;delay=1;}}
setTimeout('ClientNewWholesale.check_inp("'+idd.id+'", "'+name+'", "'+delay+'")',100);}
if(name=='client_login'){document.getElementById('client_login').value=document.getElementById('client_login').value.toLowerCase();}
if(document.getElementById('deliver_to_billingaddr')){if(document.getElementById('deliver_to_billingaddr').checked){ClientNewWholesale.deliveryaddr();}}},info:function(x,obj){try{var response=eval('('+x+')');}catch(e){return false;}
xr=response;if(response.errno==0){new ClientNewWholesale.error(obj,0);}else{if(response.message.error_code){ClNew.g(obj+'_help').innerHTML='<div>'+clientNewErrorCode[response.message.error_code]+'</div>';}
new ClientNewWholesale.error(obj,1);}},button:function(num){if(num==0&&document.getElementById('terms_agree').checked){if(document.getElementById('submit_register')){document.getElementById('submit_register').className='act';}
if(document.getElementById('submit_noregister')){document.getElementById('submit_noregister').className='act';}}else{if(document.getElementById('submit_register')){document.getElementById('submit_register').className='idle';}
if(document.getElementById('submit_noregister')){document.getElementById('submit_noregister').className='idle';}}},submitform:function(){ClientNew_status=true;if(!document.getElementById("client_firstname").value){ClientNew_status=false;}
if(!document.getElementById("client_lastname").value){ClientNew_status=false;}
if(!document.getElementById("client_email").value){ClientNew_status=false;}
if(!document.getElementById("client_city").value){ClientNew_status=false;}
if(!document.getElementById("client_zipcode").value){ClientNew_status=false;}
if(!document.getElementById("client_street").value){ClientNew_status=false;}
if(document.getElementById("firm_data2")){if(document.getElementById("firm_data2").checked&&!document.getElementById("client_firm").value&&!document.getElementById("client_nip").value){ClientNew_status=false;}}
if(document.getElementById("client_login")){if(!document.getElementById("client_login").value){ClientNew_status=false;}}
if(document.getElementById("client_password")){if(!document.getElementById("client_password").value||!document.getElementById("repeat_password").value){ClientNew_status=false;}}
if(document.getElementById("deliver_to_billingaddr")){if(!document.getElementById("deliver_to_billingaddr").checked){if((!document.getElementById("delivery_firstname").value||!document.getElementById("delivery_lastname").value)&&!document.getElementById("delivery_additional").value){ClientNew_status=false;}
if(!document.getElementById("delivery_zipcode").value){ClientNew_status=false;}
if(!document.getElementById("delivery_street").value){ClientNew_status=false;}
if(!document.getElementById("delivery_city").value){ClientNew_status=false;}}}
if(ClientNewMandatoryPhone){if(!document.getElementById('client_phone').value){ClientNew_status=false;}
if(document.getElementById('additional_phone')){if((!document.getElementById('additional_phone').value)&&!document.getElementById('additional_phone').disabled){ClientNew_status=false;}}else if(document.getElementById('delivery_phone')){if((!document.getElementById('delivery_phone').value)&&!document.getElementById('delivery_phone').disabled){ClientNew_status=false;}}}
if(ClientNewMandatoryMail){if(!document.getElementById('client_email').value){ClientNew_status=false;}}
if(document.getElementById('terms_agree')){if((!document.getElementById('terms_agree').checked)&&document.getElementById('terms_agree').type!='hidden'){ClientNew_status=false;}}
if(ClientNew_status==true){if(document.getElementById("button_alert")){document.getElementById("button_alert").style.display="none";}
return true;}else{if(document.getElementById("button_alert")){document.getElementById("button_alert").style.display="block";setTimeout('ClientNewWholesale.AlertOff()',5000);}
return false;}
if(document.getElementById('vat_ue').style.display!='none'&&!document.getElementById('vat_company').checked){document.getElementById("button_alert").style.display="block";setTimeout('ClientNew.AlertOff()',5000);return false;}},ramka:function(){if(!document.getElementById('terms_agree').checked){document.getElementById('terms_agree_box').className='ramka_ON';}else{document.getElementById('terms_agree_box').className='ramka_OFF';}},AlertOff:function(){document.getElementById("button_alert").style.display="none";},deliveryaddr:function(){if(document.getElementById('deliver_to_billingaddr').checked){document.getElementById('delivery_additional').value=document.getElementById('client_firm').value;document.getElementById('delivery_firstname').value=document.getElementById('client_firstname').value;document.getElementById('delivery_lastname').value=document.getElementById('client_lastname').value;document.getElementById('delivery_zipcode').value=document.getElementById('client_zipcode').value;document.getElementById('delivery_street').value=document.getElementById('client_street').value;document.getElementById('delivery_city').value=document.getElementById('client_city').value;if(document.getElementById('delivery_region')&&document.getElementById('client_region')){document.getElementById('delivery_region').value=document.getElementById('client_region').value;}
document.getElementById('delivery_phone').value=document.getElementById('client_phone').value;document.getElementById('box_4').className='n56315_box_idle';document.getElementById('delivery_additional').disabled='disabled';document.getElementById('delivery_firstname').disabled='disabled';document.getElementById('delivery_lastname').disabled='disabled';document.getElementById('delivery_zipcode').disabled='disabled';document.getElementById('delivery_street').disabled='disabled';document.getElementById('delivery_city').disabled='disabled';document.getElementById('delivery_region').disabled='disabled';document.getElementById('delivery_phone').disabled='disabled';}else{document.getElementById('box_4').className='n56315_box';document.getElementById('delivery_additional').disabled='';document.getElementById('delivery_firstname').disabled='';document.getElementById('delivery_lastname').disabled='';document.getElementById('delivery_zipcode').disabled='';document.getElementById('delivery_street').disabled='';document.getElementById('delivery_city').disabled='';document.getElementById('delivery_phone').disabled='';if(document.getElementById('delivery_region')){document.getElementById('delivery_region').disabled='';}}},error:function(idd,err){if(err==1){document.getElementById(idd+'_img_off').style.display="block";document.getElementById(idd+'_img_on').style.display="none";if(document.getElementById(idd+'_help')){document.getElementById(idd+'_help').style.display="block";ClientNewWholesale.hide_info_help(idd,10);}}else{document.getElementById(idd+'_img_off').style.display="none";document.getElementById(idd+'_img_on').style.display="block";if(document.getElementById(idd+'_help')){document.getElementById(idd+'_help').style.display="none";}}
return false;},hide_info_help:function(idd,i){if(i>1){setTimeout("ClientNewWholesale. hide_info_help('"+idd+"', '"+(i-1)+"');","1000");}else{document.getElementById(idd+'_help').style.display="none";}}}
var xr;var zagielnotconfirmed="Zanim złożysz zamówienie, zapoznaj się z procedurą udzielenia kredytu ratalnego E-kredyt Żagiel.";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 hold_it_now(ident){document.getElementById(ident).style.display="block";}
var timer,idek;var Dialogbox={offsetfrommouse:[0,30],truebd:function(){return(!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body},hidetrail_dialogbox:function(){document.getElementById(idek).style.display="none";document.onmousemove="";document.getElementById(idek).style.left="-2000px";clearTimeout(timer);},showtrail_dialogbox:function(id){idek=id;timer=setTimeout("Dialogbox.show_dialogbox();",50);},show_dialogbox:function(){document.onmousemove=Dialogbox.followmouse_dialogbox;document.getElementById(idek).style.display="block";},followmouse_dialogbox:function(e){var xcoord=Dialogbox.offsetfrommouse[0]
var ycoord=Dialogbox.offsetfrommouse[1]
var docwidth=document.all?Dialogbox.truebd().scrollLeft+Dialogbox.truebd().clientWidth:pageXOffset+window.innerWidth-15;var docheight=document.all?Math.min(Dialogbox.truebd().scrollHeight,Dialogbox.truebd().clientHeight):Math.min(window.innerHeight);if(typeof e!="undefined"){if(docwidth-e.pageX<2*Dialogbox.offsetfrommouse[0]){xcoord=e.pageX-xcoord;}else{xcoord+=e.pageX;}
if(docheight-e.pageY<2*Dialogbox.offsetfrommouse[1]){ycoord+=e.pageY-Math.max(0,(2*Dialogbox.offsetfrommouse[1]+e.pageY-docheight-Dialogbox.truebd().scrollTop));}else{ycoord+=e.pageY;}}else if(typeof window.event!="undefined"){if(docwidth-event.clientX<2*Dialogbox.offsetfrommouse[0]){xcoord=event.clientX+Dialogbox.truebd().scrollLeft-xcoord;}else{xcoord+=Dialogbox.truebd().scrollLeft+event.clientX}
if(docheight-event.clientY<(2*Dialogbox.offsetfrommouse[1])){ycoord+=event.clientY+Dialogbox.truebd().scrollTop-Math.max(0,(2*Dialogbox.offsetfrommouse[1]+event.clientY-docheight));}else{ycoord+=Dialogbox.truebd().scrollTop+event.clientY;}}
document.getElementById(idek).style.left=xcoord+"px"
document.getElementById(idek).style.top=ycoord+"px"}}
function dateReturn()
{var Today=new Date();var Month=1+Today.getMonth()
var Day=Today.getDate()
var Year=Today.getFullYear()
if(Year<=99)Year+=1900;if(Month<10)Month="0"+Month;return Day+"."+Month+"."+Year;}
var product_id=0;var size_id=0;var price=0;var viewSubmits=false;var active='';var message=true;function chSizeQuantity(element)
{if(element=='none'){if(document.getElementById('select_products'))sel_pr=document.getElementById('select_products').value;}else{sel_pr=element;}
div_sz_n=document.getElementById('div_sizes_'+product_id);div_sz_b=document.getElementById('div_sizes_'+sel_pr);sel_sz_n=document.getElementById('select_sizes_'+product_id);sel_sz_b=document.getElementById('select_sizes_'+sel_pr);div_sz_n.style.display='none';div_sz_b.style.display='block';sel_sz_n.disabled=true;sel_sz_b.disabled=false;sel_sz=document.getElementById('select_sizes_'+sel_pr);div_nr_n=document.getElementById('div_num_'+product_id+'_'+size_id);div_nr_b=document.getElementById('div_num_'+sel_pr+'_'+sel_sz.value);sel_nr_n=document.getElementById('select_num_'+product_id+'_'+size_id);sel_nr_b=document.getElementById('select_num_'+sel_pr+'_'+sel_sz.value);div_nr_n.style.display='none';div_nr_b.style.display='block';sel_nr_n.disabled=true;sel_nr_b.disabled=false;div_pr=document.getElementById('div_price');inp_pr=document.getElementById('price_'+sel_pr+'_'+sel_sz.value);inp_cr=document.getElementById('cur_sign');if(inp_pr.value!=''){div_pr.innerHTML=inp_pr.value+inp_cr.value;}else{div_pr.innerHTML=inp_pr.value;}
size_id=sel_sz.value;product_id=sel_pr;}
function chQuantity()
{sel_sz=document.getElementById('select_sizes_'+product_id);div_nr_n=document.getElementById('div_num_'+product_id+'_'+size_id);div_nr_b=document.getElementById('div_num_'+product_id+'_'+sel_sz.value);sel_nr_n=document.getElementById('select_num_'+product_id+'_'+size_id);sel_nr_b=document.getElementById('select_num_'+product_id+'_'+sel_sz.value);div_nr_n.style.display='none';div_nr_b.style.display='block';sel_nr_n.disabled=true;sel_nr_b.disabled=false;size_id=sel_sz.value;div_pr=document.getElementById('div_price');inp_pr=document.getElementById('price_'+product_id+'_'+sel_sz.value);inp_cr=document.getElementById('cur_sign');if(inp_pr.value!=''){div_pr.innerHTML=inp_pr.value+inp_cr.value;}else{div_pr.innerHTML=inp_pr.value;}}
function viewProductEdit()
{element=document.getElementById('div_product_edit');element.style.display='block';}
function hideProductEdit()
{element=document.getElementById('div_product_edit');element.style.display='none';}
var szerokosc_compare=995;function pageHeight(){return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;}
function compare_cover(num)
{if(num=='0')
{cover_log=document.getElementById('compare_pointer');div_log=document.getElementById('compare_table_block_ALL');cover_log.style.display='block';cover_log.style.width='100%';cover_log.style.position='absolute';cover_log.style.zIndex='9998';cover_log.style.top='0';cover_log.style.left='0';html=document.getElementsByTagName('html')[0];if(navigator.appVersion.indexOf("MSIE")!=-1){temp=navigator.appVersion.split("MSIE");ver_brow=parseFloat(temp[1]);if(ver_brow<7.0){cover_log.style.width=document.body.clientWidth+'px';div_log.style.width=document.body.clientWidth-60+'px';}}
cover_log.style.height=Math.max(html.scrollHeight,html.offsetHeight,(self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight))+'px';}
if(num=='1')
{cover_log=document.getElementById('compare_pointer');cover_log.style.display='none';div_log=document.getElementById('compare_table_block_ALL');}}
function compare_hide_boxes()
{var pointer,div_block;div_block=document.getElementById("compare_table_block");pointer=document.getElementById("compare_pointer");if(pointer.parentNode.nextSibling&&pointer.parentNode.previousSibling&&(document.body.firstChild.clientWidth!=0))
{pointer.parentNode.nextSibling.style.display="none";pointer.parentNode.previousSibling.style.display="none";div_block.style.width=szerokosc_compare+'px';div_width=szerokosc_compare+'px';var images=document.images;for(var ii=0;ii<images.length;ii++)
{if(images[ii].complete==false){setTimeout("compare_hide_boxes()",100);return false;}}
if(navigator.appVersion.indexOf("MSIE")!=-1){temp=navigator.appVersion.split("MSIE");ver_brow=parseFloat(temp[1]);if(ver_brow<=7.0){if(div_block.scrollWidth>div_block.clientWidth)
{div_block.style.height=div_block.clientHeight+35+"px";}}}}
else
{setTimeout("compare_hide_boxes()",100);}}
function compare_change(id)
{if(document.getElementById(id).style.display=='none')
{document.getElementById(id).style.display='';document.getElementById('off_'+id).style.display="none";}
else
{document.getElementById(id).style.display="none";document.getElementById('off_'+id).style.display='';}}
function compare_fullscreen(num)
{if(num==0)
{compare_cover(0);document.getElementById('compare_table_block_ALL').style.position="absolute";document.getElementById('compare_table_block_ALL').style.zIndex="9999";document.getElementById('compare_table_block_ALL').style.top="0";document.getElementById('compare_table_block_ALL').style.left="0";document.getElementById('compare_table_block_ALL').style.width="96%";document.getElementById('compare_table_block').style.width="100%";document.getElementById('compare_table_block_ALL').style.margin="35px";document.getElementById('compare_full_off').style.display="none";document.getElementById('compare_full_on').style.display="block";}
if(num==1)
{compare_cover(1);document.getElementById('compare_table_block_ALL').style.position="";document.getElementById('compare_table_block_ALL').style.top="";document.getElementById('compare_table_block_ALL').style.left="";document.getElementById('compare_table_block').style.width=szerokosc_compare+'px';document.getElementById('compare_table_block_ALL').style.margin="";document.getElementById('compare_table_block_ALL').style.width="100%";document.getElementById('compare_full_off').style.display="block";document.getElementById('compare_full_on').style.display="none";}}
var compare_vis_tablica=new Array();function compare_visibility(poz,num)
{var elems=document.getElementsByTagName('td');for(i=0;i<elems.length;i++)
{if(elems[i].id==poz)
{if(num=='0')
{document.getElementById('compare_vis_off_'+poz).style.display="none";document.getElementById('compare_vis_on_'+poz).style.display="block";compare_vis_tablica[i]=elems[i].innerHTML;elems[i].innerHTML='';elems[i].className="podswietlenie";}
if(num=='1')
{document.getElementById('compare_vis_off_'+poz).style.display="block";document.getElementById('compare_vis_on_'+poz).style.display="none";elems[i].innerHTML=compare_vis_tablica[i];elems[i].className="";}}}}
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 Prepaid={changeDelivery:function(time){if(window['orderCalendarActive']==true){OrderCalendar.changeDeliveryTime(time);}}};var SearchJS={show_size:function(id){if(document.getElementById(id).style.display=='none'){document.getElementById(id).style.display='block';document.getElementById(id+'_button').style.display='block';}
else
{document.getElementById(id).style.display='none';document.getElementById(id+'_button').style.display='none';}},button_switch:function(identyf){if(document.getElementById(identyf).className=='n56494_show_sizes'){document.getElementById(identyf).className='n56494_show_sizes_idle';}
else
{document.getElementById(identyf).className='n56494_show_sizes';}},numbercheck:function(number,amount){if(!isNaN(parseFloat(number)))
{if(number.match("^[0-9]{1}[0-9]{0,9}$")||number==''){if(number<=parseInt(amount)||amount==-1)
{return number;}
else
{Alertek.show_alert(Projector_txt_maksymalnie+amount);return amount;}}
else
{number=number.substring(0,number.length-1);return number;}}
else
{return"";}},search_dosubmit:function(number,counter){var formularz=document.getElementById('form_s'+number);var sumka=0;if(counter>0||counter=='NULLEK')
{if(counter=='NULLEK')counter=1;for(i=1;i<=counter;i++)
{if(document.getElementById('form_quant_s'+number+'_'+i).value!=0&&document.getElementById('form_quant_s'+number+'_'+i).value!='')
{sumka=1;}}}
else
{sumka=0;}
if(sumka==0)
{Alertek.show_alert(Projector_txt_podajilosc);return false;}
else
{formularz.submit();}},ADD_ALL_SEARCH:function(thid){var a2b=document.getElementById('adding_to_basket');a2b.innerHTML='';var netto_value;var brutto_value;if(netto_value!=0||brutto_value!=0)
{var sum_up=document.getElementById('sum_up');var sum_up2=document.getElementById('sum_up2');sum_up.value=0;sum_up2.value=0;var elems=document.getElementsByTagName('input');for(i=0;i<elems.length;i++)
{if(elems[i].name.match('quantity')=='quantity')
{if(!isNaN(parseFloat(elems[i].value)))
{brutto_value=elems[i].nextSibling.innerHTML;netto_value=elems[i].nextSibling.nextSibling.innerHTML;sum_up.value=parseFloat(elems[i].value)*netto_value+parseFloat(sum_up.value);sum_up2.value=parseFloat(elems[i].value)*brutto_value+parseFloat(sum_up2.value);}}}
sum_up.value=SearchJS.roundNumber(sum_up.value,2);sum_up2.value=SearchJS.roundNumber(sum_up2.value,2);}},roundNumber:function(number,flag){var rnum=number;if(flag==0)var rlength=0;if(flag!=0)var rlength=flag;if(rnum>8191&&rnum<10485){rnum=rnum-5000;var newnumber=Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);newnumber=newnumber+5000;}else{var newnumber=Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);}
return newnumber;},add2basket:function(){var a2b=document.getElementById('adding_to_basket');a2b.innerHTML='';var eArray=new Array();var eQ,eS,eP;var flaga_submit=false;var elems=document.getElementsByTagName('input');for(i=0;i<elems.length;i++)
{if(elems[i].name.match('quantity')=='quantity')
{if(!isNaN(parseFloat(elems[i].value))){var elements=elems[i].parentNode.getElementsByTagName('input');for(n=0;n<elements.length;n++)
{if(elements[n].name.match('quantity')=='quantity')
{eQ=elements[n].value;}
if(elements[n].name.match('size')=='size')
{eS=elements[n].value;}
if(elements[n].name.match('product')=='product')
{eP=elements[n].value;}}
eArray[i]=new Array(eQ,eS,eP);flaga_submit=true;}}}
for(i=0;i<elems.length;i++)
{if(eArray[i]!=null)
{SearchJS.addElement(eArray[i][0],eArray[i][1],eArray[i][2]);}}
if(flaga_submit==true)
{document.getElementById('adding_to_basket').submit();}
else
{Alertek.show_alert(Projector_txt_podajilosc);return false;}},number_up:function(idek,amount)
{var idek=document.getElementById(idek);if(isNaN(parseInt(idek.value)))idek.value=0;if(idek.value>=parseInt(amount)&&isFinite(amount)&&amount!='-1')
{return false;}
else
{idek.value=parseInt(idek.value)+1;}},number_down:function(idek,amount)
{var idek=document.getElementById(idek);if(isNaN(parseInt(idek.value)))idek.value=0;if(idek.value>1)
{idek.value=parseInt(idek.value)-1;}},addElement:function(wartosc,size,product){var ni=document.getElementById('adding_to_basket');var newinput=document.createElement('input');var newinput2=document.createElement('input');var newinput3=document.createElement('input');newinput.setAttribute('type','product');newinput2.setAttribute('type','quantity');newinput3.setAttribute('type','size');newinput.setAttribute('name','product[]');newinput2.setAttribute('name','quantity[]');newinput3.setAttribute('name','size[]');newinput.setAttribute('type','hidden');newinput2.setAttribute('type','hidden');newinput3.setAttribute('type','hidden');newinput.value=product;newinput2.value=wartosc;newinput3.value=size;ni.appendChild(newinput);ni.appendChild(newinput2);ni.appendChild(newinput3);}}
var ClientSave={validateLogin:function(obj)
{obj.value=obj.value.toLowerCase();}}
var product_id=0;var size_id=0;var price=0;var viewSubmits=false;var active='';var message=true;function auction_delivery_addr(){if(document.getElementById('delivery_address').checked){document.getElementById('delivery_address_inputs').style.display='block';}else{document.getElementById('delivery_address_inputs').style.display='none';}}
function show_firm(){if(document.getElementById('add_firm').checked){document.getElementById('add_firm_inputs').style.display='block';}else{document.getElementById('add_firm_inputs').style.display='none';}}
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 checkOnSubmit(text1,text2,text3)
{if((/^[0-9a-zA-Z._-]+@[0-9a-zA-Z._-]+.[0-9a-zA-Z]+$/).test(document.getElementById("from").value)==false||document.getElementById("from").value.length==0){alert(text1);return false;}
if(document.getElementById("subject").value.length==0){alert(text2);return false;}
if(document.getElementById("body").value.length==0){alert(text3);return false;}
return true;}
var product_id=0;var size_id=0;var price=0;var viewSubmits=false;var active='';var message=true;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';}}
function viewSubmit(id)
{var confirm=document.getElementById('submit_confirm');var confirm_idle=document.getElementById('submit_confirm_idle');var div=document.getElementById(id);if(viewSubmits==false){viewSubmits=true;div.style.display='block';confirm.style.display='none';confirm_idle.style.display='block';active=id;}else{if((active!=id)&&(message)){switch(active){case'submit_client':alert(text_submit_client);break;case'submit_delivery':alert(text_submit_delivery);break;}
message=false;}}}
var newstxt='twój e-mail';function newsletter_blur(x){if(x.value==''){x.value=news_txt;}}
function newsletter_focus(x){if(x.value!=''){x.value='';}}