
var bookmarkurl=document.location
var bookmarktitle='Miluch.pl'
function addbookmark(){if(document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)}
var newstxt='E-mail';function newsletter_blur(x){if(x.value==''){x.value=newstxt;}}
function newsletter_focus(x){if(x.value==newstxt){x.value='';}}
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'}}
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;}};var zagielnotconfirmed="Zanim złożysz zamówienie, zapoznaj się z procedurą udzielenia kredytu ratalnego E-kredyt Żagiel.";var Basketedit={roundNumber:function(number,flag){num=parseFloat(number);result=Math.abs(num.toFixed(flag));return result;},if_isanumber:function(test,basketedit_sellby)
{if(isNaN(test))return 1;if(basketedit_sellby==1){return test;}else
{return basketedit_sellby;}},sellby_recount:function(price,sellby,switcher){if(switcher=="up")
{return(price*sellby);}
else
{var sellby_correct=Math.round(switcher/sellby)*sellby;return sellby_correct;}},number_check:function(id_inputa,id_basketa){if(basketeditProducts[id_basketa][0]=='')var basketedit_sellby=1;else var basketedit_sellby=basketeditProducts[id_basketa][0];var basketedit_unit=basketeditProducts[id_basketa][1];var basketedit_unitprecission=basketeditProducts[id_basketa][2];var basketedit_amount=basketeditProducts[id_basketa][3];var elem=document.getElementById(id_inputa);if(basketedit_sellby=='1')
{if(Math.round(elem.value)>parseInt(basketedit_amount)&&isFinite(basketedit_amount)&&basketedit_amount!='-1')
{Alertek.show_alert(Projector_txt_maksymalnie+basketedit_amount);elem.value=basketedit_amount;}
else
{elem.value=Basketedit.roundNumber((Basketedit.if_isanumber(parseFloat(elem.value),basketedit_sellby)),basketedit_unitprecission);}}
else
{basketedit_unitprecission=parseInt(basketedit_unitprecission);if(Math.round(elem.value)>=parseInt(basketedit_amount)&&isFinite(basketedit_amount)&&basketedit_amount!='-1')
{Alertek.show_alert(Projector_txt_maksymalnie+Basketedit.roundNumber(Math.floor(basketedit_amount/basketedit_sellby)*basketedit_sellby,basketedit_unitprecission));elem.value=Basketedit.roundNumber(Math.floor(basketedit_amount/basketedit_sellby)*basketedit_sellby,basketedit_unitprecission);}
else
{var returnValue;var divNoMod=Math.abs(Math.floor(elem.value/basketedit_sellby));if(!divNoMod){returnValue=basketedit_sellby;}
else{if(divNoMod*basketedit_sellby==elem.value){returnValue=(divNoMod*basketedit_sellby).toFixed(basketedit_unitprecission);}
else{if(divNoMod*basketedit_sellby<elem.value){returnValue=((divNoMod+1)*basketedit_sellby).toFixed(basketedit_unitprecission);}
else returnValue=Math.abs((Math.ceil(elem.value)*basketedit_sellby).toFixed(basketedit_unitprecission));}}
elem.value=returnValue;}}}}
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 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='';}}
var HliderClass=function(){var obj=this;this.Hlider_mainID=0;this.Hlider_naviID=0;this.Hlider_naviclass=0;this.Hlider_speed=3;this.Hlider_jump=0;this.lilist=0;this.mainwidth=0;this.mainID='';this.width_pasek=0;this.elements_count=0;this.navi_count=0;this.element_width=0;this.scroll_width=0;this.scroll_width_tmp=0;this.Time=0;this.Scroll=0;this.SI=0;this.Navi=function(num,id,id2,clas,nullek)
{this.Hlider_jump=num;this.Hlider_mainID=id;this.Hlider_naviID=id2;this.Hlider_naviclass=clas;this.mainID=document.getElementById(this.Hlider_mainID);this.mainwidth=this.mainID.clientWidth;this.lilist=document.getElementById(this.Hlider_mainID).firstChild;this.mainwidth=this.mainID.clientWidth;var elements=this.lilist.getElementsByTagName('li');this.elements_count=elements.length;this.navi_count=Math.ceil(this.elements_count/this.Hlider_jump);var naviID=document.getElementById(this.Hlider_naviID);if(nullek!='NULL')
{this.width_pasek=0;naviID.innerHTML='';for(i=1;i<=this.navi_count;i++)
{var newDiv=document.createElement('div');newDiv.className=this.Hlider_naviclass;if(i==1)newDiv.className=this.Hlider_naviclass+"_on";newDiv.id=this.Hlider_mainID+"|"+this.Hlider_naviclass;newDiv.onclick=this.Start;newDiv.innerHTML='<span>'+i+'</span>';naviID.appendChild(newDiv);}
this.mainID.scrollLeft=0;var elements=this.lilist.getElementsByTagName('li');this.elements_count=elements.length;for(n=0;n<this.elements_count;n++)
{this.width_pasek+=elements[n].clientWidth;this.element_width=elements[n].clientWidth;}
if(this.element_width==0)
{setTimeout(function(){obj.Navi(num,id,id2,clas)},500);return false;}}}
this.Clear=function(num)
{var naviID=document.getElementById(this.Hlider_naviID);var elements=naviID.getElementsByTagName('div');for(i=0;i<elements.length;i++)
{if(elements[i].firstChild.innerHTML==num)
{elements[i].className=this.Hlider_naviclass+"_on";}
else
{elements[i].className=this.Hlider_naviclass;}}}
this.Start=function(num)
{var num=parseInt(this.firstChild.innerHTML);var table_id=this.id.split("|");this.Hlider_naviID=this.parentNode.id;this.Hlider_mainID=table_id[0];this.Hlider_naviclass=table_id[1];this.mainID=document.getElementById(this.Hlider_mainID);obj.Move(num);}
this.Move=function(num)
{obj.Clear(num);clearInterval(obj.Time);this.scroll_width=0;for(n=1;n<=num;n++)
{this.scroll_width+=(this.element_width*this.Hlider_jump);}
this.scroll_width=this.scroll_width_tmp=this.scroll_width-(this.element_width*this.Hlider_jump);this.Time=setInterval(function(){obj.Anim()},40);}
this.Anim=function()
{this.scroll_width=Math.abs(this.mainID.scrollLeft-this.scroll_width_tmp);if(this.mainID.scrollLeft<this.scroll_width_tmp)
{this.Scroll=Math.round(this.mainID.scrollLeft)+(this.scroll_width/this.Hlider_speed);}
else
{this.Scroll=Math.round(this.mainID.scrollLeft)-(this.scroll_width/this.Hlider_speed);}
this.scroll_width=Math.round(this.scroll_width/this.Hlider_speed);if(Math.round(this.Scroll)==this.scroll_width_tmp)
{clearInterval(this.Time);}
this.mainID.scrollLeft=this.Scroll;}
this.FixWidth=function(width_opera)
{this.element_width=width_opera;}
this.Left=function(num,id,id2,clas,nullek)
{this.Navi(num,id,id2,clas,nullek);clearInterval(this.Time);this.scroll_width=0;var number=Math.round((this.mainID.scrollLeft/this.element_width)/this.Hlider_jump);if(number==0)
{number=this.navi_count;}
obj.Move(number);}
this.Right=function(num,id,id2,clas,nullek)
{obj.Navi(num,id,id2,clas,nullek);clearInterval(this.Time);this.scroll_width=0;var number=Math.round((this.mainID.scrollLeft/this.element_width)/this.Hlider_jump);number++;number++;if(number>this.navi_count)
{number=1;}
obj.Move(number);}}
function order1_shop_payformdiv(show)
{if(show){if(document.getElementById('payform_div')){document.getElementById('payform_div').style.display='block';}}else{if(document.getElementById('payform_div')){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_shop_payformdiv_advance(time,calendar,prepaid,advance)
{if(advance==1){if(document.getElementById('payform_div_label_advance')){document.getElementById('payform_div_label_advance').style.display='block';}
if(document.getElementById('payform_div_label_order')){document.getElementById('payform_div_label_order').style.display='none';}}else{if(document.getElementById('payform_div_label_advance')){document.getElementById('payform_div_label_advance').style.display='none';}
if(document.getElementById('payform_div_label_order')){document.getElementById('payform_div_label_order').style.display='block';}}
if((prepaid||advance==1)&&(document.getElementsByName('payform_id').length>1)){document.getElementById('payform_div').style.display='block';}else{if(document.getElementById('payform_div')){document.getElementById('payform_div').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';}}}
OrderCalendar.changeDeliveryTime(time,calendar);}
function order1_show_comment(coment)
{if(coment){document.getElementById('order1_coment_background').style.display='block';document.getElementById('order1_coment_text').innerHTML=coment;}else{document.getElementById('order1_coment_background').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 cEl(t,p,h){p.appendChild(t=document.createElement(t));if(h){t.innerHTML=h;}
return t;}
var startDay;var tmpStartDay;var selectMonth2=1;var selectYear2=1;function write_words()
{}
var OrderCalendar={start:{},changeDeliveryTime:function(time,type){startD1=OrderCalendar.start.D1+time;startM1=OrderCalendar.start.M1;startY1=OrderCalendar.start.Y1;OrderCalendar.type=type;do{var days=getCountDayOfMonth(startY1,startM1);if(startD1>days){startD1-=days;startM1+=1;if(startM1>12){startM1=1;startY1+=1;}}}while(startD1>days);var date=new Date();date.setDate(startD1);date.setMonth(startM1-1);var tmp1=date.setYear(startY1);var tmpWeek=date.getDay();date.setDate(selectDay);date.setMonth(selectMonth-1);var tmp2=date.setYear(selectYear);if(tmp2<tmp1){selectMonth=startM1;selectDay=startD1;selectYear=startY1;selectWeek=tmpWeek;}
if(type=='n'||type==''){document.getElementById("order1_calendar").style.display='none';document.getElementById("calendar_select_date").value='';}else{distroyCalendar();setTimeout("printCalendar();",0);document.getElementById("order1_calendar").style.display='block';if(type=='t'){document.getElementById('hours_range_div').style.display='block';}else{document.getElementById('hours_range_div').style.display='none';}}},selectRange:function(obj){document.getElementById("calendar_select_hour").value=obj.value;}}
function distroyCalendar()
{while(document.getElementById('calendar_m2').firstChild.childNodes.length>1){document.getElementById('calendar_m2').firstChild.removeChild(document.getElementById('calendar_m2').firstChild.lastChild);}
while(document.getElementById('calendar_m1').firstChild.childNodes.length>1){document.getElementById('calendar_m1').firstChild.removeChild(document.getElementById('calendar_m1').firstChild.lastChild);}}
function printMonth(year,month,firstDay,m)
{var licznik=1;var dzient=1;var wiersz=0;var i=1;var date=new Date();date.setDate(1);date.setMonth(month-1);date.setYear(year);firstDay=date.getDay();if(firstDay==0){firstDay=7;}
var liczbaDni=getCountDayOfMonth(year,month);while(licznik){dzient=dzient+1
if(dzient>7){dzient=1;}
if(licznik%7==1){w=cEl('tr',document.getElementById('calendar_'+m).firstChild);wiersz=wiersz+1;}
td=cEl('td',w);if(licznik<firstDay&&wiersz==1){td.className='null';}else{td.id="calendar_"+year+"_"+month+"_"+i;td.innerHTML='<span>'+i+'</span>';if((month==startM1&&startY1==year&&i<startD1)||Holidays[i+"_"+month+"_"+year]==1){document.getElementById("calendar_"+year+"_"+month+"_"+i).className="n55494_deactive";}else{document.getElementById("calendar_"+year+"_"+month+"_"+i).onclick=function(x){var id=this.id.split('_');selectDate('cos',id[3],id[2],id[1],licznik%7);};}
i=i+1;}
if(i>liczbaDni){break;}
licznik=licznik+1;}}
function printCalendar()
{var wiersz=0;var i=1;var dzient=1;document.getElementById('name_month_1').innerHTML=monthArr[parseInt(selectMonth)];document.getElementById('name_month_2').innerHTML=monthArr[(parseInt(selectMonth)+1)%12];printMonth(parseInt(selectYear),parseInt(selectMonth),'',"m1");var m_tmp=parseInt(selectMonth)+1;var y_tmp=parseInt(selectYear);if(m_tmp==13){m_tmp=1;y_tmp=y_tmp+1;}
printMonth(y_tmp,m_tmp,'',"m2");activeCalendar();}
function changeMonth(action)
{document.getElementById("loader").style.display="block";if(action=="minus"){if(selectYear2==startY1&&startM1==selectMonth2){activeCalendar();return;}else{distroyCalendar();printMonth(selectYear2,selectMonth2,startDay,"m2");selectMonth2=selectMonth2-1;if(selectMonth2==0){selectMonth2=12;selectYear2=selectYear2-1;}
startDay=startDay-(getCountDayOfMonth(selectYear2,selectMonth2)%7);if(startDay<=0){startDay=startDay+7;}
printMonth(selectYear2,selectMonth2,startDay,"m1");}}else{if((selectYear2>startY1&&(startM1-6)<(selectMonth2))||(selectYear2==startY1&&(startM1+6)<selectMonth2)){activeCalendar();return;}
distroyCalendar();startDay=startDay+(getCountDayOfMonth(selectYear2,selectMonth2)%7);if(startDay>7){startDay=startDay-7;}
selectMonth2=selectMonth2+1;if(selectMonth2==13){selectMonth2=1;selectYear2=selectYear2+1;}
printMonth(selectYear2,selectMonth2,startDay,"m1");var m_tmp=selectMonth2+1;var y_tmp=selectYear2;if(m_tmp==13){m_tmp=1;y_tmp=y_tmp+1;}
var startDay2=startDay+(getCountDayOfMonth(selectYear2,selectMonth2)%7);if(startDay2>7){startDay2=startDay2-7;}
printMonth(y_tmp,m_tmp,startDay2,"m2");}
document.getElementById('name_month_1').innerHTML=monthArr[selectMonth2];var tmpM=selectMonth2+1;if(tmpM==13){tmpM=1;}
document.getElementById('name_month_2').innerHTML=monthArr[tmpM];activeCalendar();}
function activeCalendar()
{if(document.getElementById("calendar_"+selectYear+"_"+selectMonth+"_"+selectDay)){document.getElementById("calendar_"+selectYear+"_"+selectMonth+"_"+selectDay).className="n55494_active";}
document.getElementById("name_day").innerHTML=daysArr[selectWeek]+", "+selectDay+" "+monthArr2[selectMonth]+" "+selectYear;document.getElementById("loader").style.display="none";if(document.getElementById("calendar_select_date")){document.getElementById("calendar_select_date").value=selectYear+"-"+selectMonth+"-"+selectDay;}
if(OrderCalendar.type=='t'){if(OrderCalendar.start.D1==selectDay&&OrderCalendar.start.M1==selectMonth){document.getElementById("hours_range1").disabled=SelectTime>=11?true:false;document.getElementById("hours_range2").disabled=SelectTime>=13?true:false;document.getElementById("hours_range3").disabled=SelectTime>=15?true:false;document.getElementById("hours_range4").disabled=SelectTime>=17?true:false;document.getElementById("hours_range5").disabled=SelectTime>=19?true:false;}else{document.getElementById("hours_range1").disabled=false;document.getElementById("hours_range2").disabled=false;document.getElementById("hours_range3").disabled=false;document.getElementById("hours_range4").disabled=false;document.getElementById("hours_range5").disabled=false;}}}
function selectDate(cos,day,month,year,week){document.getElementById("loader").style.display="block";if(document.getElementById("calendar_"+selectYear+"_"+selectMonth+"_"+selectDay)){document.getElementById("calendar_"+selectYear+"_"+selectMonth+"_"+selectDay).className='';}
selectDay=day;selectMonth=month;selectWeek=week;selectYear=year;activeCalendar();}
function getCountDayOfMonth(year,month)
{switch(month){case 1:return 31;break;case 2:if(year%4==0){return 29;}else{return 28;}break;case 3:return 31;break;case 4:return 30;break;case 5:return 31;break;case 6:return 30;break;case 7:return 31;break;case 8:return 31;break;case 9:return 30;break;case 10:return 31;break;case 11:return 30;break;case 12:return 31;break;}}
var txt_price='';var txt_order='<b>Produkt na zamówienie.</b><br />';var txt_order_disable_days='Wysyłka w ciągu ';var txt_points='';var txt_points2='';var txt_enable='<b>Produkt dostępny.</b><br />';var txt_order_enable_days='Wysyłka w ciągu ';var txt_disable='<b>Produkt niedostępny.</b><br />';var submit_flag=true;function selectSize(params)
{var dni=" dni."
var dzien=" dzień."
var code=params[0];var price=params[1];var days=params[2];var delivery_days=params[3];var status=params[4];var itemsize=params[5];var amount=params[6];var versions=params[7];var points=params[8];var selekt=document.getElementById('projector_size');if(document.getElementById('option_idle')){selekt.remove(document.getElementById('option_idle'));}
item_nopricee=document.getElementById('item_noprice');selected=code;item_pricee=document.getElementById('item_price');item_price_curr=document.getElementById('item_price_cur');item_main_pricee=document.getElementById('item_price_main');if(price=='0.00'){item_nopricee.style.display='block';item_main_pricee.style.display='none';}else{item_main_pricee.innerHTML=txt_price+price+'zł';item_price_curr.style.visibility='visible';item_nopricee.style.display='none';item_main_pricee.style.display='block';}
item_size_mainn=document.getElementById('item_size_main');item_sizee=document.getElementById('item_size');item_sizee.innerHTML=itemsize;item_size_mainn.style.display='block';item_sizee.style.display='inline';item_amountt=document.getElementById('item_amount');item_amount2a=document.getElementById('item_amount2');item_amount2_dayss=document.getElementById('item_amount2_days');switch(status){case"order":item_amountt.style.display='none';if(days=='1'){item_amount2_dayss.innerHTML=txt_order+txt_order_disable_days+days+dzien;}
if(days>'1'){item_amount2_dayss.innerHTML=txt_order+txt_order_disable_days+days+dni;}
item_amount2a.style.display='block';if(points!=''){}
break;case"enable":item_amountt.style.display='none';if(days=='1'){item_amount2_dayss.innerHTML=txt_enable+txt_order_enable_days+days+dzien;}
if(days>'1'){item_amount2_dayss.innerHTML=txt_enable+txt_order_enable_days+days+dni;}
item_amount2a.style.display='block';break;if(points!=''){}
case"disable":if(delivery_days==''){item_amountt.style.display='block';item_amount2a.style.display='none';item_amount2_dayss.innerHTML=txt_disable;}else
{item_amountt.style.display='none';if(delivery_days=='1'){item_amount2_dayss.innerHTML=txt_disable+txt_order_disable_days+delivery_days+dzien;}
if(delivery_days>'1'){item_amount2_dayss.innerHTML=txt_disable+txt_order_disable_days+delivery_days+dni;}
item_amount2a.style.display='block';};break;default:item_amountt.style.display='none';if(days=='1'){item_amount2_dayss.innerHTML=days+dzien;}
if(days>'1'){item_amount2_dayss.innerHTML=days+dni;}
item_amount2a.style.display='block';}
if(document.getElementById('item_basket'))
{if(status!=="disable"){if(price>"0.00"||points!=''){document.getElementById('item_basket').style.display='block';document.getElementById('item_basket').style.opacity='1';document.getElementById('item_basket').style.filter="alpha(opacity=100)";document.getElementById('item_basket').style.cursor='pointer';submit_flag=true;}}else{document.getElementById('item_basket').style.display='block';document.getElementById('item_basket').style.opacity='.5';document.getElementById('item_basket').style.filter="alpha(opacity=50)";document.getElementById('item_basket').style.cursor='not-allowed';submit_flag=false;}}
projector_details_deselectradio();if(document.getElementById('color')&&versions>'1'){document.getElementById('color').value='none';}
selVal=code;divs=document.getElementsByTagName('div');for(i=0;i<divs.length;i++){if((/^versionsize_/).test(divs[i].id)==true){divs[i].style.display='none';}}
if(document.getElementById('versionsize_'+selVal)){document.getElementById('versionsize_'+selVal).style.display='block';}}
var components=new Array("component_projector_suggestproduct","component_projector_askforproduct","component_projector_longdescription");function projector_details_switch(name){for(var i=0;i<components.length;i++){if(document.getElementById(components[i])){document.getElementById(components[i]).style.display='none';}}
document.getElementById(name).style.display='block';}
function projector_details_change(){ps=document.getElementById('projector_size');if(ps.firstChild.nodeName=='SELECT'){id=ps.firstChild.value;dl=document.location;dl.href=dl.protocol+'//'+dl.host+dl.pathname+'?product='+id;}}
function dosubmit(){if(submit_flag){if(document.getElementById('color')){if(document.getElementById('color').value=='none'){alert('Proszę wybrać kolor produktu');return false;}}
document.getElementById('form').submit();}}
function projector_details_deselectradio(){var radios=document.getElementsByTagName('input');for(i=0;i<radios.length;i++){if(radios[i].checked){radios[i].checked=!radios[i].checked;}}}
function projector_button_switch(cont){if(cont=='component_projector_suggestproduct'){if(document.getElementById('component_projector_askforproduct')){document.getElementById('component_projector_askforproduct').style.display='none';}
if(document.getElementById('component_projector_suggestproduct')){document.getElementById('component_projector_suggestproduct').style.display='block';}}
if(cont=='component_projector_askforproduct'){if(document.getElementById('component_projector_suggestproduct')){document.getElementById('component_projector_suggestproduct').style.display='none';}
if(document.getElementById('component_projector_askforproduct')){document.getElementById('component_projector_askforproduct').style.display='block';}}}
var 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;}
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 components=new Array("component_projector_opinions","component_projector_dictionary","component_projector_photos","component_projector_longdescription","component_projector_ordered","component_projector_associated","component_projector_incategory","component_projector_suggestproduct","component_projector_askforproduct");function showButtons()
{var i=0;var activeButtons=components.length;for(i=0;i<components.length;i++){if(document.getElementById(components[i])){document.getElementById('projector_components_hidding').style.display='block';if(document.getElementById('hide_'+components[i])){document.getElementById('hide_'+components[i]).style.display='block';}}}
setTimeout("showButtons()",2000);}
function components_hidding(component)
{if(document.getElementById(component)){for(i=0;i<components.length;i++){if(document.getElementById(components[i])){document.getElementById(components[i]).style.display='none';}}
document.getElementById(component).style.display='block';}}
showButtons();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 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()}
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 ClientSave={validateLogin:function(obj)
{obj.value=obj.value.toLowerCase();}}
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';}}
