var admin=false;var boxPrice;var boxCategory;var sum=0;var cena=0;var jidlo=true;var novinky=false;var favourite=false;var pobyt=true;var beauty=true;var ostatni=true;var sport=true;var cr=true;var sr=true;var zahranici=true;var counter="";var urlPobyt=false;var arrPobyty=new Array();arrPobyty.sr="";arrPobyty.cr="";arrPobyty.zahranici="";arrPobyty.nezarazeno="";var sumSr=0;var sumCr=0;function strLeft(b,a){return(b.indexOf(a)==-1|a=="")?"":b.split(a)[0]}function strRight(b,a){idx=b.indexOf(a);return(idx==-1|a=="")?"":b.substr(idx+a.length)}function strMiddle(c,b,a){return strLeft(strRight(c,b),a)}function strpos(b,c,d){var a=(b+"").indexOf(c,(d||0));return a===-1?false:a}function init_box_sort(){var b=location.href;var a=strLeft(b+"?","?");boxContent="<div style='position: absolute; top: 7px; right: 25px;'>\n";boxContent+="<b>Řadit od</b>: &nbsp;";boxContent+=(b.indexOf("?s=novinky")==-1)?"<a href='"+a+"?s=novinky'>nejnovější</a>":"<b>nejnovějších</b>";boxContent+=" | ";boxContent+=(b.indexOf("?s=prodej")==-1)?"<a href='"+a+"?s=prodej'>nejprodávanější</a>":"<b>nejprodávanějších</b>";boxContent+=" | ";boxContent+=(b.indexOf("?s=sleva")==-1)?("<a href='"+a+"?s=sleva'>výše slevy</a>"):"<b>výše slevy</b>";boxContent+=" | ";boxContent+=(b.indexOf("?")>0)?"<a href='"+a+"'>priority</a>":"<b>priority</b>";boxContent+="</div>";boxCategory=document.getElementById("category");boxCategory.innerHTML=boxCategory.innerHTML+boxContent}function init_filters_city(d){var c=d.split(";");var a=c.length-1;boxContent="<b>Vyberte město</b>: ";for(var b=0;b<a;b++){url=strLeft(c[b],"#");nazev=strRight(c[b],"#");boxContent+="<a href='#' onclick='process_city(this, \""+url+"\")'>"+nazev+"</a>";boxContent+=(b+1!=a)?" | ":""}boxPrice=document.getElementById("category");boxPrice.innerHTML=boxContent}function process_city(b,c){sum=0;var a=document.getElementsByClassName("item");for(i=0;i<a.length;i++){if(a[i].getAttribute("city")==c){a[i].style.display="block";sum++}else{a[i].style.display="none"}}document.getElementById("sum").innerHTML="("+sum+"x)"}if(!document.getElementsByClassName){document.getElementsByClassName=function(g,e,a){var d=new Array();e=document.getElementById("data");a="div";if(e==null){e=document}if(a==null){a="*"}var c=e.getElementsByTagName(a);var b=c.length;var f=new RegExp("(^|\\s)"+g+"(\\s|$)");for(i=0,j=0;i<b;i++){if(f.test(c[i].className)){d[j]=c[i];j++}}return d}}function process_category(a,b){if(b=="jidlo"){jidlo=a.checked}else{if(b=="pobyt"){pobyt=a.checked}else{if(b=="beauty"){beauty=a.checked}else{if(b=="sport"){sport=a.checked}else{if(b=="ostatni"){ostatni=a.checked}}}}}filter()}function process_state(a,b){if(b=="cr"){cr=a.checked}else{if(b=="sr"){sr=a.checked}else{if(b=="zahranici"){zahranici=a.checked}else{if(b=="nezarazeno"){nezarazeno=a.checked}}}}filter()}function process_cena(a,b){cena=b;filter();reset(boxPrice);filter_eprocess(a)}function filter(){sum=0;var b;var a=document.getElementsByClassName("item");for(i=0;i<a.length;i++){itemCena=a[i].getAttribute("cena");itemNovinka=a[i].getAttribute("novinka");itemFavourite=a[i].getAttribute("favourite");b=false;if(itemCena!=null&&(itemCena==cena||cena==0)){b=true}if(itemNovinka!=null&&(itemNovinka=="0"&&novinky)){b=false}if(itemFavourite!=null&&(itemFavourite=="0"&&favourite)){b=false}if(b){b=getVisibility(a[i])}if(b){a[i].style.display="block";sum++}else{a[i].style.display="none"}}$(function(){$("img.lazy").asynchImageLoader()});document.getElementById("sum").innerHTML="("+sum+"x)"}function getVisibility(b){if(urlPobyt){var c=b.getAttribute("cr");var e=b.getAttribute("sr");var k=b.getAttribute("zahranici");var f=b.getAttribute("nezarazeno");if(c!=null&&c=="1"&&cr){return true}if(e!=null&&e=="1"&&sr){return true}if(k!=null&&k=="1"&&zahranici){return true}if(f!=null&&f=="1"&&nezarazeno){return true}}else{var l=b.getAttribute("beauty");var a=b.getAttribute("jidlo");var h=b.getAttribute("pobyt");var d=b.getAttribute("sport");var g=b.getAttribute("ostatni");if(a!=null&&a=="1"&&jidlo){return true}if(l!=null&&l=="1"&&beauty){return true}if(h!=null&&h=="1"&&pobyt){return true}if(g!=null&&g=="1"&&ostatni){return true}if(d!=null&&d=="1"&&sport){return true}}return false}function filter_eprocess(a){var b=a.className;if(b){a.className="";a.style.color="#b20000";a.style.cursor="pointer";a.style.textDecoration="underline"}else{selected(a)}}function reset(a){var b=a.getElementsByTagName("A");for(i=0;i<b.length;i++){b[i].className="";b[i].style.color="#b20000";b[i].style.cursor="pointer";b[i].style.textDecoration="underline"}}function selected(a){a.className="clicked";a.style.color="black";a.style.cursor="text";a.style.textDecoration="none"}function countdown(n,e,u,l){u="Sleva již není aktivní";var g=new Date();var b=new Date(n);var r=b.getTime()-g.getTime();r/=1000;if(r<=0){document.getElementById(e).innerHTML=u;return(0)}var f=r;var o=Math.floor(f/24/3600);f=f%(24*3600);var k=Math.floor(f/3600);f=f%3600;var c=Math.floor(f/60);f=f%60;var t=Math.floor(f);var p=" <span class='hours'>";o=(o==0)?0:(o*24);if((k+o)<10){p+="0"}var q=k+o;p+=(k+o)+"</span><span>:</span>";p+="<span class='min'>";if(c<10){p+="0"}p+=c+"</span><span>:</span>";p+="<span class='sec'>";if(t<10){p+="0"}p+=t;p+="</span>";p=""+p+"";document.getElementById(e).innerHTML=p;var a=1;if(counter=="optimalized"){if(q>48){a=9999}else{if(q>24){a=999}else{if(q>12){a=8}else{a=5}}}}setTimeout("countdown('"+n+"','"+e+"','"+u+"')",(999*a),l)}function init_icons(a,g,h){var d=document;if(h!=null){d=document.getElementById(h)}var b=a;var c="http://slevomol.cz/sleva/"+a;var f="http://www.facebook.com/sharer.php?u="+encodeURIComponent(c);var e="";e+="<p class='icons' style='display: block; position: absolute; bottom: 25px; right: 10px; padding: 0px; margin: 0px;'>";e+="<a href='/mailer/"+b+"' title='Zaslat odkaz na slevu mailem'><img src='/images/mail.gif' alt='' /></a>";e+="<a href='javascript:CreateBookmarkLink(\""+c+'", "'+g+"\")' title='Přidat do oblíbených záložek'><img src='/images/fav.gif' alt='' /></a>";e+="<a target='_blank' href='"+f+"' title='Sdílet na facebooku'><img src='/images/fcb.gif' alt='' /></a>";e+="</p>";d.innerHTML=e}function CreateBookmarkLink(a,b){if(window.sidebar){window.sidebar.addPanel(b,a,"")}else{if(window.external){window.external.AddFavorite(a,b)}else{if(window.opera&&window.print){return true}}}}function go(e){var b=e.replace("x","-");var c=document.getElementById(e);var a=c.getElementsByTagName("a");var d="";for(i=0;i<a.length;i++){d=a[i].className;if(d.indexOf("partner")==-1&&d.indexOf("admin")==-1){a[i].target="_blank";a[i].href="http://slevomol.cz/go/"+b+""}}}function unique(b){tmp=new Array(0);for(i=0;i<b.length;i++){if(!contains(tmp,b[i])){tmp.length+=1;tmp[tmp.length-1]=b[i]}}return tmp}function contains(b,c){for(j=0;j<b.length;j++){if(b[j]==c){return true}}return false}function pobyty_tags(){var c;var d=arrPobyty.cr.split("#");var b=arrPobyty.sr.split("#");var a=arrPobyty.zahranici.split("#");a=unique(a);boxContent="";c=d;if(!(c.length==1&&c[0]=="")){boxContent+=" <b>Česko:</b> ";for(i=0;i<(c.length-1);i++){boxContent+="<input id='"+strRight(c[i],":")+"' style='width: 15px;' type='checkbox' checked='checked' onclick='process_category(this, this.id)' /> \n            <a href='#' onclick='cat_link(\""+strRight(c[i],":")+"\")'>"+strLeft(c[i],":")+"</a>&nbsp; "}}c=b;if(!(c.length==1&&c[0]=="")){boxContent+=" <b>Slovensko:</b> ";for(i=0;i<(c.length-1);i++){boxContent+="<input id='"+strRight(c[i],":")+"' style='width: 15px;' type='checkbox' checked='checked' onclick='process_category(this, this.id)' /> \n            <a href='#' onclick='cat_link(\""+strRight(c[i],":")+"\")'>"+strLeft(c[i],":")+"</a>&nbsp; "}}c=a;if(!(c.length==1&&c[0]=="")){boxContent+=" &nbsp; <b>Zahraničí:</b> ";for(i=0;i<(c.length-1);i++){boxContent+="<input id='"+strRight(c[i],":")+"' style='width: 15px;' type='checkbox' checked='checked' onclick='process_category(this, this.id)' /> \n            <a href='#' onclick='cat_link(\""+strRight(c[i],":")+"\")'>"+strLeft(c[i],":")+"</a>&nbsp; "}}boxPrice=document.getElementById("category-l2");boxPrice.innerHTML=boxContent}var numHidden=true;$(window).resize(function(){eventResize(false)});function eventResize(a){if($(window).width()<1100){numHidden=true;$(".number").hide()}else{if(numHidden==true||a==true){$(".number").show();numHidden=false}}}$(document).ready(function(){eventResize(false)});
