
function viewGroupEdit(group_id,item_id)
{element=document.getElementById('div_group_edit');element.style.display='block';document.getElementById('group_'+group_id).style.display='block';document.getElementById('item_'+item_id).style.display='block';}
var product_id=0;var size_id=0;var price=0;function baskQuantity()
{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 hideGroupEdit()
{element=document.getElementById('div_group_edit');element.style.display='none';}
function basket_isNumeric(id,precision){var elem=document.getElementById(id);if(precision>0){if(elem.value.match("^[0-9]{1,9}[.,]{0,1}[0-9]{0,"+precision+"}$")||elem.value==''){elem.value=elem.value.replace(',','.');return true;}else{elem.value=elem.value.substring(0,elem.value.length-1);return false;}}
if(precision==0){if(elem.value.match("^[1-9]{1}[0-9]{0,9}$")||elem.value==''){return true;}else{elem.value=elem.value.substring(0,elem.value.length-1);return false;}}}
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 countAnnuityEraty(account,version,amount)
{window.open('https://www.eraty.pl/symulator/oblicz.php?numerSklepu='+account+'&wariantSklepu='+version+'&typProduktu=0&wartoscTowarow='+amount,'count_zagiel','width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');}
function validate_eraty()
{var zagielconfirm=document.getElementById('zagiel_confirm');if(!zagielconfirm){return false;}
if(zagielconfirm.checked){return true;}else{alert(zagielnotconfirmed)
return false;}}
function client_addresses_list_confirmdelete(){return confirm('Czy na pewno usunąć wybrany adres dostawy?');}
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';}}
var ClientSave={validateLogin:function(obj)
{obj.value=obj.value.toLowerCase();}}
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 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='';}}
function menu_categories_toggle(id,id_up){if(document.getElementById(id).style.display=='block'){document.getElementById(id).style.display='none';}else{document.getElementById(id).style.display='block';}}
function menu_highlight(id){if(document.getElementById(id).className=='menu_categories_cat_sub_first')
{document.getElementById(id).className='menu_categories_cat_sub_first_active';return false;}
if(document.getElementById(id).className=='menu_categories_cat_sub_last')
{document.getElementById(id).className='menu_categories_cat_sub_last_active';return false;}
if(document.getElementById(id).className=='menu_categories_cat_sub')
{document.getElementById(id).className='menu_categories_cat_sub_active';return false;}
if(document.getElementById(id).className=='menu_categories_cat_sub_first_active')
{document.getElementById(id).className='menu_categories_cat_sub_first';return false;}
if(document.getElementById(id).className=='menu_categories_cat_sub_last_active')
{document.getElementById(id).className='menu_categories_cat_sub_last';return false;}
if(document.getElementById(id).className=='menu_categories_cat_sub_active')
{document.getElementById(id).className='menu_categories_cat_sub';return false;}}
newsletter_txt='twój adres email';function newsletter2_blur(x){if(x.value==''){x.value=newsletter_txt;}}
function newsletter2_focus(x){if(x.value!=''){x.value='';}}
var timer_marquee=0;function marquee_anim(contener,subcontener)
{if(!contener||!subcontener)return false;var cont=document.getElementById(contener);var sub=document.getElementById(subcontener);if(timer_marquee<3){for(z=0;z<5;z++)
{sub.innerHTML=sub.innerHTML+' '+sub.innerHTML;}
cont.scrollLeft=0;}
if((cont.scrollWidth-cont.clientWidth)<=cont.scrollLeft){cont.scrollLeft=0;}
cont.scrollLeft+=1;timer_marquee=setTimeout(function(){marquee_anim(contener,subcontener)},40);}
var timer2_marquee=0;function marquee_anim2(contener,subcontener)
{if(!document.getElementById(contener)||!document.getElementById(subcontener))return false;var cont=document.getElementById(contener);var sub=document.getElementById(subcontener);if(timer2_marquee<3){for(z=0;z<5;z++)
{sub.innerHTML=sub.innerHTML+' '+sub.innerHTML;}
sub.style.width=4800+'px';cont.scrollLeft=0;}
if((cont.scrollWidth-cont.clientWidth)<=cont.scrollLeft){cont.scrollLeft=0;}
cont.scrollLeft+=1;timer_marquee=setTimeout(function(){marquee_anim(contener,subcontener)},40);}
var tWidth='690px';var tHeight='13px';var tcolour='#F5F5F5';var moStop=true;var fontfamily='verdana,arial,sans-serif';var tSpeed=1;var cps=tSpeed;var aw,mq;var fsz=parseInt(tHeight)-4;function startticker(){if(document.getElementById){var tick='<div style="position:relative;width:'+tWidth+';height:'+tHeight+';overflow:hidden;background-color:'+tcolour+'"';if(moStop)tick+=' onmouseover="cps=0" onmouseout="cps=tSpeed"';tick+='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>';document.getElementById('ticker').innerHTML=tick;mq=document.getElementById("mq");mq.style.left=(parseInt(tWidth)+10)+"px";mq.innerHTML='<span id="tx">'+content+'<\/span>';aw=document.getElementById("tx").offsetWidth;lefttime=setInterval("scrollticker()",50);}}function scrollticker(){mq.style.left=(parseInt(mq.style.left)>(-10-aw))?parseInt(mq.style.left)-cps+"px":parseInt(tWidth)+10+"px";}window.onload=startticker;top_txt='wpisz szukaną frazę';function top_blur(x){if(x.value==''){x.value=top_txt;}}
function top_focus(x){if(x.value!=''){x.value='';}}
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 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';}}
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 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';}}
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;}}}
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';}}
txt_dostepny="Produkt dostępny.";txt_niedostepny="Produkt niedostępny.";txt_zamowienie="Produkt na zamówienie.";txt_czas_wysylki="Wysyłamy w ciągu  ";txt_czas_dostawy="Dostawa za  ";txt_points="Możesz kupić za punkty.<br />Ilość punktów potrzebnych: ";txt_points_only="Produkt promocyjny, wyłącznie za punkty.";var txt_warning_choosen="Wybrałeś właściwy produkt?";txt_actual_version="Zobacz szczegółowy opis ";txt_telprice="Zapytaj o cenę";txt_czas_wysylki_zero="Wysyłamy w ciągu 24h.";txt_days="dni";txt_day="dzień roboczy.";function xdisplay(idVersion,idSize)
{var id=idVersion+'_'+idSize;var toBasket;var forPointsOnly;var price;var points;var availabilityStatus;var telPrice;var days;var priceFloat;var promo_price='';if(msg=document.getElementById('id_display_msg')){msg.style.display="none";}
if(version_link=document.getElementById('id_version_link')){version_link.style.display="none";}
if((idVersion>0)&&(idSize!='')){telPrice=arVersionSizes[id][2];forPointsOnly=0;price=arVersionSizes[id][0];priceFloat=parseFloat(price);points=arVersionSizes[id][1];days=arVersionSizes[id][6];forpoints=0;if(arVersionSizes[id][3]=='true'){forpoints=1;}
availabilityStatus=arVersionSizes[id][5];if(forpoints&&telPrice){if(priceFloat=='0'){forPointsOnly=1;}else{forPointsOnly=0;}}
if(forpoints&&(priceFloat=='0')){forPointsOnly=1;}
if(MaxPrice){promo_price="<span class='results_maxprice_proj'>"+MaxPrice+currency+"</span>";}
document.getElementById('id_display_delivery').innerHTML='';document.getElementById('id_display_availability').innerHTML='';el2=document.getElementById('id_display_delivery')
if((el=document.getElementById('id_display_availability'))&&((availabilityStatus=='enable')||(availabilityStatus=='order'))){if(availabilityStatus=='enable'&&days){el.innerHTML=txt_dostepny;if(days>1){el2.innerHTML=txt_czas_wysylki+days+txt_days;}else{if(days==0){el2.innerHTML=txt_czas_wysylki_zero;}else{el2.innerHTML=txt_czas_wysylki+days+txt_day;}}}
if(availabilityStatus=='order'&&days){el.innerHTML=txt_zamowienie;if(days>1){el2.innerHTML=txt_czas_wysylki+days+txt_days;}else{if(days==0){el2.innerHTML=txt_czas_wysylki_zero;}else{el2.innerHTML=txt_czas_wysylki+days+txt_day;}}}
toBasket=1;}
else
{toBasket=0;if(el=document.getElementById('id_display_availability')){el.innerHTML=txt_niedostepny;if(availabilityStatus=='disable'&&days){if(days>1){el2.innerHTML=txt_czas_dostawy+days+txt_days;}else{el2.innerHTML=txt_czas_dostawy+days+txt_day;}}}}}
else{toBasket=0;}
if(el=document.getElementById('size_input')){el.value=idSize;}
var el;var tmp;if((idSize=='')||(idVersion==0)){if(el=document.getElementById('id_display_watch')){el.style.opacity='.4';el.style.filter="alpha(opacity=40)";el.style.cursor="not-allowed";}}else{if(el=document.getElementById('id_display_watch')){el.style.opacity='1';el.style.filter="alpha(opacity=100)";el.style.cursor="pointer";}}
if(el=document.getElementById('id_display_delivery')){if((idSize=='')||(idVersion==0)){el1=document.getElementById('id_display_availability')
el.innerHTML=txt_warning_delivery;el1.innerHTML=txt_warning_availability;msg.style.display="block";msg.innerHTML=txt_msg_avail_deliv;forpoints=0;}else
{msg.style.display="block";msg.innerHTML=txt_warning_choosen;}}
e11=document.getElementById('id_display_size_container');if(el=document.getElementById('id_display_size')){if(idSize!=''&&SizesCount>1){e11.style.display="block";tmp=arNameS[idSize];}else{e11.style.display="none";}
el.innerHTML=tmp;}
e11=document.getElementById('id_display_price_container');e11.style.display="none";if(el=document.getElementById('id_display_price')){if((idSize!='')&&(idVersion>0)){e11.style.display="block";if(telPrice&&parseFloat(price)==0){el.innerHTML=txt_telprice;}else{el.innerHTML=promo_price+price+currency;}}else{e11.style.display="none";toBasket=0;}}
e11=document.getElementById('id_display_version_container');if(el=document.getElementById('id_display_version')){if(idVersion>1&&VersionsCount>0){tmp=arNameV[idVersion];e11.style.display="block";}else{e11.style.display="none";}
el.innerHTML=tmp;}
if(el=document.getElementById('id_display_points_container')){if(forpoints&&(availabilityStatus!='disable')){el.style.display="block";el1=document.getElementById('id_display_pointscheck');el2=document.getElementById('id_display_pointstxt');el3=document.getElementById('id_display_pointsvalue');if(forPointsOnly==1){el1.style.display="none";el3.style.display="none";el2.innerHTML=txt_points_only;}else{el1.style.display="block";el3.style.display="block";el2.innerHTML=txt_points;el3.innerHTML=points;el1.innerHTML='<input type="checkbox" name="forpoints" value="1"/>';}}else{el.style.display="none";}}
if(el=document.getElementById('id_display_basket')){if(telPrice&&(forPointsOnly==0)){toBasket=0;}
if(toBasket=='1'){el.style.display='block';el.style.opacity='1';el.style.filter="alpha(opacity=100)";el.style.cursor="pointer";submit_flag=true;}else{el.style.display='block';el.style.opacity='.4';el.style.filter="alpha(opacity=40)";el.style.cursor="not-allowed";submit_flag=false;}}}
function xselectSize(id)
{for(n in allsizes){checkElement('s',allsizes[n],'enable');}
checkElement('s',id,'checked');found=0;selectedS=id;for(n in allversions){checkElement('v',allversions[n],'disable');for(k in sizes[id]){if(sizes[id][k]==allversions[n]){if(selectedV==allversions[n]){checkElement('v',allversions[n],'checked');found=1;}else{checkElement('v',allversions[n],'enable');}}}}
if(!found){selectedV='';}else{var arEnable=new Object();i=0;for(n in versions[selectedV]){arEnable[versions[selectedV][n]]=1;}
for(n in allsizes){if(arEnable[allsizes[n]]!=1){checkElement('s',allsizes[n],'disable');}}}
xdisplay(selectedV,selectedS);}
function xselectVersion(id)
{for(n in allversions){checkElement('v',allversions[n],'enable');}
checkElement('v',id,'checked');found=0;selectedV=id;for(n in allsizes){checkElement('s',allsizes[n],'disable');for(k in versions[id]){if(versions[id][k]==allsizes[n]){if(selectedS==allsizes[n]){checkElement('s',allsizes[n],'checked');found=1;}else{checkElement('s',allsizes[n],'enable');}}}}
if(!found){selectedS='';}else{var arEnable=new Object();i=0;for(n in sizes[selectedS]){arEnable[sizes[selectedS][n]]=1;}
for(n in allversions){if(arEnable[allversions[n]]!=1){checkElement('v',allversions[n],'disable');}}}
xdisplay(selectedV,selectedS);}
function checkElement(type,id,mode)
{if(type=='s'){elementId='xsize_';}else{elementId='xversion_';}
elementId+=id;element=document.getElementById(elementId);if(element){if(mode=='enable'){element.className="block_enable";}else if(mode=='checked'){element.className="block_checked";}else{element.className="block_disable";}}}
var ns6=document.getElementById&&!document.all;var ie=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";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)?"100px":(((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+document.body.scrollTop+100)+"px";}
else
{edit.style.top=((((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop)<0)?"100px":(((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop+100)+"px";}}
else
{edit.style.top=((((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop)<0)?"100px":(((Popup.pageSizes()[3]-(Popup.height+10))/2)-100+html[0].scrollTop+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 displayed='';function ImageRotate(id)
{if(displayed==''){document.getElementById('img_1').style.display='none';}else{document.getElementById(displayed).style.display='none';}
document.getElementById(id).style.display='';displayed=id;}
function pokarz(id){document.getElementById(id).style.display='block';}
var components=new Array("component_projector_opinions","component_projector_addopinions","component_projector_photos","component_projector_ordered","component_projector_incategory","component_projector_suggestproduct","component_projector_askforproduct","component_projector_warranty","component_projector_associated","component_projector_enclosures","component_projector_dictionary","component_projector_sizes");function hider(button,id_comp)
{for(i=0;i<components.length;i++){if(document.getElementById('btn_'+components[i])){document.getElementById('btn_'+components[i]).className='off_btn';}}
button.className='on_btn';for(i=0;i<components.length;i++){if(document.getElementById(components[i])){document.getElementById(components[i]).style.display='none';}}
document.getElementById(id_comp).style.display='block';}
function show_hover(id){if(document.getElementById(id))document.getElementById(id).style.display='block';}
function showButtons()
{var i=0;for(i=0;i<components.length;i++){if(document.getElementById(components[i])){if(document.getElementById('btn_'+components[i])){document.getElementById('btn_'+components[i]).style.display='block';}
if(document.getElementById(components[i]).offsetWidth!='0'&&components[i]!='component_projector_addopinions'){document.getElementById('btn_'+components[i]).className='on_btn';}}}
setTimeout("showButtons()",1000);}
showButtons();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';}}
var x;function showOpinion(id)
{element=document.getElementById(id);element.style.display='block';}
function hideOpinion(id)
{element=document.getElementById(id);element.style.display='none';}
function drop_down(id)
{document.getElementById(id).style.height='150px';}
function roll_back(id)
{document.getElementById(id).style.height='';}
function drop_down(id)
{document.getElementById(id).style.height='150px';}
function roll_back(id)
{document.getElementById(id).style.height='';}
var alert1="Musisz wpisać niezerową ilość produktu";var alert2="Nie możesz dodać do koszyka niedostępnego produktu";var alert3="Musisz wpisać conajmniej jedną wartość";function checksize(product_id,tellie){if((document.getElementById('size_'+product_id))&&(document.getElementById('size_'+product_id).value=='')){alert("Wybierz rozmiar przed dodaniem produktu do koszyka lub przechowalni.");return false;}else{document.getElementById('iemode_'+product_id).value=tellie;document.getElementById('form_'+product_id).submit();return true;}}
function hideprev(id){id.style.display='none';}
function showprev(id,pos){img_id=document.getElementById('preview');img_id.innerHTML=document.getElementById(id).innerHTML;coors=findPos(pos);img_id.style.top=coors[1]+'px';img_id.style.left=coors[0]+'px';document.getElementById('preview').style.display="block";img_id.style.width=340+'px';img_id.style.height=pos.clientHeight+'px';}
function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){curleft=obj.offsetLeft
curtop=obj.offsetTop
while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}}
return[curleft,curtop];}
var offsetfrommouse=[10,15];var timer;var idek;function truebody(){return(!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function hidetrail(){document.getElementById(idek).style.display="none";document.onmousemove="";document.getElementById(idek).style.left="-2000px";clearTimeout(timer);}
function showtrail(id){idek=id;th=document.getElementById(idek+'_img').src;th=th.replace(/small/,"small")
document.getElementById(idek+'_img').src=th;show();}
function show(){var docwidth=document.all?truebody().scrollLeft+truebody().clientWidth:pageXOffset+window.innerWidth-offsetfrommouse[0]
var docheight=document.all?Math.min(truebody().scrollHeight,truebody().clientHeight):Math.min(window.innerHeight)
document.onmousemove=followmouse;document.getElementById(idek).style.display="block";}
function followmouse(e){var xcoord=offsetfrommouse[0]
var ycoord=offsetfrommouse[1]
var docwidth=document.all?truebody().scrollLeft+truebody().clientWidth:pageXOffset+window.innerWidth-15
var docheight=document.all?Math.min(truebody().scrollHeight,truebody().clientHeight):Math.min(window.innerHeight)
if(typeof e!="undefined"){if(docwidth-e.pageX<2*offsetfrommouse[0]){xcoord=e.pageX-xcoord;}else{xcoord+=e.pageX;}
if(docheight-e.pageY<2*offsetfrommouse[1]){ycoord+=e.pageY-Math.max(0,(2*offsetfrommouse[1]+e.pageY-docheight-truebody().scrollTop));}else{ycoord+=e.pageY;}}else if(typeof window.event!="undefined"){if(docwidth-event.clientX<2*offsetfrommouse[0]){xcoord=event.clientX+truebody().scrollLeft-xcoord;}else{xcoord+=truebody().scrollLeft+event.clientX}
if(docheight-event.clientY<(2*offsetfrommouse[1])){ycoord+=event.clientY+truebody().scrollTop-Math.max(0,(2*offsetfrommouse[1]+event.clientY-docheight));}else{ycoord+=truebody().scrollTop+event.clientY;}}
document.getElementById(idek).style.left=xcoord+"px"
document.getElementById(idek).style.top=ycoord+"px"}
function przelicz(id,num,precision,cena)
{var num_tmp=num;var ilosc2='';var wynik='';var wartosc='';var cena=parseFloat(cena);isNumeric(id,num_tmp,precision);if(num=='1')
{ilosc2=parseFloat(document.getElementById('detailbox_'+id+'_ilosc').value);wynik=roundNumber((ilosc2*cena),2);if(isNaN(wynik))
{document.getElementById('detailbox_'+id+'_wartosc').value=''}else
{document.getElementById('detailbox_'+id+'_wartosc').value=wynik;}
num='';}
if(num=='2')
{wartosc=parseFloat(document.getElementById('detailbox_'+id+'_wartosc').value);wynik=roundNumber((wartosc/cena),precision);if(precision==0){if(wartosc<parseFloat(cena)){wynik=0;}}
if(isNaN(wynik))
{document.getElementById('detailbox_'+id+'_ilosc').value=''}else
{document.getElementById('detailbox_'+id+'_ilosc').value=wynik;}
num='';}
sumuj();}
function isNumeric(id,num,precision){if(num=='1'){var elem=document.getElementById('detailbox_'+id+'_ilosc');if(precision>0){if(elem.value.match("^[0-9]{1,9}[\.,]{0,1}[0-9]{0,"+precision+"}$")||elem.value==''){elem.value=elem.value.replace(',','.');return true;}else{elem.value=elem.value.substring(0,elem.value.length-1);return false;}}
if(precision==0){if(elem.value.match("^[1-9]{1}[0-9]{0,9}$")||elem.value==''){return true;}else{elem.value=elem.value.substring(0,elem.value.length-1);return false;}}}
if(num=='2'){var elem=document.getElementById('detailbox_'+id+'_wartosc');precision=2;if(elem.value.match("^[0-9]{1,9}[\.,]{0,1}[0-9]{0,"+precision+"}$")||elem.value==''){elem.value=elem.value.replace(',','.');return true;}else{elem.value=elem.value.substring(0,elem.value.length-1);return false;}}}
function roundNumber(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;}
function sumuj()
{alles=document.getElementById('all');alles.value=0;var elems=document.getElementsByTagName('input');for(i=0;i<elems.length;i++)
{if(elems[i].name=='wartosc')
{if(isNaN(parseFloat(elems[i].value))){}else{alles.value=parseFloat(alles.value)+parseFloat(elems[i].value);}}}
alles.value=roundNumber(alles.value,2);}
function add2basket()
{var a2b=document.getElementById('adding_to_basket');a2b.innerHTML='';var elems=document.getElementsByTagName('input');for(i=0;i<elems.length;i++)
{if(elems[i].name=='quantity')
{if(!isNaN(parseFloat(elems[i].value))&&parseFloat(elems[i].value)!=0){addElement(parseFloat(elems[i].value),elems[i].title);}}}
if(document.getElementById('all').value!=''&&document.getElementById('all').value!='0'){a2b.submit();}
else{alert(alert1);}}
function addElement(wartosc,id){var table=id.split("|");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=table[0];newinput2.value=wartosc;newinput3.value=table[1];ni.appendChild(newinput);ni.appendChild(newinput2);ni.appendChild(newinput3);}
function alerter(id)
{if(id=='disabled'){alert(alert2);return false;}
else{var ilosc=document.getElementById('detailbox_'+id+'_prod_ilosc').value;var form=document.getElementById('detailbox_'+id+'_search_form');if(ilosc==''||ilosc=='0'){alert(alert1);return false;}
else
{form.submit();return true;}}}
var Searching_hideselectsArray=new Array();var ChangeDivPosition={};var ns=document.getElementById&&!document.all;function positiontip(e){ChangeDivPosition.pageX=(ns)?e.pageX:event.clientX+document.documentElement.scrollLeft;ChangeDivPosition.pageY=(ns)?e.pageY:event.clientY+document.documentElement.scrollTop;var obj=document.getElementById(ChangeDivPosition.id);if(obj){var x=ChangeDivPosition.marginLeft+(ChangeDivPosition.pageX-parseInt(ChangeDivPosition.startX));var y=ChangeDivPosition.marginTop+(ChangeDivPosition.pageY-parseInt(ChangeDivPosition.startY));if(x>ChangeDivPosition.maxX){x=ChangeDivPosition.maxX;}else if(x<0){x=0;}
if(y>ChangeDivPosition.maxY){y=ChangeDivPosition.maxY;}else if(y<0){y=0;}
var r=ChangeDivPosition.maxX;var PriceMax=document.getElementById('max_price_start').value;var PriceMin=document.getElementById('min_price_start').value;var price=parseInt(PriceMin)+parseInt((PriceMax-PriceMin)*x/r);if(obj.id=='s1'){var obj2=document.getElementById('s2');}else{var obj2=document.getElementById('s1');}
if(parseInt(obj2.style.marginLeft.replace('px',''))>x){if(PriceMin>=price){document.getElementById('pricelimitmin').value='';}else{document.getElementById('pricelimitmin').value=price;}
document.getElementById('min_price_text').innerHTML=price+'.00';}else{if(PriceMax<=price){document.getElementById('pricelimitmax').value='';}else{document.getElementById('pricelimitmax').value=price;}
document.getElementById('max_price_text').innerHTML=price+'.00';}
obj.style.marginLeft=x+'px';var left1=parseInt(obj2.style.marginLeft.replace('px',''));var left2=x;if(left2>left1){document.getElementById('s3').style.marginLeft=(left1+10)+'px';if((left2-left1-10)>0){document.getElementById('s3').style.width=(left2-left1-10)+'px';}else{document.getElementById('s3').style.width='0px';}}else{document.getElementById('s3').style.marginLeft=(left2+10)+'px';if((left1-left2-10)>0){document.getElementById('s3').style.width=(left1-left2-10)+'px';}else{document.getElementById('s3').style.width='0px';}}}}
function StartDrag(obj,contenerId){ChangeDivPosition.id=obj.id
ChangeDivPosition.startX=ChangeDivPosition.pageX;ChangeDivPosition.startY=ChangeDivPosition.pageY;ChangeDivPosition.wait=3;if(!obj.style.marginLeft){if(obj.offsetLeft){obj.style.marginLeft=obj.offsetLeft+'px';}else{obj.style.marginLeft='0px';}}
if(!obj.style.marginTop){if(obj.offsetTop){obj.style.marginTop=obj.offsetTop+'px';}else{obj.style.marginTop='0px';}}
if(!obj.style.width){if(obj.offsetWidth){obj.style.width=obj.offsetWidth+'px';}else{obj.style.width='0px';}}
ChangeDivPosition.marginLeft=parseInt(obj.style.marginLeft.replace('px',''));ChangeDivPosition.marginTop=parseInt(obj.style.marginTop.replace('px',''));var contener=document.getElementById(contenerId);if(!contener.style.width){if(contener.offsetWidth){contener.style.width=contener.offsetWidth+'px';}else{contener.style.width='0px';}}
if(!contener.style.height){if(contener.offsetHeight){contener.style.height=contener.offsetHeight+'px';}else{contener.style.height='0px';}}
ChangeDivPosition.maxX=parseInt(contener.style.width.replace('px',''))-parseInt(obj.style.width.replace('px',''));;ChangeDivPosition.maxY=parseInt(contener.style.height.replace('px',''))-parseInt(obj.style.height.replace('px',''));}
function StartDrag2(obj){if(ChangeDivPosition.id){ChangeDivPosition.wait=3;}}
function StopDrag(obj,wait){if(ChangeDivPosition.wait==3&&wait==2){ChangeDivPosition.wait=2;}
if(wait<1){ChangeDivPosition.id='';Searching.send('price');}else if(ChangeDivPosition.id&&ChangeDivPosition.wait!=3){setTimeout("StopDrag ('', '"+(wait-1)+"')",200);}}
var Searching={selectFields:{},highlightTextSelect:'',startPricePosition:function(contenerId)
{var contener=document.getElementById(contenerId);if(!contener.style.width){if(contener.offsetWidth){contener.style.width=contener.offsetWidth+'px';}else{contener.style.width=contener.currentStyle['width'];}}
if(!contener.style.height){if(contener.offsetHeight){contener.style.height=contener.offsetHeight+'px';}else{contener.style.height=contener.currentStyle['height'];}}
if(!document.getElementById('s2').style.width){if(document.getElementById('s2').offsetWidth){document.getElementById('s2').style.width=document.getElementById('s2').offsetWidth+'px';}else{document.getElementById('s2').style.width=document.getElementById('s2').currentStyle['width'];}}
var r=parseInt(contener.style.width.replace('px',''))-parseInt(document.getElementById('s2').style.width.replace('px',''));;var PriceMax=document.getElementById('max_price_start').value;var PriceMin=document.getElementById('min_price_start').value;var price=document.getElementById('pricelimitmin').value;document.getElementById('s1').style.marginLeft='0px';document.getElementById('s2').style.marginLeft=r+'px';document.getElementById('s3').style.marginLeft=10+'px';document.getElementById('s3').style.width=r+'px';},send:function()
{var name=arguments[0];if(name=='traits'&&arguments[1]){name=name+'['+arguments[1]+']';}
if(name=='text'){setTimeout("document.getElementById('find-text').style.display = 'none';",500);}
Searching.selectFields[name]=1;document.getElementById('searchingPreloader2').style.display='';var txt='';var active=true;for(nameTmp in Searching.selectFields){var form=document.getElementsByName(nameTmp);if(nameTmp=='price'){if(active){txt=txt+'&pricelimitmin='+document.getElementById('pricelimitmin').value;txt=txt+'&pricelimitmax='+document.getElementById('pricelimitmax').value;}}else if(nameTmp=='date'){if(active){txt=txt+'&day='+document.getElementById('date_d').value;txt=txt+'&month='+document.getElementById('date_m').value;txt=txt+'&year='+document.getElementById('date_y').value;}}else if(form[0].type=='select-one'&&form[0].name){if(active){if(form[0].value){txt=txt+'&'+form[0].name+'='+form[0].value;}}else{form[0].selectedIndex=0;}}else if(form[0].type=='checkbox'){if(active){if(form[0].checked){txt=txt+'&'+form[0].name+'='+form[0].value;}}else{form[0].checked=false;}}else if(nameTmp=='text'){if(active){txt=txt+'&text='+document.getElementById('searching_text').value;}else{form[0].value='';}}else if(form[0].name&&form[0].value){if(active){txt=txt+'&'+form[0].name+'='+form[0].value;}else{form[0].value='';}}
if(name==nameTmp){active=false;}}
IAI_Ajax.Request('ajax/search.php?ajax=true&selectAll=t&change_name='+name+txt,'',{onSuccess:'Searching.prepareForms'});},prepareForms:function(x)
{document.getElementById('searchingPreloader2').style.display='none';try{var response=eval('('+x+')');}catch(e){return false;}
Searching.highlightTextSelect=0;var form=document.getElementById('searching_form').elements;if(response['countProducts']>0){document.getElementById('select_products_info').style.display='none';}else{document.getElementById('select_products_info').style.display='block';}
for(i=0;i<form.length;i++){var display=false;if(!form[i].name){display='hidden';if(form[i].id=='searching_category_1'&&!form[i].value){display=false;SearchingCategory2={};if(response['category']){display=true;for(j in response['category']){SearchingCategory2[j]=SearchingCategory[j];for(k in SearchingCategoryParents[j]){if(SearchingCategoryParents[j][k]){SearchingCategory2[SearchingCategoryParents[j][k]]=SearchingCategory[SearchingCategoryParents[j][k]];}}}
for(j=1;j<form[i].options.length;j++){if(form[i].options[j].value&&!SearchingCategory2[form[i].options[j].value]){form[i].options[j].style.display='none';}else if(form[i].options[j].value){form[i].options[j].style.display='';}}}}}else if(form[i].type=='select-one'){if(form[i].value){display=true;}else if(!response[form[i].name]||response[form[i].name].length<=2){display=false;}else if(response[form[i].name]){var tmpI=1;var copySelectId='copy_'+form[i].name;if(document.getElementById(copySelectId)){var countTmpOptions=form[i].options.length;for(j=1;j<countTmpOptions;j++){form[i].removeChild(form[i].options[1]);}
for(j=1;j<document.getElementById(copySelectId).options.length;j++){var optionTmp=document.getElementById(copySelectId).options[j];if(response[form[i].name][optionTmp.value]){display=true;var t=Searching.addOption(form[i]);t.id=optionTmp.id;t.value=optionTmp.value;t.textContent=optionTmp.textContent;t.text=optionTmp.text;tmpI++}}}
if(tmpI<=2){display=false;}}}else if(form[i].type=='checkbox'){display=true;if(!form[i].checked){if(!response[form[i].name]){display=false;}else if(response[form[i].name].length<2){display=false;}}}else{display=true;}
if(display=='hidden'){}else if(display==true){form[i].disabled='';}else{form[i].disabled='disabled';}}
if(response['day']&&response['month']&&response['year']&&response['change_name']!='date'){document.getElementById('date_d').value=response['day'];document.getElementById('date_m').value=response['month'];document.getElementById('date_y').value=response['year'];document.getElementById('date').value=response['year']+'-'+response['month']+'-'+response['day'];}
if(response['pricemin']&&response['pricemax']&&response['change_name']!='price'){var errorprice=0;for(nameTmp in Searching.selectFields){if(nameTmp=='price'){errorprice=1;}else if(response['change_name']==nameTmp&&errorprice==1){errorprice=2;}}
if(response['pricemin']==response['pricemax']){errorprice=2;}
if(errorprice!=2||(document.getElementById('pricelimitmax').value==document.getElementById('max_price_start').value&&document.getElementById('pricelimitmin').value==document.getElementById('min_price_start').value)){if(response['pricemin']!=response['pricemax']){document.getElementById('contener3').style.display='block';document.getElementById('contener4').style.display='none';document.getElementById('pricelimitmin').value=response['pricemin'];document.getElementById('pricelimitmax').value=response['pricemax'];document.getElementById('min_price_text').innerHTML=response['pricemin'];document.getElementById('max_price_text').innerHTML=response['pricemax'];document.getElementById('min_price_start').value=response['pricemin'];document.getElementById('max_price_start').value=response['pricemax'];Searching.startPricePosition('contener');}else{document.getElementById('contener3').style.display='none';document.getElementById('min_price_text_2').innerHTML=response['pricemax'];document.getElementById('contener4').style.display='block';}}}},findText:function(e)
{var txt=document.getElementById('searching_text').value;if(!e)e=window.event;var key=e.keyCode||e.which;if(key==38||key==40){if(document.getElementById('find-text-1-div')){if(!Searching.highlightTextSelect){Searching.highlightText(1);}else if(key==38&&document.getElementById('find-text-'+(Searching.highlightTextSelect-1)+'-div')){Searching.highlightText(Searching.highlightTextSelect-1);}else if(key==40&&document.getElementById('find-text-'+parseInt(Searching.highlightTextSelect+1)+'-div')){Searching.highlightText(Searching.highlightTextSelect+1);}}}else if(key==13&&Searching.highlightTextSelect){Searching.selectText(Searching.highlightTextSelect);}else{if(txt.length>1){$.getJSON("ajax/search-name.php?ajax=true&text="+txt,function(json){Searching.prepareFindText(json);});}}},checkEnter:function()
{if(Searching.highlightTextSelect){Searching.selectText(Searching.highlightTextSelect);return false;}else{return true;}},highlightText:function(i)
{if(Searching.highlightTextSelect){document.getElementById('find-text-'+Searching.highlightTextSelect+'-div').style.backgroundColor='';}
Searching.highlightTextSelect=i;document.getElementById('find-text-'+i+'-div').style.backgroundColor='#FFEEAA';},sendSubmit:function()
{Searching.highlightTextSelect='';document.getElementById('searching_form').submit();},prepareFindText:function(x)
{try{var response=x;}catch(e){return false;}
Searching.highlightTextSelect=0;var text='';var re=new RegExp(response.text.toLowerCase(),"gi");if(response.products_name.length>0){document.getElementById('select_products_info').style.display='none';document.getElementById('find-text').style.display='block';var j=response.products_name.length;for(var i=1;i<=j;i++){var tmpTxt=response.products_name[i-1];if(!response.products_name[i-1]){i--;j--;continue;}
text=text+'<div id="find-text-'+i+'-div" style="cursor: pointer;" onmouseover="Searching.highlightText(\''+i+'\');" onclick="Searching.selectText(\''+i+'\');"><input type="hidden" value="'+tmpTxt+'" id="find-text-'+i+'">'+tmpTxt.replace(re,'<b>$&</b>')+'</div>';}}else{document.getElementById('find-text').style.display='none';document.getElementById('select_products_info').style.display='block';}
document.getElementById("find-text").innerHTML=text;},selectText:function(id)
{document.getElementById('searching_text').value=document.getElementById('find-text-'+id).value;document.getElementById('find-text').style.display='none';Searching.highlightTextSelect='';document.getElementById('searching_form').submit();},changeSelectCategory:function(obj,number)
{var selectId=obj.value;if(selectId){document.getElementById('category').value=selectId;}else{if(number==1){document.getElementById('category').value='';}else if(number==2){document.getElementById('category').value=document.getElementById("searching_category_1").value;}else if(number==3){document.getElementById('category').value=document.getElementById("searching_category_2").value;}else{document.getElementById('category').value=document.getElementById("searching_category_3").value;}}
if(number<4){document.getElementById("searching_category_4").style.display="none";if(number<3){document.getElementById("searching_category_3").style.display="none";if(number<2){document.getElementById("searching_category_2").style.display="none";}}}
var idtmp="searching_category_"+(1+number);if(selectId){document.getElementById(idtmp).selectedIndex=0;var j=document.getElementById(idtmp).options.length;while(j>1){j--;document.getElementById(idtmp).removeChild(document.getElementById(idtmp).options[j]);}
var ile=0;for(k in SearchingCategory2[selectId]){k=parseInt(k);if(k>0){var t=Searching.addOption(document.getElementById(idtmp));t.id=SearchingCategory2[selectId][k]["id"];t.value=SearchingCategory2[selectId][k]["id"];t.textContent=SearchingCategory2[selectId][k]["name"];t.text=SearchingCategory2[selectId][k]["name"];ile++;}}
if(ile){document.getElementById("searching_category_2").style.display="";if(number<2){document.getElementById("searching_category_3").style.display="none";}else{document.getElementById("searching_category_3").style.display="";}
if(number<3){document.getElementById("searching_category_4").style.display="none";}else{document.getElementById("searching_category_4").style.display="";}}else{document.getElementById(idtmp).style.display="none";}}
Searching.send('category');},addOption:function(p)
{var t;p.appendChild(t=document.createElement('option'));return t;},hideCalendar:function()
{document.getElementById('calendar').innerHTML='';if(document.getElementById('calendar_frame')){document.getElementById('calendar_frame').parentNode.removeChild(document.getElementById('calendar_frame'));}
document.getElementById('calendar').style.display='none';},hideselects:function()
{for(i=0;i<Searching_hideselectsArray.length;i++)
{document.getElementById(Searching_hideselectsArray[i]).style.display='none';}}};function validateDate(obj)
{}
function Calendar(E,T){var i,j,tBody,Row,od,Do,d,dt,z=0,zeroAllowed=false;function cEl(t,p,h,cl){p.appendChild(t=document.createElement(t));if(h){t.innerHTML=h;}
if(cl){t.className=cl;}
return t;}
function cB(x,E,T){with(IaiCld){if(x==0){R--;}else if(x==1){R++;}else if(x==2){M--;if(M<0){M=11;R--;}}else if(x==3){M++;if(M>11){M=0;R++;}}
od=Date.UTC(R,M,1);Do=Date.UTC(R,M+1,1);}
draw(E,T);}
function draw(E,T)
{while(E.childNodes.length){E.removeChild(E.firstChild);}
table=cEl('table',E,'','calendar_table_header');table.cellSpacing="4";table.cellPadding="0";var tBody=cEl('tbody',table);tBody.onmouseup=function(){draw(E,T);}
tBody.onmousemove=function(){if(window.getSelection){window.getSelection().removeAllRanges();}
if(document.selection){document.selection.empty();}}
Row=cEl('tr',tBody);var tmp=cEl('td',Row,'','calendar_select_year_left').onmousedown=function(){cB(0,E,T);}
tmp.id='calendar_select_year_left';cEl('th',Row,IaiCld.R,'calendar_year');var tmp=cEl('td',Row,'','calendar_select_year_right').onmousedown=function(){cB(1,E,T);}
tmp.id='calendar_select_year_right';Row=cEl('tr',tBody);var tmp=cEl('td',Row,'','calendar_select_month_left').onmousedown=function(){cB(2,E,T);}
tmp.id='calendar_select_month_left';cEl('th',Row,IaiCld.month[IaiCld.M],'calendar_month');var tmp=cEl('td',Row,'','calendar_select_month_right').onmousedown=function(){cB(3,E,T);}
tmp.id='calendar_select_month_right';var R=IaiCld.R;var M=IaiCld.M;var selectY=document.getElementById(T.id+"_y").value;var selectM=document.getElementById(T.id+"_m").value-1;var selectD=document.getElementById(T.id+"_d").value;var table2=cEl('table',E,'','calendar_table');table2.cellSpacing="4";table2.cellPadding="0";tBody=cEl('tbody',table2);Row=cEl('tr',tBody);for(i=0;i<7;i++){cEl('th',Row,IaiCld.day[i],i==6?'calendar_days_sunday':'calendar_days');}
for(i=od;i<Do;i+=86400000){with(new Date(i)){d=getUTCDate();dt=getUTCDay();}
if(dt==1||i==od){Row=cEl('tr',tBody);}
if(dt!=1&&d==1){for(j=1;j<(dt?dt:7);j++){cEl('th',Row);}}
dt=cEl('td',Row,d);dt.onmousedown=function(x){x=+this.innerHTML;with(IaiCld){a=x;document.getElementById(T.id+"_y").value=R;document.getElementById(T.id+"_m").value=(x=M+1)<10?'0'+x:x;document.getElementById(T.id+"_d").value=a<10?'0'+a:a;document.getElementById(T.id).value=R+'-'+((x=M+1)<10?'0'+x:x)+'-'+(a<10?'0'+a:a);document.getElementById('calendar').innerHTML='';if(document.getElementById('calendar_frame')){document.getElementById('calendar_frame').parentNode.removeChild(document.getElementById('calendar_frame'));}
document.getElementById('calendar').style.display='none';Searching.send(T.id);}}
if(d==selectD&&M==selectM&&R==selectY){dt.id="calendar_checked_day";}else{dt.className="calendar_normal_day";}}
IaiCld.B=1;var valueT=0,valueL=0,cont=T;do{valueT+=cont.offsetTop||0;valueL+=cont.offsetLeft||0;cont=cont.offsetParent;}while(cont);valueL+=T.offsetWidth+2;var mh=!!(window.attachEvent&&!window.opera)?172:151;if((valueT+mh)>document.body.offsetHeight){valueT=document.body.offsetHeight-mh;}
E.style.display='block';}
if((arguments.length>=3)&&arguments[2]){zeroAllowed=true;}
with(IaiCld){core=T.id;R=document.getElementById(core+"_y").value;M=document.getElementById(core+"_m").value-1;D.setFullYear(R,M,document.getElementById(core+"_d").value);if((R<=0)&&(M<=-1)){M=new Date().getMonth();R=new Date().getFullYear();}
od=Date.UTC(R,M,1);Do=Date.UTC(R,M+1,1);var frame;document.getElementById("calendar").parentNode.appendChild(frame=document.createElement('iframe'));frame.id='calendar_frame';}
draw(document.getElementById("calendar"),T);document.getElementById('calendar').style.display='block';}
IaiCld={day:new Array('pn','wt','śr','cz','pt','s','n'),month:new Array('Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'),D:new Date(),M:new Date().getMonth(),R:new Date().getFullYear()}
