// This is Nux s.r.o. standard library
NLoad=function(emailClass,loginId){this.emailClass=emailClass;this.loginId=loginId;this.loadEmails();this.focusLogin();return};NLoad.load=function(emailClass,loginId){var loader=function(){new NLoad(emailClass,loginId);};return $(window).ready(loader);};NLoad.prototype.loadEmails=function(){$("span."+this.emailClass).each(function(){var text=$(this).text();if($(this).attr("title"))var address=$(this).attr("title");else var address=text;address=address.replace('&#64;','@');address=address.replace('&#46;','.');$(this).html('<a href="mailto:'+address+'">'+text+'</a>')});return};NLoad.prototype.focusLogin=function(){var login=document.getElementById(this.loginId);if(login)login.focus();return};function openWindow(location){window.open(location);return false};
NController=function(instanceName){this.instanceName=instanceName};NController.prototype.email=function(coded,linkname,makeLink,sameAddress){var cipher='ZabcXYdeWVfUTghSiRQjklPmONnMoLpqKJrIHstGuFvEwDxCyBz1A234568790';var shift=coded.length;var link='';var ltr=null;for(var i=0;i<coded.length;i++){if(cipher.indexOf(coded.charAt(i))==-1){ltr=coded.charAt(i);link+=(ltr)}else{ltr=(cipher.indexOf(coded.charAt(i))-shift+cipher.length)%cipher.length;link+=(cipher.charAt(ltr))}}if(sameAddress)linkname=link;if(makeLink!==false)document.write('<a class="email" href="mailto:'+link+'">'+linkname+'</a>');else document.write(linkname);return};NController.prototype.flashEmbed=function(flashPath,width,height,bgColor,quality,menu,border,transparent,flashVars,loop){var embedVar="";loop=loop==null?"true":loop;transparent=transparent==null?"transparent":transparent;border=border==null?"false":border;quality=quality==null?"high":quality;embedVar='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+flashPath+'" /><param name="flashvars" value="'+flashVars+'" /><param name="quality" value="'+quality+'" /><param name="menu" value="'+menu+'" /><param name="loop" value="'+loop+'" /><param name="bgcolor" value="'+bgColor+'" /><param name="wmode" value="'+transparent+'" /><embed src="'+flashPath+'" flashvars="'+flashVars+'" quality="'+quality+'" menu="'+menu+'" loop="'+loop+'" bgcolor="'+bgColor+'" width="'+width+'" height="'+height+'" wmode="'+transparent+'" name="'+flashPath+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';document.write(embedVar)};NController.prototype.getOffset=function(what,id){var el=document.getElementById(id);var offset=0;do{switch(what){case"left":offset+=el.offsetLeft;break;case"top":offset+=el.offsetTop;break}el=el.offsetParent}while(el);return offset};NController.prototype.getLeft=function(id){return this.getOffset('left',id)};NController.prototype.getTop=function(id){return this.getOffset('top',id)};NController.prototype.getScrollLeft=function(){return document.documentElement.scrollLeft||window.pageXOffset||0};NController.prototype.getScrollTop=function(){if(document.documentElement.scrollTop)return document.documentElement.scrollTop;else if(window.pageYOffset)return window.pageYOffset;else return 0};NController.prototype.windowWidth=function(){return window.innerWidth||document.documentElement.clientWidth||0};NController.prototype.windowHeight=function(){return window.innerHeight||document.documentElement.clientHeight||0};NController.prototype.windowScrollWidth=function(){return document.documentElement.scrollWidth};NController.prototype.windowScrollHeight=function(){return document.documentElement.scrollHeight};var controller=new NController("controller");var loader = new NLoad();NLoad.load("noJsEmail", "username");

// Textarea resizers
NAreaResizer=function(){$(window).ready(function(){$("textarea").each(function(){if(!window.parseInt($(this).css("min-width")))$(this).css("min-width",$(this).width());if(!window.parseInt($(this).css("max-width")))$(this).css("max-width",$(this).width());if(!$(this).css("resize")){var a=window.parseInt($(this).css("padding-left"))+window.parseInt($(this).css("padding-right"));var b=window.parseInt($(this).css("width"))+a;var c=window.parseInt($(this).css("height"))+window.parseInt($(this).css("padding-top"))+window.parseInt($(this).css("padding-bottom"));var d=window.parseInt($(this).css("margin-left"));var e=$('<div style="position:relative;" />');var f=$('<div style="cursor:nw-resize;width:11px;height:10px;background:url(http://www.scenografie.cz/lib/content/images/resizer.png) no-repeat;right:'+(19+a)+'px;bottom:3px;position:absolute;z-index:100;" />');$(e).css("width",b+"px");$(e).css("height",c+"px");$(e).css("margin-left",d+"px");$(e).css("margin-right",$(this).css("margin-right"));$(e).css("margin-top",$(this).css("margin-top"));$(e).css("margin-bottom",$(this).css("margin-bottom"));$(e).css("clear",$(this).css("clear"));$(this).css("margin-left","0");$(this).css("margin-right","0");$(this).css("margin-top","0");$(this).css("margin-bottom","0");$(this).css("position","absolute");$(this).css("left","0");$(this).css("resize","none");$(this).wrap(e);$(this).after(f);if($(this).css("overflow")!="auto")$(this).css("overflow-y","scroll");if($(this).css('clear') != 'both' && $(this).parent().prev("label").css("float")=="left")$(this).parent().css("margin-left",$(this).parent().prev("label").width()+window.parseInt($(this).parent().prev("label").css("padding-right"))+"px");$(f).bind("mousedown",{element:this,handle:f},function(a){$(document).bind("mousemove",{element:a.data.element},function(a){var b=a.clientX;var c=a.clientY;if(!NAreaResizer.prototype.prevMouseX)NAreaResizer.prototype.prevMouseX=b;if(!NAreaResizer.prototype.prevMouseY)NAreaResizer.prototype.prevMouseY=c;var d=window.parseInt($(a.data.element).css("min-width"));var e=window.parseInt($(a.data.element).css("max-width"));var f=window.parseInt($(a.data.element).css("min-height"));var g=window.parseInt($(a.data.element).css("max-height"));if(!window.parseInt($(a.data.element).css("min-height"))||window.parseInt($(a.data.element).css("min-height"))<0)f=NAreaResizer.prototype.minHeight;if(!window.parseInt($(a.data.element).css("max-height"))||window.parseInt($(a.data.element).css("max-height"))<0)g=NAreaResizer.prototype.maxHeight;var h=NAreaResizer.prototype.prevMouseX-b;var i=NAreaResizer.prototype.prevMouseY-c;var j=window.parseInt($(a.data.element).parent().css("width"))-h;var k=window.parseInt($(a.data.element).parent().css("height"))-i;var l=window.parseInt($(a.data.element).css("width"))-h;var m=window.parseInt($(a.data.element).css("height"))-i;var n=window.parseInt($(a.data.handle).css("right"))+h;var o=window.parseInt($(a.data.handle).css("bottom"))+i;NAreaResizer.prototype.prevMouseX=b;NAreaResizer.prototype.prevMouseY=c;if(l>d&&l<e){$(a.data.element).parent().css("width",j+"px");$(a.data.element).css("width",l+"px")}if(m>f&&m<g){$(a.data.element).parent().css("height",k+"px");$(a.data.element).css("height",m+"px")}});$(document).bind("mouseup",{handle:a.data.handle},function(a){$(document).unbind('mousemove');$(document).unbind('mouseup');NAreaResizer.prototype.prevMouseX=0;NAreaResizer.prototype.prevMouseY=0})})}})})};NAreaResizer.prototype.minHeight=50;NAreaResizer.prototype.maxHeight=1e3;NAreaResizer.prototype.prevMouseX=0;NAreaResizer.prototype.prevMouseY=0;new NAreaResizer;

