var offset_left=0;if(typeof(languageCode)=='undefined')var languageCode='de';function msieversion(){var ua=window.navigator.userAgent
var msie=ua.indexOf("MSIE ")
if(msie>0)return parseInt(ua.substring(msie+5,ua.indexOf(".",msie)));else return 0;}
function hidePlaceBox(){jQuery('#placeFilter').hide();}
function isIE6(){return(msieversion()==6);}
function hide(elementID)
{jQuery('#'+elementID).hide();}
function show(elementID)
{jQuery('#'+elementID).show();}
function showBlock(elementID)
{jQuery('#'+elementID).css('display','block');}
function toggleHomeTabs2(activeID){var txt_input=jQuery('#txt_input');var content_map=jQuery('#content_map');var content_region=jQuery('#content_region');var tab_region=jQuery('#tab_region');var tab_map=jQuery('#tab_map');var tab_number=jQuery('#tab_number');var activeTab=jQuery('#activeTab');switch(activeID){case'map':hide('content_region');if(content_map.length>0){if(txt_input.val()==''||txt_input.val==Translations[languageCode]['searchChooseObjectnumber'])txt_input.val(Translations[languageCode]['searchChooseTarget']);cleared['txt_input']=false;show('content_map');tab_map.addClass('active');tab_region.removeClass();tab_number.removeClass();activeTab.val('map');}
break;case'region':hide('content_map');if(content_region.length>0){show('content_region');tab_region.addClass('active');tab_map.removeClass();tab_number.removeClass();activeTab.val('region');}
break;case'number':hide('content_region');if(content_map.length>0){if(txt_input.val()==''||txt_input.val==Translations[languageCode]['searchChooseTarget'])txt_input.val(Translations[languageCode]['searchChooseObjectnumber']);cleared['txt_input']=false;show('content_map');tab_number.addClass('active');tab_region.removeClass();tab_map.removeClass();activeTab.val('number');}
break;}}
function hideUserinfoBox()
{hide('searchUserInformation');}
function loadImage(evt,imageUrl)
{if(!evt)
evt=window.event;scrollXY=getScrollXY();positionX=scrollXY[0];positionY=scrollXY[1];if(document.getElementById&&document.getElementById("imgPrvShadow")){document.getElementById("imgPrvShadow").style.visibility='visible';document.getElementById("imgPrvShadow").style.display='block';document.getElementById("imgPrv").innerHTML='<'+'div class="imgBorder" onMouseMove="unloadImage(event)" onMouseOut="unloadImage(event)"><'+'img id="imgPrvImg" src="'+imageUrl+'" alt=""><'+'/div>';document.getElementById("imgPrvShadow").style.left=(positionX+offset_left+10)+'px';document.getElementById("imgPrvShadow").style.top=(positionY+4)+'px';}
else if(document.all&&document.all.imgPrvShadow)
{document.all.imgPrvShadow.style.visibility='visible';document.all.imgPrvShadow.style.display='block';document.all.imgPrv.innerHTML='<'+'div class="imgBorder" onMouseMove="unloadImage(event)" onMouseOut="unloadImage(event)"><'+'img id="imgPrvImg" src="'+imageUrl+'" alt=""><'+'/div>';document.all.imgPrvShadow.style.left=(positionX+offset_left+10)+'px';document.all.imgPrvShadow.style.top=(positionY+4)+'px';}}
function unloadImage(evt)
{if(!evt)
evt=window.event;positionX=mouseX(evt);positionY=mouseY(evt);scrollXY=getScrollXY();previewX=scrollXY[0];previewY=scrollXY[1];if(document.getElementById&&document.getElementById("imgPrvImg"))
{previewWith=document.getElementById("imgPrvImg").width;previewHeight=document.getElementById("imgPrvImg").height;}
else if(document.all&&document.all.imgPrv)
{previewWith=document.all.imgPrv.width;previewHeight=document.all.imgPrv.height;}
previewAreaX=previewX+previewWith+10+22;previewAreaY=previewY+previewHeight+10+16;if((positionX<previewAreaX)&&(positionY<previewAreaY)&&(positionX>170))
{}
else
{if(document.getElementById&&document.getElementById("imgPrvShadow")){document.getElementById("imgPrvShadow").style.visibility='hidden';document.getElementById("imgPrvShadow").style.display='none';document.getElementById("imgPrv").innerHTML='';document.getElementById("imgPrvShadow").style.left='1px';document.getElementById("imgPrvShadow").style.top='1px';}
else if(document.all&&document.all.imgPrvShadow)
{document.all.imgPrvShadow.style.visibility='hidden';document.all.imgPrvShadow.style.display='none';document.all.imgPrv.innerHTML='';document.all.imgPrvShadow.style.left='1px';document.all.imgPrvShadow.style.top='1px';}}}
function mouseX(evt)
{if(evt.pageX)return evt.pageX;else if(evt.clientX)
return evt.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);else return null;}
function mouseY(evt)
{if(evt.pageY)return evt.pageY;else if(evt.clientY)
return evt.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);else return null;}
function getScrollXY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];}
function hideShowElement(elementID){if(partElement=document.getElementById(elementID))
{if(partElement.style.display=='block')partElement.style.display='none';else partElement.style.display='block';}
else if(document.all&&document.all.elementID)
{if(document.all.elementID.style.display=='block')document.all.elementID.style.display='none';else document.all.elementID.style.display='block';}};var blurAllowed=true;var livesearch_items=new Array();var sug_div;var txt_input;var searchForm;var rTypeField;var longField;var latField;var highlightClass;var immediateSubmit=false;if(typeof(searchPath)=='undefined')var searchPath="Ferienhaus-Suche";var highlightElement='not_set';var lastZoom="";function changeFormAction(){if(typeof doNotChangeAction=='undefined'||doNotChangeAction==false)return true;else return false;}
function switchForm(searchMode){highlightElement='not_set';if(document.getElementById('quick_requestType'))document.getElementById('quick_requestType').value='';if(document.getElementById('quick_longitude'))document.getElementById('quick_longitude').value='';if(document.getElementById('quick_latitude'))document.getElementById('quick_latitude').value='';if(document.getElementById('quick_hiddenLocationID'))document.getElementById('quick_hiddenLocationID').value='';if(document.getElementById('quick_hiddenCountryID'))document.getElementById('quick_hiddenCountryID').value='';if(document.getElementById('requestType'))document.getElementById('requestType').value='';if(document.getElementById('longitude'))document.getElementById('longitude').value='';if(document.getElementById('latitude'))document.getElementById('latitude').value='';if(document.getElementById('hiddenLocationID'))document.getElementById('hiddenLocationID').value='';if(document.getElementById('hiddenCountryID'))document.getElementById('hiddenCountryID').value='';if(searchMode=='quick'){sug_div=document.getElementById('quick_suggestions');txt_input=document.getElementById('quick_input');searchForm=document.quicksearchfrm;rTypeField=document.getElementById('quick_requestType');longField=document.getElementById('quick_longitude');latField=document.getElementById('quick_latitude');hiddenLocationID=document.getElementById('quick_hiddenLocationID');if(typeof document.getElementById('quick_hiddenCountryID')!='undefined'){hiddenCountryID=document.getElementById('quick_hiddenCountryID');}else{hiddenCountryID=document.getElementById('quick_hiddenLocationID');}
immediateSubmit=true;}else if(searchMode=='normal'){sug_div=document.getElementById('txt_suggestions');txt_input=document.getElementById('txt_input');searchForm=document.searchfrm;rTypeField=document.getElementById('requestType');longField=document.getElementById('longitude');latField=document.getElementById('latitude');hiddenLocationID=document.getElementById('hiddenLocationID');if(typeof document.getElementById('hiddenCountryID')!='undefined'){hiddenCountryID=document.getElementById('hiddenCountryID');}else{hiddenCountryID=document.getElementById('hiddenLocationID');}
immediateSubmit=false;}}
function onsubmitcheck(){if(boxStatus()=='visible'){return false;}else{if(typeof noPreloadSearch=='undefined'||noPreloadSearch==false){showSearchLayer();}
return true;}}
function updateAction(newAction){if(newAction!=""){setCoords(0,0,false);}
if(rTypeField){if(newAction==''){rTypeField.value='';}else{rTypeField.value='suggestion';}}}
function setCoords(latitude,longitude,formSubmit){if(longitude!="0"&&latitude!="0"){updateAction('/'+searchPath+'/');if(rTypeField){if((typeof map!='undefined'&&map!=null)||(typeof forceRequestMap!='undefined'&&forceRequestMap==true)||immediateSubmit){if(!(immediateSubmit&&formSubmit))rTypeField.value='map';}else{rTypeField.value='suggestion';}}
if(longField&&latField){longField.value=longitude;latField.value=latitude;}}else{if(longField&&latField){longField.value="";latField.value="";}
if(rTypeField){if(!rTypeField.value.indexOf("/")){rTypeField.value='';}}}
if(formSubmit){if(highlightElement!='not_set')rTypeField.value=livesearch_items[highlightElement][8];searchForm.submit();}}
function updateMap(coordinates){if(typeof mapIsLoaded!='undefined'&&mapIsLoaded!='undefined'&&mapIsLoaded==false){doLoadMap();mapIsLoaded=true;}
var coordsjoined=coordinates.join();if(coordinates[0]!=0&&coordinates[1]!=0)
{setCoords(coordinates[0],coordinates[1],false);if(lastZoom!=coordsjoined){if(typeof map!='undefined'&&map!=null){globalScale=map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(coordinates[5],coordinates[3]),new GLatLng(coordinates[4],coordinates[2])));if(typeof mapProcessSuggestionWrap=='function'){mapProcessSuggestionWrap(coordinates[0],coordinates[1],coordinates[6],coordinates[7]);}}
lastZoom=coordsjoined;}}}
function validateKey(keyCode,searchStr){if(msieversion()!=0&&(keyCode==40||keyCode==38)){keyPress(keyCode);}
if(keyCode==46||keyCode==8||keyCode==0||(keyCode>=48&&keyCode<=90)){if(rTypeField){rTypeField.value='suggestion';}
if(document.getElementById('sfCountry'))
{if(document.getElementById('sfCountry').selectedIndex!=0)
{document.getElementById('sfCountry').selectedIndex=0;refreshLocation(1);}}
searchIt(searchStr);setCoords(0,0,false);updateAction('/'+searchPath+'/');highlightElement='not_set';}
if(isObjectNumber(searchStr))searchForm.action='/'+searchStr;else if(changeFormAction())searchForm.action='/'+searchPath+'/';if(typeof livesearch_items!='undefined'){if(keyCode==27){box('close');highlightElement='not_set';}
if(keyCode==13){if(isObjectNumber(searchStr)){if(rTypeField){rTypeField.value='suggestion';}
searchForm.submit();}else{if(boxStatus()=='visible')
{if(highlightElement!='not_set')
{txt_input.value=livesearch_items[highlightElement][0];submitSearchForm=false;rTypeField.value=livesearch_items[highlightElement][8];if(livesearch_items[highlightElement][3]==livesearch_items[highlightElement][4])
{hiddenLocationID.value='';hiddenCountryID.value=(livesearch_items[highlightElement][8]=='form')?livesearch_items[highlightElement][4]:'';}
else
{hiddenCountryID.value=livesearch_items[highlightElement][3];hiddenLocationID.value=(livesearch_items[highlightElement][8]=='form')?livesearch_items[highlightElement][4]:'';}
var coordinates=livesearch_items[highlightElement][7].split("|");setCoords(coordinates[0],coordinates[1],true);box('close');highlightElement='not_set';if(typeof noPreloadSearch=='undefined'||noPreloadSearch==false)
{preLoadSearchResult();}}
else
{inputBlur();searchForm.submit();}}}}}}
function keyPress(keyCode){if(typeof livesearch_items!='undefined'){if(keyCode==40){if(sug_div.innerHTML!=''){if(boxStatus()=='hidden')box('open');if(highlightElement=='not_set'){highlightElement=0;highlightClass=document.getElementById(highlightElement).className;document.getElementById(highlightElement).className='sug_item_hover';}else{if(livesearch_items[highlightElement+1]){document.getElementById(highlightElement).className=highlightClass;highlightElement++;highlightClass=document.getElementById(highlightElement).className;document.getElementById(highlightElement).className='sug_item_hover';}}}}
if(keyCode==38){if(sug_div.innerHTML!=''){if(boxStatus()=='hidden')box('open');if(highlightElement=='not_set'){highlightElement=livesearch_items.length-1;highlightClass=document.getElementById(highlightElement).className;document.getElementById(highlightElement).className='sug_item_hover';}else{if(livesearch_items[highlightElement-1]){document.getElementById(highlightElement).className=highlightClass;highlightElement--;highlightClass=document.getElementById(highlightElement).className;document.getElementById(highlightElement).className='sug_item_hover';}}}}}
if(typeof setHiddenLocation=='function'){setHiddenLocation('');}}
function inputBlur(){if(blurAllowed==true)
{if(livesearch_items[0]&&boxStatus()=='visible')
{var lowerStr=txt_input.value.toLowerCase();var lowerStr2=livesearch_items[0][0].toLowerCase();if(lowerStr==lowerStr2)
{txt_input.value=livesearch_items[0][0];rTypeField.value=livesearch_items[0][8];if(livesearch_items[0][3]==livesearch_items[0][4])
{hiddenLocationID.value='';hiddenCountryID.value=(livesearch_items[0][8]=='form')?livesearch_items[0][4]:'';}
else
{hiddenCountryID.value=livesearch_items[0][3];hiddenLocationID.value=(livesearch_items[0][8]=='form')?livesearch_items[0][4]:'';}
var coordinates=livesearch_items[0][7].split("|");if(!immediateSubmit)updateMap(coordinates);else setCoords(coordinates[0],coordinates[1],false);box('close');rTypeField.value=livesearch_items[0][8];highlightElement='not_set';if(typeof noPreloadSearch=='undefined'||noPreloadSearch==false)
{preLoadSearchResult();}}
else
{box('close');}}}}
function searchIt(searchStr){var scriptpath="/xmlProcessing/Suggestion3/php/output2.php?search="+searchStr+"&languageCode="+languageCode;var htmlhead=document.getElementsByTagName("head")[0];var script_id="outputResults";if(document.getElementById(script_id)){htmlhead.removeChild(document.getElementById(script_id));}
var updatescript=document.createElement("script");updatescript.id=script_id;updatescript.src=scriptpath;htmlhead.appendChild(updatescript);}
function print_div_content(){var div_content="";var color=0;for(var liveItem in livesearch_items){if(color%2==1)var sugClass='sug_item_color';else var sugClass='sug_item';color=color+1;if(!isNaN(liveItem))
{div_content=div_content+'<span id="'+liveItem+'" class="'+sugClass+'" onmouseout="blurAllowed = true;" onmouseover="mouseoverItem('+liveItem+');" onclick="mouseclickItem();"><span class="sug_country">'+livesearch_items[liveItem][2]+'</span>'+livesearch_items[liveItem][1]+'</span>';if(livesearch_items[liveItem][9]=='1')
{rTypeField.value=livesearch_items[liveItem][8];if(livesearch_items[liveItem][3]==livesearch_items[liveItem][4]){hiddenLocationID.value='';hiddenCountryID.value=(livesearch_items[liveItem][8]=='form')?livesearch_items[liveItem][4]:'';}else{hiddenCountryID.value=livesearch_items[liveItem][3];hiddenLocationID.value=(livesearch_items[liveItem][8]=='form')?livesearch_items[liveItem][4]:'';}}}}
sug_div.innerHTML=div_content;box('open');}
function box(mode){if(mode=='open')visibilityValue='visible';else{if(highlightElement!='not_set')document.getElementById(highlightElement).className='sug_item';visibilityValue='hidden';}
sug_div.style.visibility=visibilityValue;}
function boxStatus(){return sug_div.style.visibility;}
function mouseclickItem(){txt_input.value=livesearch_items[highlightElement][0];txt_input.focus();rTypeField.value=livesearch_items[highlightElement][8];if(livesearch_items[highlightElement][3]==livesearch_items[highlightElement][4]){hiddenLocationID.value='';hiddenCountryID.value=(livesearch_items[highlightElement][8]=='form')?livesearch_items[highlightElement][4]:'';}else{hiddenCountryID.value=livesearch_items[highlightElement][3];hiddenLocationID.value=(livesearch_items[highlightElement][8]=='form')?livesearch_items[highlightElement][4]:'';}
var coordinates=livesearch_items[highlightElement][7].split("|");if(!immediateSubmit)updateMap(coordinates);else setCoords(coordinates[0],coordinates[1],true);rTypeField.value=livesearch_items[highlightElement][8];box('close');highlightElement='not_set';if(typeof noPreloadSearch=='undefined'||noPreloadSearch==false){preLoadSearchResult();}}
function mouseoverItem(id){if(id!=highlightElement){if(highlightElement!='not_set')document.getElementById(highlightElement).className=highlightClass;highlightClass=document.getElementById(id).className;document.getElementById(id).className='sug_item_hover';highlightElement=id;blurAllowed=false;}}
function isObjectNumber(str){var preg=/^(\d{7}[a-z]|\d{7}|\d{6}|[oO]02\d{2}[a-z]|[oO]01\d{3})$/;return preg.test(str);}
function getRefreshQuery(levelID)
{if(!levelID)levelID=1;if(document.getElementById('sfCountry'))
{countryValue=document.getElementById('sfCountry').value;}
else if(document.all&&document.all.sfCountry)
{countryValue=document.sfCountry.value;}
var levelValue=new Array();for(i=1;i<levelID;i++)
{levelElement="sfLevel"+i;if(document.getElementById(levelElement))
{levelValue[i]=document.getElementById(levelElement).value;}
else if(document.all&&document.all.levelElement)
{levelValue[i]=document.levelElement.value;}}
var refreshQuery="languageCode="+languageCode+"&country="+countryValue;for(i=1;i<=5;i++)
{if(levelValue[i])
{refreshQuery=refreshQuery+'&level'+i+'='+levelValue[i];}}
var objectGroup='';if(document.getElementById('group')&&document.getElementById('group').value){objectGroup=document.getElementById('group').value;}else if(document.getElementById('group')&&document.getElementById('searchfrm').group.length>0){for(i=0;i<=document.getElementById('searchfrm').group.length;i++){if(document.getElementById('searchfrm').group[i].checked==true){objectGroup=document.getElementById('searchfrm').group[i].value;break;}}}
if(objectGroup!='')refreshQuery=refreshQuery+'&objectTypeGroup='+objectGroup;return refreshQuery;}
function change_action(locationID,isArray){if(changeFormAction()){querys=new Array();levelIDs=new Array();if(document.getElementById('sfCountry')&&document.getElementById('sfCountry').options[document.getElementById('sfCountry').selectedIndex].value!='')querys.push('country='+document.getElementById('sfCountry').options[document.getElementById('sfCountry').selectedIndex].value);if(document.getElementById('sfLevel1')&&document.getElementById('sfLevel1').length>0&&document.getElementById('sfLevel1').options[document.getElementById('sfLevel1').selectedIndex].value!='')levelIDs.push(document.getElementById('sfLevel1').options[document.getElementById('sfLevel1').selectedIndex].value);if(document.getElementById('sfLevel2')&&document.getElementById('sfLevel2').length>0&&document.getElementById('sfLevel2').options[document.getElementById('sfLevel2').selectedIndex].value!='')levelIDs.push(document.getElementById('sfLevel2').options[document.getElementById('sfLevel2').selectedIndex].value);if(document.getElementById('sfLevel3')&&document.getElementById('sfLevel3').length>0&&document.getElementById('sfLevel3').options[document.getElementById('sfLevel3').selectedIndex].value!='')levelIDs.push(document.getElementById('sfLevel3').options[document.getElementById('sfLevel3').selectedIndex].value);if(document.getElementById('sfLevel4')&&document.getElementById('sfLevel4').length>0&&document.getElementById('sfLevel4').options[document.getElementById('sfLevel4').selectedIndex].value!='')levelIDs.push(document.getElementById('sfLevel4').options[document.getElementById('sfLevel4').selectedIndex].value);if(arguments.length>0&&locationID!=''){if(arguments.length==1||!isArray){levelIDs.push(locationID);}else if(isArray){for(var ii=0;ii<locationID.length;ii++){levelIDs.push(locationID[ii]);}}}
var objectGroup='';if(document.getElementById('group')&&document.getElementById('group').value){objectGroup=document.getElementById('group').value;}else if(document.getElementById('group')&&document.getElementById('searchfrm').group.length>0){for(i=0;i<=document.getElementById('searchfrm').group.length;i++){if(document.getElementById('searchfrm').group[i].checked==true){objectGroup=document.getElementById('searchfrm').group[i].value;break;}}}
if(window.ActiveXObject)
{xmlDoc2=new ActiveXObject("Microsoft.XMLHTTP");xmlDoc2.onreadystatechange=function()
{if(xmlDoc2.readyState==4)
{document.getElementById('searchfrm').action=xmlDoc2.responseText;}}}
else
{xmlDoc2=new XMLHttpRequest();xmlDoc2.onload=function()
{if(xmlDoc2.readyState==4)
{document.getElementById('searchfrm').action=xmlDoc2.responseText;}}}
if(typeof searchPath=='undefined')searchPath='search';var requestXML='/'+searchPath+"/getFormAction.php?group="+objectGroup+"&language="+languageCode+"&"+querys.join('&')+"&levelIDs="+levelIDs.join(',');xmlDoc2.open("GET",requestXML,true);xmlDoc2.setRequestHeader("Content-type","text/html;charset=UTF-8");xmlDoc2.send(null);}}