﻿$(document).ready(function(){function d(){if(!$("#menuComponent :date:first").data("dateinput").isOpen()&&!$("#menuComponent :date:last").data("dateinput").isOpen()){$(this).find(".sub").stop().fadeTo(b,0,function(){$(this).hide()})}}function c(){if(a!=4){if($("#menuComponent :date:first").data("dateinput").isOpen())$("#menuComponent :date:first").data("dateinput").hide();if($("#menuComponent :date:last").data("dateinput").isOpen())$("#menuComponent :date:last").data("dateinput").hide()}$("#menuItems > li > div.sub:visible").each(function(){if($(this).attr("id")!="sub"+a){$(this).stop().fadeTo(b,0,function(){$(this).hide()})}$("#menu4").removeAttr("style");$("#menu4 > a").removeAttr("style")});$(this).find(".sub").stop().fadeTo(b,1).show();(function(a){jQuery.fn.calcSubWidth=function(){rowWidth=0;a(this).find("ul").each(function(){rowWidth+=a(this).width()})}})(jQuery);if($(this).find(".row").length>0){var c=0;$(this).find(".row").each(function(){$(this).calcSubWidth();if(rowWidth>c){c=rowWidth}});$(this).find(".sub").css({width:c});$(this).find(".row:last").css({margin:"0"})}else{$(this).calcSubWidth();$(this).find(".sub").css({width:rowWidth})}}var a=-1;var b=200;$("#menuItems > li").each(function(b){$(this).attr("id","menu"+b);$(this).find(".sub").attr("id","sub"+b);$(this).hover(function(){a=b},function(){a=-1})});var e={sensitivity:2,interval:100,over:c,timeout:350,out:d};$("ul#menuItems li .sub").css({opacity:"0"});$("ul#menuItems li").hoverIntent(e);$.tools.dateinput.localize("fr",{months:"janvier,février,mars,avril,mai,juin,juillet,août,"+"septembre,octobre,novembre,décembre",shortMonths:"jan,fév,mar,avr,mai,jun,jul,aoû,sep,oct,nov,déc",days:"dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi",shortDays:"dim,lun,mar,mer,jeu,ven,sam"});$.tools.dateinput.localize("de",{months:"Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember",shortMonths:"Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez",days:"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag",shortDays:"So,Mo,Di,Mi,Do,Fr,Sa"});$.tools.dateinput.localize("zh",{months:'一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月',shortMonths: '一,二,三,四,五,六,七,八,九,十,十一,十二',days:'星期日,星期一,星期二,星期三,星期四,星期五,星期六',shortDays:'周日,周一,周二,周三,周四,周五,周六'});$("#menuComponent :date").dateinput({trigger:true,format:"dd mmmm yyyy",min:-1,offset:[0,0]});$("#calroot").mouseenter(function(){if($("#menuComponent :date:first").data("dateinput").isOpen()||$("#menuComponent :date:last").data("dateinput").isOpen()){$("#menu4").css({"background-color":"#680505"});$("#menu4 > a").css({color:"#ffc652","text-shadow":"2px 2px 1px #3d0f0e"})}});$(":date").bind("onShow onHide",function(){$(this).parent().toggleClass("active")});$("#menuComponent :date:first").data("dateinput").change(function(){$("#menuComponent :date:last").data("dateinput").setMin(this.getValue(),true);var a=$("#menuComponent :date:first").data("dateinput").getValue();var b=$("#menuComponent :date:last").data("dateinput").getValue();var c=Math.floor((b-a)/60/60/24/1e3);$("#menuComponent #calNights").val(c)});$("#menuComponent :date:last").data("dateinput").change(function(){var a=$("#menuComponent :date:first").data("dateinput").getValue();var b=$("#menuComponent :date:last").data("dateinput").getValue();var c=Math.floor((b-a)/60/60/24/1e3);$("#menuComponent #calNights").val(c)})})