// Class to change a value of input by clicking.
NDynamicInput=function(instanceName,id,className,startValue){this.instanceName=instanceName;this.element=id;this.startValue=startValue;this.className=className;$(window).ready(new Function(this.instanceName+".register()"))};NDynamicInput.prototype.register=function(){this.element=document.getElementById(this.element);var reg=new RegExp("(fulltext-phrase|searchstring)");if(this.element){this.startValue=this.element.value;if(reg.test(window.location.href)&&this.element.value&&this.element.value.toLowerCase()!='vyhledávání'&&this.element.value.toLowerCase()!='hledaný text')this.startValue='';$(this.element).focus(new Function(this.instanceName+".hide()"));$(this.element).blur(new Function(this.instanceName+".show()"))}return};NDynamicInput.prototype.hide=function(){if(this.element&&this.element.value==this.startValue){$(this.element).addClass(this.className);this.element.value=""}return};NDynamicInput.prototype.show=function(){if(this.element&&this.element.value==""){$(this.element).removeClass(this.className);this.element.value=this.startValue}return};NDynamicInput.prototype.submit=function(){if(this.element&&this.element.value==this.startValue){this.element.focus();return false}else return true};var nameInput=new NDynamicInput("nameInput","name","");var emailInput=new NDynamicInput("emailInput","email","");var phoneInput=new NDynamicInput("phoneInput","phone","");var messageInput=new NDynamicInput("messageInput","message","");

// Seznam map
NMap=function(instanceName,mapId,mapLinkId){this.instanceName=instanceName;this.mapId=mapId;this.mapLinkId=mapLinkId;this.element=null;this.map=null;this.coordinates=null;this.mark=null;this.card=null;this.poiLayer=null;this.pois=null;this.marks=new Array();this.lang='cs';this.cardContent={obsah:[{title:'Initiative Media Prague s.r.o.:',cont:'Chrudimská 2526/2a<br />130 00 Praha 3'},{cont:''}]};this.cardContent2={obsah:[{title:'',cont:'Stanice metra A &bdquo;Flora&ldquo;.'},{cont:''}]};this.metro=[['Dejvická A','50°6\'1.248"N','14°23\'38.843"E'],['Hradcanská A','50°5\'50.616"N','14°24\'18.373"E'],['Malostranská A','50°5\'27.421"N','14°24\'34.335"E'],['Staromestská A','50°5\'18.575"N','14°24\'57.896"E'],['Mustek A/B','50°4\'56.99"N','14°25\'32.079"E'],['Muzeum A/C','50°4\'47.152"N','14°25\'46.732"E'],['Námestí Míru A','50°4\'30.539"N','14°26\'12.537"E'],['Jirího z Podebrad A','50°4\'39.169"N','14°26\'55.999"E'],['Flora A','50°4\'41.09"N','14°27\'41.151"E'],['Želivského A','50°4\'43.258"N','14°28\'24.933"E'],['Strašnická A','50°4\'22.248"N','14°29\'28.968"E'],['Skalka A','50°4\'5.718"N','14°30\'31.142"E'],['Depo Hostivar A','50°4\'35.19"N','14°30\'57.64"E'],['Cerný Most B','50°6\'32.125"N','14°34\'37.931"E'],['Rajská zahrada B','50°6\'24.305"N','14°33\'38.699"E'],['Hloubetín B','50°6\'24.163"N','14°32\'15.305"E'],['Kolbenova B','50°6\'36.715"N','14°30\'54.55"E'],['Vysocanská B','50°6\'37.512"N','14°30\'5.876"E'],['Ceskomoravská B','50°6\'22.596"N','14°29\'34.056"E'],['Palmovka B','50°6\'12.443"N','14°28\'22.004"E'],['Invalidovna B','50°5\'50.343"N','14°27\'53.447"E'],['Križíkova B','50°5\'36.337"N','14°27\'6.634"E'],['Florenc B/C','50°5\'27.483"N','14°26\'22.263"E'],['Námestí Republiky B','50°5\'16.574"N','14°25\'44.512"E'],['Mustek B/A','50°5\'2.596"N','14°25\'24.407"E'],['Národní trída B','50°4\'53.778"N','14°25\'12.33"E'],['Karlovo námestí B','50°4\'32.542"N','14°25\'6.29"E'],['Andel B','50°4\'17.892"N','14°24\'13.616"E'],['Smíchovské nádraží B','50°3\'41.398"N','14°24\'31.443"E'],['Radlická B','50°3\'29.701"N','14°23\'20.3"E'],['Jinonice B','50°3\'16.133"N','14°22\'15.977"E'],['Nové Butovice B','50°3\'2.758"N','14°21\'9.772"E'],['Hurka B','50°2\'59.399"N','14°20\'30.631"E'],['Lužiny B','50°2\'40.844"N','14°19\'53.794"E'],['Luka B','50°2\'43.903"N','14°19\'18.821"E'],['Stodulky B','50°2\'48.898"N','14°18\'30.178"E'],['Zlicín B','50°3\'14.871"N','14°17\'26.265"E'],['Ládví C','50°7\'36.083"N','14°28\'8.409"E'],['Kobylisy C','50°7\'27.992"N','14°27\'21.076"E'],['Nádraží Holešovice C','50°6\'35.168"N','14°26\'22.823"E'],['Vltavská C','50°5\'57.424"N','14°26\'18.905"E'],['Florenc C/B','50°5\'27.483"N','14°26\'22.263"E'],['Hlavní nádraží C','50°4\'59.362"N','14°26\'1.617"E'],['Muzeum C/A','50°4\'47.152"N','14°25\'46.732"E'],['I. P. Pavlova C','50°4\'32.548"N','14°25\'49.219"E'],['Vyšehrad C','50°3\'46.35"N','14°25\'50.429"E'],['Pražského povstání C','50°3\'21.711"N','14°26\'4.515"E'],['Pankrác C','50°3\'3.207"N','14°26\'22.425"E'],['Budejovická C','50°2\'39.997"N','14°26\'56.77"E'],['Kačerov C','50°2\'30.64"N','14°27\'35.836"E'],['Roztyly C','50°2\'14.375"N','14°28\'39.847"E'],['Chodov C','50°1\'51.114"N','14°29\'27.087"E'],['Opatov C','50°1\'41.284"N','14°30\'30.746"E'],['Háje C','50°1\'49.634"N','14°31\'34.681"E']];$(window).load(new Function(this.instanceName+".register()"))};NMap.prototype.makeMetro=function(zoom){var coordinates=null;var point=null;this.pois={source:'',data:[]};this.poiLayer=new SZN.MapEngine.MapLayers.PoiLayer('metro',false,1,this.pois,null);if(!zoom)zoom=10;if(this.map.zoomGet()>zoom){this.map.addLayer(this.poiLayer);for(var i=0;i<this.metro.length;i++){coordinates=this.map.wgsToPP(this.metro[i][1],this.metro[i][2]);point=new SZN.Visual.BaseMapIcon(coordinates.x,coordinates.y,19,13,0,0,'http://www.scenografie.cz/lib/content/images/metro.gif','',this.metro[i][0]);this.pois.data.push(point)}}return this.map.setMove(1,0)};NMap.prototype.run=function(){this.markClick=null;this.element=document.getElementById(this.mapId);if(!this.map&&this.element&&SZN&&SZN.isSupported){window.eval(this.specialPreFunction);if(!this.mouseSet)this.mouseSet=7;if(!this.enableSelection)this.enableSelection=1;if(!this.zoomSet)this.zoomSet=15;this.element.innerHTML='';this.map=new SZN.MapEngine(this.element);this.map.mouseSet(this.mouseSet);this.map.enableSelection(this.enableSelection);this.map.zoomSet(this.zoomSet);if(this.center){this.coordinates=this.map.wgsToPP(this.center.x,this.center.y);this.map.setCenter(this.coordinates.x,this.coordinates.y)}if(this.marks){for(var i=0;i<this.marks.length;i++){this.marks[i].mark=this.map.makeMark("company",this.marks[i].title,(i+1),"mark");if(this.marks[i].click){eval("this.marks[i].clickFunction = function (eventListener, element, mark) {var cardData = {obsah: [{title: '"+this.marks[i].name+"', cont: '"+this.marks[i].content+"'}, {cont: ''}]}; var crd = new SZN.Visual.BaseCard("+this.instanceName+".marks["+i+"].mark.pos.x, "+this.instanceName+".marks["+i+"].mark.pos.y, cardData, null, null, null);	"+this.instanceName+".map.addCard(crd);}");this.marks[i].mark.setAction(window,this.marks[i].clickFunction)}this.coordinates=this.map.wgsToPP(this.marks[i].x,this.marks[i].y);this.map.addMark(this.coordinates.x,this.coordinates.y,this.marks[i].mark)}}if(this.northRuler)this.map.setNorthRuler(1);if(this.scaleRuler)this.map.setScaleRuler(1);if(this.controls){var layoutBox=this.map.getDefaultLayoutBox();var moveControl=new SZN.Visual.MoveControl();var move=this.map.addControls(moveControl,layoutBox,10,12);var zoomControl=new SZN.Visual.ZoomControl('full');var pos=this.map.getControlById(move).getSize().height+17;this.map.addControls(zoomControl,layoutBox,25,pos)}if(this.showMetro)this.map.apiHandler.addApiListener(window,"mapInited",new Function(this.instanceName+".makeMetro()"));this.map.init();if(this.showCard){if(this.showCardIndex<0||this.showCardIndex>this.marks.length)this.showCardIndex=0;window.setTimeout(this.marks[this.showCardIndex].clickFunction,0)}window.eval(this.specialPostFunction);if(this.showMetro)this.makeMetro()}return};

