var kck_defpath="/"; var kck_defdomain="www.kckcyklosport.cz"; var kck_cookie_errlock=false; function trim(inputString) { if (typeof inputString != "string") return inputString; var retValue = inputString; var ch = retValue.substring(0, 1); while (ch == " ") { retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length - 1, retValue.length); while (ch == " ") { retValue = retValue.substring(0, retValue.length - 1); ch = retValue.substring(retValue.length - 1, retValue.length); } while (retValue.indexOf(" ") != -1) retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ") + 1, retValue.length); return retValue; } xlogcounter=0; function xlog(xmsg) { var o=document.getElementById("xlogarea"); if (!o) { o=document.createElement("textarea"); o.style.position="absolute"; o.style.left="0px"; o.style.top="0px"; o.style.width="200px"; o.style.height="100px"; o.style.display="block"; o.style.marginTop="20px" o.style.marginLeft="200px"; o.id="xlogarea"; document.body.appendChild(o); } if (o) { xlogcounter++; o.value=xlogcounter+": "+xmsg; } } function set_cookie ( name, value, exp_seconds, path, domain, secure ) { var cookie_string = name + "=" + escape ( value ); if ( exp_seconds ) { var expires = new Date (); ex=expires.valueOf()+exp_seconds*1000; expires = new Date (ex); cookie_string += "; expires=" + expires.toGMTString(); } if ( path ) cookie_string += "; path=" + escape ( path ); if ( domain ) cookie_string += "; domain=" + escape ( domain ); if ( secure ) cookie_string += "; secure"; document.cookie = cookie_string; var xr=get_cookie(name); if ((xr=="null") || (!xr)) xr=""; if ((value=="null") || (!value)) value=""; if ((xr!=value) && (!kck_cookie_errlock)) { if (!kck_cookie_errlock) alert("Je nám líto, ale Váš prohlížeč neumožňuje zapsat data, která jsou potřebná pro funkčnost přihlášení. Jedná se o data zapisovaná do Cookies, konkrétně jde o cookie s názvem '"+name+"'. Při kontrole stavu po zápisu bylo zjištěno, že váš prohlížeč místo zapsané hodnoty '"+ value+"' stále vrací hodnotu '"+xr+"'. Je možné, že máte nějakým způsobem cookies blokována. Máte-li trvale problémy s prohlížečem Microsoft Internet Explorer, zkuste prosím totéž v jiném prohlížeči, například Opera, nebo Mozilla Firefox."); kck_cookie_errlock=true; } } function delete_cookie ( cookie_name ) { var cookie_date = new Date ( ); cookie_date.setTime ( cookie_date.getTime() - 1 ); document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString(); } function get_cookie ( cookie_name ) { var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' ); if ( results ) return ( unescape ( results[1] ) ); else return null; } function xzoom(a2,xid) { window.open("getimage.php?a2="+a2+"&id="+xid,"_blank","width=300px,height=300px"); } var __CMS_Timers_TickRes=50; var __CMS_Timers_Cache=new Object(); function CMS_Timer_Del(timername) { CMS_Timer_Add(timername,1,""); } function CMS_Timer_Add(timername,interval,jscode) { CMS_Timer_Add_int(timername,interval,jscode,false); } function CMS_Timer_Add_Loop(timername,interval,jscode) { CMS_Timer_Add_int(timername,interval,jscode,true); } function CMS_Timer_Kill(timername) { CMS_Timer_Add_int(timername,1,'',false); } function CMS_Timer_GetTimerProgress(timername,xmaxval) { var ret=0; var t=CMS_Timer_GetTimer(timername); if (t) { var xmax=t["intervalorig"]; var xpos=t["interval"]; if (xmax>0) { if (xpos>xmax) xpos=xmax; if (xpos<0) xpos=0; ret=Math.round(xpos/xmax*xmaxval); if (ret>xmaxval) ret=xmaxval; } } return ret; } function CMS_Timer_GetTimer(timername) { var ret=false; var xtimer=__CMS_Timers_Cache[timername]; if (xtimer) ret=xtimer; return ret; } __uniqtimer=0; function CMS_Timer_Add_int(timername,interval,jscode,isloop) { var notimers=CountOfObject(__CMS_Timers_Cache)==0; if ((!timername) || (timername=="")) { __uniqtimer++; timername="timer_"+__uniqtimer; } var xtimer=__CMS_Timers_Cache[timername]; if (!xtimer) { var newtimer=new Object(); newtimer["interval"]=interval; newtimer["intervalorig"]=interval; newtimer["jscode"]=jscode; newtimer["isloop"]=isloop; __CMS_Timers_Cache[timername]=newtimer; } else { xtimer["interval"]=interval; xtimer["intervalorig"]=interval; xtimer["jscode"]=jscode; xtimer["isloop"]=isloop; } if (notimers) setTimeout("CMS_Timer_Loop()",__CMS_Timers_TickRes); } function CMS_Timer_Loop() { var newtimersobj=new Object(); var xcodes=new Array(); var xc=0; for (var p in __CMS_Timers_Cache) { var xtimer=__CMS_Timers_Cache[p]; if (xtimer) { xtimer["interval"]=xtimer["interval"]-__CMS_Timers_TickRes; if (xtimer["interval"]<=0) { if (trim(xtimer["jscode"])!="") { xcodes[xc]=xtimer["jscode"]; xc++; } if (xtimer["isloop"]) { xtimer["interval"]=xtimer["intervalorig"]; newtimersobj[p]=xtimer; } } else newtimersobj[p]=xtimer; } } __CMS_Timers_Cache=newtimersobj; if (xcodes.length>0) for (var ii=0;ii < xcodes.length;ii++) eval(xcodes[ii]); if (CountOfObject(__CMS_Timers_Cache)>0) setTimeout("CMS_Timer_Loop()",__CMS_Timers_TickRes); } function CountOfObject(obj) { var cc=0; for (var p in obj) cc++; return(cc) } function dumpobject(obj,level) { if (!level) level=0; var cc=""; if (!obj) cc="Not object"; else if (CountOfObject(obj)==0) cc="Empty object"; else { var s=""; for (var i=0;i < level+1;i++) s+=" "; for (var p in obj) { if (obj[p] instanceof Object) cc+="["+p+"]=Object {\n"+dumpobject(obj[p],level++)+s+"}\n"; else cc+=s+"["+p+"]="+obj[p]+"\n"; } } return(cc); } __qzoomdivobj=null; function qzoom(qid,insidehtml,xmainclass) { var dname="xdarkdiv"; var o=document.getElementById(dname); if (o) qcloseimg(); var o=document.createElement("DIV"); o.setAttribute("id",dname); if (document.all) o.style.position="absolute"; else o.style.position="fixed"; o.style.left="0px"; o.style.top="0px"; o.style.width="100%"; o.style.height="100%"; o.style.zIndex=1500; if (!xmainclass) xmainclass="xqimgins"; if (!insidehtml) insidehtml='


Zavřít
' o.innerHTML=''+ '
'+ ''+ '
'+ '
'+insidehtml+'
'; document.body.appendChild(o); __qzoomdivobj=o; if (document.all) qFuckOfMSIE_realign(); } function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [scrOfX, scrOfY ]; } function getWindowSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return [myWidth, myHeight ]; } function qFuckOfMSIE_realign() { if (__qzoomdivobj) { var c=getScrollXY(); __qzoomdivobj.style.top=c[1]; setTimeout("qFuckOfMSIE_realign()",200); } } function qcloseimg() { var d=__qzoomdivobj; if (d) d.parentNode.removeChild(d); __qzoomdivobj=null; } _lastbimgforshow=null; function sh_bimg(xobj,xstate) { if (!xstate) { sh_bimg_d(xobj,xstate); CMS_Timer_Add("sh_bimg",0,""); } else { _lastbimgforshow=xobj; CMS_Timer_Add("sh_bimg",500,"sh_bimg_d(_lastbimgforshow,true)"); } } function getAbsoluteLeft(objectId) { o = objectId; oLeft = o.offsetLeft; while(o.offsetParent!=null) { oParent = o.offsetParent; oLeft += oParent.offsetLeft; o = oParent; } return oLeft; } function getAbsoluteTop(objectId) { o = objectId; oTop = o.offsetTop; while(o.offsetParent!=null) { oParent = o.offsetParent; oTop += oParent.offsetTop; o = oParent; } return oTop; } function sh_realignbimg(xid) { var ob=document.getElementById("bimg_"+xid); var os=document.getElementById("simg_"+xid); if ((ob) && (os)) { var qq=getScrollXY(); var qsymin=qq[1]; var qq=getWindowSize(); var qsymax=qq[1]+qsymin; var sl=getAbsoluteLeft(os); var st=getAbsoluteTop(os); var sh=os.clientHeight; var bw=ob.clientWidth; var bh=ob.clientHeight; ob.style.left=sl+110; qq=st+(sh/2)-(bh/2); if (qq < qsymin) qq=qsymin+10; if (qq+bh > qsymax) qq=qsymax-bh-10; ob.style.top=qq; } } function sh_bimg_hideall() { var e=document.getElementsByTagName("DIV"); for (var ii=0;ii < e.length; ii++) { var o=e[ii]; if (o.getAttribute("qtype")=="simg") sh_bimg_d(o,false) } if (document.getElementById("qfilesjscript")) qhideallfiles(); } function sh_bimg_d(xobj,xstate) { if (xobj) { var xsrc=xobj.getAttribute("xsrc"); var xuid=xobj.getAttribute("xuid"); var xinit=xobj.getAttribute("xinit"); var qdiv=document.getElementById("bimg_"+xuid); if (qdiv) { if ((xinit!="yes") && (xstate)) { qdiv.innerHTML=''; xobj.setAttribute("xinit","yes"); } if (xstate) { if (qdiv.style.display!="block") { sh_bimg_hideall(); qdiv.style.visibility="hidden"; qdiv.style.display="block"; sh_realignbimg(xuid); CMS_Timer_Add_Loop("bimgtimer_"+xuid,250,'sh_realignbimg('+xuid+')'); qdiv.style.visibility="visible"; } } else { if (qdiv.style.display!="none") { CMS_Timer_Kill("bimgtimer_"+xuid); qdiv.style.display="none"; } } } } } function nologged() { alert("Nejste přihlášen. Pro zobrazení následující stránky musíte být registrovaným zákazníkem a musíte být přihlášen."); } function sh_modArray(xarray,xid,xadd) { nadd=xadd; var ret=new Array(); for (var ii=0; ii < xarray.length; ii++) if (xarray[ii]>0) { if (((!xadd) && (xarray[ii]!=xid)) || (xadd)) ret.push(xarray[ii]); if ((xadd) && (xarray[ii]==xid)) nadd=false; } if ((xadd) && (nadd)) ret.push(xid); return ret; } function sh_exp(xid) { var o=document.getElementById("_shid_"+xid); var om=document.getElementById("_shim_"+xid); if ((o) && (om)) { var cn="_gm"; var tt=get_cookie(cn); if (!tt) tt=""; var mm=tt.split(","); if (o.style.display!="none") { o.style.display="none"; om.className="tlxp"; mm=sh_modArray(mm,xid,false); } else { o.style.display="block"; om.className="tlxm"; mm=sh_modArray(mm,xid,true); } tt=mm.join(","); set_cookie(cn,tt,86400*365); } } function sh_shideall() { var e=document.getElementsByTagName("div"); for (var ii=0;ii < e.length;ii++) if (e[ii].getAttribute("_smenu")=="yes") e[ii].style.display="none"; } function sh_smenu(xid) { sh_shideall(); var o=document.getElementById("smenu_"+xid); if (o) { o.style.display="block"; set_cookie("_sm",xid,86400*100); } } function XFloat2Curency(xval) { xval=XshStr2Float(xval,true); if (xval<0) { xxcsign=true; xval=-xval; } else xxcsign=false; xval=Math.floor(Math.round(xval*100))/100; xval=trim(xval); xval=new String(xval); xc=xval.indexOf("."); if (xc>=0) { xnum=xval.substr(0,xc); xfrac=xval.substr(xc+1,xval.length-xc-1); } else { xnum=xval; xfrac="0"; } if (xnum=="") xnum="0"; c=xnum.length;xx=0;m=""; for (i = 0; i < c; i++) { if (xx==3) { xx=0; m=" "+m; } xx++; m=xnum.substr(c-i-1,1)+m; } xfrac=trim(xfrac); while (xfrac.length<2) xfrac+="0"; xval=trim(m)+"."+xfrac+" Kč"; if (xxcsign) xval="-"+xval; return xval; } function XshStr2Float(xval,frac) { var xval=new String(trim(xval)); xalow="0123456789.,"; if (xval.substr(0,1)=="-") xxsign=true; else xxsign=false; for (i = 0; i < xval.length; i++) if (xalow.indexOf(xval.substr(i,1))<0) xval=xval.substr(0,i)+" "+xval.substr(i+1,xval.length-i-1); while (true) { xc=xval.indexOf(","); if (xc>=0) xval=xval.substr(0,xc)+"."+xval.substr(xc+1,xval.length-xc-1); else { xc=xval.indexOf(" "); if (xc>=0) xval=xval.substr(0,xc)+xval.substr(xc+1,xval.length-xc-1); else break; } } while (xval.length>0) { ch=xval.substr(0,1); if (ch=="0") xval=xval.substr(1,xval.length-1); else break; } xval=trim(xval); if (xval.substr(0,1)==".") xval="0"+xval; xval=parseFloat(xval); if (isNaN(xval)) xval=0; if (frac) xval=Math.round(xval*100)/100; else xval=Math.round(xval); if (xxsign) xval=-xval; return xval; } function x_s_detail(sid) { var o=document.getElementById("xdetail_"+sid); if (o) { if (o.style.visibility=="hidden") { o.style.width=""; o.style.height=""; o.style.left=""; o.style.top=""; o.style.visibility="visible"; o.style.position=""; } else { o.style.visibility="hidden"; o.style.position="absolute"; o.style.width="0"; o.style.height="0"; o.style.left="0"; o.style.top="0"; } } } function x_s_question(kod,shop) { window.open("shopinfobox.php?kod="+kod+"&shop="+shop,"_blank","width=500px,height=500px"); } function xopenimg(xid) { window.open("getimage.php?id="+xid,"_blank","width=300px,height=300px"); } function x_sh_sortby(sby) { set_cookie("shop_sortby",sby,86400*31); window.location=window.location; } function x_sh_sorttype(stype) { set_cookie("shop_sorttype",stype,86400*31); window.location=window.location; } function x_sh_skladtype(stype) { set_cookie("shop_skladtype",stype,86400*31); window.location=window.location; } function x_s_closeframesearch() { var o=document.getElementById("qframesearchdiv"); var om=document.getElementById("qframesearchdivmain"); if ((o) && (om)) { o.innerHTML=""; om.style.display="none"; } } function x_s_search(shop,qframe) { o1=document.getElementById("xsearchname"); o2=document.getElementById("xsearchcode"); if ((o1) && (o2)) { if ((trim(o1.value)=="") && (trim(o2.value)=="")) x_s_closeframesearch(); else if (qframe=="yes") document.getElementById("workframe").src="index.php?shop="+shop+"&searchname="+o1.value+"&searchcode="+o2.value+"&qframe=yes"; else window.location="index.php?shop="+shop+"&searchname="+o1.value+"&searchcode="+o2.value; } } function x_s_framesearch() { CMS_Timer_Add("fulltext_framesearch",500,"x_s_search(2,'yes')"); } function x_s_maxperpage(count) { if (count>1) set_cookie('sh_maxperpage',count,86400*365); window.location=window.location; } function x_s_print() { c=new String(window.location); mm=c.indexOf("?"); rr=""; if (mm>=0) rr=c.substring(mm+1,c.length); window.open("print.php?"+rr,"_blank"); } function x_si_sendfrom() { name=document.getElementById("xform[name]"); phone=document.getElementById("xform[phone]"); email=document.getElementById("xform[email]"); text=document.getElementById("xform[text]"); cf=document.getElementById("shopinfoboxform"); if ((cf) && (name) && (phone) && (email) && (text)) { name.value=trim(name.value); phone.value=trim(phone.value); email.value=trim(email.value); text.value=trim(text.value); if (text.value=="") alert(_shopinfoboxnotext); else if ((phone.value=="") && (email.value=="")) alert(_shopinfoboxnophoneormail); else cf.submit(); } } function x_get_kod_and_name(sid) { o=document.getElementById("shopitemname"+sid); o1=document.getElementById("shopitemkod"+sid); if ((o) && (o1)) ret=o1.innerHTML+" - "+o.innerHTML; else ret=""; return (ret); } function x_ks_deleteall(islogged,shop) { if (islogged==1) if (confirm("Opravdu chcete odstrant všechny položky zboží z košíku ?")) { o=document.getElementById("workframe"); if (o) o.src="index.php?shopinframe=1&deleteall=1&shop="+shop; } else alert(mustbeloggedbeforebuy); } function x_ks_changeks(kod,islogged,sid,shop,skladks) { var xdo=true; if (islogged==1) { var o=document.getElementById("workframe"); var oks=document.getElementById("shopks"+sid); var okscelkem=document.getElementById("shopkscelkem"+sid); if ((o) && (oks) && (okscelkem)) { var ks=XshStr2Float(oks.value,false); var kscelkem=XshStr2Float(okscelkem.value,false) oks.value=ks; okscelkem.value=kscelkem; if ((ks>skladks) && (kscelkem<=skladks)) xdo=confirm("Vámi požadovaný počet jednotek zboží ("+oks.value+"), "+x_get_kod_and_name(sid)+", není aktuálně skladem (aktuální skladové zásoby: "+skladks+").\nChce zbytek evidovat jako závaznou objednávku a zboží poslat automaticky v okamžiku kdy bude skladem ?"); } if (xdo) o.src="index.php?shopinframe=1&changeks=1&shop="+shop+"&kod="+kod+"&ks="+oks.value+"&sid="+sid+"&sklad="+skladks; else oks.value=okscelkem.value; } else alert(mustbeloggedbeforebuy); } function x_ks_store(islogged,shop) { if (islogged==1) { var out=""; var o=null; var c=document.getElementsByTagName("tr"); for (var i=0;i < c.length;i++) if (c[i].getAttribute("xtag")=="kitem") { xid=c[i].getAttribute("xid"); xpriceks=c[i].getAttribute("xpriceks"); skladks=XshStr2Float(c[i].getAttribute("xsklad"),false); sid=c[i].getAttribute("xsid"); var xoks=document.getElementById("shopkscelkem"+sid); if (xoks) xkscelkem=XshStr2Float(xoks.value,false); o=document.getElementById("shopks"+sid); if (o) { xks=XshStr2Float(o.value,false); o.value=xks; } else xks=1; xdo=true; if ((xks>skladks) && (xkscelkem<=skladks)) if (xkscelkem!=xks) xdo=confirm("Vámi požadovaný počet jednotek zboží ("+xks+"), "+x_get_kod_and_name(sid)+", není aktuálně skladem (aktuální skladové zásoby: "+skladks+").\nChce zbytek evidovat jako závaznou objednávku a zboží poslat automaticky v okamžiku kdy bude skladem ?"); if (xdo) out+=xid+","+sid+","+xks+","+skladks+"|"; else o.value=xkscelkem; } o=document.getElementById("workframe"); if ((o) && (out!="")) o.src="index.php?shopinframe=1&changeksstatus=1&shop="+shop+"&ksstatus="+out; } else alert(mustbeloggedbeforebuy); } function x_s_buy(kod,islogged,sid,shop,iskosik,skladks) { var xdo=true; if (islogged==1) { var o=document.getElementById("buyframe_"+sid); if (!o) var o=document.getElementById("workframe"); var oks=document.getElementById("shopks"+sid); var okscelkem=document.getElementById("shopkscelkem"+sid); if ((o) && (oks) && (okscelkem)) { oks.value=XshStr2Float(oks.value,false); var celkemks=XshStr2Float(okscelkem.value,false); if (iskosik!=1) var xx=celkemks+Math.round(oks.value); else var xx=Math.round(oks.value); if ((xx>skladks) && (celkemks<=skladks)) xdo=confirm("Vámi požadovaný počet jednotek zboží ("+xx+"), "+x_get_kod_and_name(sid)+", není aktuálně skladem (aktuální skladové zásoby: "+skladks+").\nChce zbytek evidovat jako závaznou objednávku a zboží poslat automaticky v okamžiku kdy bude skladem ?"); } else xdo=false; if (xdo) o.src="index.php?shopinframe=1&shop="+shop+"&kod="+kod+"&ks="+oks.value+"&sid="+sid+"&iskosik="+iskosik+"&sklad="+skladks; else oks.value=celkemks; } else alert(mustbeloggedbeforebuy); } function x_s_unbuy(kod,islogged,sid,shop) { if (islogged==1) { var o=document.getElementById("buyframe_"+sid); if (!o) var o=document.getElementById("workframe"); if (o) o.src="index.php?shopinframe=1&shop="+shop+"&kod="+kod+"&delete=1&sid="+sid; } else { if (confirm("Nakupování v online obchodu KCK Zlín vyžaduje přihlášení uživatele. Chcete se nyní přihlásit ?")) { o=document.getElementById("workframe"); if (o) o.src="index.php?auth=1&logininframe=1"; } } } function shopsend_confirm() { var o=document.getElementById("xxzav_confirmed"); if (o) o.value="1"; } __shop_sent=false; function shopsend(shop,printonly,forcesend) { var o=document.getElementById("xxshopprintonly"); if (printonly!=true) printonly=false; if (forcesend!=true) forcesend=false; if (o) { if (printonly) o.value="1"; else o.value="0"; } var yes=true; if (shop==2) { var xmail=""; var m=document.getElementById("shpk_contact_edit_use"); var o=document.getElementById("pokladna_mail"); if ((m) && (o)) { if (m.value=="0") xmail=o.value; else { var c=document.getElementById(o.getAttribute("xqid")); if (c) xmail=c.value; } } if ((xmail=="") || (!is_email(xmail))) { yes=false; alert("Není vyplněn email, nebo email není správně zapsán. Email je nutný pro odeslání objednávky."); } } if (yes) { o=document.getElementById("pokladnaform"); if (o) { if (printonly) { o.target="_blank"; o.submit(); } else { o.target="workframe"; if ((!__shop_sent) || (forcesend)) { __shop_sent=true; o.submit(); } } } } } function x_pk_editinfo() { var o=document.getElementById("pokladna_cbutton"); if (o) { var xhide=o.getAttribute("xedited")=="yes"; var xdo=true; if (xhide) xdo=confirm("Opravdu chcete zrušit upravované fakturačních údaje a vrátit se k původním fakturačním údajům ?"); if (xdo) { var m=document.getElementById("shpk_contact_edit_use"); if (xhide) { if (m) m.value="0"; var xnameclass="xshow"; var xeditclass="xhide"; o.src=o.getAttribute("srcxxx"); o.setAttribute("xedited","no"); } else { if (m) m.value="1"; var xnameclass="xhide"; var xeditclass="xshow"; o.src=o.getAttribute("srcxx"); o.setAttribute("xedited","yes"); } var c=document.getElementsByTagName("span"); var ww=0; for (var i=0;i < c.length;i++) { if (c[i].getAttribute("xsp")=="pokladna_name") { c[i].className=xnameclass; if (!xhide) { sid=c[i].getAttribute("sid"); var os=document.getElementById("shpk_source_"+sid); var od=document.getElementById("shpk_edit_"+sid); if ((os) && (od)) { od.value=os.value; od.style.height="17px"; } } } if (c[i].getAttribute("xsp")=="pokladna_edit") { if (document.all) { if (xhide) c[i].style.display="none"; else { c[i].style.display="block"; c[i].style.height="17px"; c[i].style.width=""; } } c[i].className=xeditclass; } } } } } function x_pk_post_clear(shoptype) { if (confirm("Opravdu chcete zrušit vyplněné údaje v poštovní adrese ?")) { delete_cookie("shop_post_name_"+shoptype); delete_cookie("shop_post_street_"+shoptype); delete_cookie("shop_post_city_"+shoptype); delete_cookie("shop_post_zip_"+shoptype); o=document.getElementById("shpk_post_name"); if (o) o.value=""; o=document.getElementById("shpk_post_street"); if (o) o.value=""; o=document.getElementById("shpk_post_city"); if (o) o.value=""; o=document.getElementById("shpk_post_zip"); if (o) o.value=""; } } function is_email(email) { invalidChars = " ~\'^\`\"*+=\\|][(){}$&!#%/:,;"; // Check for null if (email == "") return false; // Check for invalid characters as defined above for (i=0; i < invalidChars.length; i++) { badChar = invalidChars.charAt(i); if (email.indexOf(badChar,0) > -1) return false; } lengthOfEmail = email.length; if ((email.charAt(lengthOfEmail - 1) == ".") || (email.charAt(lengthOfEmail - 2) == ".")) return false; Pos = email.indexOf("@",1); if (email.charAt(Pos + 1) == ".") return false; while ((Pos < lengthOfEmail) && ( Pos != -1)) { Pos = email.indexOf(".",Pos); if (email.charAt(Pos + 1) == ".") return false; if (Pos != -1) Pos++; } // There must be at least one @ symbol atPos = email.indexOf("@",1); if (atPos == -1) return false; // But only ONE @ symbol if (email.indexOf("@",atPos+1) != -1) return false; // Also check for at least one period after the @ symbol periodPos = email.indexOf(".",atPos); if (periodPos == -1) return false; if (periodPos+3 > email.length) return false; var cm=email.split("."); if (cm.length<2) return false; var xlast=trim(cm[cm.length-1]); if (xlast.length<2) return false; return true; } function xget_obj(objid,xshop) { var o=document.getElementById("workframe"); if ((o) && (confirm("Chcete nahradit obsah Vašeho nákupního košíku touto objednávkou ?"))) o.src="index.php?shop="+xshop+"&history=1&loadobj=1&objid="+objid; } function xdelete_obj(objid) { var o=document.getElementById("workframe"); if ((o) && (confirm("Chcete odstranit tuto objednávku z historie objednávek ?"))) o.src="index.php?shop=&history=1&deleteobj=1&objid="+objid; } function show_shop_images(state) { if (!state) set_cookie("_hide_shop_images","yes",86400*31); else delete_cookie("_hide_shop_images"); window.location=window.location; } function xcheckshform() { var oq=document.getElementById("xrdtname"); var e=document.getElementsByTagName("input") for (var i=0;i < e.length; i++) { var o=e[i]; var x=o.getAttribute("_fid"); if ((x) && (x>0)) { var ox=document.getElementById("req_date_"+x); if (ox) { if (o.checked) ox.style.display="block"; else ox.style.display="none"; } } } } function xshclickondatetemplate(xradioobj) { var cx=xradioobj.getAttribute("_xid"); if (cx) { var s=trim(xradioobj.value); var q=s.split("."); document.getElementById("req_dateinput_dd_"+cx).value=q[0]; document.getElementById("req_dateinput_mm_"+cx).value=q[1]; document.getElementById("req_dateinput_yy_"+cx).value=q[2]; document.getElementById("req_dateinput_hh_"+cx).value=q[3]; document.getElementById("req_dateinput_ii_"+cx).value=q[4]; } } function xshf(xobj,xid) { xshfocusinput(xobj);document.getElementById('req_customdate_radio_'+xid).checked=true; } function xshfocusinput(xinputobj) { xinputobj.select(); } var definfoboxtext=""; var iboxfocused=false; function iboxsend(xmode,spuid) { if (!xmode) { if (!iboxfocused) iboxfocus(); else if (spuid!=0) jsAntispam_Show(spuid); else iboxsend2(); } else iboxsend2(); } function iboxsend2() { var o=document.forms["infoboxform"]; if (o) o.submit(); } function iboxfocus() { m=document.getElementById("defmail"); o=document.getElementById("infobox"); h=document.getElementById("infoboxnewhint"); t=document.getElementById("infoboxnewtext"); if ((o) && (h) && (t) && (!iboxfocused)) { o.style.cursor="text"; o.title=h.value; iboxfocused=true; definfoboxtext=o.value; xx=t.value; if (m) xx+=m.value; o.value=xx; o.focus(); } } function resetInfobox() { o=document.getElementById("infobox"); if ((o) && (iboxfocused)) { iboxfocused=false; o.value=definfoboxtext; } } function Pr_send() { var f=document.getElementById("pr_form_"+__pr_lasttab); if (f) { var xev=f.getAttribute("_xbeforesend"); var cansend=true; if ((xev) && (xev!="")) eval(xev); if (cansend) f.submit(); } else alert("Err: no formtab found.") } function Pr_subload(xid) { var o=document.getElementById("pr_sub_"+xid); if (o) { var cid=o.getAttribute("cid"); var f=document.getElementById("prdataform"); var fa=document.getElementById("praction"); var fp=document.getElementById("prparam"); if ((cid) && (f) && (fa) && (fp)) { fa.value="loadprofile"; fp.value=cid; f.submit(); } } } function Pr_onLoad(xdata,xaccountkey,xaccounttitle) { Pr_resetForm(); var o=document.getElementById("pr_qsubid"); if (o) o.value=xaccountkey; var s=new String(xdata); var e=s.split(String.fromCharCode(31)); for (var i=0;i < e.length;i++) { var s=new String(e[i]); var q=s.split(String.fromCharCode(30)); var qkey=q[0]; var qval=q[1]; if ((!qval) && (qkey!="qisreseller")) qval=""; var o=document.getElementById("prinput_"+qkey); if (o) { var mtype=o.getAttribute("type"); if (mtype=="checkbox") { if (qval==0) o.checked=false; else o.checked=true; } else o.value=qval; } } var o=document.getElementById("pr_title"); if (o) o.innerHTML=xaccounttitle; } function Pr_resetForm() { var e=document.getElementsByTagName("input"); for (var ii=0;ii<=e.length;ii++) { var o=e[ii]; if ((o) && (o.getAttribute("prform")=="yes")) { var mtype=o.getAttribute("type"); if (mtype=="text") o.value=""; else if (mtype=="checkbox") o.checked=false; } } var e=document.getElementsByTagName("textarea"); for (var ii=0;ii<=e.length;ii++) { var o=e[ii]; if ((o) && (o.getAttribute("prform")=="yes")) o.value=""; } } function Pr_subclick(xid) { if (Pr_getSelected()!=xid) { Pr_SelectSub(xid); Pr_subload(xid); } } function Pr_getSelected() { var ret=-1; var e=document.getElementsByTagName("div"); for (var i=0;i<=e.length;i++) { var o=e[i]; if ((o) && (o.getAttribute("xprsubspan")=="yes") && (o.className="pr_subdiv pr_subsel")) { ret=o.getAttribute("xid"); break; } } return ret; } function Pr_unselectAll() { var e=document.getElementsByTagName("div"); for (var i=0;i<=e.length;i++) { var o=e[i]; if ((o) && (o.getAttribute("xprsubspan")=="yes")) o.className="pr_subdiv"; } } function Pr_SelectSub(xid) { Pr_unselectAll(); var o=document.getElementById("pr_sub_span_"+xid); if (o) o.className="pr_subdiv pr_subsel"; } function Pr_subover(xid,xstate) { var o=document.getElementById("pr_sub_"+xid); if (o) { if (xstate==1) o.className="pr_sub pr_sub1s"; else o.className="pr_sub pr_sub1"; } } function Pr_hidehelp() { var o=document.getElementById("pr_help"); if (o) o.style.display="none"; } function Pr_showhelp() { var o=document.getElementById("pr_help"); if (o) o.style.display="block"; } function Pr_hide() { delete_cookie("_medit"); var oq=document.getElementById("xprdiv"); var od=document.getElementById("xmaskdiv"); if ((oq) && (od)) { od.style.display="none"; oq.style.display="none"; } } function Pr_show() { var oq=document.getElementById("xprdiv"); var od=document.getElementById("xmaskdiv"); if ((oq) && (od)) { od.style.display="block"; oq.style.display="block"; } } function Pr_skip() { delete_cookie("_medit"); Pr_hide(); } function Pr_continue() { var c=document.getElementById("workframe"); if (c) c.src="pr-finfo-readed"; } function Pr_finfoclose() { var o=document.getElementById("pr_finfo"); if (o) o.style.display="none"; } function Pr_init() { Pr_show(); var ot=document.getElementById("xmaintable"); var od=document.getElementById("xmaskdiv"); if ((ot) && (od)) { od.style.height=ot.offsetHeight; setTimeout("window.scrollTo(0,0);Pr_subclick(0);",100); Pr_ShowTab(__xdefpage); } } __pr_lasttab=""; function Pr_ShowTab(pagename) { Pr_HideTabs(); var o=document.getElementById("mdlg_"+pagename); if (!o) { pagename="profile"; var o=document.getElementById("mdlg_"+pagename); } if (o) o.className="pr_titem_active"; var o=document.getElementById("mdlgtab_"+pagename); if (o) { __pr_lasttab=pagename; o.style.display="block"; } } function Pr_HideTabs() { var e=document.getElementsByTagName("DIV"); for (var i=0;i < e.length;i++) { var o=e[i]; if (o) { if (o.getAttribute("imdlg")=="yes") o.className="pr_titem"; else if (o.getAttribute("imdlgtab")=="yes") o.style.display="none"; } } } function Pr_EditPass(xhide) { var oe=document.getElementById("pr_qpass_edit"); var os=document.getElementById("pr_qpass_status") var oi=document.getElementById("ozprinput_qchangepass"); if ((oe) && (os) && (oi)) { if (xhide=="yes") { os.style.display="block"; oe.style.display="none"; oi.value="no"; } else { Pr_OZPassCheck(); os.style.display="none"; oe.style.display="block"; oi.value="yes"; } } } function Pr_OZPassClear() { var o1=document.getElementById("ozprinput_qpass"); var o2=document.getElementById("ozprinput_qpass2"); if ((o1) && (o2)) { o1.value=""; o2.value=""; } } function Pr_OZPassCheck() { var o=document.getElementById("ozprinput_qpass"); var os=document.getElementById("ozprdiv_qpass"); if ((o) && (os)) { var xpass=o.value; os.style.width=(190/32*passstrangechecker(xpass))+"px"; } } function Pr_CheckOZForm() { var ret=true; var o1=document.getElementById("ozprinput_qpass"); var o2=document.getElementById("ozprinput_qpass2"); if ((o1) && (o2)) { if (o1.value!=o2.value) { alert("Heslo a potvrzení hesla si neodpovídají."); ret=false; } } return ret; } function passstrangechecker(passwd) { intScore = 0; if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter intScore = (intScore+1); if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter intScore = (intScore+5); // NUMBERS if (passwd.match(/\d+/)) // [verified] at least one number intScore = (intScore+5); if (passwd.match(/(\d.*\d.*\d)/)) // [verified] at least three numbers intScore = (intScore+5); // SPECIAL CHAR if (passwd.match(/[!,@#$%^&*?_~]/)) // [verified] at least one special character intScore = (intScore+5); if (passwd.match(/([!,@#$%^&*?_~].*[!,@#$%^&*?_~])/)) // [verified] at least two special characters intScore = (intScore+5); // COMBOS if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/)) // [verified] both upper and lower case intScore = (intScore+2); if (passwd.match(/\d/) && passwd.match(/\D/)) // [verified] both letters and numbers intScore = (intScore+2); // [Verified] Upper Letters, Lower Letters, numbers and special characters if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/) && passwd.match(/\d/) && passwd.match(/[!,@#$%^&*?_~]/)) intScore = (intScore+2); return intScore; }