var a; function switchaktiv(b,c){window.document.getElementById("f1").className="inaktiv";window.document.getElementById("linienflug").style.display="none";window.document.getElementById("f2").className="inaktiv";window.document.getElementById("charterflug").style.display="none";window.document.getElementById("f3").className="inaktiv";window.document.getElementById("hotel").style.display="none";window.document.getElementById("f4").className="inaktiv";window.document.getElementById(c).style.display="block"; window.document.getElementById(b).className="aktiv";if(c=="pauschalreise"){window.document.getElementById("charterflug").action="/service/search/package/index.php";window.document.getElementById("charterflug").style.display="block";window.document.getElementById("chf").style.display="none";window.document.getElementById("pauschalreise").style.display="block";window.document.getElementById("chfb").style.display="none";window.document.getElementById("pauschalreiseb").style.display="block";window.document.getElementById("option1").style.display= "none";window.document.getElementById("show").style.display="block";window.document.getElementById("hide").style.display="none"}if(c=="charterflug"){window.document.getElementById("charterflug").action="/service/search/charter/index.php";window.document.getElementById("charterflug").style.display="block";window.document.getElementById("chf").style.display="block";window.document.getElementById("pauschalreise").style.display="none";window.document.getElementById("chfb").style.display="block";window.document.getElementById("pauschalreiseb").style.display= "none";window.document.getElementById("option1").style.display="none";window.document.getElementById("show").style.display="none";window.document.getElementById("hide").style.display="none"}}function showoption(){window.document.getElementById("option1").style.display="block";window.document.getElementById("show").style.display="none";window.document.getElementById("hide").style.display="block"} function hideoption(){window.document.getElementById("option1").style.display="none";window.document.getElementById("show").style.display="block";window.document.getElementById("hide").style.display="none"}function disable(){if(document.linienflug.onewayflug[1].checked){window.document.getElementById("flug2").disabled=true;window.document.getElementById("return").style.visibility="hidden"}} function enable(){window.document.getElementById("flug2").disabled=false;window.document.getElementById("return").style.visibility="visible"}var Monat=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),Tag=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","??"),datum=new Date;datum.setTime(datum.getTime());var heutetag=datum.getDate();if(heutetag<10)heutetag="0"+heutetag;var wochentag=Tag[datum.getDay()],monatheute=datum.getMonth(),heutemonat=Monat[monatheute]; monatheute+=1;if(monatheute<10)monatheute="0"+monatheute;var heutejahr=datum.getFullYear(),heute=wochentag+", "+heutetag+". "+heutemonat+" "+heutejahr,heutewert=heutejahr+""+monatheute+""+heutetag,heuteplusjahrwert=heutejahr+1+""+monatheute+""+heutetag;datum=new Date;datum.setTime(datum.getTime()+2592E5);var starttag=datum.getDate();if(starttag<10)starttag="0"+starttag;var startwochentag=Tag[datum.getDay()],Monatindreitagen=datum.getMonth(),startmonat=Monat[Monatindreitagen];Monatindreitagen+=1; if(Monatindreitagen<10)Monatindreitagen="0"+Monatindreitagen;var startjahr=datum.getFullYear(),startdatum=starttag+"-"+Monatindreitagen+"-"+startjahr,startdatum_da=startwochentag+", "+starttag+". "+startmonat+" "+startjahr;datum=new Date;datum.setTime(datum.getTime()+864E6);var returntag=datum.getDate();if(returntag<10)returntag="0"+returntag;var returnwochentag=Tag[datum.getDay()],Monatinzehntagen=datum.getMonth(),returnmonat=Monat[Monatinzehntagen];Monatinzehntagen+=1; if(Monatinzehntagen<10)Monatinzehntagen="0"+Monatinzehntagen;var returnjahr=datum.getFullYear(),returndatum=returntag+"-"+Monatinzehntagen+"-"+returnjahr,returndatum_da=returnwochentag+", "+returntag+". "+returnmonat+" "+returnjahr;datum=new Date;datum.setTime(datum.getTime()+20736E5);var return21tag=datum.getDate();if(return21tag<10)return21tag="0"+return21tag;var return21wochentag=Tag[datum.getDay()],Monatin21tagen=datum.getMonth(),return21monat=Monat[Monatin21tagen];Monatin21tagen+=1; if(Monatin21tagen<10)Monatin21tagen="0"+Monatin21tagen;var return21jahr=datum.getFullYear(),return21datum=return21tag+"-"+Monatin21tagen+"-"+return21jahr,return21datum_da=return21wochentag+", "+return21tag+". "+return21monat+" "+return21jahr; Calendar=function(b,c,d,e){this.timeout=this.getDateText=this.getDateToolTip=this.getDateStatus=this.currentDateEl=this.activeDiv=null;this.onSelected=d||null;this.onClose=e||null;this.hidden=this.dragging=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.weekNumbers=this.isPopup=true;this.firstDayOfWeek=typeof b=="number"?b:Calendar._FD;this.showsOtherMonths=false;this.dateStr=c;this.ar_days=null;this.showsTime= false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.activeYear=this.hilitedYear=this.activeMonth=this.hilitedMonth=this.yearsCombo=this.monthsCombo=this.firstdayname=this.tbody=this.element=this.table=this.multiple=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;b=[];for(c=8;c>0;)b[--c]=Calendar._DN[c].substr(0,Calendar._SDN_len);Calendar._SDN=b;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3; b=[];for(c=12;c>0;)b[--c]=Calendar._MN[c].substr(0,Calendar._SMN_len);Calendar._SMN=b}};Calendar._C=null;Calendar.is_ie=/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent);Calendar.is_ie5=Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent);Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent); Calendar.getAbsolutePos=function(b){var c=0,d=0,e=/^div$/i.test(b.tagName);if(e&&b.scrollLeft)c=b.scrollLeft;if(e&&b.scrollTop)d=b.scrollTop;c={x:b.offsetLeft-c,y:b.offsetTop-d};if(b.offsetParent){b=this.getAbsolutePos(b.offsetParent);c.x+=b.x;c.y+=b.y}return c};Calendar.isRelated=function(b,c){var d=c.relatedTarget;if(!d){var e=c.type;if(e=="mouseover")d=c.fromElement;else if(e=="mouseout")d=c.toElement}for(;d;){if(d==b)return true;d=d.parentNode}return false}; Calendar.removeClass=function(b,c){if(b&&b.className){for(var d=b.className.split(" "),e=[],f=d.length;f>0;)if(d[--f]!=c)e[e.length]=d[f];b.className=e.join(" ")}};Calendar.addClass=function(b,c){Calendar.removeClass(b,c);b.className+=" "+c};Calendar.getElement=function(b){for(b=Calendar.is_ie?window.event.srcElement:b.currentTarget;b.nodeType!=1||/^div$/i.test(b.tagName);)b=b.parentNode;return b}; Calendar.getTargetElement=function(b){for(b=Calendar.is_ie?window.event.srcElement:b.target;b.nodeType!=1;)b=b.parentNode;return b};Calendar.stopEvent=function(b){b||(b=window.event);if(Calendar.is_ie){b.cancelBubble=true;b.returnValue=false}else{b.preventDefault();b.stopPropagation()}return false};Calendar.addEvent=function(b,c,d){if(b.attachEvent)b.attachEvent("on"+c,d);else if(b.addEventListener)b.addEventListener(c,d,true);else b["on"+c]=d}; Calendar.removeEvent=function(b,c,d){if(b.detachEvent)b.detachEvent("on"+c,d);else if(b.removeEventListener)b.removeEventListener(c,d,true);else b["on"+c]=null};Calendar.createElement=function(b,c){var d=null;d=document.createElementNS?document.createElementNS("http://www.w3.org/1999/xhtml",b):document.createElement(b);typeof c!="undefined"&&c.appendChild(d);return d}; Calendar._add_evs=function(b){with(Calendar){addEvent(b,"mouseover",dayMouseOver);addEvent(b,"mousedown",dayMouseDown);addEvent(b,"mouseout",dayMouseOut);if(is_ie){addEvent(b,"dblclick",dayMouseDblClick);b.setAttribute("unselectable",true)}}};Calendar.findMonth=function(b){if(typeof b.month!="undefined")return b;else if(typeof b.parentNode.month!="undefined")return b.parentNode;return null}; Calendar.findYear=function(b){if(typeof b.year!="undefined")return b;else if(typeof b.parentNode.year!="undefined")return b.parentNode;return null}; Calendar.showMonthsCombo=function(){var b=Calendar._C;if(!b)return false;b=b;var c=b.activeDiv,d=b.monthsCombo;b.hilitedMonth&&Calendar.removeClass(b.hilitedMonth,"hilite");b.activeMonth&&Calendar.removeClass(b.activeMonth,"active");var e=b.monthsCombo.getElementsByTagName("div")[b.date.getMonth()];Calendar.addClass(e,"active");b.activeMonth=e;b=d.style;b.display="block";if(c.navtype<0)b.left=c.offsetLeft+"px";else{d=d.offsetWidth;if(typeof d=="undefined")d=50;b.left=c.offsetLeft+c.offsetWidth-d+ "px"}b.top=c.offsetTop+c.offsetHeight+"px"}; Calendar.showYearsCombo=function(b){var c=Calendar._C;if(!c)return false;c=c;var d=c.activeDiv,e=c.yearsCombo;c.hilitedYear&&Calendar.removeClass(c.hilitedYear,"hilite");c.activeYear&&Calendar.removeClass(c.activeYear,"active");c.activeYear=null;for(var f=c.date.getFullYear()+(b?1:-1),h=e.firstChild,g=false,i=12;i>0;--i){if(f>=c.minYear&&f<=c.maxYear){h.innerHTML=f;h.year=f;h.style.display="block";g=true}else h.style.display="none";h=h.nextSibling;f+=b?c.yearStep:-c.yearStep}if(g){b=e.style;b.display= "block";if(d.navtype<0)b.left=d.offsetLeft+"px";else{e=e.offsetWidth;if(typeof e=="undefined")e=50;b.left=d.offsetLeft+d.offsetWidth-e+"px"}b.top=d.offsetTop+d.offsetHeight+"px"}}; Calendar.tableMouseUp=function(b){var c=Calendar._C;if(!c)return false;c.timeout&&clearTimeout(c.timeout);var d=c.activeDiv;if(!d)return false;var e=Calendar.getTargetElement(b);b||(b=window.event);Calendar.removeClass(d,"active");if(e==d||e.parentNode==d)Calendar.cellClick(d,b);var f=Calendar.findMonth(e);if(f){d=new Date(c.date);if(f.month!=d.getMonth()){d.setMonth(f.month);c.setDate(d);c.dateClicked=false;c.callHandler()}}else if(e=Calendar.findYear(e)){d=new Date(c.date);if(e.year!=d.getFullYear()){d.setFullYear(e.year); c.setDate(d);c.dateClicked=false;c.callHandler()}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);c._hideCombos();_C=null;return stopEvent(b)}}; Calendar.tableMouseOver=function(b){var c=Calendar._C;if(c){var d=c.activeDiv,e=Calendar.getTargetElement(b);if(e==d||e.parentNode==d){Calendar.addClass(d,"hilite active");Calendar.addClass(d.parentNode,"rowhilite")}else{if(typeof d.navtype=="undefined"||d.navtype!=50&&(d.navtype==0||Math.abs(d.navtype)>2))Calendar.removeClass(d,"active");Calendar.removeClass(d,"hilite");Calendar.removeClass(d.parentNode,"rowhilite")}b||(b=window.event);if(d.navtype==50&&e!=d){var f=Calendar.getAbsolutePos(d),h=d.offsetWidth, g=b.clientX,i=true;if(g>f.x+h){g=g-f.x-h;i=false}else g=f.x-g;if(g<0)g=0;f=d._range;h=d._current;g=Math.floor(g/10)%f.length;for(var k=f.length;--k>=0;)if(f[k]==h)break;for(;g-- >0;)if(i){if(--k<0)k=f.length-1}else if(++k>=f.length)k=0;d.innerHTML=f[k];c.onUpdateTime()}if(d=Calendar.findMonth(e))if(d.month!=c.date.getMonth()){c.hilitedMonth&&Calendar.removeClass(c.hilitedMonth,"hilite");Calendar.addClass(d,"hilite");c.hilitedMonth=d}else c.hilitedMonth&&Calendar.removeClass(c.hilitedMonth,"hilite"); else{c.hilitedMonth&&Calendar.removeClass(c.hilitedMonth,"hilite");if(e=Calendar.findYear(e))if(e.year!=c.date.getFullYear()){c.hilitedYear&&Calendar.removeClass(c.hilitedYear,"hilite");Calendar.addClass(e,"hilite");c.hilitedYear=e}else c.hilitedYear&&Calendar.removeClass(c.hilitedYear,"hilite");else c.hilitedYear&&Calendar.removeClass(c.hilitedYear,"hilite")}return Calendar.stopEvent(b)}};Calendar.tableMouseDown=function(b){if(Calendar.getTargetElement(b)==Calendar.getElement(b))return Calendar.stopEvent(b)}; Calendar.calDragIt=function(b){var c=Calendar._C;if(!(c&&c.dragging))return false;var d,e;if(Calendar.is_ie){e=window.event.clientY+document.body.scrollTop;d=window.event.clientX+document.body.scrollLeft}else{d=b.pageX;e=b.pageY}c.hideShowCovered();var f=c.element.style;f.left=d-c.xOffs+"px";f.top=e-c.yOffs+"px";return Calendar.stopEvent(b)}; Calendar.calDragEnd=function(b){var c=Calendar._C;if(!c)return false;c.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(b)}c.hideShowCovered()}; Calendar.dayMouseDown=function(b){var c=Calendar.getElement(b);if(c.disabled)return false;var d=c.calendar;d.activeDiv=c;Calendar._C=d;if(c.navtype!=300)with(Calendar){if(c.navtype==50){c._current=c.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(c,"hilite active");addEvent(document,"mouseup",tableMouseUp)}else d.isPopup&&d._dragStart(b);if(c.navtype==-1||c.navtype==1){d.timeout&&clearTimeout(d.timeout); d.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else if(c.navtype==-2||c.navtype==2){d.timeout&&clearTimeout(d.timeout);d.timeout=setTimeout(c.navtype>0?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else d.timeout=null;return Calendar.stopEvent(b)};Calendar.dayMouseDblClick=function(b){Calendar.cellClick(Calendar.getElement(b),b||window.event);Calendar.is_ie&&document.selection.empty()}; Calendar.dayMouseOver=function(b){var c=Calendar.getElement(b);if(Calendar.isRelated(c,b)||Calendar._C||c.disabled)return false;if(c.ttip){if(c.ttip.substr(0,1)=="_")c.ttip=c.caldate.print(c.calendar.ttDateFormat)+c.ttip.substr(1);c.calendar.tooltips.innerHTML=c.ttip}if(c.navtype!=300){Calendar.addClass(c,"hilite");if(c.caldate){Calendar.addClass(c.parentNode,"rowhilite");var d=c.calendar;if(d&&d.getDateToolTip){var e=c.caldate;window.status=e;c.title=d.getDateToolTip(e,e.getFullYear(),e.getMonth(), e.getDate())}}}return Calendar.stopEvent(b)};Calendar.dayMouseOut=function(b){with(Calendar){var c=getElement(b);if(isRelated(c,b)||_C||c.disabled)return false;removeClass(c,"hilite");c.caldate&&removeClass(c.parentNode,"rowhilite");if(c.calendar)c.calendar.tooltips.innerHTML=_TT.SEL_DATE}}; Calendar.cellClick=function(b,c){var d=b.calendar,e=false,f=false,h=null;if(typeof b.navtype=="undefined"){if(d.currentDateEl){Calendar.removeClass(d.currentDateEl,"selected");Calendar.addClass(b,"selected");e=d.currentDateEl==b;if(!e)d.currentDateEl=b}d.date.setDateOnly(b.caldate);h=d.date;var g=!(d.dateClicked=!b.otherMonth);if(!g&&!d.currentDateEl&&d.multiple)d._toggleMultipleDate(new Date(h));else f=!b.disabled;g&&d._init(d.firstDayOfWeek,h)}else{if(b.navtype==200){Calendar.removeClass(b,"hilite"); d.callCloseHandler();return}h=new Date(d.date);b.navtype==0&&h.setDateOnly(new Date);d.dateClicked=false;g=h.getFullYear();var i=h.getMonth();function k(j){var m=h.getDate(),n=h.getMonthDays(j);m>n&&h.setDate(n);h.setMonth(j)}switch(b.navtype){case 400:Calendar.removeClass(b,"hilite");b=Calendar._TT.ABOUT;if(typeof b!="undefined")b+=d.showsTime?Calendar._TT.ABOUT_TIME:"";else b='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'; alert(b);return;case -2:g>d.minYear&&h.setFullYear(g-1);break;case -1:if(i>0)k(i-1);else if(g-- >d.minYear){h.setFullYear(g);k(11)}break;case 1:if(i<11)k(i+1);else if(g<d.maxYear){h.setFullYear(g+1);k(0)}break;case 2:g<d.maxYear&&h.setFullYear(g+1);break;case 100:d.setFirstDayOfWeek(b.fdow);return;case 50:e=b._range;f=b.innerHTML;for(g=e.length;--g>=0;)if(e[g]==f)break;if(c&&c.shiftKey){if(--g<0)g=e.length-1}else if(++g>=e.length)g=0;b.innerHTML=e[g];d.onUpdateTime();return;case 0:if(typeof d.getDateStatus== "function"&&d.getDateStatus(h,h.getFullYear(),h.getMonth(),h.getDate()))return false;break}if(h.equalsTo(d.date)){if(b.navtype==0)f=e=true}else{d.setDate(h);f=true}}f&&c&&d.callHandler();if(e){Calendar.removeClass(b,"hilite");c&&d.callCloseHandler()}}; Calendar.prototype.create=function(b){var c=null;if(b){c=b;this.isPopup=false}else{c=document.getElementsByTagName("body")[0];this.isPopup=true}this.date=this.dateStr?new Date(this.dateStr):new Date;this.table=b=Calendar.createElement("table");b.cellSpacing=0;b.cellPadding=0;b.calendar=this;Calendar.addEvent(b,"mousedown",Calendar.tableMouseDown);var d=Calendar.createElement("div");this.element=d;d.className="calendar";if(this.isPopup){d.style.position="absolute";d.style.display="none"}d.appendChild(b); var e=Calendar.createElement("thead",b),f=null,h=null,g=this;d=function(j,m,n){f=Calendar.createElement("td",h);f.colSpan=m;f.className="button";if(n!=0&&Math.abs(n)<=2)f.className+=" nav";Calendar._add_evs(f);f.calendar=g;f.navtype=n;f.innerHTML="<div unselectable='on'>"+j+"</div>";return f};h=Calendar.createElement("tr",e);var i=6;this.isPopup&&--i;this.weekNumbers&&++i;d("?",1,400).ttip=Calendar._TT.INFO;this.title=d("",i,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE; this.title.style.cursor="move";d("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}h=Calendar.createElement("tr",e);h.className="headrow";this._nav_py=d("&#x2039; "+jahrbutton,1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_py.className="navpjahr";this._nav_pm=d("\u00ab M",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_pm.className="navpmon";this._nav_now=d(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_now.className="navheute";this._nav_nm= d("M \u00bb",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_nm.className="navnmon";this._nav_ny=d(jahrbutton+" &#x203a;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;this._nav_ny.className="navnjahr";h=Calendar.createElement("tr",e);h.className="daynames";if(this.weekNumbers){f=Calendar.createElement("td",h);f.className="name wn";f.innerHTML=Calendar._TT.WK}for(e=7;e>0;--e){f=Calendar.createElement("td",h);if(!e){f.navtype=100;f.calendar=this;Calendar._add_evs(f)}}this.firstdayname=this.weekNumbers? h.firstChild.nextSibling:h.firstChild;this._displayWeekdays();this.tbody=i=Calendar.createElement("tbody",b);for(e=6;e>0;--e){h=Calendar.createElement("tr",i);if(this.weekNumbers)f=Calendar.createElement("td",h);for(var k=7;k>0;--k){f=Calendar.createElement("td",h);f.calendar=this;Calendar._add_evs(f)}}if(this.showsTime){h=Calendar.createElement("tr",i);h.className="time";f=Calendar.createElement("td",h);f.className="time";f.colSpan=2;f.innerHTML=Calendar._TT.TIME||" ";f=Calendar.createElement("td", h);f.className="time";f.colSpan=this.weekNumbers?4:3;(function(){function j(o,p,r,w){var s=Calendar.createElement("span",f);s.className=o;s.innerHTML=p;s.calendar=g;s.ttip=Calendar._TT.TIME_PART;s.navtype=50;s._range=[];if(typeof r!="number")s._range=r;else for(o=r;o<=w;++o)s._range[s._range.length]=o<10&&w>=10?"0"+o:""+o;Calendar._add_evs(s);return s}var m=g.date.getHours(),n=g.date.getMinutes(),l=!g.time24,t=m>12;if(l&&t)m-=12;var q=j("hour",m,l?1:0,l?12:23);m=Calendar.createElement("span",f);m.innerHTML= ":";m.className="colon";var v=j("minute",n,0,59),u=null;f=Calendar.createElement("td",h);f.className="time";f.colSpan=2;if(l)u=j("ampm",t?"pm":"am",["am","pm"]);else f.innerHTML=" ";g.onSetTime=function(){var o,p=this.date.getHours(),r=this.date.getMinutes();if(l){if(o=p>=12)p-=12;if(p==0)p=12;u.innerHTML=o?"pm":"am"}q.innerHTML=p<10?"0"+p:p;v.innerHTML=r<10?"0"+r:r};g.onUpdateTime=function(){var o=this.date,p=parseInt(q.innerHTML,10);if(l)if(/pm/i.test(u.innerHTML)&&p<12)p+=12;else if(/am/i.test(u.innerHTML)&& p==12)p=0;var r=o.getDate(),w=o.getMonth(),s=o.getFullYear();o.setHours(p);o.setMinutes(parseInt(v.innerHTML,10));o.setFullYear(s);o.setMonth(w);o.setDate(r);this.dateClicked=false;this.callHandler()}})()}else this.onSetTime=this.onUpdateTime=function(){};b=Calendar.createElement("tfoot",b);h=Calendar.createElement("tr",b);h.className="footrow";f=d(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);f.className="ttip";if(this.isPopup){f.ttip=Calendar._TT.DRAG_TO_MOVE;f.style.cursor="move"}this.tooltips= f;this.monthsCombo=d=Calendar.createElement("div",this.element);d.className="combo";for(e=0;e<Calendar._MN.length;++e){b=Calendar.createElement("div");b.className=Calendar.is_ie?"label-IEfix":"label";b.month=e;b.innerHTML=Calendar._SMN[e];d.appendChild(b)}this.yearsCombo=d=Calendar.createElement("div",this.element);d.className="combo";for(e=12;e>0;--e){b=Calendar.createElement("div");b.className=Calendar.is_ie?"label-IEfix":"label";d.appendChild(b)}this._init(this.firstDayOfWeek,this.date);c.appendChild(this.element)}; Calendar._keyEvent=function(b){var c=window._dynarch_popupCalendar;if(!c||c.multiple)return false;Calendar.is_ie&&(b=window.event);var d=Calendar.is_ie||b.type=="keypress",e=b.keyCode;if(b.ctrlKey)switch(e){case 37:d&&Calendar.cellClick(c._nav_pm);break;case 38:d&&Calendar.cellClick(c._nav_py);break;case 39:d&&Calendar.cellClick(c._nav_nm);break;case 40:d&&Calendar.cellClick(c._nav_ny);break;default:return false}else switch(e){case 32:Calendar.cellClick(c._nav_now);break;case 27:d&&c.callCloseHandler(); break;case 37:case 38:case 39:case 40:if(d){var f,h,g,i,k;d=e==37||e==38;k=e==37||e==39?1:7;function j(){i=c.currentDateEl;var l=i.pos;f=l&15;h=l>>4;g=c.ar_days[h][f]}j();function m(){var l=new Date(c.date);l.setDate(l.getDate()-k);c.setDate(l)}function n(){var l=new Date(c.date);l.setDate(l.getDate()+k);c.setDate(l)}for(;;){switch(e){case 37:if(--f>=0)g=c.ar_days[h][f];else{f=6;e=38;continue}break;case 38:if(--h>=0)g=c.ar_days[h][f];else{m();j()}break;case 39:if(++f<7)g=c.ar_days[h][f];else{f=0; e=40;continue}break;case 40:if(++h<c.ar_days.length)g=c.ar_days[h][f];else{n();j()}break}break}if(g)if(g.disabled)d?m():n();else Calendar.cellClick(g)}break;case 13:d&&Calendar.cellClick(c.currentDateEl,b);break;default:return false}return Calendar.stopEvent(b)};a=Calendar.prototype; a._init=function(b,c){var d=new Date,e=d.getFullYear(),f=d.getMonth();d=d.getDate();this.table.style.visibility="hidden";var h=c.getFullYear();if(h<this.minYear){h=this.minYear;c.setFullYear(h)}else if(h>this.maxYear){h=this.maxYear;c.setFullYear(h)}this.firstDayOfWeek=b;this.date=new Date(c);b=c.getMonth();var g=c.getDate();c.getMonthDays();c.setDate(1);var i=(c.getDay()-this.firstDayOfWeek)%7;if(i<0)i+=7;c.setDate(-i);c.setDate(c.getDate()+1);i=this.tbody.firstChild;for(var k=this.ar_days=[],j= Calendar._TT.WEEKEND,m=this.multiple?(this.datesCells={}):null,n=0;n<6;++n,i=i.nextSibling){var l=i.firstChild;if(this.weekNumbers){l.className="day wn";l.innerHTML=c.getWeekNumber();l=l.nextSibling}i.className="daysrow";for(var t=false,q,v=k[n]=[],u=0;u<7;++u,l=l.nextSibling,c.setDate(q+1)){q=c.getDate();var o=c.getDay();l.className="day";l.pos=n<<4|u;v[u]=l;var p=c.getMonth()==b;if(p){l.otherMonth=false;t=true}else if(this.showsOtherMonths){l.className+=" othermonth";l.otherMonth=true}else{l.className= "emptycell";l.innerHTML=" ";l.disabled=true;continue}l.disabled=false;l.innerHTML=this.getDateText?this.getDateText(c,q):q;if(m)m[c.print("%Y%m%d")]=l;if(this.getDateStatus){var r=this.getDateStatus(c,h,b,q);if(r===true){l.className+=" disabled";l.disabled=true}else{if(/disabled/i.test(r))l.disabled=true;l.className+=" "+r}}if(!l.disabled){l.caldate=new Date(c);l.ttip="_";if(!this.multiple&&p&&q==g&&this.hiliteToday){l.className+=" selected";this.currentDateEl=l}if(c.getFullYear()==e&&c.getMonth()== f&&q==d){l.className+=" today";l.ttip+=Calendar._TT.PART_TODAY}if(j.indexOf(o.toString())!=-1)l.className+=l.otherMonth?" oweekend":" weekend"}}if(!(t||this.showsOtherMonths))i.className="emptyrow"}this.title.innerHTML=Calendar._MN[b]+", "+h;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};a._initMultipleDates=function(){if(this.multiple)for(var b in this.multiple){var c=this.datesCells[b];if(this.multiple[b])if(c)c.className+=" selected"}}; a._toggleMultipleDate=function(b){if(this.multiple){var c=b.print("%Y%m%d"),d=this.datesCells[c];if(d)if(this.multiple[c]){Calendar.removeClass(d,"selected");delete this.multiple[c]}else{Calendar.addClass(d,"selected");this.multiple[c]=b}}};a.setDateToolTipHandler=function(b){this.getDateToolTip=b};a.setDate=function(b){b.equalsTo(this.date)||this._init(this.firstDayOfWeek,b)};a.refresh=function(){this._init(this.firstDayOfWeek,this.date)};a.setFirstDayOfWeek=function(b){this._init(b,this.date);this._displayWeekdays()}; a.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(b){this.getDateStatus=b};a.setRange=function(b,c){this.minYear=b;this.maxYear=c};a.callHandler=function(){this.onSelected&&this.onSelected(this,this.date.print(this.dateFormat))};a.callCloseHandler=function(){this.onClose&&this.onClose(this);this.hideShowCovered()};a.destroy=function(){this.element.parentNode.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null}; a.reparent=function(b){var c=this.element;c.parentNode.removeChild(c);b.appendChild(c)};Calendar._checkCalendar=function(b){var c=window._dynarch_popupCalendar;if(!c)return false;for(var d=Calendar.is_ie?Calendar.getElement(b):Calendar.getTargetElement(b);d!=null&&d!=c.element;d=d.parentNode);if(d==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(b)}};a=Calendar.prototype; a.show=function(){for(var b=this.table.getElementsByTagName("tr"),c=b.length;c>0;){var d=b[--c];Calendar.removeClass(d,"rowhilite");d=d.getElementsByTagName("td");for(var e=d.length;e>0;){var f=d[--e];Calendar.removeClass(f,"hilite");Calendar.removeClass(f,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document, "mousedown",Calendar._checkCalendar)}this.hideShowCovered()};a.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};a.showAt=function(b,c){var d=this.element.style;d.left=b+"px";d.top=c+"px";this.show()}; a.showAtElement=function(b,c){function d(h){if(h.x<0)h.x=0;if(h.y<0)h.y=0;var g=document.createElement("div"),i=g.style;i.position="absolute";i.right=i.bottom=i.width=i.height="0px";document.body.appendChild(g);i=Calendar.getAbsolutePos(g);document.body.removeChild(g);if(Calendar.is_ie){i.y+=document.body.scrollTop;i.x+=document.body.scrollLeft}else{i.y+=window.scrollY;i.x+=window.scrollX}g=h.x+h.width-i.x;if(g>0)h.x-=g;g=h.y+h.height-i.y;if(g>0)h.y-=g}var e=this,f=Calendar.getAbsolutePos(b);if(!c|| typeof c!="string"){this.showAt(f.x,f.y+b.offsetHeight);return true}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var h=e.element.offsetWidth,g=e.element.offsetHeight;e.element.style.display="none";var i=c.substr(0,1),k="l";if(c.length>1)k=c.substr(1,1);switch(i){case "T":f.y-=g;break;case "B":f.y+=b.offsetHeight;break;case "C":f.y+=(b.offsetHeight-g)/2;break;case "t":f.y+=b.offsetHeight-g;break;case "b":break}switch(k){case "L":f.x-=h;break;case "R":f.x+= b.offsetWidth;break;case "C":f.x+=(b.offsetWidth-h)/2;break;case "l":f.x+=b.offsetWidth-h;break;case "r":break}f.width=h;f.height=g+40;e.monthsCombo.style.display="none";d(f);e.showAt(f.x,f.y)};Calendar.is_khtml?setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10):Calendar.continuation_for_the_fucking_khtml_browser()};a.setDateFormat=function(b){this.dateFormat=b};a.setTtDateFormat=function(b){this.ttDateFormat=b}; a.parseDate=function(b,c){if(!c)c=this.dateFormat;this.setDate(Date.parseDate(b,c))}; a.hideShowCovered=function(){function b(q){var v=q.style.visibility;v||(v=document.defaultView&&typeof document.defaultView.getComputedStyle=="function"?Calendar.is_khtml?"":document.defaultView.getComputedStyle(q,"").getPropertyValue("visibility"):q.currentStyle?q.currentStyle.visibility:"");return v}if(Calendar.is_ie||Calendar.is_opera){var c=new Array("applet","iframe","select"),d=this.element,e=Calendar.getAbsolutePos(d),f=e.x,h=d.offsetWidth+f,g=e.y;d=d.offsetHeight+g;for(var i=c.length;i>0;)for(var k= document.getElementsByTagName(c[--i]),j=null,m=k.length;m>0;){j=k[--m];e=Calendar.getAbsolutePos(j);var n=e.x,l=j.offsetWidth+n;e=e.y;var t=j.offsetHeight+e;if(this.hidden||n>h||l<f||e>d||t<g){if(!j.__msh_save_visibility)j.__msh_save_visibility=b(j);j.style.visibility=j.__msh_save_visibility}else{if(!j.__msh_save_visibility)j.__msh_save_visibility=b(j);j.style.visibility="hidden"}}}}; a._displayWeekdays=function(){for(var b=this.firstDayOfWeek,c=this.firstdayname,d=Calendar._TT.WEEKEND,e=0;e<7;++e){c.className="day name";var f=(e+b)%7;if(e){c.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[f]);c.navtype=100;c.calendar=this;c.fdow=f}d.indexOf(f.toString())!=-1&&Calendar.addClass(c,"weekend");c.innerHTML=Calendar._SDN[(e+b)%7];c=c.nextSibling}};a._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"}; a._dragStart=function(b){if(!this.dragging){this.dragging=true;var c;if(Calendar.is_ie){c=window.event.clientY+document.body.scrollTop;b=window.event.clientX+document.body.scrollLeft}else{c=b.clientY+window.scrollY;b=b.clientX+window.scrollX}var d=this.element.style;this.xOffs=b-parseInt(d.left);this.yOffs=c-parseInt(d.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1E3; Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY; Date.parseDate=function(b,c){var d=new Date,e=0,f=-1,h=0;b=b.split(/\W+/);var g=c.match(/%./g),i=0,k=0,j=0;for(c=0;c<b.length;++c)if(b[c])switch(g[c]){case "%d":case "%e":h=parseInt(b[c],10);break;case "%m":f=parseInt(b[c],10)-1;break;case "%Y":case "%y":e=parseInt(b[c],10);e<100&&(e+=e>29?1900:2E3);break;case "%b":case "%B":for(i=0;i<12;++i)if(Calendar._MN[i].substr(0,b[c].length).toLowerCase()==b[c].toLowerCase()){f=i;break}break;case "%H":case "%I":case "%k":case "%l":k=parseInt(b[c],10);break; case "%P":case "%p":if(/pm/i.test(b[c])&&k<12)k+=12;else if(/am/i.test(b[c])&&k>=12)k-=12;break;case "%M":j=parseInt(b[c],10);break}if(isNaN(e))e=d.getFullYear();if(isNaN(f))f=d.getMonth();if(isNaN(h))h=d.getDate();if(isNaN(k))k=d.getHours();if(isNaN(j))j=d.getMinutes();if(e!=0&&f!=-1&&h!=0)return new Date(e,f,h,k,j,0);e=0;f=-1;for(c=h=0;c<b.length;++c)if(b[c].search(/[a-zA-Z]+/)!=-1){g=-1;for(i=0;i<12;++i)if(Calendar._MN[i].substr(0,b[c].length).toLowerCase()==b[c].toLowerCase()){g=i;break}if(g!= -1){if(f!=-1)h=f+1;f=g}}else if(parseInt(b[c],10)<=12&&f==-1)f=b[c]-1;else if(parseInt(b[c],10)>31&&e==0){e=parseInt(b[c],10);e<100&&(e+=e>29?1900:2E3)}else if(h==0)h=b[c];if(e==0)e=d.getFullYear();if(f!=-1&&h!=0)return new Date(e,f,h,k,j,0);return d};a=Date.prototype;a.getMonthDays=function(b){var c=this.getFullYear();if(typeof b=="undefined")b=this.getMonth();return 0==c%4&&(0!=c%100||0==c%400)&&b==1?29:Date._MD[b]}; a.getDayOfYear=function(){var b=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),c=new Date(this.getFullYear(),0,0,0,0,0);return Math.floor((b-c)/Date.DAY)};a.getWeekNumber=function(){var b=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),c=b.getDay();b.setDate(b.getDate()-(c+6)%7+3);c=b.valueOf();b.setMonth(0);b.setDate(4);return Math.round((c-b.valueOf())/6048E5)+1}; a.equalsTo=function(b){return this.getFullYear()==b.getFullYear()&&this.getMonth()==b.getMonth()&&this.getDate()==b.getDate()&&this.getHours()==b.getHours()&&this.getMinutes()==b.getMinutes()};a.setDateOnly=function(b){b=new Date(b);this.setDate(1);this.setFullYear(b.getFullYear());this.setMonth(b.getMonth());this.setDate(b.getDate())}; a.print=function(b){var c=this.getMonth(),d=this.getDate(),e=this.getFullYear(),f=this.getWeekNumber(),h=this.getDay(),g={},i=this.getHours(),k=i>=12,j=k?i-12:i,m=this.getDayOfYear();if(j==0)j=12;var n=this.getMinutes(),l=this.getSeconds();g["%a"]=Calendar._SDN[h];g["%A"]=Calendar._DN[h];g["%b"]=Calendar._SMN[c];g["%B"]=Calendar._MN[c];g["%C"]=1+Math.floor(e/100);g["%d"]=d<10?"0"+d:d;g["%e"]=d;g["%H"]=i<10?"0"+i:i;g["%I"]=j<10?"0"+j:j;g["%j"]=m<100?m<10?"00"+m:"0"+m:m;g["%k"]=i;g["%l"]=j;g["%m"]= c<9?"0"+(1+c):1+c;g["%M"]=n<10?"0"+n:n;g["%n"]="\n";g["%p"]=k?"PM":"AM";g["%P"]=k?"pm":"am";g["%s"]=Math.floor(this.getTime()/1E3);g["%S"]=l<10?"0"+l:l;g["%t"]="\t";g["%U"]=g["%W"]=g["%V"]=f<10?"0"+f:f;g["%u"]=h+1;g["%w"]=h;g["%y"]=(""+e).substr(2,2);g["%Y"]=e;g["%%"]="%";c=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return b.replace(c,function(t){return g[t]||t});d=b.match(c);for(e=0;e<d.length;e++)if(f=g[d[e]]){c=new RegExp(d[e],"g");b=b.replace(c,f)}return b};a.__msh_oldSetFullYear=Date.prototype.setFullYear; a.setFullYear=function(b){var c=new Date(this);c.__msh_oldSetFullYear(b);c.getMonth()!=this.getMonth()&&this.setDate(28);this.__msh_oldSetFullYear(b)};window._dynarch_popupCalendar=null;Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December"); Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar"; Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \u00ab, \u00bb buttons to select month\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select year\n- Hold mouse button on any of the above buttons for faster selection."; Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.DRAG_TO_MOVE="Drag to move"; Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";var jahrbutton="Y"; Calendar.setup=function(b){function c(g,i){if(typeof b[g]=="undefined")b[g]=i}function d(g){var i=g.params,k=g.dateClicked||i.electric;if(k&&i.inputField){i.inputField.value=g.date.print(i.ifFormat);typeof i.inputField.onchange=="function"&&i.inputField.onchange()}if(k&&i.displayArea)i.displayArea.innerHTML=g.date.print(i.daFormat);k&&typeof i.onUpdate=="function"&&i.onUpdate(g);k&&i.flat&&typeof i.flatCallback=="function"&&i.flatCallback(g);k&&i.singleClick&&g.dateClicked&&g.callCloseHandler()}c("inputField", null);c("displayArea",null);c("button",null);c("eventName","click");c("ifFormat","%d-%m-%Y");c("daFormat","%a, %d. %b %Y");c("singleClick",true);c("disableFunc",null);c("dateStatusFunc",disallowDate);c("dateTooltipFunc",null);c("dateText",null);c("firstDay",1);c("align","Bl");c("range",[heutejahr,heutejahr+1]);c("weekNumbers",true);c("flat",null);c("flatCallback",null);c("onSelect",null);c("onClose",null);c("onUpdate",datecontrol);c("date",null);c("showsTime",false);c("timeFormat","24");c("electric", false);c("step",1);c("position",null);c("cache",false);c("showOthers",false);c("multiple",null);var e=["inputField","displayArea","button"];for(var f in e)if(typeof b[e[f]]=="string")b[e[f]]=document.getElementById(b[e[f]]);if(!(b.flat||b.multiple||b.inputField||b.displayArea||b.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false}if(b.flat!=null){if(typeof b.flat=="string")b.flat=document.getElementById(b.flat);if(!b.flat){alert("Calendar.setup:\n Flat specified but can't find parent."); return false}var h=new Calendar(b.firstDay,b.date,b.onSelect||d);h.setDateToolTipHandler(b.dateTooltipFunc);h.showsOtherMonths=b.showOthers;h.showsTime=b.showsTime;h.time24=b.timeFormat=="24";h.params=b;h.weekNumbers=b.weekNumbers;h.setRange(b.range[0],b.range[1]);h.setDateStatusHandler(b.dateStatusFunc);h.getDateText=b.dateText;b.ifFormat&&h.setDateFormat(b.ifFormat);b.inputField&&typeof b.inputField.value=="string"&&h.parseDate(b.inputField.value);h.create(b.flat);h.show();return false}(b.button|| b.displayArea||b.inputField)["on"+b.eventName]=function(){var g=b.inputField||b.displayArea,i=b.inputField?b.ifFormat:b.daFormat,k=false,j=window.calendar;if(g)b.date=Date.parseDate(g.value||g.innerHTML,i);if(j&&b.cache){b.date&&j.setDate(b.date);j.hide()}else{window.calendar=j=new Calendar(b.firstDay,b.date,b.onSelect||d,b.onClose||function(l){l.hide()});j.setDateToolTipHandler(b.dateTooltipFunc);j.showsTime=b.showsTime;j.time24=b.timeFormat=="24";j.weekNumbers=b.weekNumbers;k=true}if(b.multiple){j.multiple= {};for(g=b.multiple.length;--g>=0;){var m=b.multiple[g],n=m.print("%Y%m%d");j.multiple[n]=m}}j.showsOtherMonths=b.showOthers;j.yearStep=b.step;j.setRange(b.range[0],b.range[1]);j.params=b;j.setDateStatusHandler(b.dateStatusFunc);j.getDateText=b.dateText;j.setDateFormat(i);k&&j.create();j.refresh();b.position?j.showAt(b.position[0],b.position[1]):j.showAtElement(b.button||b.displayArea||b.inputField,b.align);return false};return h}; function disallowDate(b){b=b.print("%Y%m%d");if(b<heutewert)return true;if(b>=heuteplusjahrwert)return true;return false} function datecontrol(b){var c=document.getElementById("flug1"),d=c.value,e=document.getElementById("flug1da"),f=e.innerHTML,h=document.getElementById("flug2"),g=h.value,i=document.getElementById("flug2da"),k=i.innerHTML,j=d.substr(6)+d.substr(3,2)+d.substr(0,2),m=g.substr(6)+g.substr(3,2)+g.substr(0,2);if(c==b.params.inputField)if(j>=m){h.value=d;i.innerHTML=f}if(h==b.params.inputField)if(j>=m){c.value=g;e.innerHTML=k}} function datecontrolhotel(b){var c=document.getElementById("hotel1"),d=c.value,e=document.getElementById("hotel1da"),f=e.innerHTML,h=document.getElementById("hotel2"),g=h.value,i=document.getElementById("hotel2da"),k=i.innerHTML,j=d.substr(6)+d.substr(3,2)+d.substr(0,2),m=g.substr(6)+g.substr(3,2)+g.substr(0,2);if(c==b.params.inputField)if(j>=m){h.value=d;i.innerHTML=f}if(h==b.params.inputField)if(j>=m){c.value=g;e.innerHTML=k}} function datecontrolcharter(b){var c=document.getElementById("charter1"),d=c.value,e=document.getElementById("charter1da"),f=e.innerHTML,h=document.getElementById("charter2"),g=h.value,i=document.getElementById("charter2da"),k=i.innerHTML,j=d.substr(6)+d.substr(3,2)+d.substr(0,2),m=g.substr(6)+g.substr(3,2)+g.substr(0,2);if(c==b.params.inputField)if(j>=m){h.value=d;i.innerHTML=f}if(h==b.params.inputField)if(j>=m){c.value=g;e.innerHTML=k}}if(typeof bsn=="undefined")_b=bsn={}; if(typeof _b.Autosuggest=="undefined")_b.Autosuggest={};else alert("Autosuggest is already set!"); _b.AutoSuggest=function(b,c){if(!document.getElementById)return 0;this.fld=_b.DOM.gE(b);if(!this.fld)return 0;this.sInp="";this.nInpC=0;this.aSug=[];this.iHigh=0;this.hasFocus=false;this.oP=c?c:{};var d;b={minchars:1,meth:"get",varname:"input",className:"autosuggest",timeout:2500,delay:500,offsety:0,shownoresults:true,noresults:"No results!",maxheight:50,cache:true,maxentries:25};for(d in b)if(typeof this.oP[d]!=typeof b[d])this.oP[d]=b[d];var e=this;this.fld.onkeypress=function(f){return e.onKeyPress(f)}; this.fld.onkeyup=function(f){return e.onKeyUp(f)};this.fld.onfocus=function(f){return e.onFocus(f)};this.fld.onblur=function(f){return e.onBlur(f)};this.fld.setAttribute("autocomplete","off")};a=_b.AutoSuggest.prototype;a.onFocus=function(){this.hasFocus=true};a.onBlur=function(){this.hasFocus=false;this.clearSuggestions()}; a.onKeyPress=function(b){var c=1;switch(window.event?window.event.keyCode:b.keyCode){case 9:this.setHighlightedValue();c=0;break;case 13:this.setHighlightedValue();return false;case 27:this.clearSuggestions();break}return c};a.onKeyUp=function(b){b=window.event?window.event.keyCode:b.keyCode;var c=1;switch(b){case 38:this.changeHighlight(b);c=0;break;case 40:this.changeHighlight(b);c=0;break;default:this.getSuggestions(this.fld.value)}return c}; a.getSuggestions=function(b){if(b==this.sInp)return 0;_b.DOM.remE(this.idAs);this.sInp=b;if(b.length<this.oP.minchars){this.aSug=[];this.nInpC=b.length;return 0}var c=this.nInpC;this.nInpC=b.length?b.length:0;var d=this.aSug.length;if(this.nInpC>c&&d&&d<this.oP.maxentries&&this.oP.cache){c=[];for(var e=0;e<d;e++)this.aSug[e].value.substr(0,b.length).toLowerCase()==b.toLowerCase()&&c.push(this.aSug[e]);this.aSug=c;this.createList(this.aSug);return false}else{var f=this,h=this.sInp;clearTimeout(this.ajID); this.ajID=setTimeout(function(){f.doAjaxRequest(h)},this.oP.delay)}return false};a.doAjaxRequest=function(b){if(b!=this.fld.value)return false;var c=this,d=typeof this.oP.script=="function"?this.oP.script(encodeURIComponent(this.sInp)):this.oP.script+this.oP.varname+"="+encodeURIComponent(this.sInp);if(!d)return false;var e=this.oP.meth;b=this.sInp;(new _b.Ajax).makeRequest(d,e,function(f){c.setSuggestions(f,b)},function(f){alert("AJAX error: "+f)})}; a.setSuggestions=function(b,c){if(c!=this.fld.value)return false;this.aSug=[];if(this.oP.json){c=eval("("+b.responseText+")");for(b=0;b<c.results.length;b++)this.aSug.push({id:c.results[b].id,value:c.results[b].value,info:c.results[b].info})}else{c=b.responseXML.getElementsByTagName("results")[0].childNodes;for(b=0;b<c.length;b++)c[b].hasChildNodes()&&this.aSug.push({id:c[b].getAttribute("id"),value:c[b].childNodes[0].nodeValue,info:c[b].getAttribute("info")})}this.idAs="as_"+this.fld.id;this.createList(this.aSug)}; a.createList=function(b){if(this.hasFocus){var c=this;_b.DOM.remE(this.idAs);this.killTimeout();if(b.length==0&&!this.oP.shownoresults)return false;var d=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className}),e=_b.DOM.cE("div",{className:"as_corner"}),f=_b.DOM.cE("div",{className:"as_bar"}),h=_b.DOM.cE("div",{className:"as_header"});h.appendChild(e);h.appendChild(f);d.appendChild(h);e=_b.DOM.cE("ul",{id:"as_ul"});for(f=0;f<b.length;f++){h=b[f].value;var g=h.toLowerCase().indexOf(this.sInp.toLowerCase()); h=h.substring(0,g)+"<em>"+h.substring(g,g+this.sInp.length)+"</em>"+h.substring(g+this.sInp.length);h=_b.DOM.cE("span",{},h,true);if(b[f].info!=""){g=_b.DOM.cE("br",{});h.appendChild(g);g=_b.DOM.cE("small",{},b[f].info);h.appendChild(g)}g=_b.DOM.cE("a",{href:"#"});var i=_b.DOM.cE("span",{className:"tl"}," "),k=_b.DOM.cE("span",{className:"tr"}," ");g.appendChild(i);g.appendChild(k);g.appendChild(h);g.name=f+1;g.onclick=function(){c.setHighlightedValue();return false};g.onmouseover=function(){c.setHighlight(this.name)}; h=_b.DOM.cE("li",{},g);e.appendChild(h)}if(b.length==0&&this.oP.shownoresults){h=_b.DOM.cE("li",{className:"as_warning"},this.oP.noresults);e.appendChild(h)}d.appendChild(e);b=_b.DOM.cE("div",{className:"as_corner"});e=_b.DOM.cE("div",{className:"as_bar"});f=_b.DOM.cE("div",{className:"as_footer"});f.appendChild(b);f.appendChild(e);d.appendChild(f);b=_b.DOM.getPos(this.fld);d.style.left=b.x+"px";d.style.top=b.y+this.fld.offsetHeight+this.oP.offsety+"px";d.style.width=this.fld.offsetWidth+"px";d.style.width= "200px";d.onmouseover=function(){c.killTimeout()};d.onmouseout=function(){c.resetTimeout()};document.getElementsByTagName("body")[0].appendChild(d);this.iHigh=0;c=this;this.toID=setTimeout(function(){c.clearSuggestions()},this.oP.timeout)}};a.changeHighlight=function(b){var c=_b.DOM.gE("as_ul");if(!c)return false;var d;if(b==40)d=this.iHigh+1;else if(b==38)d=this.iHigh-1;if(d>c.childNodes.length)d=c.childNodes.length;if(d<1)d=1;this.setHighlight(d)}; a.setHighlight=function(b){var c=_b.DOM.gE("as_ul");if(!c)return false;this.iHigh>0&&this.clearHighlight();this.iHigh=Number(b);c.childNodes[this.iHigh-1].className="as_highlight";this.killTimeout()};a.clearHighlight=function(){var b=_b.DOM.gE("as_ul");if(!b)return false;if(this.iHigh>0){b.childNodes[this.iHigh-1].className="";this.iHigh=0}}; a.setHighlightedValue=function(){if(this.iHigh){this.sInp=this.fld.value=this.aSug[this.iHigh-1].value;this.fld.focus();this.fld.selectionStart&&this.fld.setSelectionRange(this.sInp.length,this.sInp.length);this.clearSuggestions();typeof this.oP.callback=="function"&&this.oP.callback(this.aSug[this.iHigh-1])}};a.killTimeout=function(){clearTimeout(this.toID)};a.resetTimeout=function(){clearTimeout(this.toID);var b=this;this.toID=setTimeout(function(){b.clearSuggestions()},1E3)}; a.clearSuggestions=function(){this.killTimeout();var b=_b.DOM.gE(this.idAs),c=this;b&&new _b.Fader(b,1,0,250,function(){_b.DOM.remE(c.idAs)})};if(typeof _b.Ajax=="undefined")_b.Ajax={};_b.Ajax=function(){this.req={};this.isIE=false}; _b.Ajax.prototype.makeRequest=function(b,c,d,e){if(c!="POST")c="GET";this.onComplete=d;this.onError=e;var f=this;if(window.XMLHttpRequest){this.req=new XMLHttpRequest;this.req.onreadystatechange=function(){f.processReqChange()};this.req.open("GET",b,true);this.req.send(null)}else if(window.ActiveXObject)if(this.req=new ActiveXObject("Microsoft.XMLHTTP")){this.req.onreadystatechange=function(){f.processReqChange()};this.req.open(c,b,true);this.req.send()}}; _b.Ajax.prototype.processReqChange=function(){if(this.req.readyState==4)this.req.status==200?this.onComplete(this.req):this.onError(this.req.status)};if(typeof _b.DOM=="undefined")_b.DOM={};_b.DOM.cE=function(b,c,d,e){b=document.createElement(b);if(!b)return 0;for(var f in c)b[f]=c[f];c=typeof d;if(c=="string"&&!e)b.appendChild(document.createTextNode(d));else if(c=="string"&&e)b.innerHTML=d;else c=="object"&&b.appendChild(d);return b}; _b.DOM.gE=function(b){var c=typeof b;return c=="undefined"?0:c=="string"?(b=document.getElementById(b))?typeof b.appendChild!="undefined"?b:0:0:typeof b.appendChild!="undefined"?b:0};_b.DOM.remE=function(b){return(b=this.gE(b))?b.parentNode.removeChild(b)?true:0:0}; _b.DOM.getPos=function(b){var c=b=this.gE(b),d=0;if(c.offsetParent)for(;c.offsetParent;){d+=c.offsetLeft;c=c.offsetParent}else if(c.x)d+=c.x;c=b;b=0;if(c.offsetParent)for(;c.offsetParent;){b+=c.offsetTop;c=c.offsetParent}else if(c.y)b+=c.y;return{x:d,y:b}};if(typeof _b.Fader=="undefined")_b.Fader={};_b.Fader=function(b,c,d,e,f){if(!b)return 0;this.e=b;this.from=c;this.to=d;this.cb=f;this.nDur=e;this.nInt=50;this.nTime=0;var h=this;this.nID=setInterval(function(){h._fade()},this.nInt)}; _b.Fader.prototype._fade=function(){this.nTime+=this.nInt;var b=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100),c=b/100;if(this.e.filters)try{this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=b}catch(d){this.e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+b+")"}else this.e.style.opacity=c;if(this.nTime==this.nDur){clearInterval(this.nID);this.cb!=undefined&&this.cb()}};_b.Fader.prototype._tween=function(b,c,d,e){return c+(d-c)*(b/e)};