// Functions for eshop module.
NEshop=function(instanceName,formId){this.instanceName=instanceName;this.formId=formId;this.message='';this.firstNameError='';this.lastNameError='';this.emailError='';this.wrongEmailError='';this.wrongPhoneError='';this.addressError='';this.cityError='';this.placeError='';this.cashValue=null;this.cashText=null;var trafficElement=document.getElementById("traffic-send");var paymentElement=document.getElementById("payment-cashless");if(trafficElement&&!trafficElement.checked)document.getElementById("traffic-send-type").disabled=true;if(paymentElement&&!paymentElement.checked)document.getElementById("payment-cashless-type").disabled=true;$("form#"+this.formId+" [name=recalculate]").click(function(){var element=document.getElementById("custinfoForm");if(element)element.onsubmit=""})};NEshop.prototype.configure=function(firstNameError,lastNameError,emailError,wrongEmailError,wrongPhoneError,addressError,cityError,placeError){this.element=document.getElementById(this.formId);this.firstNameError=firstNameError;this.lastNameError=lastNameError;this.emailError=emailError;this.wrongEmailError=wrongEmailError;this.wrongPhoneError=wrongPhoneError;this.addressError=addressError;this.cityError=cityError;this.placeError=placeError;this.cz=50;var cashElement=document.getElementById('cash-on-delivery');var sendElement=document.getElementById("traffic-send");if(cashElement){this.cashValue=cashElement.value;this.cashSelected=cashElement.selected;this.cashText=$(cashElement).text();if(sendElement&&sendElement.checked==false)$(cashElement).remove()}if(document.getElementById("traffic-personal"))$(document.getElementById("traffic-personal")).click(new Function(this.instanceName+".payPersonal()"));if(document.getElementById("traffic-send"))$(document.getElementById("traffic-send")).click(new Function(this.instanceName+".sendPost()"));if(document.getElementById("payment-cash"))$(document.getElementById("payment-cash")).click(new Function(this.instanceName+".payCash()"));if(document.getElementById("payment-cashless"))$(document.getElementById("payment-cashless")).click(new Function(this.instanceName+".enabledCashlessType()"));if(document.getElementById("payment-cashless-type"))$(document.getElementById("payment-cashless-type")).click(new Function("document.getElementById('payment-cashless').checked = true"));if(document.getElementById("traffic"))$("#traffic").change(new Function(this.instanceName+".countryDelivery()"));return};NEshop.prototype.countryDelivery=function(){if($("#traffic").val()==this.cz)this.addDelivery();else this.removeDelivery()};NEshop.prototype.addDelivery=function(){var cashElement=document.getElementById('payment-cashless-type');var cashOptionOld=document.getElementById('cash-on-delivery');var cashOption=document.createElement('option');if(!cashOptionOld){$(cashOption).text(this.cashText);cashOption.value=this.cashValue;cashOption.id='cash-on-delivery';if(this.cashSelected)cashOption.selected=true;cashElement.insertBefore(cashOption,cashElement.firstChild)}};NEshop.prototype.removeDelivery=function(){var cashElement=document.getElementById('cash-on-delivery');if(cashElement){this.cashSelected=cashElement.selected;$(cashElement).remove()}};NEshop.prototype.validateCustinfo=function(){this.message='';if(this.element){if(!this.message&&this.element.firstName.value=="")this.message=this.firstNameError;if(!this.message&&this.element.lastName.value=="")this.message=this.lastNameError;if(!this.message&&this.element.email.value=="")this.message=this.emailError;else if(!this.message&&this.element.email.value.search(/^[a-zA-Z0-9_\.-]+@[a-zA-Z0-9_\.-]+\.[a-zA-Z0-9_\.-]{1,4}/)<0)this.message=this.wrongEmailError;if(!this.message&&this.element.phone.value&&this.element.phone.value.search(/^[+]?[0-9 ]{1,18}$/)<0)this.message=this.wrongPhoneError;if(!this.message&&this.element.address&&this.element.address.value=="")this.message=this.addressError;if(!this.message&&this.element.city&&this.element.city.value=="")this.message=this.cityError;if(!this.message&&this.element.place&&this.element.place.value=="")this.message=this.placeError}if(this.message){window.alert(this.message);return false}else return true};NEshop.prototype.confirmAction=function(message,url){temp=window.confirm(message);if(temp)window.location=url;return temp};NEshop.prototype.payCash=function(){document.getElementById('traffic-send-type').disabled=true;document.getElementById('traffic-personal').checked=true;document.getElementById('payment-cash').disabled=false;document.getElementById('payment-cashless-type').disabled=true;return};NEshop.prototype.sendPost=function(){document.getElementById('payment-cash').disabled=true;document.getElementById('payment-cashless').checked=true;document.getElementById('traffic-send-type').disabled=false;var cashElement=document.getElementById('payment-cashless-type');var cashOptionOld=document.getElementById('cash-on-delivery');var cashOption=document.createElement('option');if($("#traffic").val()==this.cz)this.addDelivery();cashElement.disabled=false;return};NEshop.prototype.payPersonal=function(){document.getElementById('traffic-send-type').disabled=true;document.getElementById('traffic-personal').checked=true;document.getElementById('payment-cash').disabled=false;document.getElementById('payment-cashless-type').disabled=false;this.removeDelivery();return};NEshop.prototype.enabledCashlessType=function(){return document.getElementById('payment-cashless-type').disabled=false};var formEl=null;function disabledVariations(sendEl){var reg=new RegExp("^variation");var selects=new Array();var variation="";var productId=0;var counter=0;var id=0;formEl=sendEl.parentNode;while(formEl.nodeName.toLowerCase()!="form"&&formEl)formEl=formEl.parentNode;if(formEl){selects=$(formEl).find("select");for(var i=0;i<selects.length;i++){if(reg.test(selects[i].name)){if(counter)variation+="|";id=selects[i].name.replace("variation","").split("-");productId=id[0];variation+=id[1]+"-"+$(selects[i]).val();counter++}}}$("#loading-dialog").dialog("open");$.ajax({type:"POST",url:'http://www.scenografie.cz/modules/eshop/disabledVariations.php',data:"ajax-page-request=1&productId="+productId+"&variation="+variation,complete:function(request){if(request.responseText=="ok"){$("#loading-dialog").dialog("close");$("#saving-cart-dialog").dialog("open");formEl.submit()}else{$("#loading-dialog").dialog("close");$("#variation-dialog").dialog("open")}}});return false}$(window).ready(function(){if(document.getElementById("variation-dialog")){$("#variation-dialog").css("text-align","left");$("#variation-dialog").dialog({autoOpen:false,bgiframe:true,modal:true,buttons:{Ok:function(){$(this).dialog('close')}}});$("#saving-cart-dialog").css("text-align","left");$("#saving-cart-dialog").dialog({autoOpen:false,bgiframe:true,modal:true,buttons:{}});$("#loading-dialog").dialog({autoOpen:false,bgiframe:true,modal:true,buttons:{}})}$(".eshop-item-count").keypress(function(event){if(!event)event=window.event;if(typeof(event)=='undefined')return;var keyCode=event.charCode?event.charCode:event.keyCode;if(event.altKey||event.ctrlKey||keyCode==8||keyCode==9||keyCode==13)return;if(!(keyCode<58&&keyCode>47)){if(event.preventDefault)event.preventDefault();event.returnValue=false;event.cancel=true}})});

