function twoDigit(val){return parseInt(val,10)<10?"0"+parseInt(val,10):parseInt(val,10)}function TTIBE(name,port,formname){this.name=typeof (name)!="undefined"?name:"IBE";this.port=typeof (port)!="undefined"?port:654;this.formname=typeof (formname)!="undefined"?formname:"bengine"}TTIBE.prototype={extend:function(dest,src){for(attr in src){dest[attr]=src[attr]}return dest},include:function(tag,pfad){var attrs={link:{rel:"stylesheet",type:"text/css",href:pfad},script:{type:"text/javascript",src:pfad}};
document.getElementsByTagName("head")[0].appendChild(this.extend(document.createElement(tag),attrs[tag]))},includeFiles:function(){for(var i=0;i<window["cacheFiles_"+this.port].length;++i){if(this.req.nurflug=="1"&&(window["cacheFiles_"+this.port][i].search(/regionen.*/)!=-1)&&(typeof this.req.udf=="undefined")){continue}else{if(this.req.engine=="erde"&&this.req.formular=="2"&&(window["cacheFiles_"+this.port][i].search(/regionen.*/)!=-1)){continue}}this.include("script",cacheurl+"booking/cache/"+KID+"/"+this.port+"/"+window["cacheFiles_"+this.port][i])
}for(var i=0;i<this.jsFiles.length;++i){this.include("script",this.jsFiles[i])}},inject:function(obj){for(var ClassName in obj){try{window[ClassName].apply(this,obj[ClassName])}catch(e){var strError=ClassName+" - type: "+typeof (window[ClassName])+"\n";strError+="typeof Args = "+typeof (obj[ClassName])+"\n";for(i=0;i<obj[ClassName].length;i++){strError+="arg["+i+"]="+obj[ClassName][i]+", type="+typeof (obj[ClassName][i])+"\n\n"}for(var i in e){if(i=="number"){strError+="number: "+(e[i]&65535)+"\n"
}else{strError+=i+": "+e[i]+"\n"}}alert("Beim Laden der Seite ist ein Fehler aufgetreten ('"+ClassName+"')\n\nBitte laden Sie die Seite neu.")}}return true},writeHF:function(){for(hfname in this.hidf){document.write('<input type="hidden" name="'+hfname+'" value="'+this.hidf[hfname]+'">\n')}}};Object.extend=function(destination,source){for(var property in source){destination[property]=source[property]}return destination};function TTAjaxRequest(sUrl,oOptions,pRefObj,funcSuccess){var pRefObj=pRefObj||window;
this.Options={method:"GET",params:"",async:true};Object.extend(this.Options,oOptions||{});this.Url=sUrl;if(this.Options.method.toUpperCase()=="GET"&&this.Options.params!=""){if(this.Url.indexOf("?")!=-1){this.Url+="&"+this.Options.params}else{this.Url+="?"+this.Options.params}}this.onStateChange=function(){if(!pRefObj||!pRefObj.xmlReq){this.onStateChange=null;return }if(pRefObj.xmlReq.readyState==4){if(pRefObj.xmlReq.status==200||pRefObj.xmlReq.status==304){if(pRefObj.xmlReq.responseText==""){pRefObj.onAjaxError()
}else{pRefObj.onAjaxSuccess(funcSuccess)}}else{pRefObj.onAjaxError()}}};var xmlRequest=false;if(!xmlRequest&&typeof (XMLHttpRequest)!="undefined"){xmlRequest=new XMLHttpRequest()}if(!xmlRequest){try{xmlRequest=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){xmlRequest=false}}}if(xmlRequest){pRefObj.xmlReq=xmlRequest;pRefObj.xmlReq.open(this.Options.method,this.Url,this.Options.async);pRefObj.xmlReq.onreadystatechange=this.onStateChange;if(this.Options.method.toUpperCase()=="GET"){pRefObj.xmlReq.send(null)
}else{pRefObj.xmlReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");pRefObj.xmlReq.send(this.Options.params)}try{if(navigator.userAgent.indexOf("Gecko")!=-1&&!this.Options.async&&pRefObj.xmlReq.onreadystatechange==null){this.onStateChange()}}catch(e){}}return xmlRequest}function $(id){if(typeof jQuery!="undefined"&&jQuery){if(jQuery(id).length>0){return jQuery(id)}else{return document.getElementById(id)}}else{return document.getElementById(id)}}function TTDR(){}TTDR.DATAPOOLS=["DEPAIRPORT","DESTINATION","HOTELNAMES","POI","VILLAGES","MEALTYPE","FAMILYANDKIDS","ADULTS","CHILDREN","DESTAIRPORT","ROOMTYPE","Regions","DATE","DURATION","SPORTANDLEISURE","STARS","BEACH","WELLNESS","TOUROPERATOR","RAILWAYSTATION"];
TTDR.isValidDataPool=function(datapool){for(var i=0;i<TTDR.DATAPOOLS.length;i++){if(TTDR.DATAPOOLS[i]==datapool){return true}}return false};TTDR.hideAllSuggestions=function(exception){var exception=exception||"";var arDiv=document.getElementsByTagName("DIV");for(var i=0;i<arDiv.length;i++){if(arDiv[i].id&&arDiv[i].id.search(/^div_suggest_/)!=-1&&arDiv[i].id!=exception){arDiv[i].style.display="none"}}};TTDR.extend=function(dest,src){for(attr in src){dest[attr]=src[attr]}return dest};TTDR.DreamReader=function(datapool){try{if(!datapool||!TTDR.isValidDataPool(datapool)){throw new TTDR.Exception("InvalidDatapool","'"+datapool+"' is not a valid datapool value.")
}this.xmlReq=null;this.calls=0;this.selRow=-1;this.arSuggestions=[];this.suggestDiv="div_suggest_"+datapool;this.suggestFrame="ifr_suggest_"+datapool;this.blockSuggestions=false;this.ignoreMouseEvents=false;this.inputFeld="input_"+datapool;this.Name=datapool;this.DataPool=datapool;this.ForceSuggestions=true;this.InputFieldDefaultValue="";this.InputFieldWidth=185;this.SuggestBoxWidth=300;this.SuggestBoxHeight=200;this.SuggestLineHeight=20;this.SuggestFontFamily="Verdana";this.SuggestFontSize=11;this.SuggestHighlightColor="#eeeeee";
this.SuggestLength=60;this.EH=new TTDR.EventHandler(this);this.XMLResponse=new TTDR.Ajax.Response();this.XMLRequest=new TTDR.Ajax.Request(this)}catch(e){alert("TT DreamReader Exception!\n\n"+e.name+": "+e.message)}};TTDR.DreamReader.prototype={init:function(){var strHTML='<input type="hidden" name="'+this.Name+'" id="'+this.Name+'" value=""><input type="text" name="'+this.inputFeld+'" id="'+this.inputFeld+'"  autocomplete="off" value="'+this.InputFieldDefaultValue+'"><br><div id="'+this.suggestDiv+'" style="display:none;"><iframe name="'+this.suggestFrame+'" id="'+this.suggestFrame+'" src="'+file_path+'booking/tui_reisecenter_at/city/result_ttdr.html" frameborder="0" framespacing="0" border="0"></iframe></div>';
var ttdrbox=$("TTDR_"+this.DataPool);try{if(ttdrbox){ttdrbox.innerHTML=strHTML;TTDR.extend($(this.inputFeld),{onkeydown:this.EH.handleOnKeyDown,onkeypress:this.EH.handleOnKeyPress,onkeyup:this.EH.handleOnKeyUp,onfocus:this.EH.handleOnFocus});TTDR.extend($(this.inputFeld).style,{width:this.InputFieldWidth+"px",fontFamily:this.SuggestFontFamily,fontSize:this.SuggestFontSize+"px"});TTDR.extend($(this.suggestDiv).style,{position:"absolute",zIndex:"100",height:this.SuggestBoxHeight+"px",backgroundColor:"#FFF"});
TTDR.extend($(this.suggestFrame).style,{width:this.SuggestBoxWidth+"px",height:this.SuggestBoxHeight+"px"});if(navigator.appName.indexOf("Microsoft")==-1){$(this.suggestFrame).style.border="1px solid #000"}else{$(this.suggestFrame).style.border="none"}}else{throw new TTDR.Exception("MissingContainer","'TTDR_"+this.DataPool+"' not found!")}}catch(e){alert("TT DreamReader Exception!!\n\n"+e.name+": "+e.message)}},showSuggestions:function(){var sdiv=$(this.suggestDiv);var sframe=$(this.suggestFrame);
var sfrdiv=frames[this.suggestFrame].document.getElementById("suggestions");var strRes="";var cntErg=this.arSuggestions.length;TTDR.hideAllSuggestions(this.suggestDiv);if(cntErg<=Math.floor(this.SuggestBoxHeight/this.SuggestLineHeight)){sdiv.style.height=(cntErg*this.SuggestLineHeight+2)+"px";sframe.style.height=(cntErg*this.SuggestLineHeight+2)+"px";sfrdiv.style.width=(this.SuggestBoxWidth-2)+"px"}else{sdiv.style.height=this.SuggestBoxHeight+"px";sframe.style.height=this.SuggestBoxHeight+"px";sfrdiv.style.width=(this.SuggestBoxWidth-20)+"px"
}TTDR.extend(frames[this.suggestFrame].document.getElementsByTagName("body")[0].style,{margin:0,padding:0,color:"#000",backgroundColor:"#FFF"});if(navigator.appName.indexOf("Microsoft")!=-1){frames[this.suggestFrame].document.getElementsByTagName("body")[0].style.border="1px solid #000"}for(var i=0;i<cntErg;i++){strRes+=this.arSuggestions[i].toHTML()}if(sdiv){sfrdiv.innerHTML=strRes;var arSug=frames[this.suggestFrame].document.getElementsByTagName("div");for(var i=0;i<arSug.length;i++){if(arSug[i].id.search(/^sugrow_/)==-1){continue
}arSug[i].onmouseover=this.EH.sugOnMouseOver;arSug[i].onclick=this.EH.sugOnClick;TTDR.extend(arSug[i].style,{height:this.SuggestLineHeight+"px",cursor:"pointer",whiteSpace:"nowrap"});TTDR.extend(arSug[i].firstChild.style,{display:"block",width:(this.SuggestBoxWidth-30)+"px",lineHeight:this.SuggestLineHeight+"px",fontFamily:this.SuggestFontFamily,fontSize:this.SuggestFontSize+"px",paddingLeft:"3px",cursor:"pointer",overflow:"hidden",whiteSpace:"nowrap"})}this.selRow=0;this.selectRow();sdiv.style.display="block"
}},hideSuggestions:function(){this.arSuggestions=[];this.selRow=-1;$(this.suggestDiv).style.display="none"},positioniereCursor:function(){var input=$(this.inputFeld);var pos=input.value.length;input.focus();if(typeof (document.selection)!="undefined"){input.select();var range=document.selection.createRange();range.move("character",pos);range.select()}else{if(typeof (input.selectionStart)!="undefined"){input.selectionStart=pos;input.selectionEnd=pos}}},updateData:function(){try{var val=this.XMLResponse[this.DataPool];
if(typeof (val)=="undefined"){throw new TTDR.Exception("DatapoolError","'"+this.DataPool+"' was not found in XMLResponse!")}if(typeof (val)=="string"){$(this.Name).value=val}else{var strVal="";for(var i=0;i<val.length;i++){if(val[i].toString){strVal+=val[i].toString()}else{strVal+=val[i]}if(i<(val.length-1)){strVal+="@@"}}$(this.Name).value=strVal}}catch(e){alert("TT DreamReader Exception!!\n\n"+e.name+": "+e.message)}},selectRow:function(){var sframe=frames[this.suggestFrame];var row=sframe.document.getElementById("sugrow_"+this.selRow);
if(row){for(var i=0;i<this.arSuggestions.length;i++){sframe.document.getElementById("sugrow_"+i).style.backgroundColor="transparent"}row.style.backgroundColor=this.SuggestHighlightColor}}};TTDR.EventHandler=function(dr){var pDr=dr;this.handleOnKeyDown=function(e){var e=e||window.event;var charCode=e.which?e.which:e.keyCode;var sugbox=$(pDr.suggestDiv);var sfrdoc=frames[pDr.suggestFrame].document;pDr.ignoreMouseEvents=true;switch(charCode){case 38:if(sugbox.style.display=="block"){if(pDr.selRow>0){pDr.selRow--;
pDr.selectRow();if(frames[pDr.suggestFrame].document.body.scrollTop>20*pDr.selRow){frames[pDr.suggestFrame].scrollTo(0,20*pDr.selRow)}}}if(e.preventDefault){e.preventDefault()}else{return false}break;case 40:if(sugbox.style.display=="block"){if(pDr.selRow<(pDr.arSuggestions.length-1)){pDr.selRow++;pDr.selectRow();if(frames[pDr.suggestFrame].document.body.scrollTop<-180+20*pDr.selRow){frames[pDr.suggestFrame].scrollTo(0,-180+20*pDr.selRow)}}}if(e.preventDefault){e.preventDefault()}else{return false
}break;case 34:case 35:if(sugbox.style.display=="block"){pDr.selRow=pDr.arSuggestions.length-1;pDr.selectRow();if(pDr.selRow>=10){frames[pDr.suggestFrame].scrollTo(0,20*pDr.selRow+2)}}break;case 33:case 36:if(sugbox.style.display=="block"){if(pDr.selRow>0){pDr.selRow=0;pDr.selectRow();frames[pDr.suggestFrame].scrollTo(0,0)}}break;case 27:if(sugbox.style.display=="block"){pDr.hideSuggestions()}if(e.preventDefault){e.preventDefault()}else{return false}break}};this.handleOnKeyPress=function(e){var e=e||window.event;
var charCode=e.which?e.which:e.keyCode;switch(charCode){case 13:if(e.preventDefault){e.preventDefault()}else{return false}break}};this.handleOnKeyUp=function(e){var e=e||window.event;var charCode=e.which?e.which:e.keyCode;var sugbox=$(pDr.suggestDiv);var suglist=frames[pDr.suggestFrame].document.getElementById("suggestions");pDr.ignoreMouseEvents=false;switch(charCode){case 9:case 16:case 32:case 37:case 39:pDr.hideSuggestions();break;case 27:case 33:case 34:case 35:case 36:case 38:case 40:break;
case 13:if($(pDr.inputFeld).value==""||sugbox.style.display!="block"||pDr.selRow==-1){if(e.stopPropagation){e.stopPropagation()}if(e.preventDefault){e.preventDefault()}else{return false}break}var aktSuggest=pDr.arSuggestions[pDr.selRow];var selItem=aktSuggest.vorschlag;var selKat=aktSuggest.kategorie;var nPos=aktSuggest.strpos;if(nPos>1){$(pDr.inputFeld).value=$(pDr.inputFeld).value.substr(0,nPos)+selItem}else{$(pDr.inputFeld).value=selItem}pDr.arSuggestions=[];pDr.XMLResponse.SUGGESTIONS=[];pDr.selRow=-1;
pDr.blockSuggestions=true;if(sugbox.style.display=="block"){pDr.hideSuggestions()}if(typeof (pDr.XMLResponse[selKat])=="string"){pDr.XMLResponse[selKat]=selItem}else{pDr.XMLResponse[selKat].push(selItem)}pDr.XMLRequest.doXMLRequest();pDr.updateData();if(e.stopPropagation){e.stopPropagation()}if(e.preventDefault){e.preventDefault()}else{return false}break;default:if($(pDr.inputFeld).value==""){pDr.hideSuggestions();pDr.updateData();break}if(!pDr.ForceSuggestions){$(pDr.Name).value=$(pDr.inputFeld).value
}pDr.calls++;window.setTimeout(pDr.XMLRequest.doXMLRequest,TTDR.Ajax.Delay)}};this.handleOnFocus=function(){TTDR.hideAllSuggestions();if(this.value==pDr.InputFieldDefaultValue){this.value="";if(document.forms.bengine.input_DESTINATION.value==""){document.forms.bengine.IFFVillage.value=""}}};this.sugOnMouseOver=function(){if(pDr.ignoreMouseEvents){return }pDr.selRow=this.id.replace(/(sugrow_)(.+)/,"$2");pDr.selectRow()};this.sugOnClick=function(){var id=this.id.replace(/(sugrow_)(.+)/,"$2");var selItem=pDr.arSuggestions[id].vorschlag;
var selKat=pDr.arSuggestions[id].kategorie;var nPos=pDr.arSuggestions[id].strpos;if(nPos>1){$(pDr.inputFeld).value=$(pDr.inputFeld).value.substr(0,nPos)+selItem}else{$(pDr.inputFeld).value=selItem}pDr.positioniereCursor();pDr.arSuggestions=[];pDr.selRow=-1;pDr.blockSuggestions=true;pDr.XMLRequest.doXMLRequest()};this.handleXMLResponse=function(){if(pDr.xmlReq.readyState==4){if(pDr.xmlReq.status==200||pDr.xmlReq.status==304){if(pDr.xmlReq.responseText==""){pDr.EH.onAjaxError()}else{pDr.EH.onAjaxSuccess()
}}else{pDr.EH.onAjaxError()}}};this.onAjaxSuccess=function(){pDr.XMLResponse=new TTDR.Ajax.Response(pDr.xmlReq.responseXML);if(!(!pDr.ForceSuggestions&&pDr.XMLResponse[pDr.DataPool]=="")){pDr.updateData()}pDr.arSuggestions=[];if(pDr.XMLResponse.SUGGESTIONS.length>0&&pDr.blockSuggestions==false){for(var i=0;i<pDr.XMLResponse.SUGGESTIONS.length;i++){pDr.arSuggestions[i]=new TTDR.Ajax.Response.Suggestion(pDr.XMLResponse.SUGGESTIONS[i],i,pDr)}pDr.showSuggestions()}else{pDr.hideSuggestions()}pDr.blockSuggestions=false
};this.onAjaxError=function(){}};TTDR.Exception=function(errName,errMessage){this.name=errName;this.message=errMessage};TTDR.Ajax=function(){};TTDR.Ajax.Method="GET";TTDR.Ajax.Url=file_path+"booking/jslib/ttdr/suggest.php?port="+port;TTDR.Ajax.Delay=0;TTDR.Ajax.Response=function(xmlDoc){if(xmlDoc){this.MEALTYPE=this.getXMLValue(xmlDoc.getElementsByTagName("MEALTYPE")[0]);this.SUGGESTIONS=this.getXMLItems(xmlDoc.getElementsByTagName("SUGGESTION")[0]);this.SPORTANDLEISURE=this.getXMLItems(xmlDoc.getElementsByTagName("SPORTANDLEISURE")[0]);
this.BEACH=this.getXMLItems(xmlDoc.getElementsByTagName("BEACH")[0]);this.ROOMTYPE=this.getXMLValue(xmlDoc.getElementsByTagName("ROOMTYPE")[0]);this.WELLNESS=this.getXMLItems(xmlDoc.getElementsByTagName("WELLNESS")[0]);this.STARS=this.getXMLValue(xmlDoc.getElementsByTagName("STARS")[0]);this.FAMILYANDKIDS=this.getXMLItems(xmlDoc.getElementsByTagName("FAMILYANDKID")[0]);this.ADULTS=this.getXMLValue(xmlDoc.getElementsByTagName("ADULTS")[0]);this.CHILDREN=this.getXMLValue(xmlDoc.getElementsByTagName("CHILDREN")[0]);
this.DEPAIRPORT=this.getXMLItems(xmlDoc.getElementsByTagName("DEPAIRPORTS")[0]);this.DESTAIRPORT=this.getXMLValue(xmlDoc.getElementsByTagName("DESTAIRPORT")[0]);this.DESTINATION=this.getXMLDestinations(xmlDoc.getElementsByTagName("DESTINATION")[0]);this.VILLAGES=this.getXMLVillages(xmlDoc.getElementsByTagName("VILLAGE")[0]);this.DATE=this.getXMLValue(xmlDoc.getElementsByTagName("DATE")[0]);this.DURATION=this.getXMLValue(xmlDoc.getElementsByTagName("DURATION")[0]);this.HOTELNAMES=this.getXMLHotelnames(xmlDoc.getElementsByTagName("HOTEL")[0]);
this.TOUROPERATOR=this.getXMLItems(xmlDoc.getElementsByTagName("TOUROPERATOR")[0]);this.RAILWAYSTATION=this.getXMLRailwaystations(xmlDoc.getElementsByTagName("RAILWAYSTATION")[0]);this.POI=this.getXMLPOIs(xmlDoc.getElementsByTagName("POI")[0])}};TTDR.Ajax.Response.prototype={MEALTYPE:"",SUGGESTIONS:new Array(),SPORTANDLEISURE:new Array(),BEACH:new Array(),ROOMTYPE:"",WELLNESS:new Array(),STARS:"",FAMILYANDKIDS:"",ADULTS:"",CHILDREN:"",DEPAIRPORT:"",DESTAIRPORT:"",DESTINATION:new Array(),VILLAGES:new Array(),DATE:"",DURATION:"",HOTELNAMES:new Array(),POI:new Array(),TOUROPERATOR:new Array(),RAILWAYSTATION:new Array(),getXMLItems:function(node){if(!node||!node.childNodes||node.childNodes.length==0){return[]
}var arRes=[];var strVal="";for(var i=0;i<node.childNodes.length;i++){if(node.childNodes[i].nodeName=="ITEM"){strVal=node.childNodes[i].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");strVal=strVal.replace(/'/g,"´");if(strVal!=""){arRes.push(strVal)}}}return arRes},getXMLValue:function(node){if(!node||!node.firstChild){return""}var strVal=node.firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");strVal=strVal.replace(/'/g,"´");return strVal},getXMLHotel:function(node){if(!node||!node.childNodes||node.childNodes.length==0){return""
}var hotelname="";var iff="";var res="";var lat="";var lon="";var citytravel="";for(var i=0;i<node.childNodes.length;i++){var subnode=node.childNodes[i];if(subnode.nodeName=="HOTELNAME"){hotelname=this.getXMLValue(subnode)}else{if(subnode.nodeName=="IFF"){iff=this.getXMLValue(subnode)}else{if(subnode.nodeName=="LAT"){lat=this.getXMLValue(subnode)}else{if(subnode.nodeName=="LONG"){lon=this.getXMLValue(subnode)}else{if(subnode.nodeName=="CITYTRAVEL"){citytravel=this.getXMLValue(subnode)}}}}}}res=(new TTDR.Ajax.Response.Hotel(hotelname,iff,lat,lon,citytravel)).toString();
return res},getXMLHotelnames:function(node){if(!node||!node.childNodes||node.childNodes.length==0){return[]}var arRes=[];var hnname="";var hniff="";var hndlclist="";var hntopregion="";var hniffort="";var hnlat="";var hnlon="";var hncitytravel="";for(var j=0;j<node.childNodes.length;j++){if(node.childNodes[j].nodeName=="HOTELNAME"){hnname=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");hnname=hnname.replace(/'/g,"´")}else{if(node.childNodes[j].nodeName=="IFF"){hniff=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")
}else{if(node.childNodes[j].nodeName=="DLCLIST"){hndlclist=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(node.childNodes[j].nodeName=="TOPREGION"){hntopregion=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(node.childNodes[j].nodeName=="IFFORT"){hniffort=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(node.childNodes[j].nodeName=="LAT"){hnlat=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")
}else{if(node.childNodes[j].nodeName=="LONG"){hnlon=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(node.childNodes[j].nodeName=="CITYTRAVEL"){hncitytravel=node.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}}}}}}}}}if(hnname!=""){arRes[arRes.length]=new TTDR.Ajax.Response.Hotelnames(hnname,hniff,hndlclist,hntopregion,hniffort,hnlat,hnlon,hncitytravel);if(document.forms.bengine.shotel){document.forms.bengine.shotel.value=hnname}if(document.forms.bengine.IFF){document.forms.bengine.IFF.value=hniff
}flagEnter="true"}return arRes},getXMLDestinations:function(node){if(!node||!node.childNodes||node.childNodes.length==0){return[]}var arRes=[];for(var i=0;i<node.childNodes.length;i++){if(node.childNodes[i].nodeName=="ITEM"){var destname="";var desttopregs="";var destaktion="";var destvalue="";var dlclist="";var fewotopreg="";var attributes="";var subnode=node.childNodes[i];var destudr="";var destlat="";var destlon="";var destcitytravel="";for(var j=0;j<subnode.childNodes.length;j++){if(subnode.childNodes[j].nodeName=="DESTINATIONNAME"){destname=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
destname=destname.replace(/'/g,"´")}else{if(subnode.childNodes[j].nodeName=="TOPREGIONIDS"){desttopregs=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="VALUE"){destvalue=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="UDR"){destudr=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="LAT"){destlat=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")
}else{if(subnode.childNodes[j].nodeName=="LONG"){destlon=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="CITYTRAVEL"){destcitytravel=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="DLCLIST"){dlclist=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}}}}}}}}}if(destname!=""&&destvalue!=""){arRes[arRes.length]=new TTDR.Ajax.Response.Destination(destname,destaktion,destvalue,desttopregs,dlclist,fewotopreg,attributes,destudr,destlat,destlon,destcitytravel);
if(document.forms.bengine.IFFVillage){document.forms.bengine.IFFVillage.value=destvalue}flagEnter="true"}}}return arRes},getXMLPOIs:function(node){if(!node||!node.childNodes||node.childNodes.length==0){return[]}var arRes=[];for(var i=0;i<node.childNodes.length;i++){if(node.childNodes[i].nodeName=="ITEM"){var poiName="";var poiIffort="";var poiTopregion="";var poiVillage="";var poiLat="";var poiLon="";var poiCitytravel="";var subnode=node.childNodes[i];for(var j=0;j<subnode.childNodes.length;j++){if(subnode.childNodes[j].nodeName=="POINAME"){poiName=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
poiName=poiName.replace(/'/g,"´")}else{if(subnode.childNodes[j].nodeName=="IFFORT"){poiIffort=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="TOPREGIONIDLAPA"){poiTopregion=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="VILLAGE"){poiVillage=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");poiVillage=poiVillage.replace(/'/g,"´")
}else{if(subnode.childNodes[j].nodeName=="LAT"){poiLat=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="LONG"){poiLon=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="CITYTRAVEL"){poiCitytravel=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}}}}}}}}if(poiName!=""&&document.bengine.POI){document.bengine.POI.value=poiName+"|"+poiIffort+"|"+poiTopregion+"|"+poiVillage+"|"+poiLat+"|"+poiLon+"|"+poiCitytravel;
if(document.forms.bengine.IFFVillage){document.forms.bengine.IFFVillage.value=poiIffort}flagEnter="true"}}}return arRes},getXMLVillages:function(node){if(!node||!node.childNodes||node.childNodes.length==0){return[]}var arRes=[];var strVal="";for(var i=0;i<node.childNodes.length;i++){if(node.childNodes[i].nodeName=="ITEM"){var ortname="";var ortaktion="2";var orttopreg="";var ortiff="";var dlclist="";var fewotopreg="";var subnode=node.childNodes[i];for(var j=0;j<subnode.childNodes.length;j++){if(subnode.childNodes[j].nodeName=="VILLAGENAME"){ortname=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2");
ortname=ortname.replace(/'/g,"´")}else{if(subnode.childNodes[j].nodeName=="TOPREGIONID"){orttopreg=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="VALUE"){ortiff=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}}}}if(ortname!=""){arRes[arRes.length]=new TTDR.Ajax.Response.Village(ortname,ortaktion,orttopreg,ortiff,dlclist,fewotopreg)}}}return arRes},getXMLRailwaystations:function(node){if(!node||!node.childNodes||node.childNodes.length==0){return[]
}var arRes=[];var strVal="";for(var i=0;i<node.childNodes.length;i++){if(node.childNodes[i].nodeName=="ITEM"){var id="";var country="";var rname="";var subnode=node.childNodes[i];for(var j=0;j<subnode.childNodes.length;j++){if(subnode.childNodes[j].nodeName=="ID"){id=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="COUNTRYID"){country=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")}else{if(subnode.childNodes[j].nodeName=="NAME"){rname=subnode.childNodes[j].firstChild.nodeValue.replace(/^(\s+)?(.*)(\s+)?$/,"$2")
}}}}if(id!=""){arRes[arRes.length]=new TTDR.Ajax.Response.Railwaystation(id,country,rname)}}}return arRes}};TTDR.Ajax.Response.Suggestion=function(strSuggestion,id,pDr){var arTmp=strSuggestion.split(";");if(arTmp[1]=="VILLAGE"){arTmp[1]="VILLAGES"}this.vorschlag=arTmp[0];this.kategorie=arTmp[1];this.strpos=arTmp[2];this.id=id;this.toHTML=function(){var strErg='<div id="sugrow_'+this.id+'" class="divSuggestion"><span>'+this.vorschlag.trim(pDr.SuggestLength)+"</span></div>";return strErg}};TTDR.Ajax.Response.Hotelnames=function(name,iff,dlclist,topregion,iffort,lat,lon,citytravel){this.name=name;
this.iff=iff;this.dlclist=dlclist;this.topregion=topregion;this.iffort=iffort;this.lat=lat;this.lon=lon;this.citytravel=citytravel;this.toString=function(){return this.name+"|"+this.iff+"|"+this.dlclist+"|"+this.topregion+"|"+this.iffort+"|"+this.lat+"|"+this.lon+"|"+this.citytravel}};TTDR.Ajax.Response.Destination=function(name,daction,value,topregs,dlclist,fewotopreg,attributes,udr,lat,lon,citytravel){var arTmp=daction.split(";");this.name=name;this.daction=arTmp[1];var tmp_value=value.split(";")[0]||"";
this.value=tmp_value;this.topregions=topregs;this.dlclist=dlclist;this.fewotopreg=fewotopreg;this.attributes=attributes;this.udr=udr;this.lat=lat;this.lon=lon;this.citytravel=citytravel;this.toString=function(){return this.name+"|"+this.daction+"|"+this.value+"|"+this.topregions+"|"+this.dlclist+"|"+this.fewotopreg+"|"+this.attributes+"|"+this.udr+"|"+this.lat+"|"+this.lon+"|"+this.citytravel}};TTDR.Ajax.Response.POI=function(name,iffort,topregion,village,lat,lon,citytravel){this.name=name;this.iffort=iffort;
this.topregion=topregion;this.village=village;this.lat=lat;this.lon=lon;this.citytravel=citytravel;this.toString=function(){return this.name+"|"+this.iffort+"|"+this.topregion+"|"+this.village+"|"+this.lat+"|"+this.lon+"|"+this.citytravel}};TTDR.Ajax.Response.Village=function(name,vaction,topregion,iffort,dlclist,fewotopreg){this.name=name;this.vaction=vaction;this.topregion=topregion;this.iffort=iffort;this.dlclist=dlclist;this.fewotopreg=fewotopreg;this.toString=function(){return this.name+"|"+this.vaction+"|"+this.topregion+"|"+this.iffort+"|"+this.dlclist+"|"+this.fewotopreg
}};TTDR.Ajax.Response.Railwaystation=function(id,country,rname){this.id=id;this.country=country;this.rname=rname;this.toString=function(){return this.id+"|"+this.country+"|"+this.rname}};TTDR.Ajax.Response.Hotel=function(hotelname,iff,lat,lon,citytravel){this.hotelname=hotelname;this.iff=iff;this.lat=lat;this.lon=lon;this.citytravel=citytravel;this.toString=function(){return this.hotelname+"|"+this.iff+"|"+this.lat+"|"+this.lon+"|"+this.citytravel}};TTDR.Ajax.Request=function(dr){var pDr=dr;this.doXMLRequest=function(){pDr.calls--;
if(pDr.calls>0||$(pDr.inputFeld).value==""){if(document.forms.bengine.IFFVillage){document.forms.bengine.IFFVillage.value=""}return }var xmlRequest=false;try{xmlRequest=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){xmlRequest=false}}if(!xmlRequest&&typeof (XMLHttpRequest)!="undefined"){xmlRequest=new XMLHttpRequest()}if(xmlRequest){pDr.xmlReq=xmlRequest;if(document.forms.bengine.IFFVillage&&document.forms.bengine.IFFVillage.value!=""){pDr.xmlReq.open("GET",TTDR.Ajax.Url+"?datapools="+pDr.DataPool+"&userinput="+escape($(pDr.inputFeld).value)+"&IFFVillage="+document.forms.bengine.IFFVillage.value,true)
}else{pDr.xmlReq.open("GET",TTDR.Ajax.Url+"?datapools="+pDr.DataPool+"&userinput="+escape($(pDr.inputFeld).value),true)}pDr.xmlReq.onreadystatechange=pDr.EH.handleXMLResponse;pDr.xmlReq.send(null)}}};String.prototype.trim=function(maxchar){var strRet=this;try{if(this.length>maxchar){strRet=this.substr(0,maxchar-3)+"..."}}catch(e){strRet=""}return strRet};inputDestinationText="Stadt oder Sehenswürdigkeit";inputHotelnamesText="Hotelname / -kette";streckenpfad="tui_reisecenter_at";var inputClass="ttkalInput2";
var leftDistance=478;var topDistance=50;function ferienOnChange(selBox){g_strFerienSelect=selBox.value;oKalHin.updateCalendar();oKalRueck.updateCalendar()}function ckeckRelatives(object){if(object.type!="undefined"&&object.name!="undefined"&&object.name!=""){var relative="";var test1=/.*Klein$/;if(test1.test(object.name)){relative=object.name.replace(/Klein$/,"")}else{relative=object.name+"Klein"}if(typeof document.getElementsByName(relative)[0]=="undefined"){return false}var tmpSelObjDefault="input[name='"+relative+"']";
var tmpSelObj="input[name='"+relative+"'][value='"+object.value+"']";var tmpSelObj2="select[name='"+relative+"']";if(typeof $(tmpSelObj)[0]!="undefined"&&$(tmpSelObj)[0]!=""&&$(tmpSelObj)[0].type=="radio"){for(c=0;c<document.getElementsByName(relative).length;c++){document.getElementsByName(relative)[c].checked=false;if(document.getElementsByName(relative)[c].value.toString()==object.value.toString()){$(tmpSelObj)[0].checked=true}}}else{if(typeof jQuery(tmpSelObjDefault)[0]!="undefined"&&jQuery(tmpSelObjDefault)[0]!=""&&jQuery(tmpSelObjDefault)[0].type=="text"){jQuery(tmpSelObjDefault).val(object.value)
}else{if(typeof $(tmpSelObj2)!="undefined"&&$(tmpSelObj2)!=""&&$(tmpSelObj2)[0].type=="select-one"){for(c=0;c<$(tmpSelObj2)[0].options.length;c++){if($(tmpSelObj2)[0].options[c].value==object.value){$(tmpSelObj2)[0].options[c].selected=true}}}else{return false}}}return true}else{return false}}function initCheckRelatives(){if(detail=="hotel"){var checkRelatives=new Array("kategorie","kategorieKlein","zimmer","zimmerKlein","verpflegung","verpflegungKlein");for(c=0;c<checkRelatives.length;c++){if(document.getElementsByName(checkRelatives[c])[0].type=="text"){jQuery("[name='"+checkRelatives[c]+"']").bind("blur",function(){ckeckRelatives(this)
})}else{jQuery("[name='"+checkRelatives[c]+"']").bind("click",function(){ckeckRelatives(this)})}}}}var defAuswahlEX={ziel:"alle Reiseziele",region:"alle Regionen"};var optHbfgesTU=["Bewertung;0","mind. 3.0 von 6.0;30","mind. 4.0 von 6.0;40","mind. 5.0 von 6.0;50","6.0 von 6.0;60"];var optHbfanzTU=["Anzahl Bewertungen;0","mind. 2;2","mind. 3;3","mind. 5;5","mind. 10;10","mind. 20;20","mind. 30;30"];var optHbfempfTU=["Empfehlung;0","mind. 80%;800","mind. 90%;900","100%;1000"];function checkRadioFamily(obj,family){try{if(typeof obj.checked!="undefined"){for(c=0;
c<family.length;c++){family[c].checked=false}}}catch(e){}return obj}var IBE=new TTIBE("IBE",port,"bengine");var arrOrte=[];IBE.jsFiles=[];IBE.initOnLoad=function(){var mustHave=["FormBase","DateHelperLoaded","termin_min_"+this.port,"termin_max_"+this.port,"Zeitraum","Reisende","Terminauswahl","arrMarke_"+this.port,"Kalender","g_oFerien"];var injObj;if(this.req.formular=="5"){injObj={SucheERDE:[],Zeitraum:[],Reisende:[this.req.personen]}}else{injObj={Zielauswahl:[defAuswahlEX],SucheERDE:[],Zeitraum:[],Reisende:[this.req.personen]}
}if(this.req.formular=="4"){mustHave=mustHave.concat(["Zielauswahl","TTREGS_"+this.port,"optZielOrt"])}else{if(this.req.formular=="5"){mustHave.push("arrLaender")}else{mustHave=mustHave.concat(["Zielauswahl","TTRZ_ERDE","optZielOrt"])}}for(var i in mustHave){if(typeof (window[mustHave[i]])=="undefined"){window.setTimeout("IBE.initOnLoad()",20);return }}this.inject(injObj);this.init()};var optZimmerEX=["beliebig;-1","Einzelzimmer;5","Doppelzimmer;6","Familienzimmer;2","Bungalow;0","Studio/Apartment/Suite;8"];
var optVerpflegungEX=["beliebig;-1","nur Übernachtung;0","Frühstück;1","Halbpension;2","Vollpension;3","All Inclusive;4"];function showOrte(){var i,lbl,val;var tmp=[];var expr=new RegExp(" "+IBE.req.orte_IFF,"");var selectbox=document.getElementById("selOrte");if(selectbox){for(i=selectbox.length-1;i>0;i--){selectbox.options[i]=null}for(i=0;i<arrOrte.length;i++){tmp=arrOrte[i].split("#");val=tmp[0];lbl=tmp[1];selectbox.options[i+1]=new Option(lbl,val);if(IBE.req.orte_IFF!=""&&expr.exec(val)!=null){selectbox.options[i+1].selected=true
}}}}this.dauert_toc=function(){var sb=document.getElementsByName("dauer")[0]||0;if(!sb||sb.type!="select-one"){return }sb.options[sb.options.length]=new Option("Reisedauer","-1");sb.options[sb.options.length]=new Option("1 Tag","6_1");for(i=2;i<=21;i++){sb.options[sb.options.length]=new Option(i+" Tage","6_"+i)}sb.options[sb.options.length]=new Option("> 22 Tage","13");try{if(this.req.dauer!=""&&this.req.dauer!="-1"){sb.value=this.req.dauer}}catch(e){}};function SucheERDE(){FormBase.apply(this);Terminauswahl.apply(this);
this.setBitChecksGroups=function(cknames){for(var i=0;i<cknames.length;++i){cba=document.getElementsByName(cknames[i]);for(var j=0;j<cba.length;++j){var cb=cba[j];if(!cb){continue}var val=typeof (this.req[cknames[i].replace(/\[\]$/,"")])!="undefined"?parseInt(this.req[cknames[i].replace(/\[\]$/,"")],10):0;val=val<0?0:val;if(cb&&(parseInt(cb.value,10)&val)!=0){cb.checked=true}}}};this.fillReisende=function(optUsrPersLbl){var defPersLbl={erw:["Erwachsener","Erwachsene"],erw_short:["Erwachsener","Erwachsene"],pers:["Person","Personen"],kinder:["J.","J."]};
var optPersLbl=optUsrPersLbl||defPersLbl;var strPers=this.Personen;var bform=document.forms[this.formname];var elems=["alter1","alter2","alter3"];var erwSel=bform.erwachsene;var strErw="25";var erwMax=this.req.engine=="fewo"?8:4;if(typeof (bform.erwachsene)!="undefined"){for(i=1;i<=erwMax;i++){var lbl;if(this.req.engine=="fewo"){lbl=i==1?optPersLbl.pers[0]:optPersLbl.pers[1]}else{if(this.req.formular=="2"||this.req.formular=="3"||typeof (window.SucheERDE)!="undefined"||typeof (window.SucheLMPS)!="undefined"){lbl=i==1?optPersLbl.erw_short[0]:optPersLbl.erw_short[1]
}else{lbl=i==1?optPersLbl.erw[0]:optPersLbl.erw[1]}}erwSel.options[erwSel.options.length]=new Option(i+" "+lbl,strErw);strErw+=";25"}erwSel.options.selectedIndex=this.AnzErwachsene-1;for(i=0;i<elems.length;++i){if(bform[elems[i]]){bform[elems[i]].options[0]=new Option("Kind "+(i+1),"-1");bform[elems[i]].options[1]=new Option("< 2 "+optPersLbl.kinder[0],"1");for(var j=2;j<=16;j++){bform[elems[i]].options[j]=new Option(j+" "+optPersLbl.kinder[1],j)}if(this.AlterKinder[i]&&this.AlterKinder[i]!="-1"){bform[elems[i]].value=this.AlterKinder[i]
}}}}};this.dauert=function(){var sb=document.getElementsByName("dauer")[0]||0;if(!sb||sb.type!="select-one"){return }sb.options[sb.options.length]=new Option("Reisedauer","-1");sb.options[sb.options.length]=new Option("1 Tag","6_1");for(i=2;i<=21;i++){sb.options[sb.options.length]=new Option(i+" Tage","6_"+i)}sb.options[sb.options.length]=new Option("> 22 Tage","13");try{if(this.req.dauer!=""&&this.req.dauer!="-1"){sb.value=this.req.dauer}}catch(e){}};this.UpdateRegionen=function(){var opt;if(document.forms[this.formname].uthema){this.uthema=document.forms[this.formname].uthema.value
}else{if(document.forms[this.formname].uthema_dis){this.uthema=document.forms[this.formname].uthema_dis.value}else{if(document.forms[this.formname].zielOrt){opt=document.forms[this.formname].zielOrt.options;for(i=0;i<opt.length;i++){if(this.req.orte_IFF&&opt[i].value.split(" ")[1]==this.req.orte_IFF){bform.zielOrt.value=opt[i].value}}}return }}this.HBit=this.uthema.split("_");if(this.HBit[0]==1){this.tmp_val=4;this.tmp_HBit=1}else{this.tmp_val=5;this.tmp_HBit=2}document.forms[this.formname].elements.region.options[0]=new Option(this.optFirstRegSelect.region,"-1");
var type_ziel=1;if(typeof (document.forms[this.formname].elements.ziel_dis)!="undefined"){type_ziel=2}if(type_ziel==1){opt=document.forms[this.formname].elements.ziel.options}else{opt=document.forms[this.formname].elements.ziel_dis.options}while(opt.length>0){opt[opt.length-1]=null}opt[0]=new Option(this.optFirstRegSelect.ziel,"-1");for(i=0;i<this.Regionen.length;++i){var sr=this.Regionen[i].split("|");if(sr[1]>=10000){if((sr[this.tmp_val]&(1<<this.HBit[1]-1)&&this.HBit[0]==this.tmp_HBit)||this.uthema==""||this.uthema=="0"){opt[opt.length]=new Option(sr[0],sr[1])
}}}this.FixRSel()};this.RZC=function(ds){var bform=document.forms[this.formname];var zielSel;var type_ziel=1;if(typeof (document.forms[this.formname].elements.ziel_dis)!="undefined"){type_ziel=2}if(type_ziel==1){zielSel=bform.elements.ziel}else{zielSel=bform.elements.ziel_dis}var kenner=zielSel.value;this.valZiel=kenner;if(zielSel.selectedIndex>0){this.strZiel=zielSel[zielSel.selectedIndex].text}else{this.strZiel=""}this.gfilt=kenner!=-1;var opt=bform.elements.region.options;while(opt.length>1){opt[opt.length-1]=null
}for(i=0;i<this.Regionen.length;++i){var sr=this.Regionen[i].split("|");if(sr[1]<10000&&(kenner<0||sr[2]==kenner)){if((sr[this.tmp_val]&(1<<this.HBit[1]-1)&&this.HBit[0]==this.tmp_HBit)||this.uthema==""||this.uthema=="0"){opt[opt.length]=new Option(sr[0],sr[1]+"|"+sr[2])}}}if(ds){opt.selectedIndex=0;this.strReg="";this.valReg=-1}};this.REGC=function(){var type_ziel=1;var selZiel;if(typeof (document.forms[this.formname].elements.ziel_dis)!="undefined"){type_ziel=2}var bform=document.forms[this.formname];
var ropt=bform.elements.region.options;var kenner=ropt[ropt.selectedIndex].value.split("|");this.valReg=kenner[0];if(ropt.selectedIndex>0){this.strReg=ropt[ropt.selectedIndex].text.replace(/([^(]*)\((.*)/,"$1")}else{this.strReg=""}if(this.gfilt==false&&kenner[0]>=0){try{if(type_ziel==1){selZiel=bform.elements.ziel}else{selZiel=bform.elements.ziel_dis}selZiel.value=kenner[1];this.valZiel=kenner[1];this.strZiel=selZiel.options[selZiel.options.selectedIndex].text}catch(e){}}};this.FixRSel=function(){var type_ziel=1;
var opt;if(typeof (document.forms[this.formname].elements.ziel_dis)!="undefined"){type_ziel=2}if(type_ziel==1){opt=document.forms[this.formname].elements.ziel.options}else{opt=document.forms[this.formname].elements.ziel_dis.options}if((opt.selectedIndex<0||opt.value!=this.valZiel)&&this.valZiel!=0){try{if(type_ziel==1){document.forms[this.formname].elements.ziel.value=this.valZiel}else{document.forms[this.formname].elements.ziel_dis.value=this.valZiel}}catch(e){if(this.strZiel!=""){opt[opt.length]=new Option(this.strZiel,this.valZiel,true,true)
}else{opt.selectedIndex=0;this.RZC();return }}}this.RZC();opt=document.forms[this.formname].elements.region.options;if(opt.selectedIndex<0||opt[opt.selectedIndex].value.split("|")[0]!=this.valReg){for(i=0;i<opt.length;i++){if(opt[i].value.split("|")[0]==this.valReg){opt.selectedIndex=i;break}}if(i==opt.length){if(this.strReg!=""){opt[opt.length]=new Option(this.strReg+" (keine Ang.)",this.valReg+"|"+this.valZiel,true,true)}else{opt.selectedIndex=0;this.valReg=-1;this.strReg=""}}}};this.is_land=function(idland){var expr=new RegExp(idland+"#","");
for(var i=0;i<arrLaender.length;i++){if(expr.exec(arrLaender[i])!=null){return true}}return false};this.showLaender=function(){var i,lbl,val,sel;var tmp=[];var selectbox=document.getElementById("selLaender");for(i=selectbox.length-1;i>=0;i--){selectbox.options[i]=null}for(var u=0;u<arrLaender.length;u++){tmp=arrLaender[u].split("#");val=tmp[0];lbl=tmp[1];selectbox.options[u]=new Option(lbl,val);if(IBE.req.selLand==val){selectbox.options[u].selected=true;this.req.orte_max=tmp[2]}}};this.updateOrte=function(){var aktLand=document.getElementById("selLaender").value;
var tmp=arrLaender[document.getElementById("selLaender").selectedIndex].split("#");this.req.orte_max=tmp[2];var iFrameOrte=document.getElementById("iframeOrte");iFrameOrte.src=file_path+"booking/js/iff_orte/getOrte_js.php?selLand="+aktLand};this.booking_action=function(){var bform=document.forms[this.formname];if(bform.detail.value==""){bform.detail.value="zielgebiet"}if(this.req.orte_IFF!=0&&bform.formular.value=="4"){this.BookingAction(detail)}else{this.BookingAction(bform.detail.value)}};this.BookingAction=function(detail){var bform=document.forms[this.formname];
bform.showresult.value="1";if(detail){bform.detail.value=detail}else{detail=bform.detail.value}bform.termin.value=parseInt(getTimestampFromString(bform.oKalHin_input.value)/1000);bform.ruecktermin.value=parseInt(getTimestampFromString(bform.oKalRueck_input.value)/1000);if(typeof (bform.shotel)!="undefined"&&(bform.shotel.value=="Hotelname"||bform.shotel.value=="Kreuzfahrtname"||bform.shotel.value=="Rundreisename")){bform.shotel.value=""}var felder={input_DESTINATION:["DESTINATION","Das von Ihnen eingegebene Reiseziel ist uns leider nicht bekannt."],input_HOTELNAMES:["DESTINATION","Das/Die von Ihnen eingegebene Hotel/-kette ist uns leider nicht bekannt."]};
updateHiddenFields();if(detail=="hotel"&&bform.suchradius&&typeof (TT_GoogleMap)!="undefined"){bform.suchradius.value=TT_GoogleMap.suchradius}if(typeof searchLayer!="undefined"&&checkSearchLayer&&bform.searchLayer.value=="1"){if(typeof bform.udfregionen!="undefined"){bform.udfregionen.value=""}checkSearchLayer();if(typeof bform.wDLC!="undefined"){bform.wDLC.value=""}if(typeof bform.zielgebiets_kenner!="undefined"){bform.zielgebiets_kenner.value=""}}if(flagDRInput&&flagNODR){if(document.getElementById("divErrorDR")){document.getElementById("divErrorDR").style.display="none"
}if((bform.input_DESTINATION.value!=""&&bform.input_DESTINATION.value!=drRZ.InputFieldDefaultValue&&((bform.DESTINATION.value=="-1"||bform.DESTINATION.value==""))&&(bform.input_DESTINATION.value!=""&&bform.POI.value!=drRZ.InputFieldDefaultValue&&(bform.POI.value=="-1"||bform.POI.value==""||typeof (bform.POI)=="undefinded")))){if(document.getElementById("divErrorDR")){if(typeof document.getElementById("divResult")!="undefined"){document.getElementById("divResult").style.display="none"}document.getElementById("divErrorDR").innerHTML='<div class="tt_font11b tt_padtop tt_padbot">'+felder.input_DESTINATION[1]+"</div>";
document.getElementById("divErrorDR").style.display="block";$("tabSucheOuterContainer").innerHTML=""}else{alert(felder.input_DESTINATION[1])}bform.input_DESTINATION.focus();bform.input_DESTINATION.select();return false}if(bform.input_DESTINATION.value!=""&&bform.input_DESTINATION.value!=drRZ.InputFieldDefaultValue&&bform.DESTINATION.value==""&&typeof (bform.POI.value)=="undefined"){if(document.getElementById("divErrorDR")){if(typeof document.getElementById("divResult")!="undefined"){document.getElementById("divResult").style.display="none"
}document.getElementById("divErrorDR").innerHTML='<div class="tt_font11b tt_padtop tt_padbot">'+felder.input_DESTINATION[1]+"</div>";document.getElementById("divErrorDR").style.display="block";$("tabSucheOuterContainer").innerHTML=""}else{alert(felder.input_DESTINATION[1])}bform.input_DESTINATION.focus();bform.input_DESTINATION.select();return false}}if(bform.preis.value=="beliebig"){bform.preis.value=""}return this.chkFormular()};this.chkFormular=function(){var bform=document.forms[this.formname];
if(bform.termin.value>bform.ruecktermin.value){alert("Ihr Rückreisedatum liegt vor dem Hinreisedatum");return false}if(document.getElementById("quickSearchErwSuche").style.display=="block"){bform.showErwSuche.value="1"}else{bform.showErwSuche.value=""}if(bform.input_DESTINATION.value==inputDestinationText){bform.input_DESTINATION.focus();window.setTimeout("formSubmit()",200)}else{bform.submit()}return false};this.init=function(){if(!document.forms[this.formname]){return }g_strFerienSelect=document.forms[this.formname].ferientermine.value;
g_oTermine.tsTerminMin=this.termin_min*1000;g_oTermine.tsTerminMax=this.termin_max*1000;g_oTermine.tsSelTerminHin=getTimestampFromString(this.termin_hin);g_oTermine.tsSelTerminRueck=getTimestampFromString(this.termin_rueck);altStyle=1;oKalHin=new Kalender("oKalHin","hin","-1",1,1);oKalRueck=new Kalender("oKalRueck","rueck","-1",1,1);oKalHin.init();oKalRueck.init();with(this){dauert();fillSels({ferientermine:optBundeslaender});fillReisende();setRadios(["verpflegung","zimmer","kategorie","familie_kinder"]);
setBitChecksGroups(["HotelBit[]","HotelBit1[]","HotelBit2[]","WellBit1[]"]);UpdateRegionen();if(typeof (optHbfges)!="undefined"){fillSels({hbfges:optHbfgesTU,hbfempf:optHbfempfTU})}if(detail!="zielgebiet"&&detail!=""&&document.forms.bengine.IFFVillage){document.forms.bengine.IFFVillage.value=document.forms.bengine.IFFOrt.value}}drInit();$("input_DESTINATION").style.color="#000";$("input_HOTELNAMES").style.color="#000"}}var flagNODR=true;var flagDRInput=false;var flagTopRegion=false;function updateHiddenFields(){var bform=document.bengine;
function checkHotelnames(arHN){var bform=document.bengine;var hnname="";var hniff="";var hntopregion="";var hniffort="";var hnlat="";var hnlon="";var hncitytravel="";for(var i=0;i<arHN.length;i++){arTmp=arHN[i].split("|");if(arTmp.length<4){continue}hnname=arTmp[0];hniff=arTmp[1];hndlclist=arTmp[2];hntopregion=arTmp[3];hniffort=arTmp[4];hnlat=arTmp[5];hnlon=arTmp[6];hncitytravel=arTmp[7]}if(hnname!=""){if(hniffort!=""){hniffort=hniffort.replace(/(.*)(;)$/,"$1")}bform.lat.value=hnlat!=""?hnlat:0;bform.lon.value=hnlon!=""?hnlon:0;
bform.citytravel.value=hncitytravel!=""?hncitytravel:"";bform.IFFOrt.value="";bform.IFF.value="";bform.topRegion.value="";bform.detail.value="zielgebiet";if(bform.flugdauer){bform.flugdauer.value=""}if(hniffort!=""){bform.IFFOrt.value=hniffort}if(hniff!=""){bform.detail.value="termine";bform.IFF.value=hniff;if(hntopregion!=""){bform.topRegion.value=hntopregion}}else{if(hntopregion!=""){bform.detail.value="hotel";bform.IFF.value="";bform.topRegion.value=hntopregion}}if(hncitytravel=="false"||hncitytravel==""){bform.action="index.php"
}if(bform.DESTINATION.value==""&&bform.udfregionen){bform.udfregionen.value=""}if(bform.IFFFilter){bform.IFFFilter.value=""}flagNODR=false}}var arTmp=[];var arDest=bform.DESTINATION.value==""?[]:bform.DESTINATION.value.split("@@");if(bform.POI.value){var arPOI=bform.POI.value==""?[]:bform.POI.value.split("@@")}var arHN=bform.HOTELNAMES.value==""?[]:bform.HOTELNAMES.value.split("@@");if(bform.DESTINATION.value!=""){var udfregionen="";var iffort="";var destname="";var daction="";var dvalue="";var topregions="";
var citytravel="";for(i=0;i<arDest.length;i++){arTmp=arDest[i].split("|");if(arTmp.length<4){continue}destname=arTmp[0];daction=arTmp[1];dvalue=arTmp[2];topregions=arTmp[3].replace(/;/g,",");udr=arTmp[7];lat=arTmp[8];lon=arTmp[9];citytravel=arTmp[10];if(typeof (daction)=="undefined"){continue}}if(destname!=""){udfregionen+=destname+"|"+topregions+";";if(daction=="2"){iffort+=dvalue+";"}if(bform.IFFOrt.value!=dvalue){drHT.InputFieldDefaultValue="Hotelname / -kette";if(bform.IFF){bform.IFF.value=""
}}if(dvalue!=""&&dvalue!="0"&&dvalue.search(";")=="-1"){bform.IFFOrt.value=dvalue;bform.IFFVillage.value=dvalue}if(udfregionen!=""){udfregionen=udfregionen.replace(/(.*)(;)$/,"$1")}bform.udfregionen.value=udfregionen;if(bform.flugdauer){bform.flugdauer.value=""}bform.lat.value=0;bform.lon.value=0;bform.citytravel.value=citytravel!=""?citytravel:"";if(bform.citytravel&&(bform.citytravel.value=="false"||bform.citytravel.value=="")){bform.IFFOrt.value="";bform.IFFVillage.value=dvalue}if(citytravel=="false"||citytravel==""){bform.action="index.php";
if(topregions.search(",")!=-1){bform.detail.value="zielgebiet"}else{var tmpUdfReg=bform.udfregionen.value.split("|");var tmpUdfReg2=tmpUdfReg[1].split(",");bform.udfregionen.value=tmpUdfReg[0]+"|"+tmpUdfReg2[0];bform.topRegion.value=tmpUdfReg2[0];bform.suchradius.value="";flagTopRegion=true;bform.detail.value="hotel"}}else{bform.detail.value="hotel"}if(bform.IFF.value!=""){bform.detail.value="termine"}if(bform.hotelsortierung.value!=""){bform.hotelsortierung.value="-1"}}if(bform.HOTELNAMES.value!=""){checkHotelnames(arHN)
}else{bform.input_HOTELNAMES.value="";bform.input_HOTELNAMES.value="";bform.suchradius.value="";bform.zielgebiets_kenner.value="-1";if(bform.wDLC){bform.wDLC.value=""}if(bform.IFFFilter){bform.IFFFilter.value=""}}if(!flagTopRegion){bform.topRegion.value=topregions}flagNODR=false}else{if(bform.POI.value!=""&&arPOI){var poiname="";var poiiffort="";var poitopregion="";var poivillage="";var poilat="";var poilon="";var poicitytravel="";for(var i=0;i<arPOI.length;i++){arTmp=arPOI[i].split("|");if(arTmp.length<4){continue
}poiname=arTmp[0];poiiffort=arTmp[1];poitopregion=arTmp[2];poivillage=arTmp[3];poilat=arTmp[4];poilon=arTmp[5];poicitytravel=arTmp[6]}if(poiname!=""){bform.IFFOrt.value="";bform.topRegion.value="";bform.udfregionen.value="";if(poiiffort!=""){bform.IFFOrt.value=poiiffort;bform.IFFVillage.value=poiiffort}if(poitopregion!=""){bform.topRegion.value=poitopregion}bform.lat.value=poilat!=""?poilat:0;bform.lon.value=poilon!=""?poilon:0;if(bform.flugdauer){bform.flugdauer.value=""}bform.citytravel.value=poicitytravel!=""?poicitytravel:"";
if(poicitytravel=="true"){bform.detail.value="hotel"}else{bform.detail.value="hotel"}if(bform.udfregionen){bform.udfregionen.value=poivillage+"|"+bform.topRegion.value}if(bform.hotelsortierung.value!=""){bform.hotelsortierung.value="-1"}}if(bform.HOTELNAMES.value!=""){checkHotelnames(arHN)}else{bform.input_HOTELNAMES.value="";if(bform.IFFFilter){bform.IFFFilter.value=""}bform.zielgebiets_kenner.value="-1";if(bform.wDLC){bform.wDLC.value=""}if(bform.IFFFilter){bform.IFFFilter.value=""}}flagNODR=false
}else{if(bform.HOTELNAMES.value!=""){checkHotelnames(arHN)}else{if(typeof searchLayer!="undefined"&&searchLayer!="1"){if((bform.input_DESTINATION.value==""||bform.input_DESTINATION.value==inputDestinationText)&&(bform.input_HOTELNAMES.value==""||bform.input_HOTELNAMES.value==inputHotelnamesText)){if(bform.IFFOrt){bform.IFFOrt.value=""}if(bform.IFFVillage){bform.IFFVillage.value=""}if(bform.topRegion){bform.topRegion.value=""}if(bform.udfregionen){bform.udfregionen.value=""}if(bform.IFFVillage){bform.zielgebiets_kenner.value="-1"
}if(bform.wDLC){bform.wDLC.value=""}bform.detail.value="zielgebiet"}else{if(bform.citytravel.value=="false"&&bform.input_HOTELNAMES.value!="Hotelname / -kette"){if(bform.input_DESTINATION.value==""||bform.input_DESTINATION.value=="Stadt oder Sehenswürdigkeit"){if(bform.udfregionen){bform.udfregionen.value=""}}}else{if(bform.input_DESTINATION.value==""){if(bform.IFFOrt){bform.IFFOrt.value=""}if(bform.IFFVillage){bform.IFFVillage.value=""}if(bform.topRegion){bform.topRegion.value=""}if(bform.udfregionen){bform.udfregionen.value=""
}bform.detail.value="zielgebiet"}else{if(bform.input_HOTELNAMES.value==""){bform.IFF.value="";bform.udfregionen.value="";if(bform.input_DESTINATION.value!=""){bform.detail.value="hotel"}else{bform.detail.value="zielgebiet";if(bform.IFFOrt){bform.IFFOrt.value=""}bform.topRegion.value=""}}else{if(bform.detail.value=="zielgebiet"){if(bform.topRegion){bform.topRegion.value=""}if(bform.udfregionen){bform.udfregionen.value=""}}}}}}if(bform.HOTELNAMES.value!=""){checkHotelnames(arHN)}flagNODR=true}}}}}function drInit(){drRZ.init();
drPOI.init();drHT.init()}function onAjaxError(){}TTDR.Ajax.Port="653";TTDR.Ajax.Url=file_path+"booking/"+streckenpfad+"/city/js/suggest.php";var drRZ=new TTDR.DreamReader("DESTINATION");drRZ.InputFieldDefaultValue=inputDestinationText;drRZ.SuggestHighlightColor="#99CCFF";drRZ.SuggestFontFamily="Arial";drRZ.SuggestFontSize="11";drRZ.InputFieldWidth="200";drRZ.EH.onAjaxError=onAjaxError;var drPOI=new TTDR.DreamReader("POI");drPOI.InputFieldDefaultValue=inputDestinationText;drPOI.SuggestHighlightColor="#99CCFF";
drPOI.SuggestFontFamily="Arial";drPOI.SuggestFontSize="11";drPOI.InputFieldWidth="162";drPOI.EH.onAjaxError=onAjaxError;var drHT=new TTDR.DreamReader("HOTELNAMES");drHT.InputFieldDefaultValue=inputHotelnamesText;drHT.SuggestHighlightColor="#99CCFF";drHT.SuggestFontFamily="Arial";drHT.SuggestFontSize="11";drHT.InputFieldWidth="200";drHT.EH.onAjaxError=onAjaxError;function showInfoDR(status){document.getElementById("divInfoDR").style.display=status?"block":"none";return true}function showInfoHT(status){document.getElementById("divInfoHT").style.display=status?"block":"none";
return true}function showInfoZEM(status){document.getElementById("divInfoZEM").style.display=status?"block":"none";return true}function showWaitDiv(){document.getElementById("waitDiv").style.display="block"}function formSubmit(){var bform=document.forms.bengine;bform.submit()}function setDRInput(){var zg_DRAusgabe=$("zg_ausgabe").innerHTML.split(",");if($("input_DESTINATION")){$("input_DESTINATION").value=zg_DRAusgabe[0].replace(/&nbsp;/g,"")}}var statusTabSuche=false;function showSuche(statusTabSuche){$("tabSuche").style.display=statusTabSuche?"block":"none";
statusTabSuche=statusTabSuche?false:true;if(countAttributes>0&&statusTabSuche){$("#quickSucheMapOpen").hide()}else{$("#quickSucheMapOpen").show()}}if(online=="1"){if((typeof urlIffOrtCacheFile=="undefined"||urlIffOrtCacheFile=="")&&(typeof url!="undefined"&&url!="")){var urlIffOrtCacheFile=url}else{if(typeof urlIffOrtCacheFile=="undefined"||urlIffOrtCacheFile==""){var urlIffOrtCacheFile="../../../../"}}}else{if(typeof url=="undefined"||url==""){var urlIffOrtCacheFile="../../../"}else{var urlIffOrtCacheFile=url
}}var dataLand=null;var dataReg=null;var dataOrt=null;var arrLaender=new Array();var arrZiele=new Array();var iffLand="";var tmpSelIn=new Array();var trOSK="";function updateDRHiddenField(){a=new TTDR.Ajax.Request(drRZ);a.inputFeld=drRZ.InputFieldDefaultValue;drRZ.blockSuggestions=true;a.doXMLRequest();drRZ.updateData()}function checkSearchLayer(){if(typeof document.bengine.searchLayer!="undefined"&&document.bengine.searchLayer.value=="1"){if(document.bengine.detail!="termine"||(document.bengine.detail=="termine"&&(document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].value!=CityIFFOrtOrg||document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value!=CitytopRegionOrg))){if(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value!="-1"&&document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value=="-1"){document.bengine.IFFOrt.value="";
document.bengine.IFFOrt.disabled="true";document.bengine.topRegion.value="";document.bengine.topRegion.disabled="true";getUdfReg=getUDFRegionen(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value,"idland");var ttdrARD=new TTDR.Ajax.Response.Destination(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].text,"",getUdfReg,getUdfReg,"","","","","","",typeof citytravel!="undefined"?citytravel:"");document.bengine.DESTINATION.value=ttdrARD;
var arTmp=document.bengine.DESTINATION.value.split("|");var destname=arTmp[0];var topregions=arTmp[3].replace(/;/g,",");document.bengine.udfregionen.value=destname+"|"+topregions}else{if(document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value!="-1"&&document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].value=="-1"){document.bengine.topRegion.value=document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value;
document.bengine.input_DESTINATION.value="";document.bengine.DESTINATION.disabled="true";document.bengine.HOTELNAMES.value="";document.bengine.HOTELNAMES.disabled="true";document.bengine.input_DESTINATION.value="";document.bengine.input_DESTINATION.disabled="true";document.bengine.input_HOTELNAMES.value="";document.bengine.input_HOTELNAMES.disabled="true";document.bengine.input_POI.value="";document.bengine.input_POI.disabled="true";flagNODR=false}else{if(document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value!="-1"&&document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].value!="-1"){var valTmpIffOrt=document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].value.split(" ");
document.bengine.IFFOrt.value=valTmpIffOrt[1];document.bengine.topRegion.value=document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value;document.bengine.input_DESTINATION.value="";document.bengine.DESTINATION.disabled="true";document.bengine.HOTELNAMES.value="";document.bengine.HOTELNAMES.disabled="true";document.bengine.input_DESTINATION.value="";document.bengine.input_DESTINATION.disabled="true";document.bengine.input_HOTELNAMES.value="";document.bengine.input_HOTELNAMES.disabled="true";
document.bengine.input_POI.value="";document.bengine.input_POI.disabled="true";flagNODR=false}}}}if(typeof document.getElementById("Cityziel")!="undefined"&&(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value=="-1"||document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value!="-1")&&document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value=="-1"&&document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].value=="-1"){document.bengine.detail.value="zielgebiet"
}else{if(typeof CityIFFOrtOrg=="undefined"||(typeof CityIFFOrtOrg!="undefined"&&document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].value!=CityIFFOrtOrg)){document.bengine.detail.value="hotel"}}if(document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].value=="-1"){document.bengine.IFFOrt.value="";document.bengine.IFFVillage.value=""}}else{document.getElementById("ttSearchLayer").innerHTML=""}}var trUDFRegG="";
function getUDFRegionen(idP,idtypeP,trUDFReg){trUDFRegG="";id=idP;idtype=idtypeP;if(typeof idtype!="undefined"&&idtype=="byTopregion"){if(typeof trUDFReg=="undefined"||trUDFReg==""){return false}trUDFRegG=trUDFReg}jQuery.ajax({beforeSend:function(){if(dataLand!=null){trUDFRegG=prepareUDFRegionen(dataLand,"success");return false}},url:urlIffOrtCacheFile+"booking/js/iff_orte/ioeL.xml",type:"get",async:false,cache:cachecontrol(),dataType:"xml",success:prepareUDFRegionen});idtype=null;return trUDFRegG
}function prepareUDFRegionen(data,success){if(idtype!="byTopregion"&&(!id||typeof id=="undefined"||id=="")){return""}if(dataLand==null){dataLand=data}doWat="";if(trUDFRegG!=""&&idtype=="byTopregion"){dlUDFQuery='r[id="'+trUDFRegG+'"]';doWat="byTopregion"}else{if(idtype=="idland"){dlUDFQuery='r[ld="'+id+'"]';doWat="idland"}else{if(typeof id=="undefined"||id==""){return""}dlUDFQuery='[id="'+id+'"]'}}var dlUDF=jQuery(dlUDFQuery,dataLand);if(dlUDF!=""&&dlUDF.length>0&&dlUDF!=false&&dlUDF!="undefined"){if(doWat=="byTopregion"){dlUDFQuery='l[id="'+dlUDF[0].attributes[1].value+'"]';
var dlUDF2=jQuery(dlUDFQuery,dataLand);trUDFRegG=dlUDF2.attr("id")+"#"+dlUDF2.text()}else{if(doWat=="idland"){trUDFRegG="";for(doC1=0;doC1<dlUDF.length;doC1++){for(doC=0;doC<dlUDF[doC1].attributes.length;doC++){if(dlUDF[0].attributes[doC].name=="id"){trUDFRegG+=dlUDF[doC1].attributes[doC].value.toString()+";"}}}}else{trUDFRegG=dlUDF.attr("id")+"#"+dlUDF.text()}}}else{trUDFRegG=""}return trUDFRegG}function prepareCacheLand(data){var countLandX=0;dataLand=data;jQuery("l",data).each(function(i){var landI=jQuery(this);
arrLaender[countLandX]=landI.attr("id")+"#"+landI.text();countLandX++});return true}function loadLanderBox(){jQuery.ajax({beforeSend:function(){if(dataLand!=null){prepareCacheLand(dataLand,"success");return false}},url:urlIffOrtCacheFile+"booking/js/iff_orte/ioeL.xml",type:"get",async:false,cache:cachecontrol(),dataType:"xml",success:prepareCacheLand});return true}function prepareCacheIffo(data,textStatus){if(textStatus=="success"||typeof textStatus=="undefined"){if(data==null){if(dataOrt!=null){data=dataOrt
}else{return false}}else{dataOrt=data}arrZiele=new Array();if(typeof iffLand=="undefined"||iffLand=="-1"||iffLand==""){iffLandXPQ="[il]"}else{iffLandXPQ='[il="'+iffLand+'"]'}jQuery(iffLandXPQ,data).each(function(i,r){jQTxt=jQuery("o",r)[0].text;if(!jQTxt){jQTxt=jQuery("o",r)[0].textContent}arrZiele[i]=r.attributes[1].value+" "+r.attributes[0].value+"#"+jQTxt});return true}else{return false}}function prepareCacheIffoTr(data,textStatus){if(textStatus=="success"){dataOrt=data;arrZiele=new Array();if(typeof trOSK=="undefined"||trOSK=="-1"||trOSK==""){trOSKXPQ="[tr]"
}else{trOSKXPQ='[tr="'+trOSK+'"]'}jQuery(trOSKXPQ,dataOrt).each(function(i,r){jQTxt=jQuery("o",r)[0].text;if(!jQTxt){jQTxt=jQuery("o",r)[0].textContent}arrZiele[i]=r.attributes[1].value+" "+r.attributes[0].value+"#"+jQTxt});return true}else{return false}}function loadLandIffOrt(iffLande,troskpa,loadReg){if(typeof loadReg=="undefined"||(loadReg!=true&&loadReg!=false)){loadReg=true}trOSK=troskpa;iffLand=iffLande;if(typeof iffLand=="undefined"||iffLand==""){iffLand="-1"}else{iffLand=iffLande}retValue=true;
if(typeof trOSK=="undefined"){if(typeof document.getElementById("CitytopRegion").options!="undefined"&&document.getElementById("CitytopRegion").options.length>1&&document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value!="-1"){trOSK=document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value}else{trOSK=""}}if(document.getElementById("Cityziel").selectedIndex!=0){var ajxCallBack="";ajxCallBack=prepareCacheIffo;
if(trOSK!=""){ajxCallBack=prepareCacheIffoTr}if(ajxCallBack!=""){jQuery.ajax({beforeSend:function(){if(dataOrt!=null){ajxCallBack(dataOrt,"success");fillOrteBox();return false}},url:urlIffOrtCacheFile+"booking/js/iff_orte/ioeIO.xml",type:"get",async:false,cache:cachecontrol(),dataType:"xml",success:ajxCallBack,complete:fillOrteBox})}retValue=true}else{fillOrteBox();retValue=false}if(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value=="-1"){document.getElementById("CityIFFOrt").disabled=true
}else{if(loadReg==true){loadRegionBox(iffLand)}}return retValue}function fillLaenderBox(rzil){if(typeof rzil=="undefined"){rzil="";if(typeof Cityziel!="undefined"&&Cityziel!=""){rzil=Cityziel}}var opti=document.createElement("option");opti.value="-1";var myText=document.createTextNode("beliebig");if(typeof stringRessources!="undefined"){myText=document.createTextNode(stringRessources.common.sany)}opti.appendChild(myText);document.getElementById("Cityziel").appendChild(opti);jQuery.each(arrLaender,function(index,s){strpl=s.split("#");
opti=document.createElement("option");opti.value=strpl[0];var myText=document.createTextNode(strpl[1]);if(rzil==strpl[0]){opti.selected="true"}opti.appendChild(myText);document.getElementById("Cityziel").appendChild(opti)});return true}function fillOrteBox(){if(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value=="-1"){document.getElementById("CityIFFOrt").disabled=true}else{document.getElementById("CityIFFOrt").disabled=false}tRsI=document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value;
if(tRsI=="-1"){var stringRessAlle="beliebig";if(typeof stringRessources!="undefined"){stringRessAlle=stringRessources.common.sall}showOrte=stringRessAlle}else{showOrte=tRsI}if(typeof document.getElementById("CitytopRegion").options!="undefined"&&document.getElementById("CitytopRegion").options.length>0){if(document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value!="-1"){trOSK=document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value
}else{trOSK=-1}}else{trOSK=-1}document.getElementById("CityIFFOrt").innerHTML="";var opti=document.createElement("option");opti.value="-1";var myText=document.createTextNode("beliebig");if(typeof stringRessources!="undefined"){myText=document.createTextNode(stringRessources.common.sany)}opti.appendChild(myText);document.getElementById("CityIFFOrt").appendChild(opti);if(typeof arrZiele=="undefined"||arrZiele==""){return false}jQuery.each(arrZiele,function(index,s){strpl=s.split("#");iffo=strpl[0].split(" ");
if(trOSK==-1||(trOSK!=-1&&trOSK==iffo[0])){iffo=iffo.join(" ");var opti=document.createElement("option");opti.value=iffo;var myText=document.createTextNode(strpl[1]);opti.appendChild(myText);if((typeof CityIFFOrt!="undefined"&&CityIFFOrt!="-1"&&CityIFFOrt!=""&&CityIFFOrt==iffo&&document.getElementById("CitytopRegion").selectedIndex>0)||(document.forms.bengine.IFFVillage.value!=""&&document.forms.bengine.IFFVillage.value==iffo)){opti.selected="true"}document.getElementById("CityIFFOrt").appendChild(opti)
}});return true}function prepareCacheRegs(data,textStatus){if(textStatus=="success"){dataReg=data;arrRegs=new Array();var xpatSearchPath="";if(typeof iffLand!="undefined"&&iffLand!=""&&iffLand!=-1&&document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value!="-1"){}else{if(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value!="-1"){iffLand=document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value
}else{iffLand=""}}if(iffLand!=""){xpatSearchPath='[il="'+iffLand+'"]'}else{xpatSearchPath="r"}jQuery(xpatSearchPath,data).each(function(i,tri){if(tri.text){triTxt=tri.text}else{triTxt=tri.textContent}arrRegs[i]=tri.attributes[0].value+"#"+triTxt});return true}else{return false}}function cachecontrol(){if(online=="1"){return true}else{return false}}function loadRegionBox(parIdLand){tmpSelIn=new Array();jQuery.ajax({beforeSend:function(){if(dataReg!=null){prepareCacheRegs(dataReg,"success");fillRegBox();
return false}},url:urlIffOrtCacheFile+"booking/js/iff_orte/ioeR.xml",type:"get",async:false,cache:cachecontrol(),dataType:"xml",success:prepareCacheRegs,complete:fillRegBox});return true}function fillRegBox(){if(typeof arrRegs!="undefined"){tmpSelIn=arrRegs}var regPSel="-1";if(typeof CitytopRegion!="undefined"&&CitytopRegion!=""){regPSel=CitytopRegion}document.getElementById("CitytopRegion").innerHTML="";var opti=document.createElement("option");opti.value="-1";var myText=document.createTextNode("beliebig");
if(typeof stringRessources!="undefined"){myText=document.createTextNode(stringRessources.common.sany)}opti.appendChild(myText);document.getElementById("CitytopRegion").appendChild(opti);jQuery.each(tmpSelIn,function(index,s){strpl=s.split("#");opti=document.createElement("option");opti.value=strpl[0];if(regPSel==strpl[0]){opti.selected="true"}var myText=document.createTextNode(strpl[1]);opti.appendChild(myText);document.getElementById("CitytopRegion").appendChild(opti)});if(document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value.toString()!="-1"){fillOrteBox()
}}function initRegBox(){loadLanderBox();fillLaenderBox();loadLandIffOrt();loadRegionBox();if(typeof Cityziel!="undefined"&&Cityziel!=""&&Cityziel!="-1"){llIFOb(Cityziel)}return true}function initRegBoxPreSelect(){loadLanderBox();fillLaenderBox(Cityziel);loadLandIffOrt(Cityziel,CitytopRegion);loadRegionBox();if(typeof Cityziel!="undefined"&&Cityziel!=""&&Cityziel!="-1"){llIFOb(Cityziel)}jQuery(function(){handleLinks("1")});return true}function ttHandleSearchSelects(status){jQuery("#quickSearchBasicSuche").prepend('<div id="searchLayerWaitGif"><img src="/images/spacer.gif" height="1" width="1" alt="" /></div>');
var bform=document.forms.bengine;if(status){var initReturn=initRegBox();if(initReturn==true){bform.input_DESTINATION.value=inputDestinationText;document.getElementById("ttSearchLayer").style.display="block";bform.searchLayer.value="1";searchLayer="1";if(typeof Cityziel=="undefined"){Cityziel="-1";bform.Cityziel.selectedIndex=0}if(typeof CitytopRegion=="undefined"){CitytopRegion="-1";bform.CitytopRegion.selectedIndex=0}if(typeof CityIFFOrt=="undefined"){CityIFFOrt="-1";bform.CityIFFOrt.selectedIndex=0
}}}else{bform.searchLayer.value="";if(document.getElementById("CityIFFOrt").options[0].selected!=true){bform.input_DESTINATION.value=document.getElementById("CityIFFOrt").options[document.getElementById("CityIFFOrt").selectedIndex].text}else{if(document.getElementById("CitytopRegion").options[0].selected!=true){bform.input_DESTINATION.value=document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].text}else{if(document.getElementById("Cityziel").options[0].selected!=true){bform.input_DESTINATION.value=document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].text
}else{bform.input_DESTINATION.value=inputDestinationText}}}bform.DESTINATION.value="";updateDRHiddenField();document.getElementById("CityIFFOrt").options[0].selected="true";document.getElementById("CitytopRegion").options[0].selected="true";document.getElementById("Cityziel").options[0].selected="true";document.getElementById("ttSearchLayer").style.display="none";bform.searchLayer.value="0";searchLayer=null;handleLinks("0")}jQuery("#searchLayerWaitGif").fadeOut("slow")}function handleLinks(sLvar){if(typeof searchLayer=="undefined"){return false
}if(typeof sLvar!="undefined"&&sLvar=="1"){if(typeof uebergabe!="undefined"){uebergabe=replAddUrl(uebergabe)}if(typeof uebergabe_hotel!="undefined"){uebergabe_hotel=replAddUrl(uebergabe_hotel)}if(typeof uebergabe_suchestart!="undefined"){uebergabe_suchestart=replAddUrl(uebergabe_suchestart)}if(typeof uebergabe_hotel_cities!="undefined"){uebergabe_hotel_cities=replAddUrl(uebergabe_hotel_cities)}}else{if(typeof uebergabe!="undefined"){uebergabe=replAddUrl(uebergabe,true)}if(typeof uebergabe_hotel!="undefined"){uebergabe_hotel=replAddUrl(uebergabe_hotel,true)
}if(typeof uebergabe_suchestart!="undefined"){uebergabe_suchestart=replAddUrl(uebergabe_suchestart,true)}if(typeof uebergabe_hotel_cities!="undefined"){uebergabe_hotel_cities=replAddUrl(uebergabe_hotel_cities,true)}}return true}function replAddUrl(obj,repl){if(typeof searchLayer=="undefined"){return false}if(repl){var uebergabe_tmp=obj;uebergabe_tmp=uebergabe_tmp.replace(/searchLayer=[^&]*&?/,"","g");uebergabe_tmp=uebergabe_tmp.replace(/Cityziel=[^&]*&?/,"","g");uebergabe_tmp=uebergabe_tmp.replace(/CitytopRegion=[^&]*&?/,"","g");
uebergabe_tmp=uebergabe_tmp.replace(/CityIFFOrt=[^&]*&?/,"","g");obj=uebergabe_tmp}else{if(searchLayer!="undefined"&&searchLayer=="1"){obj+="&searchLayer=1&CityIFFOrt="+CityIFFOrt+"&CitytopRegion="+CitytopRegion+"&Cityziel="+Cityziel}}return obj}function llIFOb(iffland){if(iffland=="-1"||document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value=="-1"||Cityziel!=iffland){Cityziel="-1";CitytopRegion="-1";CityIFFOrt="-1";dataReg=null;dataOrt=null;loadRegionBox();
loadLandIffOrt(iffland);document.getElementById("CitytopRegion").options[0].selected=true;document.getElementById("CityIFFOrt").options[0].selected=true;if(Cityziel==iffland){document.getElementById("CityIFFOrt").disabled=true}}else{lrbRet=loadRegionBox();if(lrbRet){loadLandIffOrt(iffland)}}}function adjustCaR(){var trTmpValue=document.getElementById("CitytopRegion").options[document.getElementById("CitytopRegion").selectedIndex].value;if(typeof document.getElementById("CitytopRegion").options!="undefined"&&trTmpValue!=""&&trTmpValue!="-1"){retAj=getUDFRegionen("","byTopregion",trTmpValue);
var idland=retAj;if(idland==false||typeof idland!="string"){return false}idland=idland.split("#");idland=idland[0];if(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value.toString()!=idland.toString()){for(c=0;c<document.getElementById("Cityziel").options.length;c++){if(document.getElementById("Cityziel").options[c].value==idland){document.getElementById("Cityziel").options[c].selected="true"}}}loadLandIffOrt(idland,trTmpValue,false)}else{if(document.getElementById("Cityziel").options[0].selected==false){loadLandIffOrt(document.getElementById("Cityziel").options[document.getElementById("Cityziel").selectedIndex].value,"",false);
fillOrteBox()}else{loadLandIffOrt("","",false)}}}function adjustTar(cityiffort){if(cityiffort!="-1"){var tmpcityiffort=cityiffort.split(" ");CityIFFOrt=cityiffort;selectBoxPre("CitytopRegion",tmpcityiffort[0]);return true}return false}function selectBoxPre(selBox,val,enable){if(typeof selBox=="string"){selBox=document.getElementById(selBox)}if(typeof enable!="undefined"&&enable==1){selBox.disabled=false}for(c=0;c<selBox.options.length;c++){if(selBox.options[c].value==val){selBox.options[c].selected="true";
return true}}return false}function Zielauswahl(optUserRegSelect){this.gfilt=false;this.Regionen=[];if(typeof (window["TTREGS_"+this.port])!="undefined"){this.Regionen=window["TTREGS_"+this.port]}this.strZiel="";this.valZiel=-1;this.strReg="";this.valReg=-1;this.uthema="";var defAuswahl={ziel:"<Alle Reiseziele>",region:"<Alle Regionen>"};this.optFirstRegSelect=optUserRegSelect||defAuswahl;if(this.req.show_regModBalearen==1){for(var i=0;i<this.Regionen.length;++i){var sr=this.Regionen[i].split("|");
if(sr[1]==10000){sr[0]="Mallorca, Ibiza, Menorca"}this.Regionen[i]=sr.join("|")}this.Regionen.sort()}this.getTTZiel=function(topregion){topregion=topregion||0;for(var i=0;i<this.Regionen.length;++i){var tr=this.Regionen[i].split("|")[3]||0;if(tr==topregion){return this.Regionen[i].split("|")[2]||0}}return 0};this.getTTRegion=function(topregion){topregion=topregion||0;for(var i=0;i<this.Regionen.length;++i){var tr=this.Regionen[i].split("|")[3]||0;if(tr==topregion){return this.Regionen[i].split("|")[1]||0
}}return 0};this.getTTFlugdauer=function(zk){zk=zk||0;for(var i=0;i<this.Regionen.length;++i){var aktzk=this.Regionen[i].split("|")[1]||0;if(aktzk==zk){return this.Regionen[i].split("|")[2]||0}}return 0};var topregion=this.req.topRegion||0;var flugdauer=this.req.flugdauer||0;var zielgebiets_kenner=this.req.zielgebiets_kenner||0;if(parseInt(topregion)>=10000){this.valZiel=parseInt(topregion)}else{if(parseInt(topregion)>0){this.valReg=this.getTTRegion(parseInt(topregion));this.valZiel=this.getTTZiel(parseInt(topregion))
}else{this.valReg=zielgebiets_kenner!=""?zielgebiets_kenner:0;this.valZiel=flugdauer!=""?flugdauer:0;if(this.valReg!=0&&(this.valZiel==0||this.valZiel=="-1")){this.valZiel=this.getTTFlugdauer(this.valReg);this.req.flugdauer=this.valZiel;flugdauer=this.valZiel}}}this.updateRegListe=function(){this.valZiel=-1;this.strZiel="";this.valReg=-1;this.strReg="";this.UpdateRegionen()};this.UpdateRegionen=function(){if(document.forms[this.formname].uthema){this.uthema=document.forms[this.formname].uthema.value
}else{if(document.forms[this.formname].uthema_dis){this.uthema=document.forms[this.formname].uthema_dis.value}else{if(document.forms[this.formname].zielOrt){var opt=document.forms[this.formname].zielOrt.options;for(var i=0;i<opt.length;i++){if(this.req.orte_IFF&&opt[i].value.split(" ")[1]==this.req.orte_IFF){bform.zielOrt.value=opt[i].value}}}return }}this.HBit=this.uthema.split("_");if(this.HBit[0]==1){this.tmp_val=4;this.tmp_HBit=1}else{this.tmp_val=5;this.tmp_HBit=2}document.forms[this.formname].elements.region.options[0]=new Option(this.optFirstRegSelect.region,"-1");
var opt=document.forms[this.formname].elements.ziel.options;while(opt.length>0){opt[opt.length-1]=null}opt[0]=new Option(this.optFirstRegSelect.ziel,"-1");for(var i=0;i<this.Regionen.length;++i){var sr=this.Regionen[i].split("|");if(sr[1]>=10000){if((sr[this.tmp_val]&(1<<this.HBit[1]-1)&&this.HBit[0]==this.tmp_HBit)||this.uthema==""||this.uthema=="0"){opt[opt.length]=new Option(sr[0],sr[1])}}}this.FixRSel()};this.RZC=function(ds){var bform=document.forms[this.formname];var zielSel=bform.elements.ziel;
var kenner=zielSel.value;this.valZiel=kenner;if(zielSel.selectedIndex>0){this.strZiel=zielSel[zielSel.selectedIndex].text}else{this.strZiel=""}this.gfilt=kenner!=-1;var opt=bform.elements.region.options;while(opt.length>1){opt[opt.length-1]=null}for(var i=0;i<this.Regionen.length;++i){var sr=this.Regionen[i].split("|");if(sr[1]<10000&&(kenner<0||sr[2]==kenner)){if((sr[this.tmp_val]&(1<<this.HBit[1]-1)&&this.HBit[0]==this.tmp_HBit)||this.uthema==""||this.uthema=="0"){opt[opt.length]=new Option(sr[0],sr[1]+"|"+sr[2])
}}}if(ds){opt.selectedIndex=0;this.strReg="";this.valReg=-1;this.emptyElements()}};this.REGC=function(){var bform=document.forms[this.formname];var ropt=bform.elements.region.options;var kenner=ropt[ropt.selectedIndex].value.split("|");this.valReg=kenner[0];if(ropt.selectedIndex>0){this.strReg=ropt[ropt.selectedIndex].text.replace(/([^(]*)\((.*)/,"$1")}else{this.strReg=""}if(this.gfilt==false&&kenner[0]>=0){try{var selZiel=bform.elements.ziel;selZiel.value=kenner[1];this.valZiel=kenner[1];this.strZiel=selZiel.options[selZiel.options.selectedIndex].text
}catch(e){}}this.emptyElements()};this.emptyElements=function(){if(typeof delElementsForPost=="undefined"){delElementsForPost=new Array("s_ort","sleistung")}if(typeof delElementsForPost!="undefined"&&delElementsForPost.length>0){for(var c=0;c<delElementsForPost.length;c++){if(typeof document.forms[this.formname].elements[delElementsForPost[c].toString()]!="undefined"&&document.forms[this.formname].elements[delElementsForPost[c].toString()].value!=""){document.forms[this.formname].elements[delElementsForPost[c].toString()].value=""
}}}};this.FixRSel=function(){var opt=document.forms[this.formname].elements.ziel.options;if((opt.selectedIndex<0||opt.value!=this.valZiel)&&this.valZiel!=0){try{document.forms[this.formname].elements.ziel.value=this.valZiel}catch(e){if(this.strZiel!=""){opt[opt.length]=new Option(this.strZiel,this.valZiel,true,true)}else{opt.selectedIndex=0;this.RZC();return }}}this.RZC();opt=document.forms[this.formname].elements.region.options;if(opt.selectedIndex<0||opt[opt.selectedIndex].value.split("|")[0]!=this.valReg){for(i=0;
i<opt.length;i++){if(opt[i].value.split("|")[0]==this.valReg){opt.selectedIndex=i;break}}if(i==opt.length){if(this.strReg!=""){opt[opt.length]=new Option(this.strReg+" (keine Ang.)",this.valReg+"|"+this.valZiel,true,true)}else{opt.selectedIndex=0;this.valReg=-1;this.strReg=""}}}}}var optDauer=["beliebig;-1","1 - 4 Tage;9","5 - 8 Tage;10","1 Woche;6_7","9 - 12 Tage;7","13 - 15 Tage;3","2 Wochen;6_14","16 - 22 Tage;12","3 Wochen;6_21","> 22 Tage;13"];var optZimmer2=["weitere Zimmertypen;-1","Studio;2","Suite;16","Villa;256","Superior;512","Dreibettzimmer;1024","Mehrbettzimmer;4096","Ferienwohnung;8192","Ferienhaus;16384","Deluxe-Zimmer;32768","Duplexzimmer;2048"];
var optSportangebot=["gro\xDFes Sportangeb.;10","Tennis;0","Golf;1","Squash;2","Radsport;3","Wassersport;4","Tauchen;5","Reiten;6","Wandern;7","Surfen;8","egal;-1"];var optZielOrt=["beliebig;","Aachen;117 4616","Augsburg;105 4625","Bad F\xFCssing;105 4863","Bad Kissingen;2029 4866","Bad Mergentheim;2070 6365","Baden-Baden;2002 4882","Bayreuth;2030 4627","Berchtesgaden;2069 5463","Berlin;106 4527","Bochum;2059 4590","Bonn;117 4617","Bremen;112 4588","Cochem;118 6333","Cottbus;107 6723","Dortmund;2059 4614","Dresden;121 4528","D\xFCsseldorf;2019 4591","Erfurt;128 4647","Essen;2059 4592","Frankfurt am Main;114 4613","Friedrichshafen;2028 6574","Garmisch-Partenkirchen;2058 4858","Gotha;128 7220","Halle/Saale;123 4648","Hamburg;113 4572","Hannover;116 4644","Heidelberg;104 4607","Insel Lindau;2028 6910","Kassel;114 4653","Kiel;2039 4656","Köln;2020 4585","Königswinter;117 4619","Konstanz;2028 6918","Leipzig;121 4570","L\xFCbeck;2039 4655","Magdeburg;123 4638","Marburg;114 4898","Mittelberg;105 6486","M\xFCnchen;264 4564","Oberhausen;2059 4615","Potsdam;107 4560","Rostock;2035 5629","R\xFCdesheim;2022 6596","Rust;2002 5147","Schwerin;2034 4640","Suttgart;104 4579","Titisee;2002 5453","Triberg;2002 5459","Trier;118 4651","Weimar;128 4569","Wiesbaden;2022 4652","Winterberg;2038 5500","Wuppertal;117 6360","W\xFCrzburg;2060 4623"];
var optThemes=["beliebig;0","Golf;1_9","Wellness;1_12","Urlaub in den Bergen;2_1","Gourmet;2_2","Ski;1_10","Badeurlaub Nord- & Ostsee;1_13","Badeurlaub am Mittelmeer;1_14","Badeurlaub in der Ferne;1_15","Familienurlaub;2_3","Urlaub in Deutschland;1_11","Urlaub in Österreich;1_16","Städtereisen;2_4","Freizeitparks;2_5",String.fromCharCode(160,160)+"Disneyland Paris (FR);1_1",String.fromCharCode(160,160)+"Legoland Billund (DK);1_2",String.fromCharCode(160,160)+"Legoland Deutschland;1_3",String.fromCharCode(160,160)+"Movie Park Germany;1_4",String.fromCharCode(160,160)+"Phantasialand;1_5",String.fromCharCode(160,160)+"Heidepark Soltau;1_6",String.fromCharCode(160,160)+"Hansa Park;1_7",String.fromCharCode(160,160)+"Europa Park;1_8"];
var imgThemeId={"0":"default","1_9":"glf","1_12":"wll","2_1":"brg","2_2":"gor","1_10":"ski","1_13":"bno","1_14":"bmi","1_15":"bfe","2_3":"fam","1_11":"deu","1_16":"ast","2_4":"sta","2_5":"fpk","1_1":"fpk","1_2":"fpk","1_3":"fpk","1_4":"fpk","1_5":"fpk","1_6":"fpk","1_7":"fpk","1_8":"fpk"};var optHbfges=["beliebig;0","min. 3.0 von 6.0;30","min. 4.0 von 6.0;40","min. 5.0 von 6.0;50","6.0 von 6.0;60"];var optHbfanz=["beliebig;0","min. 5;5","min. 10;10","min. 20;20","min. 30;30","> 50;50"];var optHbfempf=["beliebig;0","min. 80%;800","min. 90%;900","min. 100%;1000"];
var optKategorie=["egal;-1","2 Sterne;0","3 Sterne;1","4 Sterne;2","5 Sterne;3"];var optZimmer=["beliebig;-1","Einzelzimmer;5","Doppelzimmer;6","Familienzimmer;2","Bungalow;0","Studio/Apartment/Suite;7"];var optVerpflegung=["beliebig;-1","nur \xDCbernachtung;0","Fr\xFChst\xFCck;1","Halbpension;2","Vollpension;3","All Inclusive;4"];var optPreis=["beliebig;-1","bis 300 €;1","bis 500 €;2","bis 750 €;3","bis 1000 €;4"];var optLcfilter={withoutTransfer:[{name:"beliebig",value:"-1"},{name:"mit Transfer",value:"0"},{name:"ohne Transfer",value:"1"}],withRentalCar:[{name:"beliebig",value:"-1"},{name:"mit Mietwagen",value:"1"},{name:"ohne Mietwagen",value:"0"}]};
var monNames=new Array("Jan.","Feb.","M\xE4rz","April","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez.");function twoDigit(val){return parseInt(val,10)<10?"0"+parseInt(val,10):parseInt(val,10)}Date.prototype.addMonth=function(month){if(typeof (month)=="undefined"){month=1}month=parseInt(month);var years=Math.floor(month/12);this.addYear(years);month=month%12;if((this.getMonth()+month)>11){this.addYear();this.setMonth((this.getMonth()+month)%12)}else{this.setMonth(this.getMonth()+month)}};Date.prototype.addYear=function(years){if(typeof (years)=="undefined"){years=1
}years=parseInt(years);var aktYear=this.getFullYear();this.setYear(aktYear+years);return this};Date.prototype.addDay=function(days){if(typeof (days)=="undefined"){days=1}days=parseInt(days);var aktTs=this.getTime();var addTs=days*86400000;this.setTime(aktTs+addTs);return this};Date.prototype.resetTime=function(){this.setHours(0,0,0,0);return this};Date.prototype.getWeek=function(){var dt=new Date(this.getTime());var aktDay=dt.getDay();if(aktDay==0){dt.addDay(-6)}else{dt.addDay(1-aktDay)}var aktYear=dt.getFullYear();
var tmpDt=new Date(dt.getTime());tmpDt.addDay(6);if(tmpDt.getFullYear()>aktYear&&tmpDt.getDate()>=4){return 1}var dtFirst=new Date(aktYear,0,1);var dFirst=dtFirst.getDay();if(dFirst<=4){dtFirst.addDay(1-dFirst)}else{dtFirst.addDay(8-dFirst)}return 1+parseInt((dt.getTime()-dtFirst.getTime())/(86400000*7),10)};function getTimestampFromString(sTermin){var day=0;var month=0;var year=0;if(sTermin.search(/(Mo|Di|Mi|Do|Fr|Sa|So)\. (\d{2})\.(\d{2})\.(\d{4})/i)!=-1){day=parseInt(RegExp.$2,10);month=parseInt(RegExp.$3,10);
year=parseInt(RegExp.$4,10)}else{if(sTermin.search(/(\d{2})[\.\/]?(\d{2})[\.\/]?(\d{4})/)!=-1){day=parseInt(RegExp.$1,10);month=parseInt(RegExp.$2,10);year=parseInt(RegExp.$3,10)}else{if(sTermin.search(/(\d{2})[\.\/]?(\d{2})[\.\/]?(\d{2})/)!=-1){day=parseInt(RegExp.$1,10);month=parseInt(RegExp.$2,10);year=parseInt(RegExp.$3,10);year=year>20?(1900+year):(2000+year)}}}if(day>=1&&day<=31&&month>=1&&month<=12&&year>=1920&&year<2020){var dt=new Date(year,month-1,day,12,0,0)}else{var dt=new Date();dt.setHours(12,0,0,0)
}return dt.getTime()}var DateHelperLoaded=true;function Zeitraum(){var today=(new Date()).resetTime();this.termin_min=window["termin_min_"+this.port]||"";this.termin_max=window["termin_max_"+this.port]||"";if(this.termin_min==""){this.termin_min=((new Date()).resetTime().getTime()/1000);if(this.req.engine=="pauschal"){this.termin_max=(new Date()).addDay(180).resetTime().getTime()/1000}else{this.termin_max=(new Date()).addDay(24).resetTime().getTime()/1000}}if(typeof (this.req.min_termin_kunde)!="undefined"&&this.req.min_termin_kunde!=""){this.termin_min=this.termin_min+(86400*parseInt(this.req.min_termin_kunde,10))
}if((today.getTime()/1000)>this.termin_min){this.termin_min=parseInt(today.getTime()/1000)}if(this.req.termin==""){if(this.req.engine=="pauschal"){this.req.termin=(new Date(this.termin_min*1000)).addDay(44).getTime()/1000}else{this.req.termin=this.termin_min}}else{if(String(this.req.termin).search(/\./)!=-1){var tlist=this.req.termin.split(".");this.req.termin=(new Date(tlist[2],parseInt(tlist[1],10)-1,parseInt(tlist[0],10))).getTime()/1000}}if(this.req.termin<this.termin_min){this.req.termin=this.termin_min
}var termin_min2=new Date(this.termin_min*1000);this.erster_termin=twoDigit(termin_min2.getDate())+"."+twoDigit(termin_min2.getMonth()+1)+"."+termin_min2.getFullYear();var termin2=new Date(this.req.termin*1000);this.termin_hin=twoDigit(termin2.getDate())+"."+twoDigit(termin2.getMonth()+1)+"."+termin2.getFullYear();if(this.req.ruecktermin==""){if(this.req.engine=="pauschal"){this.req.ruecktermin=parseInt(this.termin_min)+(86400*65)}else{this.req.ruecktermin=parseInt((new Date()).addDay(24).getTime()/1000)
}if(this.req.ruecktermin<=this.req.termin){this.req.ruecktermin=parseInt(this.req.termin)+(86400*21)}if(this.req.ruecktermin>this.termin_max){this.req.ruecktermin=this.termin_max}}else{if(String(this.req.ruecktermin).search(/\./)!=-1){var tlist=this.req.ruecktermin.split(".");this.req.ruecktermin=(new Date(tlist[2],parseInt(tlist[1],10)-1,parseInt(tlist[0],10))).getTime()/1000}else{if(String(this.req.ruecktermin).search(/_/)!=-1){var tlist=this.req.ruecktermin.split("_");if(this.req.termin>=(today.getTime()/1000)){this.req.ruecktermin=this.req.termin+tlist[0]*86400
}else{this.req.ruecktermin=(today.getTime()/1000)+tlist[0]*86400}}else{if(this.req.ruecktermin=="-1"){this.req.ruecktermin=this.termin_max}}}}var termin_max2=(new Date(this.termin_max*1000)).addDay(-14).resetTime();this.letzter_termin_hin=twoDigit(termin_max2.getDate())+"."+twoDigit(termin_max2.getMonth()+1)+"."+termin_max2.getFullYear();this.letzter_termin_hin_stamp=termin_max2.getTime()/1000;termin_max2=(new Date(this.termin_max*1000)).addDay().resetTime();this.letzter_termin_rueck=twoDigit(termin_max2.getDate())+"."+twoDigit(termin_max2.getMonth()+1)+"."+termin_max2.getFullYear();
this.letzter_termin=this.letzter_termin_rueck;this.letzter_termin_rueck_stamp=termin_max2.getTime()/1000;termin_max2=(new Date(this.req.ruecktermin*1000)).resetTime();this.termin_rueck=twoDigit(termin_max2.getDate())+"."+twoDigit(termin_max2.getMonth()+1)+"."+termin_max2.getFullYear()}function Terminauswahl(){this.GetTage=function(strDate,hin){var myDate=new Date(strDate.split(".")[2],parseInt(strDate.split(".")[1],10),1);myDate.setDate(0);var nTage=myDate.getDate();lts=(hin)?(this.letzter_termin_hin.split(".")):(this.letzter_termin_rueck.split("."));
if(twoDigit(lts[1])==twoDigit(myDate.getMonth()+1)&&lts[2]==myDate.getFullYear()){nTage=parseInt(lts[0],10)}return nTage};this.ChangeRueck=function(){var lts=this.letzter_termin_rueck.split(".");var lDate=new Date(lts[2],parseInt(lts[1]-1,10),parseInt(lts[0]),10);var d=this.getValue("ktag");var lMon=this.getValue("kmonat").split(".");d=new Date(lMon[1],lMon[0]-1,d);var nTime=d.getTime()+(22*86400000);if(nTime>lDate.getTime()){d.setTime(lDate.getTime())}else{d.setTime(nTime)}var nMon=twoDigit(parseInt(d.getMonth(),10)+1);
var nDay=twoDigit(parseInt(d.getDate(),10));this.SetDatum(nDay+"."+nMon+"."+d.getFullYear(),"",2)};this.getValue=function(name){return document.forms[this.formname].elements[name].value};this.UpdateTermine=function(kenner,y,m,d){var date=new Date(y,m-1,d);var bform=document.forms[this.formname];dn=date.getTime()/1000;if(kenner=="k"){this.req.termin=dn;bform.termin.value=dn}else{this.req.ruecktermin=dn}};this.SetDatum=function(strDate,strRKenner,noMon,form){var myDate=new Date(strDate.split(".")[2],parseInt(strDate.split(".")[1],10)-1,parseInt(strDate.split(".")[0],10));
var nTage=this.GetTage(strDate,strRKenner!="");var com=(strRKenner)?document.forms[this.formname].ktag:document.forms[this.formname].rueckktag;var comMon=(strRKenner)?document.forms[this.formname].kmonat:document.forms[this.formname].rueckkmonat;var len=com.length;var nMax=(len>nTage)?len:nTage;for(i=0;i<nMax;i++){if(i<nTage){if(i>=len){com.options[i]=new Option()}com.options[i].text=i+1;com.options[i].value=i+1}else{com[nTage]=null}}var nSel=myDate.getDate();if(nSel>nTage){nSel=nTage}com.value=nSel;
this.UpdateTermine(((strRKenner!="")?"k":""),strDate.split(".")[2],strDate.split(".")[1],nSel);if(noMon!=1){comMon.value=twoDigit(myDate.getMonth()+1)+"."+myDate.getFullYear()}if(noMon!=2&&strRKenner!=""){this.ChangeRueck()}};this.UpdateDate=function(strKenner){var nTag=this.getValue(strKenner+"tag");var strMon=this.getValue(strKenner+"monat");this.SetDatum(nTag+"."+strMon,(strKenner=="rueckk")?"":"dummy",2)};this.SetDay=function(strKenner){var nTag=this.getValue(strKenner+"tag");var cMon=document.forms[this.formname][strKenner+"monat"];
var strMon=this.getValue(strKenner+"monat");var ets=this.erster_termin.split(".");if(ets[1]+"."+ets[2]==strMon&&nTag<parseInt(ets[0],10)){cMon.selectedIndex=1;strMon=this.getValue(strKenner+"monat");this.SetDatum(nTag+"."+strMon,(strKenner=="rueckk")?"":"dummy",1);nTag=this.getValue(strKenner+"tag")}if(strKenner=="k"){this.ChangeRueck()}this.UpdateTermine(strKenner,strMon.split(".")[1],strMon.split(".")[0],nTag)};this.SetMonth=function(strKenner){var nTag=this.getValue(strKenner+"tag");var strMonat=this.getValue(strKenner+"monat");
var ets=this.erster_termin.split(".");if(ets[1]+"."+ets[2]==strMonat&&nTag<parseInt(ets[0],10)){nTag=ets[0]}var strDate=nTag+"."+strMonat;this.SetDatum(strDate,(strKenner=="rueckk")?"":"dummy",1)};this.InitDays=function(hin){if(typeof (document.forms[this.formname].elements[(hin)?"ktag":"rueckktag"])!="undefined"){var nTage=this.GetTage((hin)?this.termin_hin:this.termin_rueck,hin);var SelTag=(hin)?this.termin_hin.split(".")[0]:this.termin_rueck.split(".")[0];var selBox=document.forms[this.formname].elements[(hin)?"ktag":"rueckktag"];
for(i=1;i<=nTage;i++){selBox.options[i-1]=new Option(i,i);if(i==SelTag){selBox.options[i-1].selected=true}}}};this.InitMonth=function(hin){if(typeof (document.forms[this.formname].elements[(hin)?"kmonat":"rueckkmonat"])!="undefined"){if(typeof (this.monNames)!="undefined"){var m=this.monNames}else{var m=["Jan.","Feb.","M\xE4rz","April","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."]}var ets=this.erster_termin.split(".");var lts=(hin)?(this.letzter_termin_hin.split(".")):(this.letzter_termin_rueck.split("."));
var sels=(hin)?(this.termin_hin.split(".")):(this.termin_rueck.split("."));var selBox=document.forms[this.formname].elements[(hin)?"kmonat":"rueckkmonat"];var aktDate=new Date(ets[2],parseInt(ets[1],10)-1,1);var selDate=new Date(sels[2],parseInt(sels[1],10)-1,1);var maxDate=new Date(lts[2],parseInt(lts[1],10)-1,1);while(aktDate.getTime()<=maxDate.getTime()){var sel=aktDate.getTime()==selDate.getTime()?" selected":"";var val=(aktDate.getMonth()+1)<10?"0"+(aktDate.getMonth()+1):(aktDate.getMonth()+1);
var optVal=val+"."+aktDate.getFullYear();var optLbl=m[aktDate.getMonth()]+" "+String(aktDate.getFullYear()).substr(2,2);selBox.options[selBox.options.length]=new Option(optLbl,optVal);if(aktDate.getTime()==selDate.getTime()){selBox.options[selBox.options.length-1].selected=true}aktDate.addMonth()}}};this.showKalender=function(strTyp){if(strTyp=="hin"&&typeof (kalender_rueck)!="undefined"){kalender_rueck.close()}else{if(strTyp=="rueck"&&typeof (kalender_hin)!="undefined"){kalender_hin.close()}}var top=screen.height;
var left=screen.width;var posx=((left/2)-100);var posy=((top/2)-180);var wndName="kalender_"+strTyp+"__"+this.formname+"__"+this.name;if(typeof (t3url)!="undefined"){var infowin=window.open(url+"booking/"+ordner_name+"/kalender.html",wndName,"width=200,height=230,scrollbars=no,screenX="+posx+",screenY="+posy+",left="+posx+",top="+posy+",dependent=yes,location=no")}else{if(typeof (isExtQuickSearch)!="undefined"&&isExtQuickSearch==1){var infowin=window.open(main_url+"booking/jsq_search/kalender.html",wndName,"width=200,height=230,scrollbars=no,screenX="+posx+",screenY="+posy+",left="+posx+",top="+posy+",dependent=yes,location=no")
}else{var infowin=window.open("kalender.html",wndName,"width=200,height=230,scrollbars=no,screenX="+posx+",screenY="+posy+",left="+posx+",top="+posy+",dependent=yes,location=no")}}infowin.focus()}}function FormBase(){this.fillSelFromArray=function(selname,arrdata){var sb=document.forms[this.formname].elements[selname]||0;if(!sb||sb.type!="select-one"){return }var sel=this.req[selname]!="undefined"?this.req[selname]:"";for(var i=0;i<arrdata.length;i++){var lbl=arrdata[i].split(";")[0];var val=arrdata[i].split(";")[1];
sb.options[sb.options.length]=new Option(lbl,val);if(val==sel){sb.options[sb.options.length-1].selected=true}}};this.fillSelFromArrayStyled=function(selname,arrdata){var sb=document.forms[this.formname].elements[selname]||0;if(!sb||sb.type!="select-one"){return }var sel=this.req[selname]!="undefined"?this.req[selname]:"";for(var i=0;i<arrdata.length;i++){var arrTmp=arrdata[i].split(";");var lbl=arrTmp[0];var val=arrTmp[1];var cName=arrTmp[2]||"";sb.options[sb.options.length]=new Option(lbl,val);if(val==sel){sb.options[sb.options.length-1].selected=true
}if(cName!=""){sb.options[sb.options.length-1].className=cName}}};this.fillSels=function(boxobject){for(var boxname in boxobject){this.fillSelFromArray(boxname,boxobject[boxname])}};this.fillSelWithOptGroups=function(selname,boxobject){var sb=document.forms[this.formname].elements[selname]||0;if(!sb||sb.type!="select-one"){return }var sel=this.req[selname]!="undefined"?this.req[selname]:"";for(var boxname in boxobject){if(typeof boxobject[boxname]==="object"&&boxobject[boxname]&&boxobject[boxname] instanceof Array){var optGroup=document.createElement("optgroup");
optGroup.label=boxname;for(var i=0;i<boxobject[boxname].length;i++){var arrTmp=boxobject[boxname][i].split(";");var objOption=document.createElement("option");objOption.innerHTML=arrTmp[0];objOption.value=arrTmp[1];if(typeof arrTmp[2]!="undefined"&&arrTmp[2]!=""){objOption.className=arrTmp[2]}if(arrTmp[1]==sel){objOption.selected=true}optGroup.appendChild(objOption)}sb.appendChild(optGroup)}else{if(typeof boxobject[boxname]==="string"){var arrTmp=boxobject[boxname].split(";");var objOption=document.createElement("option");
objOption.innerHTML=arrTmp[0];objOption.value=arrTmp[1];if(typeof arrTmp[2]!="undefined"&&arrTmp[2]!=""){objOption.className=arrTmp[2]}if(arrTmp[1]==sel){objOption.selected=true}sb.appendChild(objOption)}}}};this.fillBitSels=function(boxobject){for(var boxname in boxobject){var sb=document.forms[this.formname].elements[boxname]||0;if(!sb||sb.type!="select-one"){continue}var arrdata=boxobject[boxname];var sel=this.req[boxname]!="undefined"?parseInt(this.req[boxname]):0;sel=sel<0?0:sel;for(var i=0;
i<arrdata.length;i++){var lbl=arrdata[i].split(";")[0];var val=arrdata[i].split(";")[1];sb.options[sb.options.length]=new Option(lbl,val);if((parseInt(val,10)&sel)!=0){sb.options[sb.options.length-1].selected=true}}}};this.setRadios=function(rnames){for(var i=0;i<rnames.length;++i){var rb=document.forms[this.formname].elements[rnames[i]]||0;if(!rb){continue}var val=this.req[rnames[i]]!="undefined"?this.req[rnames[i]]:"";for(var j=0;j<rb.length;j++){if(rb[j].value==val){rb[j].checked=true}}}};this.setChecks=function(cknames){for(var i=0;
i<cknames.length;++i){var cb=document.forms[this.formname].elements[cknames[i]]||0;if(!cb){continue}var val=typeof (this.req[cknames[i]])!="undefined"?this.req[cknames[i]]:"";if(cb&&cb.value==val){cb.checked=true}}};this.setBitChecks=function(cknames){for(var i=0;i<cknames.length;++i){var cb=document.forms[this.formname].elements[cknames[i]]||0;if(!cb){continue}var val=typeof (this.req[cknames[i]])!="undefined"?parseInt(this.req[cknames[i]],10):0;val=val<0?0:val;if(cb&&(parseInt(cb.value,10)&val)!=0){cb.checked=true
}}};this.setBitChecksGroups=function(cknames){for(var i=0;i<cknames.length;++i){cba=document.getElementsByName(cknames[i]);for(var j=0;j<cba.length;++j){var cb=cba[j];if(!cb){continue}var val=typeof (this.req[cknames[i]])!="undefined"?parseInt(this.req[cknames[i]],10):0;val=val<0?0:val;if(cb&&(parseInt(cb.value,10)&val)!=0){cb.checked=true}}}};this.setTexts=function(txtnames){for(var i=0;i<txtnames.length;++i){var tb=document.forms[this.formname].elements[txtnames[i]]||0;if(!tb){continue}var val=typeof (this.req[txtnames[i]])!="undefined"?this.req[txtnames[i]]:"";
if(tb){tb.value=val}}};this.CRad=function(val){if(val==1){document.forms[this.formname].zimmer[6].checked=true}else{document.forms[this.formname].zimmer2.selectedIndex=0}};this.fillReisende=function(optUsrPersLbl){var defPersLbl={erw:["Erwachsener","Erwachsene"],erw_short:["Erw.","Erw."],pers:["Person","Personen"],kinder:["Jah.","Jahre"," --- "," --- "," --- "]};if(typeof stringRessources!="undefined"&&typeof stringRessources.common!="undefined"){if(typeof stringRessources.common.sadult!="undefined"){defPersLbl.erw[0]=stringRessources.common.sadult
}if(typeof stringRessources.common.sadults!="undefined"){defPersLbl.erw[1]=stringRessources.common.sadults}if(typeof stringRessources.common.sadultAbbr!="undefined"){defPersLbl.erw_short[0]=stringRessources.common.sadultAbbr;defPersLbl.erw_short[1]=stringRessources.common.sadultAbbr}if(typeof stringRessources.common.sperson!="undefined"){defPersLbl.pers[0]=stringRessources.common.sperson}if(typeof stringRessources.common.spersons!="undefined"){defPersLbl.pers[1]=stringRessources.common.spersons}if(typeof stringRessources.common.sy!="undefined"){defPersLbl.kinder[0]=stringRessources.common.sy
}if(typeof stringRessources.common.syears!="undefined"){defPersLbl.kinder[1]=stringRessources.common.syears}}var optPersLbl=optUsrPersLbl||defPersLbl;var strPers=this.Personen;var bform=document.forms[this.formname];var elems=["alter1","alter2","alter3"];var erwSel=bform.erwachsene;var strErw="25";var erwMax=this.req.engine=="fewo"?8:4;if(typeof (bform.erwachsene)!="undefined"){for(var i=1;i<=erwMax;i++){if(this.req.engine=="fewo"){var lbl=i==1?optPersLbl.pers[0]:optPersLbl.pers[1]}else{if(this.req.formular=="2"||this.req.formular=="3"||typeof (window.SucheERDEKlein)!="undefined"||typeof (window.SucheLMPSKlein)!="undefined"){var lbl=i==1?optPersLbl.erw_short[0]:optPersLbl.erw_short[1]
}else{var lbl=i==1?optPersLbl.erw[0]:optPersLbl.erw[1]}}erwSel.options[erwSel.options.length]=new Option(i+" "+lbl,strErw);strErw+=";25"}erwSel.options.selectedIndex=this.AnzErwachsene-1;for(var i=0;i<elems.length;++i){if(bform[elems[i]]){var kindFirst=optPersLbl.kinder[2+i]||" --- ";bform[elems[i]].options[0]=new Option(kindFirst,"-1");bform[elems[i]].options[1]=new Option("< 2 "+optPersLbl.kinder[0],"1");for(var j=2;j<=16;j++){bform[elems[i]].options[j]=new Option(j+" "+optPersLbl.kinder[1],j)}if(this.AlterKinder[i]&&this.AlterKinder[i]!="-1"){bform[elems[i]].value=this.AlterKinder[i]
}}}}};this.dauert=function(flextime){var sRCsany="beliebig";var sRCsday="Tag";var sRCsdays="Tage";if(typeof stringRessources!="undefined"&&typeof stringRessources.common!="undefined"){if(typeof stringRessources.common.sany!="undefined"){sRCsany=stringRessources.common.sany}if(typeof stringRessources.common.sday!="undefined"){sRCsday=stringRessources.common.sday}if(typeof stringRessources.common.sdays!="undefined"){sRCsdays=stringRessources.common.sdays}}var sb=document.getElementsByName("dauer")[0]||0;
if(!sb||sb.type!="select-one"){return }sb.options[sb.options.length]=new Option(sRCsany,"-1");if(typeof (flextime)!="undefined"){if(flextime!=""){sb.options[sb.options.length]=new Option(flextime,"0")}}sb.options[sb.options.length]=new Option("1 "+sRCsday,"6_1");for(i=2;i<=21;i++){sb.options[sb.options.length]=new Option(i+" "+sRCsdays,"6_"+i)}sb.options[sb.options.length]=new Option("> 22 "+sRCsdays,"13");try{if(this.req.dauer!=""&&this.req.dauer!="-1"){sb.value=this.req.dauer}}catch(e){}};this.setFormsForLcfilter=function(nameValueObj){if(typeof nameValueObj=="undefined"){alert("keine Definition für lcfilter Formularfelder vorgegeben - Bitte optLcfilter definieren!");
return }var withoutTransfer="-1";var withRentalCar="-1";var combiLcfilter="-1";if(typeof this.req.lcfilter!="undefined"){var lcFilter=this.req.lcfilter;if(lcFilter.search(";")==-1){if(lcFilter!=""){if(lcFilter&512){withoutTransfer="1";lcFilter=parseInt(lcFilter);lcFilter|=512}if(lcFilter&1){withRentalCar="1";lcFilter=parseInt(lcFilter);lcFilter|=1}if(lcFilter&512){combiLcfilter="512;512";lcFilter=512}else{if(lcFilter&1){combiLcfilter="1;1";lcFilter=1}else{combiLcfilter="-1";lcFilter=0}}this.req.lcfilter=lcFilter+";"+lcFilter
}}else{var lcFilterArr=lcFilter.split(";");lcFilterArr[0]=parseInt(lcFilterArr[0]);lcFilterArr[1]=parseInt(lcFilterArr[1]);if(lcFilterArr[0]&512&&lcFilterArr[1]&512){withoutTransfer="1"}else{if(lcFilterArr[0]&512&&lcFilterArr[1]^512){withoutTransfer="0"}}if(lcFilterArr[0]&1&&lcFilterArr[1]&1){withRentalCar="1"}else{if(lcFilterArr[0]&1&&lcFilterArr[1]^1){withRentalCar="0"}}combiLcfilter=lcFilter}var bForm=document.bengine;var bFormWithoutTransfer=bForm.lcfilterWithoutTransfer;var bFormWithRentalCar=bForm.lcfilterWithRentalCar;
var bFormCombination=bForm.lcfilterCombination;if(typeof bFormCombination!="undefined"){if(typeof IBE.req.lcfilterCombination!="undefined"){var lcfilterCombination=IBE.req.lcfilterCombination}else{alert("lcfilterCombination nicht in IBE.req[] gesetzt.")}}if(typeof bFormWithoutTransfer!="undefined"&&bFormWithoutTransfer.type=="select-one"){for(var i=0;i<nameValueObj.withoutTransfer.length;i++){bFormWithoutTransfer.options[i]=new Option(nameValueObj.withoutTransfer[i].name,nameValueObj.withoutTransfer[i].value,true,((withoutTransfer==nameValueObj.withoutTransfer[i].value)?true:false))
}}if(typeof bFormWithRentalCar!="undefined"&&bFormWithRentalCar.type=="select-one"){for(var i=0;i<nameValueObj.withRentalCar.length;i++){bFormWithRentalCar.options[i]=new Option(nameValueObj.withRentalCar[i].name,nameValueObj.withRentalCar[i].value,true,((withRentalCar==nameValueObj.withRentalCar[i].value)?true:false))}}if(typeof bFormCombination!="undefined"&&bFormCombination.type=="select-one"){for(var i=0;i<nameValueObj.combiLcfilter.length;i++){bFormCombination.options[i]=new Option(nameValueObj.combiLcfilter[i].name,nameValueObj.combiLcfilter[i].value,true,((combiLcfilter==nameValueObj.combiLcfilter[i].value||lcfilterCombination==nameValueObj.combiLcfilter[i].value)?true:false))
}}if(typeof bFormWithoutTransfer!="undefined"&&bFormWithoutTransfer.length>1&&bFormWithoutTransfer[0].type=="radio"){for(var i=0;i<bFormWithoutTransfer.length;i++){if(bFormWithoutTransfer[i].value==withoutTransfer){bFormWithoutTransfer[i].checked=true;break}}}if(typeof bFormWithRentalCar!="undefined"&&bFormWithRentalCar.length>0&&bFormWithRentalCar[0].type=="radio"){for(var i=0;i<bFormWithRentalCar.length;i++){if(bFormWithRentalCar[i].value==withRentalCar){bFormWithRentalCar[i].checked=true;break
}}}if(typeof bFormCombination!="undefined"&&bFormCombination.length>0&&bFormCombination[0].type=="radio"){for(var i=0;i<bFormCombination.length;i++){if(bFormCombination[i].value==combiLcfilter){bFormCombination[i].checked=true;break}}}if(typeof bFormWithoutTransfer!="undefined"){if(bFormWithoutTransfer.length){for(var i=0;i<bFormWithoutTransfer.length;i++){if(bFormWithoutTransfer[i].type=="checkbox"){if(bFormWithoutTransfer[i].value==withoutTransfer){bFormWithoutTransfer[i].checked=true}}}}else{if(bFormWithoutTransfer.type=="checkbox"){if(bFormWithoutTransfer.value==withoutTransfer){bFormWithoutTransfer.checked=true
}}}}if(typeof bFormWithoutTransfer!="undefined"&&bFormWithoutTransfer.type=="select-one"){if(typeof window.attachEvent!="undefined"){bFormWithoutTransfer.attachEvent("onchange",IBE.setLcfilterHiddenFieldForSearch)}else{bFormWithoutTransfer.setAttribute("onchange","IBE.setLcfilterHiddenFieldForSearch();")}}if(typeof bFormWithRentalCar!="undefined"&&bFormWithRentalCar.type=="select-one"){if(typeof window.attachEvent!="undefined"){bFormWithRentalCar.attachEvent("onchange",IBE.setLcfilterHiddenFieldForSearch)
}else{bFormWithRentalCar.setAttribute("onchange","IBE.setLcfilterHiddenFieldForSearch();")}}if(typeof bFormCombination!="undefined"&&bFormCombination.type=="select-one"){if(typeof window.attachEvent!="undefined"){bFormCombination.attachEvent("onchange",IBE.setLcfilterHiddenFieldForSearch)}else{bFormCombination.setAttribute("onchange","IBE.setLcfilterHiddenFieldForSearch();")}}if(typeof bFormWithoutTransfer!="undefined"&&bFormWithoutTransfer.length>1&&bFormWithoutTransfer[0].type=="radio"){for(var i=0;
i<bFormWithoutTransfer.length;i++){if(typeof window.attachEvent!="undefined"){bFormWithoutTransfer[i].attachEvent("onclick",IBE.setLcfilterHiddenFieldForSearch)}else{bFormWithoutTransfer[i].setAttribute("onclick","IBE.setLcfilterHiddenFieldForSearch();")}}}if(typeof bFormWithRentalCar!="undefined"&&bFormWithRentalCar.length>0&&bFormWithRentalCar[0].type=="radio"){for(var i=0;i<bFormWithRentalCar.length;i++){if(typeof window.attachEvent!="undefined"){bFormWithRentalCar[i].attachEvent("onclick",IBE.setLcfilterHiddenFieldForSearch)
}else{bFormWithRentalCar[i].setAttribute("onclick","IBE.setLcfilterHiddenFieldForSearch();")}}}if(typeof bFormCombination!="undefined"&&bFormCombination.length>0&&bFormCombination[0].type=="radio"){for(var i=0;i<bFormCombination.length;i++){if(typeof window.attachEvent!="undefined"){bFormCombination[i].attachEvent("onclick",IBE.setLcfilterHiddenFieldForSearch)}else{bFormCombination[i].setAttribute("onclick","IBE.setLcfilterHiddenFieldForSearch();")}}}if(typeof bFormWithoutTransfer!="undefined"){if(bFormWithoutTransfer.length){for(var i=0;
i<bFormWithoutTransfer.length;i++){if(bFormWithoutTransfer[i].type=="checkbox"&&bFormWithoutTransfer[i].getAttribute("onclick",0)==null){alert("Achtung!\nBei Checkbox lcfilterWithoutTransfer ["+i+'] fehlt der onclick Event!\n\nonclick="IBE.setLcfilterHiddenFieldForSearch();"')}}}else{if(bFormWithoutTransfer.type=="checkbox"&&bFormWithoutTransfer.getAttribute("onclick",0)==null){if(typeof window.attachEvent!="undefined"){bFormWithoutTransfer.attachEvent("onclick",IBE.setLcfilterHiddenFieldForSearch)
}else{bFormWithoutTransfer.setAttribute("onclick","IBE.setLcfilterHiddenFieldForSearch();")}}}}}else{alert("lcfilter nicht in IBE.req[] gesetzt.")}};this.setLcfilterHiddenFieldForSearch=function(elem){var bForm=document.bengine;var bFormWithoutTransfer=bForm.lcfilterWithoutTransfer;var bFormWithRentalCar=bForm.lcfilterWithRentalCar;var bFormCombination=bForm.lcfilterCombination;var aLcfilter=new Array();var withoutTransferValue="";var withRentalCarValue="";var combiLcfilterValue="";if(IBE.req.lcfilter!=""){aLcfilter=IBE.req.lcfilter.split(";")
}if(typeof bFormWithoutTransfer!="undefined"){if(typeof bFormWithoutTransfer!="undefined"&&bFormWithoutTransfer.type=="select-one"){withoutTransferValue=bFormWithoutTransfer.value}if(typeof bFormWithoutTransfer!="undefined"&&bFormWithoutTransfer.length>1&&bFormWithoutTransfer[0].type=="radio"){for(var i=0;i<bFormWithoutTransfer.length;i++){if(bFormWithoutTransfer[i].checked==true){withoutTransferValue=bFormWithoutTransfer[i].value;break}}}if(typeof bFormWithoutTransfer!="undefined"){if(bFormWithoutTransfer.length){var merkValue=-1;
for(var i=0;i<bFormWithoutTransfer.length;i++){if(bFormWithoutTransfer[i].type=="checkbox"){if(bFormWithoutTransfer[i]==elem){merkValue=bFormWithoutTransfer[i].value;withoutTransferValue=bFormWithoutTransfer[i].value}}}for(var i=0;i<bFormWithoutTransfer.length;i++){if(bFormWithoutTransfer[i].type=="checkbox"){if(bFormWithoutTransfer[i].checked==true&&bFormWithoutTransfer[i].value!=merkValue){bFormWithoutTransfer[i].checked=false}}}}else{if(bFormWithoutTransfer.type=="checkbox"){if(bFormWithoutTransfer.checked==true){withoutTransferValue=bFormWithoutTransfer.value
}}}}}if(typeof bFormWithRentalCar!="undefined"){if(typeof bFormWithRentalCar!="undefined"&&bFormWithRentalCar.type=="select-one"){withRentalCarValue=bFormWithRentalCar.value}if(typeof bFormWithRentalCar!="undefined"&&bFormWithRentalCar.length>0&&bFormWithRentalCar[0].type=="radio"){for(var i=0;i<bFormWithRentalCar.length;i++){if(bFormWithRentalCar[i].checked==true){withRentalCarValue=bFormWithRentalCar[i].value;break}}}}if(typeof bFormCombination!="undefined"){if(typeof bFormCombination!="undefined"&&bFormCombination.type=="select-one"){combiLcfilterValue=bFormCombination.value
}if(typeof bFormCombination!="undefined"&&bFormCombination.length>0&&bFormCombination[0].type=="radio"){for(var i=0;i<bFormCombination.length;i++){if(bFormCombination[i].checked==true){combiLcfilterValue=bFormCombination[i].value;break}}}}if(typeof bFormWithoutTransfer!="undefined"){aLcfilter[0]&=~512;aLcfilter[1]&=~512}if(typeof bFormWithRentalCar!="undefined"){aLcfilter[0]&=~1;aLcfilter[1]&=~1}if(typeof bFormCombination!="undefined"){aLcfilter[0]&=~513;aLcfilter[1]&=~513}if(withoutTransferValue=="0"){aLcfilter[0]|=512
}else{if(withoutTransferValue=="1"){aLcfilter[0]|=512;aLcfilter[1]|=512}}if(withRentalCarValue=="1"){aLcfilter[0]|=1;aLcfilter[1]|=1}else{if(withRentalCarValue=="0"){aLcfilter[0]|=1}}if(combiLcfilterValue!=""){if(combiLcfilterValue!="-1"){aLcfilterTmp=combiLcfilterValue.split(";");aLcfilter[0]|=aLcfilterTmp[0];aLcfilter[1]|=aLcfilterTmp[1]}}if(typeof document.bengine.lcfilter!="undefined"){var newLcfilter=aLcfilter.join(";");if(newLcfilter!=""&&newLcfilter!=";"){document.bengine.lcfilter.value=newLcfilter
}else{document.bengine.lcfilter.value=""}}else{alert("Achtung!\r\nHiddenField lcfilter nicht gesetzt!")}}}function Reisende(strPersonen){this.Personen=strPersonen;this.AnzErwachsene=0;this.AnzKinder=0;this.AlterErwachsene=[];this.AlterKinder=[];this.updateFromPersonen=function(){this.AnzErwachsene=0;this.AnzKinder=0;this.AlterErwachsene=[];this.AlterKinder=[];var arrTmp=this.Personen.split(";");for(var i=0;i<arrTmp.length;++i){if(arrTmp[i]==""||parseInt(arrTmp[i],10)<=0){continue}var aktAlter=parseInt(arrTmp[i],10);
if(aktAlter<=16){this.AnzKinder++;this.AlterKinder.push(Number(aktAlter))}else{this.AnzErwachsene++;this.AlterErwachsene.push(aktAlter)}}this.AlterKinder.sort(Numsort);this.updateToPersonen()};this.updateToPersonen=function(){this.Personen="";for(var i=0;i<this.AlterErwachsene.length;++i){this.Personen+=this.AlterErwachsene[i]+";"}for(var i=0;i<this.AlterKinder.length;++i){this.Personen+=this.AlterKinder[i]+";"}if(this.Personen!=""){this.Personen=this.Personen.substr(0,this.Personen.length-1)}};this.getPersonenFromForm=function(){var fKind=["alter1","alter2","alter3"];
var bform=document.forms[this.formname];var strPers=bform.erwachsene.value+";";for(var i=0;i<fKind.length;++i){if(bform[fKind[i]]&&bform[fKind[i]].value!="-1"){strPers+=bform[fKind[i]].value+";"}}this.Personen=strPers.substr(0,strPers.length-2);this.updateFromPersonen()};this.updateFromPersonen()}function Numsort(a,b){return b-a}var oKalHin,oKalRueck;var g_oTermine={};var g_calActive=false;var g_strFerienSelect="-1";var g_focus="";var g_arWeekDays=["So","Mo","Di","Mi","Do","Fr","Sa"];var g_arMonNames=["J\xE4nner","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
var g_strToolTip="";var g_Pfad_KAL_IMG="/kunden_parameter/"+ordner_name+"/ibe_v2/images/city/kalender/";var oImages={pfeil_links:new Image(),pfeil_links_over:new Image(),pfeil_rechts:new Image(),pfeil_rechts_over:new Image()};Function.prototype.bind=function(object){var __method=this;return function(){return __method.apply(object,arguments)}};Object.extend=function(dest,src){for(attr in src){dest[attr]=src[attr]}return dest};function twoDigit(val){return parseInt(val,10)<10?"0"+parseInt(val,10):parseInt(val,10)
}function $(id){if(typeof jQuery!="undefined"&&jQuery){if(jQuery(id).length>0){return jQuery(id)}else{return document.getElementById(id)}}else{return document.getElementById(id)}}function str2tstamp(str){return str.length==6?(new Date(2000+parseInt(str.substr(4,2),10),parseInt(str.substr(2,2),10)-1,parseInt(str.substr(0,2),10),12,0,0,0)).getTime():0}var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;function isIELT7(){if(navigator.userAgent.indexOf("MSIE")!=-1){var version=parseFloat(navigator.appVersion.split("MSIE")[1]);
if(version<7){return false}}return true}function getTimestampFromString(sTermin){var day=0;var month=0;var year=0;if(sTermin.search(/(Mo|Di|Mi|Do|Fr|Sa|So)\. (\d{2})\.(\d{2})\.(\d{4})/i)!=-1){day=parseInt(RegExp.$2,10);month=parseInt(RegExp.$3,10);year=parseInt(RegExp.$4,10)}else{if(sTermin.search(/(\d{2})[\.\/]?(\d{2})[\.\/]?(\d{4})/)!=-1){day=parseInt(RegExp.$1,10);month=parseInt(RegExp.$2,10);year=parseInt(RegExp.$3,10)}else{if(sTermin.search(/(\d{2})[\.\/]?(\d{2})[\.\/]?(\d{2})/)!=-1){day=parseInt(RegExp.$1,10);
month=parseInt(RegExp.$2,10);year=parseInt(RegExp.$3,10);year=year>20?(1900+year):(2000+year)}}}if(day>=1&&day<=31&&month>=1&&month<=12&&year>=1920&&year<2020){var dt=new Date(year,month-1,day,12,0,0)}else{var dt=new Date();dt.setHours(12,0,0,0)}return dt.getTime()}function getStringFromTimestamp(ts,withWeekDay){var dt=new Date(ts);var returnString="";if(withWeekDay!=false){returnString=g_arWeekDays[dt.getDay()]+". "}returnString+=twoDigit(dt.getDate())+"."+twoDigit(dt.getMonth()+1)+"."+dt.getFullYear();
return returnString}function setInactive(){g_calActive=false}function setActive(){g_calActive=true}function updateRueckTermin(){if(g_oTermine.tsSelTerminHin>=g_oTermine.tsSelTerminRueck){g_oTermine.tsSelTerminRueck=Math.min(g_oTermine.tsTerminMax,(g_oTermine.tsSelTerminHin+(2*86400000)));$("oKalRueck_input").value=getStringFromTimestamp(g_oTermine.tsSelTerminRueck);oKalRueck.sel_termin=g_oTermine.tsSelTerminRueck;oKalRueck.value=getStringFromTimestamp(g_oTermine.tsSelTerminRueck);oKalRueck.active_td=getStringFromTimestamp(g_oTermine.tsSelTerminRueck,false);
oKalRueck.selTermin=new Date(getTimestampFromString(oKalRueck.value));oKalRueck.selTermin.setHours(12,0,0,0);oKalRueck.showMonth=new Date(oKalRueck.selTermin.getTime());oKalRueck.updateCalendar()}}Object.extend(Date.prototype,{addMonth:function(month){if(typeof (month)=="undefined"){month=1}month=parseInt(month);var years=Math.floor(month/12);this.addYear(years);month=month%12;if((this.getMonth()+month)>11){this.addYear();this.setMonth((this.getMonth()+month)%12)}else{this.setMonth(this.getMonth()+month)
}},addYear:function(years){if(typeof (years)=="undefined"){years=1}years=parseInt(years);var aktYear=this.getFullYear();this.setYear(aktYear+years);return this},addDay:function(days){if(typeof (days)=="undefined"){days=1}days=parseInt(days);var aktTs=this.getTime();var addTs=days*86400000;this.setTime(aktTs+addTs);return this},resetTime:function(){this.setHours(0,0,0,0);return this},getWeek:function(){var dt=new Date(this.getTime());var aktDay=dt.getDay();if(aktDay==0){dt.addDay(-6)}else{dt.addDay(1-aktDay)
}var aktYear=dt.getFullYear();var tmpDt=new Date(dt.getTime());tmpDt.addDay(6);if(tmpDt.getFullYear()>aktYear&&tmpDt.getDate()>=4){return 1}var dtFirst=new Date(aktYear,0,1);var dFirst=dtFirst.getDay();if(dFirst<=4){dtFirst.addDay(1-dFirst)}else{dtFirst.addDay(8-dFirst)}return 1+parseInt((dt.getTime()-dtFirst.getTime())/(86400000*7),10)}});function Kalender(name,typ,holidays){this.name=name;this.typ=typ||"hin";this.termin_min=g_oTermine.tsTerminMin;this.termin_max=g_oTermine.tsTerminMax;this.sel_termin=g_oTermine.tsSelTerminHin;
this.sel_rueck=g_oTermine.tsSelTerminRueck;this.active_td="";this.active_css="";this.tmp_css="";this.noframe=isIELT7();this.isIE=isIE;this.tabindex=(this.typ=="hin")?2:2;this.value=(this.typ=="hin")?getStringFromTimestamp(g_oTermine.tsSelTerminHin):getStringFromTimestamp(g_oTermine.tsSelTerminRueck);try{this.selTermin=new Date(getTimestampFromString(this.value))}catch(e){this.selTermin=new Date()}this.selTermin.setHours(12,0,0,0);this.showMonth=new Date(this.selTermin.getTime());this.showMonth.setDate(1);
this.showMonth.resetTime();if(typeof (oDefInfoText)!="undefined"){this.txtHdHinKurz=oDefInfoText.hin_kurz[0];this.txtHdRueKurz=oDefInfoText.rueck_kurz[0];this.txtHdHinLang=oDefInfoText.hin_lang[0];this.txtHdRueLang=oDefInfoText.rueck_lang[0];this.txtBlInfo=oDefInfoText.bl_text[0]}else{this.txtHdHinKurz="Frühester Hinflug";this.txtHdRueKurz="Spätester Rückflug";this.txtHdHinLang="Frühesten Hinflug korrigieren<br>oder Daten übernehmen.";this.txtHdRueLang="Spätesten Rückflug korrigieren<br>oder Daten übernehmen.";
this.txtBlInfo="Wählen Sie Ihr Bundesland"}this.showCalendar=function(){if(g_calActive==false){this.updateShowMonth();var oName=this.name;var divCal=$("BOXKAL");var refObj=$(oName+"_input");var nHeight=refObj.offsetHeight;var posX=0+leftDistance;var posY=nHeight+topDistance;var refObjX=refObj.offsetTop;var refObjY=refObj.offsetLeft;var oParent=refObj.offsetParent;while(oParent){refObjX+=oParent.offsetLeft;refObjY+=oParent.offsetTop;oParent=oParent.offsetParent}if(!this.isIE){posY-=1}var oStyle={position:"absolute",top:posY+"px",left:posX+"px",width:"400px",zIndex:9900,display:"block"};
Object.extend(divCal.style,oStyle);if(!this.noframe){Object.extend($("KAL_IFR").style,{position:"absolute",top:posY+"px",left:posX+"px",width:"415px",zIndex:9899,display:"block"})}$("BOXKAL").style.display="block";oKalHin.showKalenderControl();oKalRueck.showKalenderControl();if(!this.noframe){$("KAL_IFR").style.height=$("BOXKAL").offsetHeight+"px"}}};this.hideCalendar=function(){if(g_calActive!=true){var seltermin=$(this.name+"_input").value;var dt=new Date(getTimestampFromString(seltermin));$(this.name+"_input").value=g_arWeekDays[dt.getDay()]+". "+twoDigit(dt.getDate())+"."+twoDigit(dt.getMonth()+1)+"."+dt.getFullYear();
if(this.typ=="hin"){g_oTermine.tsSelTerminHin=dt.getTime();updateRueckTermin()}else{g_oTermine.tsSelTerminRueck=dt.getTime()}if(!this.noframe){$("KAL_IFR").style.display="none"}$("BOXKAL").style.display="none"}else{}};this.init=function(){var strKalTitle;var closeLink;if(this.typ=="hin"){strKalTitle="Früheste Anreise:";closeLink=""}else{strKalTitle="Späteste Abreise:";closeLink='<img src="'+g_Pfad_KAL_IMG+'schliessen_klein.gif" alt="X" title="Kalender schlie&szlig;en" class="closeLink" onclick="hideKal();" >';
this.termin_max=this.termin_max+1814400000}var sHTML='<input type="text" id="'+this.name+'_input" class="'+inputClass+'" value="'+this.value+'" tabindex="'+this.tabindex+'"><br>\n';var sHTML2='<div id="'+this.name+'_cal_box" class="calDiv">\n   <div class="kalheadBox">\n      <div class="kalTitle">'+strKalTitle+"</div>"+closeLink+'      <div class="tt_clearboth"><img src="/images/spacer.gif" alt="" width="0" height="0" /></div>      <table border="0" cellspacing="0" cellpadding="0" align="center" width="150">\n          <tr>\n              <td class="kalhead_le"><a id="'+this.name+'_lnkPrev" href="javascript:void(0);"><img src="'+g_Pfad_KAL_IMG+'pfeil_links.gif" title="zurück" border="0"></td>\n              <td id="'+this.name+'_kalTitel" class="kalTitel"></td>\n              <td class="kalhead_ri"><a id="'+this.name+'_lnkNext" href="javascript:void(0);"><img src="'+g_Pfad_KAL_IMG+'pfeil_rechts.gif" title="vor" border="0"></td>\n          </tr>\n      </table>\n   </div>\n      <div class="tt_clearboth"><img src="/images/spacer.gif" alt="" width="0" height="0" /></div>  <table border="0" cellspacing="0" cellpadding="0" align="center" width="170">\n      <tr>\n          <td class="kalHeadTage">Mo</td>\n          <td class="kalHeadTage">Di</td>\n          <td class="kalHeadTage">Mi</td>\n          <td class="kalHeadTage">Do</td>\n          <td class="kalHeadTage">Fr</td>\n          <td class="kalHeadTage">Sa</td>\n          <td class="kalHeadTage">So</td>\n      </tr>\n  </table>\n  <div id="'+this.name+'_kalTable"></div>\n';
sHTML2+="</div>\n";var div=$("TTKAL_"+this.name);if(div){div.innerHTML=sHTML;$(this.name+"_input").onfocus=this.showCalendar.bind(this);$(this.name+"_input").onclick=this.showCalendar.bind(this);$(this.name+"_input").onblur=function(){g_focus=""}.bind(this);$(this.name+"_input").onkeypress=function(e){var e=e||window.event;var charCode=e.which?e.which:e.keyCode;switch(charCode){case 27:case 13:if(e.stopPropagation){e.stopPropagation()}if(e.preventDefault){e.preventDefault()}else{return false}break
}}.bind(this);var refObj=$(this.name+"_input");var oParent=refObj.offsetParent;var nHeight=refObj.offsetHeight;this.refObjX=refObj.offsetTop;this.refObjY=refObj.offsetLeft;while(oParent){this.refObjX+=oParent.offsetLeft;this.refObjY+=oParent.offsetTop;oParent=oParent.offsetParent}}else{alert("Konnte Container für Kalender nicht finden!")}var div2=$("TTKALBOX_"+this.name);if(div2){div2.innerHTML=sHTML2;$(this.name+"_lnkPrev").onclick=this.showPrevMonth.bind(this);$(this.name+"_lnkNext").onclick=this.showNextMonth.bind(this)
}else{alert("Konnte Container für Kalender nicht finden!")}};this.updateShowMonth=function(){this.selTermin=new Date(getTimestampFromString($(this.name+"_input").value));this.selTermin.setHours(12,0,0,0);this.showMonth=new Date(this.selTermin.getTime());this.showMonth.setDate(1);this.showMonth.resetTime()};this.selectInput=function(){g_focus=this.name;var input=$(this.name+"_input");input.focus();input.select();if(typeof (input.selectionStart)!="undefined"){input.selectionStart=0;input.selectionEnd=input.value.length
}window.setTimeout("setInactive()",200)};this.showKalenderControl=function(){this.sel_termin=g_oTermine.tsSelTerminHin;this.sel_rueck=g_oTermine.tsSelTerminRueck;var divTable=$(this.name+"_kalTable");var divTitel=$(this.name+"_kalTitel");var tmpMonthMin=new Date(this.termin_min);tmpMonthMin.setDate(1);tmpMonthMin.resetTime();var tmpMonthMax=new Date(this.termin_max);tmpMonthMax.setDate(1);tmpMonthMax.resetTime();var preStr;if(this.typ=="hin"){preStr="sSwitchHin_"}else{preStr="sSwitchRueck_"}var strTitel='<select name="'+preStr+'select" onchange="switchMonth(this, \''+this.typ+'\');" id="'+preStr+'box" style="font-size: 10px; font-family: verdana; font-weight: normal;">';
var strSelected="";for(var iterDate=tmpMonthMin;iterDate<=tmpMonthMax;iterDate.addMonth()){if(this.showMonth.getMonth()==iterDate.getMonth()&&this.showMonth.getFullYear()==iterDate.getFullYear()){strSelected=' selected="selected"'}else{strSelected=""}strTitel+='<option value="'+iterDate+'"'+strSelected+">"+g_arMonNames[iterDate.getMonth()]+" "+iterDate.getFullYear()+"</option>"}strTitel+="</select>";divTitel.innerHTML=strTitel;var today=new Date();today.setHours(12,0,0,0);var startDate=new Date(this.showMonth.getTime());
var diff=startDate.getDay();if(diff){startDate.addDay(1-diff)}else{startDate.addDay(-6)}startDate.setHours(12);var nKW=0;var bMonStart=false;var bMonEnde=false;var aktCss="";var setWT=0;var sHTML='<table cellspacing="0" cellpadding="0" border="0" align="center" width="170">\r\n<tr><td colspan=\'7\' height=\'2\'></td></tr>\r\n';for(var i=0;i<6;i++){if(bMonEnde||(!bMonEnde&&bMonStart&&startDate.getMonth()>this.showMonth.getMonth()&&startDate.getFullYear()==this.showMonth.getFullYear())){}if(!bMonStart&&startDate.getMonth()==this.showMonth.getMonth()){bMonStart=true
}sHTML+=" <tr>\r\n";for(var j=0;j<7;j++){var bSZR=false;if((startDate.getTime()>=this.sel_termin)&&(startDate.getTime()<=this.sel_rueck)){bSZR=true}aktCss="kalwt";if(startDate.getMonth()!=this.showMonth.getMonth()||startDate.getFullYear()!=this.showMonth.getFullYear()){aktCss="kalam"}else{if(startDate.getTime()<this.termin_min||startDate.getTime()>this.termin_max){aktCss="klnl"}else{if(startDate.getDay()==0||startDate.getDay()==6){aktCss="kalson2"}}}if(aktCss!="kalam"){if(startDate.getMonth()==9&&startDate.getDate()>24&&setWT==0&&this.typ=="hin"){if(this.sel_termin==(startDate.getTime()+3600000)&&(startDate.getTimezoneOffset()=="-60")){bSZR=true;
setWT=1;aktCss="kalzr"}}if(startDate.getMonth()==2&&startDate.getDate()>24&&this.typ=="rueck"){if((this.sel_rueck+3600000)==startDate.getTime()&&(startDate.getTimezoneOffset()=="-120")){bSZR=true;aktCss="kalzr"}}if(setWT==0&&aktCss!="kalzr"&&this.typ=="hin"&&(startDate.getTime()==this.sel_termin||(this.sel_termin>(startDate.getTime()-86400000)&&bSZR))){aktCss="kalzr"}if(this.typ=="rueck"&&(startDate.getTime()==this.sel_rueck||(this.sel_rueck<(startDate.getTime()+86400000)&&bSZR))){var setTmpAktCss=1;
if(startDate.getMonth()==2&&startDate.getDate()>23&&this.sel_rueck==(startDate.getTime()+82800000)){setTmpAktCss=0}if(setTmpAktCss==1){aktCss="kalzr"}}}if(aktCss!="klnl"&&aktCss.indexOf("kalam")==-1&&aktCss!="kalzr"){var val=twoDigit(startDate.getDate())+"."+twoDigit(startDate.getMonth()+1)+"."+startDate.getFullYear();var sTooltip=SindFerien(startDate.getTime())?g_strToolTip:"";if(sTooltip!=""){aktCss+=" kalferien"}strLink=' id="'+val+'" onclick="'+this.name+'.SelectDate(this);" style="cursor:pointer;"  title="'+sTooltip+'"'
}else{strLink=""}if(aktCss.indexOf("kalam")==-1){if(startDate.getTime()==today.getTime()){sHTML+='<td class="'+aktCss+'"'+strLink+'><div id="today">'+startDate.getDate()+"</div></td>\r\n"}else{sHTML+='<td class="'+aktCss+'"'+strLink+">"+startDate.getDate()+"</td>\r\n"}}else{sHTML+='<td class="'+aktCss+'">'+startDate.getDate()+"</td>\r\n"}startDate.addDay()}sHTML+="</tr><tr><td colspan='7' height='3' style='line-height: 0;'></td></tr>\r\n"}sHTML+="</table>\r\n";divTable.innerHTML=sHTML;if(!this.noframe){$("KAL_IFR").style.height=$("BOXKAL").offsetHeight+"px"
}};this.showNextMonth=function(){g_calActive=true;var tmpMonth=new Date(this.showMonth);tmpMonth.addMonth();if(tmpMonth.getTime()<this.termin_max){this.showMonth=tmpMonth;this.showKalenderControl()}else{alert("Spätere Termine sind leider nicht auswählbar.")}};this.showPrevMonth=function(){g_calActive=true;var tmpMonth=new Date(this.showMonth);tmpMonth.setDate(0);tmpMonth.setDate(1);var firstMonth=new Date(this.termin_min);firstMonth.setDate(1);firstMonth.resetTime();if(tmpMonth.getTime()>=firstMonth.getTime()){this.showMonth=tmpMonth;
this.showKalenderControl()}else{alert("Früherere Termine sind leider nicht auswählbar.")}};this.updateCalendar=function(){this.showMonth.setDate(1);this.showKalenderControl()};this.SelectDate=function(td){g_calActive=true;this.active_td=td.id;var dt=new Date(this.active_td.split(".")[2],parseInt(this.active_td.split(".")[1],10)-1,parseInt(this.active_td.split(".")[0],10));dt.setHours(12,0,0,0);$(this.name+"_input").value=g_arWeekDays[dt.getDay()]+". "+this.active_td;if(this.typ=="hin"){g_oTermine.tsSelTerminHin=dt.getTime();
IBE.req.termin=g_oTermine.tsSelTerminHin/1000}else{if(dt.getTime()>g_oTermine.tsSelTerminHin){g_oTermine.tsSelTerminRueck=dt.getTime();IBE.req.ruecktermin=g_oTermine.tsSelTerminRueck/1000}}if(detail=="termine"){document.bengine.refresh.value=1}updateRueckTermin();this.updateCalendar()};this.TransmitDate=function(){if(this.active_td){var dt=new Date(this.active_td.split(".")[2],parseInt(this.active_td.split(".")[1],10)-1,parseInt(this.active_td.split(".")[0],10));dt.setHours(12,0,0,0);$(this.name+"_input").value=g_arWeekDays[dt.getDay()]+". "+this.active_td;
if(this.typ=="hin"){IBE.req.termin=g_oTermine.tsSelTerminHin/1000}else{if(dt.getTime()>g_oTermine.tsSelTerminHin){IBE.req.ruecktermin=g_oTermine.tsSelTerminRueck/1000}}if(detail=="termine"){document.bengine.refresh.value=1}}}}function changeDauer(){var retValue=false;var cdDauer=createDauerFromTimestamp(parseInt(getTimestampFromString(document.bengine.oKalHin_input.value)),parseInt(getTimestampFromString(document.bengine.oKalRueck_input.value)));if(cdDauer<=21){for(cdc=0;cdc<document.bengine.dauer.options.length;
cdc++){var tmpDau="6_"+cdDauer.toString();if(document.bengine.dauer.options[cdc].value==tmpDau){document.bengine.dauer.options[cdc].selected="true";retValue=true;break}}}else{for(cdc=0;cdc<document.bengine.dauer.options.length;cdc++){if(document.bengine.dauer.options[cdc].value=="13"){document.bengine.dauer.options[cdc].selected="true";retValue=true;break}}}return retValue}function createDauerFromTimestamp(timestampHin,timestampRueck){var cdft=timestampRueck/1000-timestampHin/1000;if((new Date(timestampRueck)).getTimezoneOffset()=="-60"&&(new Date(timestampHin)).getTimezoneOffset()=="-120"){cdft+=86400
}if((new Date(timestampRueck)).getTimezoneOffset()=="-120"&&(new Date(timestampHin)).getTimezoneOffset()=="-60"){cdft+=86400}if(cdft<0){cdft=-1}else{if(cdft<86400){cdft=1}else{cdft=Math.floor(cdft/86400)}}return cdft}function saveKal(){g_calActive=false;oKalHin.hideCalendar();oKalRueck.hideCalendar();changeDauer()}function hideKal(){g_calActive=false;oKalHin.hideCalendar();oKalRueck.hideCalendar()}function switchMonth(monthBox,type){var tmpMonth=new Date(monthBox.value);var kalObj;if(type=="hin"){kalObj=oKalHin
}else{kalObj=oKalRueck}kalObj.showMonth=tmpMonth;kalObj.showKalenderControl()};