$(window).ready(function()
{var el=document.getElementById("startCalendar");if(el)
el.style.display="none";el=document.getElementById("finalCalendar");if(el)
el.style.display="none";$(".sell-up").click(function()
{var parentElement=$(this).parent().get(0);var inputElement=$(parentElement).find("input")[0];var oldValue=$(inputElement).attr("value");oldValue++;$(inputElement).attr("value",oldValue);});$(".let-up").click(function()
{var parentElement=$(this).parent().get(0);var inputElement=$(parentElement).find("input")[0];var oldValue=$(inputElement).attr("value");oldValue++;$(inputElement).attr("value",oldValue);});$("p.product-submit input").click(function()
{var submitElements=$("p.product-submit input");var sellElements=$(".price-sell input.text");var letElements=$(".price-let input.text");var sellElementsHidden=$(".price-sell input.hidden");var letElementsHidden=$(".price-let input.hidden");var hasSell=true;for(var i=0;i<sellElements.length;i++)
{if(submitElements[i].id!=this.id)
{$(sellElements[i]).attr("value",0);$(sellElementsHidden[i]).attr("value",0);}
else if($(sellElements[i]).attr("value")==0)
{if($(sellElements[i]).attr("type")=="hidden")
hasSell=false;else
$(sellElements[i]).attr("value",1);}}
for(var i=0;i<letElements.length;i++)
{if(submitElements[i].id!=this.id)
{$(letElements[i]).attr("value",0);$(letElementsHidden[i]).attr("value",0);}
else if(!hasSell&&$(letElements[i]).attr("value")==0)
$(letElements[i]).attr("value",1);}});});Cart=function(sellIdentifier,letIdentifier)
{this.sellIdentifier=sellIdentifier;this.letIdentifier=letIdentifier;this.message="Nebylo přidáno žádné zboží.";}
Cart.prototype.controlContent=function()
{var sellElements=$(this.sellIdentifier);var letElements=$(this.letIdentifier);var totalProducts=0;for(var i=0;i<sellElements.length;i++)
if(parseInt($(sellElements[i]).attr("value")))
totalProducts+=parseInt($(sellElements[i]).attr("value"));for(var i=0;i<letElements.length;i++)
if(parseInt($(letElements[i]).attr("value")))
totalProducts+=parseInt($(letElements[i]).attr("value"));if(!totalProducts)
{window.alert(this.message);return false;}
else
return true;}
Cart.prototype.showCalendar=function(id,linkElement)
{var element=document.getElementById(id);if(element)
{if(element.style.display=="block")
{element.style.display="none";$(linkElement).text("Zobrazit kalendář");}
else
{element.style.display="block";$(linkElement).text("Skrýt kalendář");}}
return false;}
$(window).ready(function()
{$(".items-per-page-submit").css("display","none");$(".items-per-page").change(function()
{if(this.parentNode.nodeName.toLowerCase()=="form")
$(this.parentNode).submit();else if(this.parentNode.parentNode.nodeName.toLowerCase()=="form")
$(this.parentNode.parentNode).submit();});$("#showr").css('display','none');$("#build").change(function(){var displayed=$("#showr").css('display');if(displayed=='none')
$("#showr").css('display','inline');else
$("#showr").css('display','none');});$(function(){$("a.blank").click(function(){window.open(this.href);return false;});});});var cart=new Cart(".price-sell input.text",".price-let input.text");
function Is()
{var agt=navigator.userAgent.toLowerCase();this.ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1))?1:0;this.dom=document.getElementById?1:0;this.ie4=(document.all&&!this.dom)?1:0;this.ns4=(document.layers&&!this.dom)?1:0;return this;}
var clndr_wnames=new Array('Po','Út','St','Čt','Pá','So','Ne');var is=new Is();if(is.ns4){var regSurnames=/^[ ]*[a-z]+[ ]*[a-z]+[ a-z]*$/i;var regNames=/^[ ]*[a-z]+[ a-z]*$/i;var regInfSurnames=/^[ ]*[a-z]{2,}[ ]*$/i;var regInfNames=/^[ ]*[a-z]{1,}[ ]*$/i;var regContact=/^[ ]*[a-z0-9,.:_"\'()&#*+\/-]+[ a-z0-9,.:_"\'()&#*+\/-]*$/i;}
else
{var charAllowed=' -ſ';var regSurnames=new RegExp("^[ ]*[a-z"+charAllowed+"]+[ ]*[a-z"+charAllowed+"]+[ a-z"+charAllowed+"]*$","i");var regNames=new RegExp("^[ ]*[a-z"+charAllowed+"]+[ a-z"+charAllowed+"]*$","i");var regInfSurnames=new RegExp("^[ ]*[a-z"+charAllowed+"]{2,}[ ]*$","i");var regInfNames=new RegExp("^[ ]*[a-z"+charAllowed+"]{1,}[ ]*","i");var regContact=new RegExp("^[ ]*[a-z"+charAllowed+"0-9,.:_\"'()&#\/*+-]+[ a-z"+charAllowed+"0-9,.:_\"'()&#\/*+-]*$","i");}
function getElement(form,elName)
{var el;if(!form||!elName||(elName==''))
return false;eval('el = form.'+elName+';');if(!el)
return false;return el;}
function getFormByName(formName)
{var el;if(is.dom)
return document.getElementsByName(formName)[0];else
return document.forms[formName];}
function getCombo(Ctrl,elName)
{var el;if(!Ctrl)
return false;if(!elName)
return false;eval("el = Ctrl."+elName);if(!el)
return false;if(!el||!el.options)
return false;return el.options[el.selectedIndex].value;}
function setRadio(name,wanted,unwanted)
{elm=document.getElementsByName(name);if(!elm||!elm.length)
return;if(unwanted&&unwanted.length)
{for(var k=0;k<elm.length;k++)
if(elm[k].value==unwanted&&elm[k].checked)
return setRadio(name,wanted);}
else
{for(var k=0;k<elm.length;k++)
{if(elm[k].value==wanted)
{elm[k].checked=true;return true;}}}
return false;}
function setCssClass(elem,cssClassName)
{var elm;if(!is.dom)
return false;elm=document.getElementById(elem);if(elm)
{elm.className=cssClassName;return true;}
else
return false;}
function postSelection(el,status,name,index,cssClassName)
{swapImages(el,status);if(status&&lastSelected&&lastSelected[index])
{setCssClass(lastSelected[index],'odd');setCssClass(lastSelected[index]+"ln",'odd');setCssClass(lastSelected[index]+"_0",'odd');setCssClass(lastSelected[index]+"_1",'odd');var i=1;while(setCssClass(lastSelected[index]+"_rules_"+i+"_1",'odd'))
{setCssClass(lastSelected[index]+"_rules_"+i+"_2",'odd');i++;}}
setCssClass(name,(status)?cssClassName:'odd');setCssClass(name+"ln",(status)?cssClassName:'odd');setCssClass(name+"_0",(status)?cssClassName:'odd');setCssClass(name+"_1",(status)?cssClassName:'odd');var j=1;while(setCssClass(name+"_rules_"+j+"_1",(status)?cssClassName:'odd'))
{setCssClass(name+"_rules_"+j+"_2",(status)?cssClassName:'odd');j++;}
if(index!==null)
lastSelected[index]=name;}
function notExpired(month,year)
{var now=getServerNow();if(year<now.getFullYear())
return false;if(year==now.getFullYear())
if(month<(now.getMonth()+1))
return false;return true;}
function IsLeapYear(y)
{return(0==y%4&&((y%100!=0)||(y%400==0)));}
function DayEnd(mes,rok)
{mes-=1;var pocet_dni=new Array(31,28,31,30,31,30,31,31,30,31,30,31);if((typeof pocet_dni[mes]=='undefined')||(pocet_dni[mes]=='undefined'))
return 0;return((IsLeapYear(rok))&&(mes==1))?29:pocet_dni[mes];}
function checkConfirm(form,message)
{if(typeof confirmName=='undefined')
return true;var val=getRadio(form,confirmName);if(!val||!val.length)
{alert(message);return false;}
return true;}
function clearContent(id,obj){var x;if(!id&&obj)x=obj;else if(id)x=document.getElementById(id);if(x)
{if(x.value)
{if((x.value.substring(0,1)=='\u00A0')||(x.value.substring(0,1)==' '))
{x.value='';return true;}}}
return null;}
function checkBirthDates(day,month,year,min,max)
{var depDay,depMonth,depYear,i;if(departureDates&&departureDates.length)
{for(i=0;i<departureDates.length;i++)
if(!checkBirthDate(day,month,year,min,max,departureDates[i]))
return false;return true;}
else
return checkBirthDate(day,month,year,min,max,departureDate);}
function checkBirthDate(day,month,year,min,max,depDate)
{var depDay=depDate.substr(0,2);var depMonth=depDate.substr(2,2);var depYear=depDate.substr(4,2);var year1=parseInt(year,10)+min;var year3=parseInt(year,10)+max;var stamp1=new Date(year3,parseInt(month,10)-1,day);var stamp2=new Date(2000+parseInt(depYear,10),parseInt(depMonth,10)-1,depDay);var stamp3=new Date(year1,parseInt(month,10)-1,day);return((stamp3<=stamp2)&&(stamp2<stamp1));}
function fullnameLength(surname,firstname,title)
{var fullname=""+surname+"/"+firstname+""+title;return(fullname.length<=27);}
function getServerNow()
{return new Date(serverNow.getFullYear(),serverNow.getMonth(),serverNow.getDate(),serverNow.getHours(),serverNow.getMinutes(),serverNow.getSeconds());}
function getElementValue(Ctrl,elName)
{var el;if(!Ctrl)
return false;if(!elName)
return false;eval("el = Ctrl."+elName);if(!el)
return false;if(el.type=='text')
return el.value;if(el.options)
return el.options[el.selectedIndex].value;if(!el.length&&el.checked==1)
return el.value
else
for(z=0;z<el.length;z++)
if(el[z].checked)return el[z].value;}
function encodeURIComponentFull(text)
{var reg;text=encodeURIComponent(text);reg=new RegExp('\\x2d','gm');text=text.replace(reg,'%2D');reg=new RegExp('\\x5f','gm');text=text.replace(reg,'%5F');reg=new RegExp('\\x2e','gm');text=text.replace(reg,'%2E');reg=new RegExp('\\x21','gm');text=text.replace(reg,'%21');reg=new RegExp('\\x7e','gm');text=text.replace(reg,'%7E');reg=new RegExp('\\x2a','gm');text=text.replace(reg,'%2A');reg=new RegExp('\\x27','gm');text=text.replace(reg,'%27');reg=new RegExp('\\x28','gm');text=text.replace(reg,'%28');reg=new RegExp('\\x29','gm');text=text.replace(reg,'%29');return text;}
var calendars=new Array();function createCalendar(idx,divName,monthElementName,url,year,month,day,unavailable,divName2)
{var click_url,link,field,css;if(!year)
year=guessYear(day,month);var date_x=new Date(year,month-1,day);var date_now=getServerNow();if(date_x.getTime()<date_now.getTime())
{day=date_now.getDate();month=date_now.getMonth()+1;year=date_now.getFullYear();click_url=url;field=click_url.replace(/.*'([^']+)'.*/,'$1');eval("document.forms['"+formName+"']."+field+".value = day;");}
if(calendars[idx+1]!=undefined&&calendars[idx+1].length)
{var date_1=new Date(year,month-1,day);var date_2=new Date(calendars[idx+1][2],calendars[idx+1][3]-1,calendars[idx+1][4]);if(date_1.getTime()>date_2.getTime())
{createCalendar(idx+1,divName2,calendars[idx+1][6],calendars[idx+1][1],year,month,day,unavailable,divName);click_url=calendars[idx+1][1];field=click_url.replace(/.*'([^']+)'.*/,'$1');changeDate(idx+1,field,day,true);changeMonth(idx+1,calendars[idx+1][6],month);changeYear(idx+1,depYearSelName[idx+1],year);}}
calendars[idx]=new Array(divName,url,year,month,day,unavailable,monthElementName,divName2);var out="<table class='calendar'>";var monthStart=new Date(year,month-1,1);var index=(monthStart.getDay()+6)%7;out+="<tr>";for(var k=0;k<7;k++)
out+="<th>"+clndr_wnames[k]+"</th>";out+="</tr>";out+="<tr>";for(k=0;k<index;k++)
out+="<td>&nbsp;</td>";for(var d=1;d<=31;d++)
{if(d>DayEnd(month,year))
break;if(k++%7==0)
{k=1;out+="</tr><tr>";}
css='';if(d==day)
css=' class="active"';else if(k>5)
css=' class="vacation"';else
css='';link='';if(unavailable[d]==null)
link=url.replace(/calendarDay/,d);else
css=' class="unavailable"';if(link.length>0)
out+="<td"+css+"><a href=\""+link+"\">"+d+"</a></td>";else
out+="<td"+css+">"+d+"</td>";}
for(;k<7;k++)
out+="<td>&nbsp;</td>";out+="</tr>";out+="</table>";var el=document.getElementById(divName);if(el)
el.innerHTML=out;}
function guessYear_old(day,month)
{var today=getServerNow();day=parseInt(day,10);month=parseInt(month,10);if(month>today.getMonth()+1)
return today.getFullYear();else
{if(month==today.getMonth()+1)
{if(day>=today.getDate())
return today.getFullYear();else
return(today.getFullYear()+1);}
else
return(today.getFullYear()+1);}}
function guessYear(day,month)
{var today=getServerNow();day=parseInt(day,10);month=parseInt(month,10);if(month>=today.getMonth()+1)
return today.getFullYear();else
return(today.getFullYear()+1);}
function changeDate(idx,field,val,nodraw)
{eval("document.forms['"+formName+"']."+field+".value = val;");var c=calendars[idx];if(!nodraw)
return createCalendar(idx,c[0],c[6],c[1],c[2],c[3],val,c[5],c[7]);else
return;}
function changeMonth(idx,field,val)
{var el,x,i;el=getElement(getFormByName(formName),field);for(x in depMonthNameOptions[idx]){if(depMonthNameOptions[idx][x]==val)break;}
for(i=0;i<el.options.length;i++){if(el.options[i].value==x){el.selectedIndex=i;break;}}
return;}
function changeYear(idx,field,val)
{var el,x,i;el=getElement(getFormByName(formName),field);for(i=0;i<el.options.length;i++){if(el.options[i].value==val){el.selectedIndex=i;break;}}
return;}
function checkDay(value)
{value=new String(value);return(value.search(regnum)==-1)?false:true;}
function getWholeDate(monthStr,dayStr)
{var month=parseInt(monthStr,10)-1;var day=parseInt(dayStr,10);var today=getServerNow();var today_midnight=Date.UTC(today.getFullYear(),today.getMonth(),today.getDate(),0,0,0);var guess_midnight=Date.UTC(today.getFullYear(),month,day,0,0,0);var year=(guess_midnight>=today_midnight)?today.getFullYear():today.getFullYear()+1;var date=new Date(year,month,day,0,0,0);return date;}
function classDate_parse(textDT,format)
{var pole,i,x,y;var cas=new Array(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds());if(!format)
format='Y-m-d H:i:s';var p=new RegExp('[^a-zA-Z]+','g');format=format.replace(p,'');p=new RegExp('[^0-9a-zA-Z]+');pole=textDT.split(p);for(i=0;((i<format.length)&&(i<pole.length));i++)
{x=format.substr(i,1);if(!isNaN(pole[i]))
{if(x=='d')
cas[2]=pole[i];else if(x=='j')
cas[2]=pole[i];else if(x=='m')
cas[1]=pole[i]-1;else if(x=='n')
cas[1]=pole[i]-1;else if(x=='Y')
cas[0]=pole[i];else if(x=='H')
cas[3]=pole[i];else if(x=='G')
cas[3]=pole[i];else if(x=='i')
cas[4]=pole[i];else if(x=='s')
cas[5]=pole[i];else if(x=='g')
cas[3]=pole[i];else if(x=='h')
cas[3]=pole[i];else if(x=='w');else return(false);}
else
{if(x=='F')
{for(y=0;y<12;y++)
if(this.mnames[y]==pole[i])
cas[1]=y;}
else if(x=='M')
{for(y=0;y<12;y++)
if(this.msnames[y]==pole[i])
cas[1]=y;}
else if(x=='a')
{if((pole[i]=='pm')&&(cas[3]<12))
cas[3]+=12;else if((pole[i]=='am')&&(cas[3]>=12))
cas[3]-=12;}
else if(x=='A')
{if((pole[i]=='PM')&&(cas[3]<12))
cas[3]+=12;else if((pole[i]=='AM')&&(cas[3]>=12))
cas[3]-=12;}
else
return(false);}}
var xx=this.checkDate(cas);if(xx==false)
return(false);this.setTime(xx);return(true);}
function classDate_checkDate(pole)
{if(!pole||!(pole instanceof Array))
return(false);if((pole[5]<0)||(pole[5]>59))
return(false);if((pole[4]<0)||(pole[4]>59))
return(false);if((pole[3]<0)||(pole[3]>23))
return(false);var xx=new Date(pole[0],pole[1],pole[2],pole[3],pole[4],pole[5]);if(xx.getFullYear()!=pole[0])
return(false);if(xx.getMonth()!=pole[1])
return(false);if(xx.getDate()!=pole[2])
return(false);return(xx.getTime());}
function classDate_isLeapYear()
{if(0==this.getFullYear()%4&&((this.getFullYear()%100!=0)||(this.getFullYear()%400==0)))
return(true);return(false);}
function classDate_getDaysOfMonths()
{var daysOfMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);if(this.isLeap())
daysOfMonth[1]=29;return(daysOfMonth);}
function classDate_getDaysOfMonth()
{var daysOfMonths=this.getDaysOfMonths();return(daysOfMonths[this.getMonth()]);}
function classDate_addDay(num)
{if(!num)
num=1;var newDay=this.getTime()+(num*24*60*60*1000);this.setTime(newDay);}
function classDate_subDay(num)
{if(!num)
num=1;var newDay=this.getTime()-(num*24*60*60*1000);this.setTime(newDay);}
function classDate_format(format)
{var i,x,y;var out=new String();if(!format)
format='Y-m-d H:i:s';for(i=0;i<format.length;i++)
{x=format.substr(i,1);if(x=='a')
{if(this.getHours()>11)
out+='pm';else
out+='am';}
else if(x=='A')
{if(this.getHours()>11)
out+='PM';else
out+='AM';}
else if(x=='c');else if(x=='d')
{if(this.getDate()<10)
out+='0';out+=this.getDate();}
else if(x=='D')
out+=this.wsnames[this.getDay()];else if(x=='F')
out+=this.mnames[this.getMonth()];else if(x=='g')
{if(this.getHours()>12)
out+=(this.getHours()-12);else if(this.getHours()==0)
out+='12';else
out+=this.getHours();}
else if(x=='G')
out+=this.getHours();else if(x=='h')
{if(this.getHours()>21)
out+=(this.getHours()-12);else if(this.getHours()>12)
out+='0'+(this.getHours()-12);else if(this.getHours()==0)
out+='12';else if(this.getHours()<10)
out+='0'+this.getHours();else
out+=this.getHours();}
else if(x=='H')
{if(this.getHours()<10)
out+='0';out+=this.getHours();}
else if(x=='i')
{if(this.getMinutes()<10)
out+='0';out+=this.getMinutes();}
else if(x=='I');else if(x=='j')
out+=this.getDate();else if(x=='l')
out+=this.wnames[this.getDay()];else if(x=='L')
{if(this.isLeap())
out+='1';else
out+='0';}
else if(x=='m')
{if(this.getMonth()<9)
out+='0';out+=(this.getMonth()+1);}
else if(x=='M')
out+=this.msnames[this.getMonth()];else if(x=='n')
out+=(this.getMonth()+1);else if(x=='O');else if(x=='r')
out+=this.getVal('D, d M Y H:i:s O');else if(x=='s')
{if(this.getSeconds()<10)
out+='0';out+=this.getSeconds();}
else if(x=='t')
out+=this.daysOfMonth();else if(x=='T');else if(x=='w')
out+=this.getDay();else if(x=='W');else if(x=='Y')
out+=this.getFullYear();else if(x=='y')
{y=new String('aa00'+this.getFullYear());out+=y.substr(y.length-2,2);}
else if(x=='z');else if(x=='Z');else
out+=x;}
return(out);}
function classDate_formatPresentation(format)
{var i,x;var out=new String();if(!format)
format='Y-m-d H:i:s';for(i=0;i<format.length;i++)
{x=format.substr(i,1);if(x=='a')
out+='am/pm';else if(x=='A')
out+='AM/PM';else if(x=='d')
out+='DD';else if(x=='j')
out+='DD';else if(x=='m')
out+='MM';else if(x=='n')
out+='MM';else if(x=='Y')
out+='YYYY';else if(x=='H')
out+='hh';else if(x=='G')
out+='hh';else if(x=='i')
out+='mm';else if(x=='s')
out+='ss';else if(x=='g')
out+='hh';else if(x=='h')
out+='hh';else if(x=='F')
out+='MMMM';else if(x=='M')
out+='MMM';else
out+=x;}
return(out);}
function calendarRun(id,title,mindate,maxdate,holidays,styles,callBack)
{var r;calendar_close();calendar_window=window.open('about:blank','calendar_window',"location=no, menubar=no, resizable=no, scrollbars=no, status=no, directories=no, toolbar=no, width=186,height=146,left="+Math.floor((screen.width-196)/2)+",top="+Math.floor((screen.height-175)/2));openedCalendar=calendar_window;calendar_DT=new Date();calendar_holidays=new Array();if(!holidays)
holidays=new Array();for(i=0;i<holidays.length;i++)
{if(holidays[i].charAt(holidays[i].length-1)==".")
calendar_holidays[i]=holidays[i].substring(0,holidays[i].length-1);else
calendar_holidays[i]=holidays[i];}
if(mindate instanceof Date)
calendar_mindate=mindate;else
{calendar_mindate=new Date();calendar_mindate.setVal(mindate+' 00:00:00');}
if(maxdate instanceof Date)
calendar_maxdate=maxdate;else
{calendar_maxdate=new Date();calendar_maxdate.setVal(maxdate+' 23:59:59');}
if(!title)
calendar_title=encodeURIComponentFull('Kalendář');else
calendar_title=title;calendar_id=id;if(callBack)
calendar_callback=callBack;else
calendar_callback='';if(!styles)
calendar_styles="<link href=\"css/calendar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";else
calendar_styles=decodeURIComponent(styles);if((r=document.getElementById(id))&&(r.value!=''))
calendar_DT.setVal(r.value);window.onfocus=calendar_close;calendar_Runtime();}
function calendar_Runtime()
{var i,pd,bm,yr,ho,row;var mnames=new Array('Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Prosinec');var wnames=new Array('Po','Út','St','Čt','Pá','So','Ne');var cal_document=calendar_window.document;var Larrow='&#x00ab;';var Rarrow='&#x00bb;';cal_document.open();cal_document.write("<html>\n<head>\n");if(document.all)
cal_document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset="+document.charset+"\">\n");cal_document.write("<title>"+decodeURIComponent(calendar_title)+"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</title>");cal_document.write("\n"+calendar_styles+"\n");cal_document.write("<scr"+"ipt language=\"javascript\">\n");cal_document.write("\nfunction ff(v) { var id='"+calendar_id+"'; var cb='"+calendar_callback+"'; window.opener.calendar_finishDate(v,id,cb); }");cal_document.write("\nfunction set_month(v) { window.opener.calendar_DT.setMonth(v); window.opener.calendar_Runtime(); }");cal_document.write("\nfunction set_year(v) { window.opener.calendar_DT.setFullYear(v); window.opener.calendar_Runtime(); }");cal_document.write("</scr"+"ipt>\n");cal_document.write("</head>\n<body topmargin=\"3\" leftmargin=\"3\" marginheight=\"3\" marginwidth=\"3\">");cal_document.write("<table width=\"180\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\"><tr><td class=\"border\">\n<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td width=\"20\" class=\"head\">");if((calendar_DT.getFullYear()>calendar_mindate.getFullYear())||((calendar_DT.getMonth()!=0)&&(calendar_DT.getFullYear()==calendar_mindate.getFullYear())))
cal_document.write("<a href=\"javascript:set_month("+(calendar_DT.getMonth()-1)+");\"><b>"+Larrow+"</b></a>");else
cal_document.write("<b>"+Larrow+"</b>");cal_document.write("</td><form><td class=\"head\"><select name=\"m\" onchange=\"set_month(this[this.selectedIndex].value);\">");for(i=0;i<12;i++)
{cal_document.write("<option value=\""+i+"\"");if(i==(calendar_DT.getMonth()))
cal_document.write(" selected=\"selected\"");cal_document.write(">"+mnames[i]+"</option>\n");}
cal_document.write("</select><select name=\"r\" onchange=\"set_year(this[this.selectedIndex].value);\">");if((calendar_DT.getFullYear()<calendar_mindate.getFullYear())||(calendar_DT.getFullYear()>calendar_maxdate.getFullYear()))
cal_document.write("<option value=\""+calendar_DT.getFullYear()+"\" selected=\"selected\">"+calendar_DT.getFullYear()+"</option>\n");for(i=calendar_mindate.getFullYear();i<(calendar_maxdate.getFullYear()+1);i++)
{cal_document.write("<option value=\""+i+"\"");if(i==calendar_DT.getFullYear())
cal_document.write(" selected=\"selected\"");cal_document.write(">"+i+"</option>\n");}
cal_document.write("</select></td></form><td class=\"head\" width=\"20\">");if((calendar_DT.getFullYear()<calendar_maxdate.getFullYear())||((calendar_DT.getMonth()!=11)&&(calendar_DT.getFullYear()==calendar_maxdate.getFullYear())))
cal_document.write("<a href=\"javascript:set_month("+(calendar_DT.getMonth()+1)+");\"><b>"+Rarrow+"</b></a>");else
cal_document.write("<b>"+Rarrow+"</b>");cal_document.write("</td></tr></table><table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\"><tr>");for(i=0;i<6;i++)
cal_document.write("<th width=\"20\">"+wnames[i]+"</th>");cal_document.write("<th width=\"20\"><span>"+wnames[6]+"</span></th></tr>\n");calendar_DT.setDate(1);pd=calendar_DT.getDay()-1;row=0;if(pd==-1)
pd=6;bm=calendar_DT.getMonth();yr=calendar_DT.getFullYear();if(bm==0)
{calendar_DT.setMonth(11);calendar_DT.setFullYear(yr-1);}
else
calendar_DT.setMonth(bm-1);for(i=calendar_DT.getDaysOfMonth()-pd+1;i<=calendar_DT.getDaysOfMonth();i++)
{calendar_DT.setDate(i);if(calendar_DT.getDay()==0)
ho="class=\"holiday\"";else
ho="";cal_document.write("<td>&nbsp</td>");}
calendar_DT.setDate(1);calendar_DT.setMonth(bm);calendar_DT.setFullYear(yr);for(i=0;i<calendar_DT.getDaysOfMonth();i++)
{calendar_DT.setDate(i+1);if((calendar_DT.getDay()==1)&&(calendar_DT.getDate()!=1))
{cal_document.write("</tr>\n<tr>");row++;}
else if((calendar_DT.getDay()==1)&&(calendar_DT.getDate()==1))
cal_document.write("<tr>");if(calendar_DT.getDay()==0)
ho="class=\"holiday\"";else
ho="";for(j=0;j<calendar_holidays.length;j++)
if((calendar_holidays[j].substring(0,calendar_holidays[j].indexOf("."))==calendar_DT.getDate())&&(calendar_holidays[j].substring(calendar_holidays[j].indexOf(".")+1,calendar_holidays[j].length)==(calendar_DT.getMonth()+1)))
ho="class=\"holiday\"";if((calendar_DT.getTime()>calendar_maxdate.getTime())||(calendar_DT.getTime()<calendar_mindate.getTime()))
cal_document.write("<td "+ho+"><span class=\"disable\">"+calendar_DT.getDate()+"</span></td>");else if(ho=="")
cal_document.write("<td><a href=\"javascript:ff('"+calendar_DT.getVal('Y-m-d')+"');\">"+calendar_DT.getDate()+"</a></td>");else
cal_document.write("<td><a href=\"javascript:ff('"+calendar_DT.getVal('Y-m-d')+"');\"><span class=\"holiday\">"+calendar_DT.getDate()+"</span></a></td>");}
calendar_DT.setDate(1);calendar_DT.setMonth(bm+1);pd=calendar_DT.getDay()-1;if(pd==0)
pd=20;if(pd==-1)
pd=6;for(i=1;i<=(7-pd);i++)
{cal_document.write("<td>&nbsp</td>");calendar_DT.setDate(i);if(calendar_DT.getDay()==0)
ho="class=\"holiday\"";else
ho="";}
calendar_DT.setDate(1);calendar_DT.setMonth(bm);calendar_DT.setFullYear(yr);if(row<5)
cal_document.write("</tr><tr><td colspan=\"7\">&nbsp;</td>");cal_document.write("</tr></table></td></tr></table></body></html>");cal_document.close();window.calendar_window.focus();}
function calendar_close()
{if(openedCalendar&&!window.openedCalendar.closed)
{window.openedCalendar.close();window.openedCalendar=null;}
window.onfocus=null;}
function calendar_finishDate(datum,id,callBack)
{var el1,el2,ele;var myDT=new Date();if(ele=document.getElementById(id))
{if(ele.value!='')myDT.setVal(ele.value);myDT.setVal(datum,'Y-m-d');ele.value=myDT.getVal('Y-m-d H:i:s');}
window.calendar_window.close();openedCalendar=false;if((el1=document.getElementById(id+'_format'))&&(el2=document.getElementById(id+'_show')))
el2.value=myDT.getVal(el1.value);if(callBack)
{callBack=decodeURIComponent(callBack);eval(callBack);}}
function calendar_checkUsrDate(id){var el1,el2,ele;var old='';var myDT=new Date();if((ele=document.getElementById(id))&&(el1=document.getElementById(id+'_format')))
{if(ele.value!='')
{myDT.setVal(ele.value);old=myDT.getVal(el1.value);}
if(el2=document.getElementById(id+'_show'))
{if(el2.value=='')
ele.value='';else if(!myDT.setVal(el2.value,el1.value))
{alert('Wrong date!'+' '+el2.value+' - '+'use format'+': '+myDT.formatPresentation(el1.value));el2.value=old;}
else
{el2.value=myDT.getVal(el1.value);ele.value=myDT.getVal('Y-m-d H:i:s');}}}}
function dummy()
{return null;}
var openedCalendar=null;Date.prototype.mnames=new Array('Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Prosinec');Date.prototype.msnames=new Array('Led','Úno','Bře','Dub','Kvě','Čvn','Čec','Srp','Zář','Říj','Lis','Pro');Date.prototype.wnames=new Array('Neděle','Pondělí','Úterý','Středa','Čtvrtek','Pátek','Sobota','Neděle');Date.prototype.wsnames=new Array('Ned','Pon','Úte','Stř','Čtv','Pát','Sob','Ned');Date.prototype.checkDate=classDate_checkDate;Date.prototype.setVal=classDate_parse;Date.prototype.isLeap=classDate_isLeapYear;Date.prototype.getDaysOfMonths=classDate_getDaysOfMonths;Date.prototype.getDaysOfMonth=classDate_getDaysOfMonth;Date.prototype.getVal=classDate_format;Date.prototype.formatPresentation=classDate_formatPresentation;Date.prototype.addDay=classDate_addDay;Date.prototype.subDay=classDate_subDay;


