var validate={HColors:new Array("#FCFECC","#FCFECC","#FCFECC","#FFFFFF"),errorField:"",intensity:0,aktiv:null,elementMetas:{},CHECK_LENGTH:"length",CHECK_REQUIRED:"required",CHECK_NUMBER:"number",CHECK_STRING:"string",CHECK_ALPHANUMERIC:"alphanumeric",CHECK_PHONENUMBER:"phonenumber",CHECK_CURRENCY_DE:"currencyde",CHECK_STREETNUMBER:"streetnumber",CHECK_ZIP:"zip",CHECK_SELECT_ONE:"selectone",CHECK_RADIO_ONE:"checkedone",CHECK_AGB:"checkAGB",PARAM_MAXLENGTH:"maxLength",PARAM_MINLENGTH:"minLength",PARAM_PRECISION_BEFORE_COMMA:"precisionBeforeComma",PARAM_PRECISION_AFTER_COMMA:"precisionAfterComma",getElementMeta:function(elementId){var elementMeta=validate.elementMetas[elementId];if(immo.isEmpty(elementMeta)){validate.elementMetas[elementId]={};validate.elementMetas[elementId]["checks"]={};elementMeta=validate.elementMetas[elementId];}
return elementMeta;},registerCheckLength:function(elementId,errorAnchorName,maxLength,errorLabelId,minLength){if(immo.isEmpty(maxLength)){maxLength=16;}
if(immo.isEmpty(minLength)){minLength=0;}
validate.getElementMeta(elementId)[validate.PARAM_MINLENGTH]=minLength;validate.getElementMeta(elementId)[validate.PARAM_MAXLENGTH]=maxLength;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_LENGTH);},registerCheckRequired:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_REQUIRED);},registerCheckNumber:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerCheckString:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_STRING);},registerCheckAlphaNumeric:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_ALPHANUMERIC);},registerCheckPhoneNumber:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_PHONENUMBER);},registerCheckCurrencyDE:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_CURRENCY_DE);},registerCheckStreetnumber:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_STREETNUMBER);},registerCheckZip:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_ZIP);},registerCheckInteger:function(elementId,errorAnchorName,errorLabelId){validate.getElementMeta(elementId)[validate.PARAM_PRECISION_BEFORE_COMMA]=20;validate.getElementMeta(elementId)[validate.PARAM_PRECISION_AFTER_COMMA]=0;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerCheckDecimal:function(elementId,errorAnchorName,errorLabelId){validate.getElementMeta(elementId)[validate.PARAM_PRECISION_BEFORE_COMMA]=3;validate.getElementMeta(elementId)[validate.PARAM_PRECISION_AFTER_COMMA]=2;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerCheckEnergyValue:function(elementId,errorAnchorName,errorLabelId){validate.getElementMeta(elementId)[validate.PARAM_PRECISION_BEFORE_COMMA]=6;validate.getElementMeta(elementId)[validate.PARAM_PRECISION_AFTER_COMMA]=4;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerCheckYear:function(elementId,errorAnchorName,errorLabelId){validate.getElementMeta(elementId)[validate.PARAM_MINLENGTH]=4;validate.getElementMeta(elementId)[validate.PARAM_MAXLENGTH]=4;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_LENGTH);validate.getElementMeta(elementId)[validate.PARAM_PRECISION_BEFORE_COMMA]=4;validate.getElementMeta(elementId)[validate.PARAM_PRECISION_AFTER_COMMA]=0;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerCheckMoney:function(elementId,errorAnchorName,precisionAfterComma,errorLabelId){validate.getElementMeta(elementId)[validate.PARAM_PRECISION_BEFORE_COMMA]=10;if(immo.isStringEmpty(precisionAfterComma)){precisionAfterComma=2;}
validate.getElementMeta(elementId)[validate.PARAM_PRECISION_AFTER_COMMA]=precisionAfterComma;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerCheckRoom:function(elementId,errorAnchorName,errorLabelId){validate.getElementMeta(elementId)[validate.PARAM_PRECISION_BEFORE_COMMA]=4;validate.getElementMeta(elementId)[validate.PARAM_PRECISION_AFTER_COMMA]=1;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerSelectOne:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_SELECT_ONE);},registerCheckRadio:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_RADIO_ONE);},registerCheckAGB:function(elementId,errorAnchorName,errorLabelId){validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_AGB);},registerCheckArea:function(elementId,errorAnchorName,errorLabelId){validate.getElementMeta(elementId)[validate.PARAM_PRECISION_BEFORE_COMMA]=9;validate.getElementMeta(elementId)[validate.PARAM_PRECISION_AFTER_COMMA]=2;validate.registerDelegate(elementId,errorAnchorName,errorLabelId,validate.CHECK_NUMBER);},registerDelegate:function(elementId,errorAnchorName,errorLabelId,checkIdentifier){validate.getElementMeta(elementId)["elementId"]=elementId;validate.getElementMeta(elementId)["checks"][checkIdentifier]=checkIdentifier;if(typeof errorAnchorName=="undefined"){errorAnchorName=null;}
if(typeof errorLabelId=="undefined"){errorLabelId=null;}
validate.getElementMeta(elementId)["errorAnchorName"]=errorAnchorName;validate.getElementMeta(elementId)["errorLabelId"]=errorLabelId;var element=document.getElementById(elementId);if(element.type=='checkbox'||element.type=='radio'){immo.addEvent(element,"click",validate.eventCheckCall);}else{immo.addEvent(element,"change",validate.eventCheckCall);immo.addEvent(element,"blur",validate.eventCheckCall);}},eventCheckCall:function(event){var elementId=null;if(event.target){elementId=this.id;}
else{elementId=event.srcElement.id;}
var elementMeta=validate.getElementMeta(elementId);validate.validateField(elementMeta);},validateField:function(elementMeta){var checksValid=true;var elementError=document.getElementById(elementMeta.elementId+"_error");if(elementError==null){elementError=document.getElementById("_error");}
var elementErrorLabelId=document.getElementById(elementMeta.errorLabelId);for(var checkIdentifierKey in elementMeta["checks"]){var checkIdentifier=elementMeta["checks"][checkIdentifierKey];var result=validate.dispatchElementValidation(elementMeta,checkIdentifier);checksValid&=result.valid;if(!result.valid){validate.errorField=elementMeta.elementId;if(elementError!=null){elementError.innerHTML=result.message;elementError.style.display="block";}
if(elementErrorLabelId!=null){elementErrorLabelId.className="contenthlerror";}
break;}}
if(checksValid){if(elementError!=null){elementError.style.display="none";}
if(elementErrorLabelId!=null){elementErrorLabelId.className="contenthlsmall";}}
return checksValid;},validateFields:function(){var result=true;for(var elementMetaKey in validate.elementMetas){var elementMeta=validate.elementMetas[elementMetaKey];var checksValid=validate.validateField(elementMeta);if(!checksValid){if(!immo.isEmpty(elementMeta.errorAnchorName)){var url=window.location.href;url=url.substring(url.indexOf("#"),url.lastIndexOf());window.location.href=url+"#"+elementMeta.errorAnchorName;}
if(validate.aktiv==null){validate.aktiv=window.setInterval("validate.highlightOptions('"+elementMetaKey+"')",250);}
result=false;break;}}
return result;},dispatchElementValidation:function(elementMeta,checkIdentifier){var element=document.getElementById(elementMeta.elementId);if(!immo.isEmpty(element)){var value=immo.ltrim(element.value);element.value=value;if(checkIdentifier==validate.CHECK_LENGTH){return validate.validateLength(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_NUMBER){return validate.validateNumber(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_REQUIRED){return validate.validateRequired(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_SELECT_ONE){return validate.validateSelectOne(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_RADIO_ONE){return validate.validateCheckRadio(elementMeta,element);}
else if(checkIdentifier==validate.CHECK_AGB){return validate.validateCheckAGB(elementMeta,element);}
else if(checkIdentifier==validate.CHECK_STRING){return validate.validateString(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_ALPHANUMERIC){return validate.validateAlphaNumeric(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_PHONENUMBER){return validate.validatePhoneNumber(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_CURRENCY_DE){return validate.validateCurrencyDE(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_STREETNUMBER){return validate.validateStreetNumber(elementMeta,element,value);}
else if(checkIdentifier==validate.CHECK_ZIP){return validate.validateZip(elementMeta,element,value);}}},validateLength:function(elementMeta,element,value,maxLength,minLength){if(typeof(maxLength)=='undefined'||maxLength==null){maxLength=(elementMeta!=null)?elementMeta[validate.PARAM_MAXLENGTH]:0;}
if(typeof(minLength)=='undefined'||minLength==null){minLength=(elementMeta!=null)?elementMeta[validate.PARAM_MINLENGTH]:0;}
var result=new Object();if(value.length<minLength&&value.length>0){result.valid=false;result.message="Bitte geben Sie mind. "+minLength+" Zeichen ein.";}
else if(value.length>maxLength){result.valid=false;result.message="Bitte reduzieren Sie Ihre Eingabe auf "+maxLength+" Zeichen.";}
else{result.valid=true;}
return result;},validateString:function(elementMeta,element,value){var result=new Object();var re=new RegExp("^[A-Za-zÃÃŒÃÃ¶ÃÃ€ÃÃÃ¡ÃÃ ÃÃ©ÃÃš]+[A-Za-zÃÃŒÃÃ¶ÃÃ€ÃÃÃ¡ÃÃ ÃÃ©ÃÃš \s.,-/]*$");if(!re.test(value)){result.valid=false;result.message="Bitte geben Sie nur Buchstaben ein.";return result;}
result.valid=true;return result;},validateAlphaNumeric:function(elementMeta,element,value){var result=new Object();var re=new RegExp("^[0-9A-Za-zÃÃŒÃÃ¶ÃÃ€ÃÃÃ¡ÃÃ ÃÃ©ÃÃš \s.,-]*$");if(!re.test(value)){result.valid=false;result.message="Bitte geben Sie nur g&uuml;ltige Buchstaben oder Ziffern ein.";return result;}
result.valid=true;return result;},validateCurrencyDE:function(elementMeta,element,value){var result=new Object();var re=new RegExp("^(?:\\d+|\\d{1,3}(?:\\.\\d{3})+)*?(?:,\\d+)*?$");if(!re.test(value)){result.valid=false;result.message="Bitte geben Sie ein g&uuml;ltiges W&auml;hrungsformat ein. (Bsp. 1.000,00)";return result;}
result.valid=true;return result;},validateStreetNumber:function(elementMeta,element,value){var result=new Object();var re=new RegExp("^[0-9]{1,5}[a-zA-Z0-9-., ]*?$");if(!re.test(value)){result.valid=false;result.message="Bitte geben Sie nur Ziffern oder Buchstaben ein. (Bsp: 8d oder 93a-c)";return result;}
result.valid=true;return result;},validatePhoneNumber:function(elementMeta,element,value){var result=new Object();var re=new RegExp("^[0-9 \(\)\+/-]+$");if(!re.test(value)){result.valid=false;result.message="Bitte geben Sie ein g&uuml;tiges Format ein. (Erlaubt: Ziffern, (, ), +, -, /)";return result;}
result.valid=true;return result;},validateZip:function(elementMeta,element,value){var result=new Object();var re=new RegExp("^([A-Z]{0,3}[ ]?\-?[ ]?)?[0-9]*?$");if(!re.test(value)){result.valid=false;result.message="Bitte geben Sie ein g&uuml;ltiges PLZ-Format an. (Bsp: D-20097)";return result;}
result.valid=true;return result;},validateNumber:function(elementMeta,element,value){var result=new Object();var regexClauseAfterComma="(,[0-9]*)?";var re=new RegExp("^ *[0-9]*"+regexClauseAfterComma+" *$");if(!re.test(value)&&!re.test(value.replace(".",""))){result.valid=false;result.message="Bitte geben Sie nur Ziffern ein.";return result;}
var precisionAfterComma=elementMeta[validate.PARAM_PRECISION_AFTER_COMMA];if((precisionAfterComma!=null)&&(typeof precisionAfterComma!="undefined")){if(precisionAfterComma==0){regexClauseAfterComma="";re=new RegExp("^ *[0-9]* *$");if(!re.test(value)&&!re.test(value.replace(".",""))){result.valid=false;result.message="Bitte geben Sie nur Ziffern ein.";return result;}}
else{re=new RegExp("^ *[0-9]*,?[0-9]{0,"+precisionAfterComma+"} *$");if(!re.test(value)&&!re.test(value.replace(".",""))){result.valid=false;if(precisionAfterComma>1){result.message="Bitte geben Sie nur "+precisionAfterComma+" Nachkommastellen ein.";}
else{result.message="Bitte geben Sie nur eine Nachkommastelle ein.";}
return result;}}}
var precisionBeforeComma=elementMeta[validate.PARAM_PRECISION_BEFORE_COMMA];if((precisionBeforeComma!=null)&&(typeof precisionBeforeComma!="undefined")){re=new RegExp("^ *[0-9]{0,"+precisionBeforeComma+"}"+regexClauseAfterComma+" *$");if(!re.test(value)&&!re.test(value.replace(".",""))){result.valid=false;if(precisionBeforeComma>1){result.message="Bitte geben Sie nur "+precisionBeforeComma+" Ziffern ein.";}
else{result.message="Bitte geben Sie nur eine Ziffer ein.";}
return result;}}
result.valid=true;return result;},validateRequired:function(elementMeta,element,value){var result=new Object();if(immo.isStringEmpty(value)){result.valid=false;result.message="Bitte f&uuml;llen Sie das Feld aus.";return result;}
result.valid=true;return result;},validateSelectOne:function(elementMeta,element,value){var result=new Object();if(element.selectedIndex==-1){result.valid=false;result.message="W&auml;hlen Sie bitte eine Option aus.";return result;}
result.valid=true;return result;},validateCheckAGB:function(elementMeta,element){var result=new Object();result=validate.validateCheckRadio(elementMeta,element);if(!result.valid){result.message="Bitte best&auml;tigen Sie, dass Sie die AGBs gelesen haben.";}
return result;},validateCheckRadio:function(elementMeta,element){var result=new Object();result.valid=false;var elements=document.getElementsByName(element.name);for(var i=0;i<elements.length;i++){if(elements[i].checked){result.valid=true;}}
if(!result.valid){result.message="W&auml;hlen Sie bitte eine Option aus.";}
return result;},highlightOptions:function(elementid){var element=document.getElementById(elementid);element.style.backgroundColor=validate.HColors[validate.intensity];validate.intensity++;if(validate.intensity>validate.HColors.length){window.clearInterval(validate.aktiv);validate.aktiv=null;validate.intensity=0;}}}
var submitsearchcriteria={formName:"LocationListForm",targetFormName:"searchform",switchParameterValues:function(fromId,toId){if(document.getElementById(fromId).value!=""&&document.getElementById(toId).value!=""){var fromParameter=parseInt(document.getElementById(fromId).value);var toParameter=parseInt(document.getElementById(toId).value);if(fromParameter>toParameter){document.getElementById(fromId).value=toParameter;document.getElementById(toId).value=fromParameter;}}},submitForm:function(domain,formname,allparams){if(formname==null){var formName=submitsearchcriteria.formName;}else{var formName=formname;}
if(document.forms[formName].target==null){var targetName=submitsearchcriteria.targetFormName;}else{var targetName=document.forms[formName].target;}
if(allparams!=null){var params=allparams;}else{var params='';}
if(domain==null){for(i=0;i<document.forms[formName].length;i++){if(document.forms[formName][i].checked||document.forms[formName][i].type=='text'){params+='&'+document.forms[formName][i].name+'='+document.forms[formName][i].value;}}
if(formname=='importer'){document.forms[formName].parentcat.value='-1';for(i=0;i<document.forms[formName]['objecttype'].length;i++){if(document.forms[formName]['objecttype'][i].checked==true){if(document.forms[formName]['objecttype'][i].id!=null){pcat=document.forms[formName]['objecttype'][i].id.split('_');if(pcat!=null&&pcat.length==2){document.forms[formName].parentcat.value=pcat[1];}}}}}}else{var str='';for(i=0;i<document.forms[formName].length;i++){var elem=document.forms[formName][i];if(elem.name!='temp'&&elem.name!='t'&&elem.name!='c'){if(document.forms[formName][i].type=='radio'||document.forms[formName][i].type=='checkbox'){if(document.forms[formName][i].checked){if(domain.indexOf('map24')!=-1){str+=elem.name+'='+elem.value+'%26';}else{str+=elem.name+'='+elem.value+'&';}}}else{if(domain.indexOf('map24')!=-1){str+=elem.name+'='+elem.value+'%26';}else{str+=elem.name+'='+elem.value+'&';}}}else if(elem.name=='t'){document.forms[formName]['t'].value='';}}
if(domain.indexOf('map24')!=-1){document.forms[formName]['t'].value=document.forms[formName]['temp'].value+'%26'+str;}else{document.forms[formName]['t'].value=document.forms[formName]['temp'].value+str;}
var tWin=window.open("about:blank",targetName);}
document.forms[formName].submit();if(document.forms[formName].popupvalue!=null&&document.forms[formName].popupvalue.value=='true'){javascript:immo.load_popup(document.forms[formName].popupurl.value+'?listsize=10&agent=confirm&'+params);}
return true;},submitsearchCriteria:function(domain,formname,allparams){if(validate.validateFields()){if(document.getElementById("fromprice")||document.getElementById("toprice")){submitsearchcriteria.switchParameterValues("fromprice","toprice");}
if(document.getElementById("fromrooms")||document.getElementById("torooms")){submitsearchcriteria.switchParameterValues("fromrooms","torooms");}
if(document.getElementById("fromarea")||document.getElementById("toarea")){submitsearchcriteria.switchParameterValues("fromarea","toarea");}
if(document.getElementById("fromyear")||document.getElementById("toyear")){submitsearchcriteria.switchParameterValues("fromyear","toyear");}
submitsearchcriteria.submitForm(domain,formname,allparams);}else{return false;}}}
var objectValue=null;var immosel={isPanelOpen:false,panelDisplay:function(elemID,show){for(var i=0;i<50;i++){immosel.displayElem(elemID+"_"+i,show);}
if(show){immosel.displayElem(elemID+"_true",true);immosel.displayElem(elemID+"_false",false);}
else{immosel.displayElem(elemID+"_true",false);immosel.displayElem(elemID+"_false",true);}},display:function(elemID,show){immosel.displayElem(elemID,show);if(show){immosel.isPanelOpen=true;immosel.displayElem(elemID+"_true",true);immosel.displayElem(elemID+"_false",false);}
else{immosel.isPanelOpen=false;immosel.displayElem(elemID+"_true",false);immosel.displayElem(elemID+"_false",true);}},displayElem:function(elemID,show){var myElem=$(elemID);if(!immo.isEmpty(myElem)){if(show){myElem.show();}
else{myElem.hide();}}},updateSel:function(rattail,pagename,mandant){function updateSelComplete(){new Ajax.Updater("aktuelleSuche","/letzteSucheRechts.do");immosel.incrementEtracker(pagename.replace('/liste','/liste/seite1'),mandant);}
if(validate.validateFields()&&immosel.checkFromToFields()){var rattailTmp=rattail.replace(/&amp;/g,'&');var tail=encodeURI(immosel.setRattail(rattailTmp));immo.showSpinnerOverlay("ergebnisse");new Ajax.Updater({success:"ergebnisse"},"/search.do?outputtype=ajax_sel"+tail,{evalScripts:true,onComplete:updateSelComplete});}},updateSearch:function(rattail,pagename,mandant,value){this.objectValue=value;function onUpdateSearchComplete(){immosel.incrementEtracker(pagename.replace('/liste','/liste/seite1')+"/verfeinerung",mandant);new Effect.Highlight("trefferanzeige",{startcolor:"#6AA2D8",endcolor:"#D2E3F3"});}
if(validate.validateFields()&&immosel.checkFromToFields()){var rattailTmp=rattail.replace(/&amp;/g,'&');var tail=encodeURI(immosel.setRattail(rattailTmp));new Ajax.Updater({success:"sucheVerfeinerung"},"/search.do?outputtype=ajax_refinement"+tail,{evalScripts:true,onComplete:onUpdateSearchComplete});}},updatePage:function(rattail,page,size,pagename,mandant,scrollTop){function updateSelComplete(){immosel.incrementEtracker(pagename.replace('/liste/seite1','/liste/seite'+page),mandant);if(!immo.isEmpty(scrollTop)&&scrollTop){window.scrollTo(0,1);}}
var listsize=size;var pageoffset=(listsize*page-(listsize-1));immo.showSpinnerOverlay("ergebnisse");var rattailTmp=rattail.replace(/&amp;/g,'&');var tail=encodeURI(rattailTmp);new Ajax.Updater({success:"ergebnisse"},"/search.do?outputtype=ajax_sel&pageoffset="+pageoffset+tail,{evalScripts:true,onComplete:updateSelComplete});},updatePageSort:function(rattail,pagename,mandant){function updateSelComplete(){immosel.incrementEtracker(pagename.replace('/liste','/liste/seite1')+"/sortierung",mandant);}
var sortby=document.SortByForm.sortby;var value=0;for(var i=0;i<sortby.length;i++){if(sortby.options[i].selected){value=sortby.options[i].value;}}
var rattailTmp=rattail.replace(/&amp;/g,'&');var tail=encodeURI(rattailTmp);immo.showSpinnerOverlay("ergebnisse");new Ajax.Updater({success:"ergebnisse"},"/search.do?outputtype=ajax_sel&pageoffset=1"+tail+"&sortby="+value,{evalScripts:true,onComplete:updateSelComplete});},locationCheck:function(tail){var locationcheck=0;var locationInfo=document.FilterListForm.SearchInfos;var citysearch=document.FilterListForm.citysearch;var districtsearch=document.FilterListForm.districtsearch;var rattail=new String();if(citysearch!=null&&districtsearch==null){tail=tail.replace(/&city=-1/g,"");var locationtype="&city=";}else if(districtsearch!=null){if(tail.indexOf('city=')==-1&&document.FilterListForm.city!=null&&document.FilterListForm.city.value!=null){rattail+="&city="+document.FilterListForm.city.value;}
var locationtype="&district=";}
if(!immo.isEmpty(locationInfo)){if(this.objectValue!=null)
immosel.isPanelOpen=true;if(locationInfo.length>0){isLocationChecked=false;if(this.objectValue!=-1){for(var i=1;i<locationInfo.length;i++){if(locationInfo[i].checked){locationcheck++;tail=tail.replace(locationtype+locationInfo[i].value,"");rattail+=locationtype+locationInfo[i].value;isLocationChecked=true;}}
locationInfo[0].checked=!isLocationChecked;}else{for(var i=1;i<locationInfo.length;i++){locationInfo[i].checked=false;}}}
if(!isLocationChecked){rattail=locationtype+"-1";}}
if(immosel.isPanelOpen){rattail+="&openPanel=true"}
return tail+rattail;},checkFromToFields:function(){var returner=true;var fromprice=$F("fromprice");var toprice=$F("toprice");var fromrooms=$F("fromrooms");var torooms=$F("torooms");var fromarea=$F("fromarea");var toarea=$F("toarea");var fromyear=$F("fromyear");var toyear=$F("toyear");if(fromprice!=""&&toprice!=""&&Number(fromprice)>Number(toprice)){returner=false;}
else if(fromrooms!=""&&torooms!=""&&Number(fromrooms)>Number(torooms)){returner=false;}
else if(fromarea!=""&&toarea!=""&&Number(fromarea)>Number(toarea)){returner=false;}
else if(fromyear!=""&&toyear!=""&&Number(fromyear)>Number(toyear)){returner=false;}
return returner;},getPerson:function(rattail){var persons=document.FilterListForm.person;if(!immo.isEmpty(persons)){if(persons.length!=null){for(var i=0;i<persons.length;i++){if(persons[i].checked){rattail+="&person="+persons[i].value;}}}else{if(persons.checked){rattail+="&person="+persons.value;}}}
return rattail;},setMarketing:function(rattail){var marketingtypes=document.FilterListForm.marketingtype;var marketingtype=1;if(marketingtypes.length!=null){for(var i=0;i<marketingtypes.length;i++){if(marketingtypes[i].checked){marketingtype=marketingtypes[i].value;}}}else{if(marketingtypes.checked){marketingtype=document.FilterListForm.marketingtype.value;}}
return rattail+="&marketingtype="+marketingtype;},setRattail:function(rattail){var fromprice=$F("fromprice");var toprice=$F("toprice");var fromrooms=$F("fromrooms");var torooms=$F("torooms");var fromarea=$F("fromarea");var toarea=$F("toarea");var fromyear=$F("fromyear");var toyear=$F("toyear");var seperablearea=document.FilterListForm.seperablearea;if(!immo.isEmpty(seperablearea)&&seperablearea.checked){rattail+="&seperablearea="+seperablearea.value;}else{rattail+="&seperablearea=0";}
var parentcats=document.FilterListForm.parentcat;if(!immo.isEmpty(parentcats)){var parentcat;for(var i=0;i<parentcats.length;i++){if(parentcats.options[i].selected){parentcat=parentcats.options[i].value;}}}
var objectcats=document.FilterListForm.objectcat;if(!immo.isEmpty(objectcats)){if(objectcats.length!=null){for(var i=0;i<objectcats.length;i++){if(objectcats[i].checked){rattail+="&objectcat="+objectcats[i].value;}}}else{if(objectcats.checked){rattail+="&objectcat="+objectcats.value;}}}
var features=document.FilterListForm.sft;if(!immo.isEmpty(features)){if(features.length!=null){for(var i=0;i<features.length;i++){if(features[i].checked){rattail+="&sft="+features[i].value;}}}else{if(features.checked){rattail+="&sft="+features.value;}}}
var radius=document.FilterListForm.radius;if(!immo.isEmpty(radius)){if(radius.type=="select-one"){for(var i=0;i<radius.length;i++){if(radius.options[i].selected){rattail+="&radius="+radius.options[i].value;}}}else if(radius.type=="hidden"){rattail+="&radius="+radius.value;}
else{rattail+="&radius=0"}}
rattail=this.setMarketing(rattail);var objecttype=document.FilterListForm.objecttype;if(!immo.isEmpty(objecttype)&&objecttype.value==6){rattail=this.getPerson(rattail);}
rattail+="&parentcat="+parentcat+"&fromprice="+fromprice+"&toprice="+toprice+"&fromrooms="+fromrooms+"&torooms="+torooms+"&fromarea="+fromarea+"&toarea="+toarea+"&fromyear="+fromyear+"&toyear="+toyear;return this.locationCheck(rattail);},incrementEtracker:function(subsystem,mandant){var subsystemInternal=subsystem;etracker.incrementEtrackerSimple("",subsystemInternal,true);}}
var immoautocomplete={outp:null,textfield:null,words:new Array(),value:null,key:null,request:null,adr:null,bSelect:-1,listsize:10,pref:null,cityNameElem:null,eventElement:null,focusedField:null,callbackBeforeChange:null,callbackAfterChange:null,perform:function(formElem,elemId,url,lsize,cityNameElem,callbackBeforeChange,callbackAfterChange,executionCondition){immoautocomplete.textfield=formElem;immoautocomplete.cityNameElem=cityNameElem;immoautocomplete.callbackAfterChange=callbackAfterChange;immoautocomplete.callbackBeforeChange=callbackBeforeChange;var execute=true;if(!immo.isEmpty(executionCondition)){execute=executionCondition();}
if(execute&&immoautocomplete.textfield!=null&&immoautocomplete.value!=immoautocomplete.textfield.value.toLowerCase()){immoautocomplete.value=immoautocomplete.textfield.value.toLowerCase();immoautocomplete.init(formElem,elemId,url,lsize);if(immoautocomplete.value!=null&&immoautocomplete.value.length>=2){if(immoautocomplete.words.length==0||(immoautocomplete.pref==null||immoautocomplete.value.indexOf(immoautocomplete.pref)!=0)){immoautocomplete.pref=immoautocomplete.value.substring(0,2);immoautocomplete.lookAt();}
window.setTimeout("immoautocomplete.handleWords()",100);}
else{immoautocomplete.words=new Array();immoautocomplete.clearOutput();immoautocomplete.outp.style.visibility="hidden";}}},performDistricts:function(zip){immoautocomplete.value=zip;immoautocomplete.pref=zip;immoautocomplete.adr="/ajax/autocomplete/district.do?zip=";immoautocomplete.lookAt();window.setTimeout("immoautocomplete.addDistricts()",100);},init:function(formElem,elemId,url,lsize){immoautocomplete.listsize=lsize;immoautocomplete.bSelect=-1;immoautocomplete.outp=document.getElementById(elemId);immo.addEvent(document,"keydown",immoautocomplete.keygetter);immo.addEvent(document,"keyup",immoautocomplete.keyHandler);immo.addEvent(document,"click",immoautocomplete.blurHandler);immo.addEvent(document,"blur",immoautocomplete.blurHandler);immoautocomplete.adr=url;},handleWords:function(){immoautocomplete.clearOutput();var selectWords=new Array();if(immoautocomplete.words.length>0&&immoautocomplete.words[0].length>0){var j=0;for(i=0;i<immoautocomplete.words.length;i++){if(immoautocomplete.words[i].toLowerCase().indexOf(immoautocomplete.value)==0){selectWords[j]=immoautocomplete.words[i];j++;}}}
immoautocomplete.outp.style.visibility="hidden";if(selectWords.length>0){immoautocomplete.outp.style.visibility="visible";immoautocomplete.addWords(selectWords);}},lookAt:function(){if(immoautocomplete.value.length>1){if(window.XMLHttpRequest){immoautocomplete.request=new XMLHttpRequest();}
else if(window.ActiveXObject){try{immoautocomplete.request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){immoautocomplete.request=new ActiveXObject("Microsoft.XMLHTTP");}}
immoautocomplete.request.onreadystatechange=immoautocomplete.processStateChange;immoautocomplete.request.open("GET",immoautocomplete.adr+escape(immoautocomplete.pref),true);immoautocomplete.request.send(null);}
else{immoautocomplete.clearOutput();immoautocomplete.outp.style.visibility="hidden";}},processStateChange:function(){if(immoautocomplete.request.readyState==4){immoautocomplete.responseComplete();}},responseComplete:function(){if(immoautocomplete.request.status==200){var response=eval("("+immoautocomplete.request.responseText+")");immoautocomplete.words=new Array();for(var iElement=0;iElement<response.length;iElement++){immoautocomplete.words.push(response[iElement]);}}},addWords:function(selectWords){immoautocomplete.outp.onclick=immoautocomplete.mouseClick;var size=0;for(var i=0;i<selectWords.length;++i){if(selectWords[i]!=null&&selectWords[i].length>0){size++;var li=document.createElement("option");li.appendChild(document.createTextNode(selectWords[i]));immoautocomplete.outp.appendChild(li);}}
if(selectWords.length==1&&immoautocomplete.textfield.value.toLowerCase()==selectWords[0].toLowerCase()){immoautocomplete.outp.style.visibility="hidden";}
else{immoautocomplete.outp.style.visibility="visible";if(size>=10){immoautocomplete.outp.size=10;}
else if(size==1){immoautocomplete.outp.size=2;}
else{immoautocomplete.outp.size=size;}}},clearOutput:function(){while(immoautocomplete.outp.hasChildNodes()){noten=immoautocomplete.outp.firstChild;immoautocomplete.outp.removeChild(noten);}},keygetter:function(event){if(!event&&window.event){event=window.event;}
if(event){immoautocomplete.key=event.keyCode;}
else{immoautocomplete.key=event.which;}},keyHandler:function(event){if(!event&&window.event){event=window.event;}
var eventElem=(event.target)?event.target:event.srcElement;immoautocomplete.eventElement=eventElem;var name=navigator.appName;var version=navigator.appVersion;if(eventElem.id==immoautocomplete.textfield.id||eventElem.id==immoautocomplete.outp.id){if(immoautocomplete.key==40){if(immoautocomplete.words.length>0){immoautocomplete.outp.focus();immoautocomplete.outp.selectedIndex;if(immoautocomplete.outp.selectedIndex<0){immoautocomplete.outp.selectedIndex=0;}
immoautocomplete.bSelect=immoautocomplete.outp.selectedIndex;}}
else if(immoautocomplete.key==38){if(immoautocomplete.words.length>0){if(immoautocomplete.bSelect==0){immoautocomplete.outp.selectedIndex=-1;immoautocomplete.textfield.focus();immoautocomplete.bSelect=-1;}
else{immoautocomplete.bSelect=immoautocomplete.outp.selectedIndex;}}}
else if(immoautocomplete.key==27){immoautocomplete.clearOutput();immoautocomplete.outp.style.visibility="hidden";immoautocomplete.textfield.value="";immoautocomplete.textfield.focus();}
else if(immoautocomplete.key==13){immoautocomplete.handleSelect();immoautocomplete.textfield.focus();}}
if(name=="Microsoft Internet Explorer"&&version>="4.0"){if(immoautocomplete.key==9){immoautocomplete.handleSelect();}}},mouseClick:function(){immoautocomplete.handleSelect();},handleSelect:function(){if(!immo.isEmpty(immoautocomplete.callbackBeforeChange)){immoautocomplete.callbackBeforeChange();}
var selectedItem=immoautocomplete.outp.selectedIndex;try{var txt=immoautocomplete.outp.options[selectedItem].text;if(!immo.isEmpty(immoautocomplete.cityNameElem)&&txt.charAt(0)>=0&&txt.charAt(4)>=0){immoautocomplete.textfield.value=txt.substring(0,5);var inpTxtField=document.getElementById(immoautocomplete.cityNameElem);inpTxtField.value=txt.substring(6,txt.length);immoautocomplete.words=new Array();}
else{immoautocomplete.textfield.value=txt;}}
catch(e){}
immoautocomplete.outp.style.visibility="hidden";if(!immo.isEmpty(immoautocomplete.callbackAfterChange)){immoautocomplete.callbackAfterChange();}},blurHandler:function(){if(immoautocomplete.eventElement.id==immoautocomplete.focusedField.id){immoautocomplete.handleSelect();}},updateTextField:function(source,target){immoautocomplete.textfield=document.getElementsByName(target)[0];var selectedItem=immoautocomplete.outp.selectedIndex;var txt=immoautocomplete.outp.options[selectedItem].text;if(!immo.isEmpty(immoautocomplete.cityNameElem)){immoautocomplete.textfield.value=txt.substring(0,5);}
else{immoautocomplete.textfield.value=txt;}},setFocus:function(element){immoautocomplete.focusedField=element;}}
var fjpsuche={clickedItems:'',withHighlight:true,highlightThis:function(doId,doHighlight){adId="id_"+doId;var thisId=document.getElementById(adId);if(thisId){if(doHighlight){thisId.style.backgroundColor="#D2E3F3";}else{thisId.style.backgroundColor="#FFF";}}},checkItems:function(elemId,divId,classname,withHighlight){if(withHighlight!=null){fjpsuche.withHighlight=withHighlight;}
var elem=document.getElementById(elemId);if(fjpsuche.withHighlight){fjpsuche.highlightThis(elem.id,elem.checked);}
if(elem.id=="Alle"){if(fjpsuche.clickedItems==''){elem.checked=true;if(fjpsuche.withHighlight){fjpsuche.highlightThis(elem.id,elem.checked);}}else{var checkboxes=(fjpsuche.clickedItems).split('&');for(var i=0;i<checkboxes.length;i++){if(checkboxes[i]!=''){var uncheckElem=document.getElementById(checkboxes[i]);if(uncheckElem.id!=null){uncheckElem.checked=false;if(fjpsuche.withHighlight){fjpsuche.highlightThis(uncheckElem.id,uncheckElem.checked);}}}}}}else{var all=document.getElementById("Alle");var pos=(fjpsuche.clickedItems).indexOf(elem.id);if(pos==-1&&elem.checked){fjpsuche.clickedItems=(fjpsuche.clickedItems).concat(elem.id+'&');}else if(pos>0&&!elem.checked){fjpsuche.clickedItems=((fjpsuche.clickedItems).substring(0,pos-1)).concat((fjpsuche.clickedItems).substring(pos+((elem.id).length)));}else if(pos==0&&!elem.checked){fjpsuche.clickedItems=(fjpsuche.clickedItems).substr(pos+((elem.id).length)+1);}
if(fjpsuche.clickedItems==''){all.checked=true;}else{all.checked=false;}
if(fjpsuche.withHighlight){fjpsuche.highlightThis(all.id,all.checked);}}},checkLabelItems:function(elemId,divId,classname){var elem=document.getElementById(elemId);if(elem.checked){elem.checked=false;}else{elem.checked=true;}
fjpsuche.checkItems(elemId,divId,classname);},initClickedItems:function(formName,elemName,withHighlight){if(withHighlight!=null){fjpsuche.withHighlight=withHighlight;}
fjpsuche.clickedItems='';var tempList=document.forms[formName].elements[elemName];if(tempList!=null){for(i=1;i<tempList.length;i++){if(tempList[i].checked){fjpsuche.clickedItems=(fjpsuche.clickedItems).concat(tempList[i].id+'&');fjpsuche.checkItems(tempList[i].id,null,null,withHighlight);}}}},toggleLink:function(aLink){var lnkName=aLink.getAttribute("name");var lnkAnz=0;var elClone=null;var childNode=null;var doCount=0;if(lnkName!=null&&lnkName.length>0){var lnkArray=document.getElementsByName(lnkName);lnkAnz=lnkArray.length;}
do{aLink=(lnkAnz==0)?aLink:lnkArray[doCount];childNode=aLink.firstChild;while(childNode!=null){if(childNode.nodeType==3){var text=new String(childNode.nodeValue);var rExp=new RegExp("\\w+");if(!rExp.test(text)){aLink.removeChild(childNode);childNode=aLink.firstChild;continue;}
else{elClone=childNode.cloneNode(true);break;}}
else if(childNode.nodeType==1){elClone=childNode.cloneNode(true);break;}
childNode=childNode.nextSibling;}
var eDiv=document.createElement("div");eDiv.setAttribute("name","clone_"+lnkName);eDiv.setAttribute("style","display:inline");eDiv.appendChild(elClone);aLink.parentNode.appendChild(eDiv);aLink.style.display='none';doCount++;}while(doCount<lnkAnz);},sendFormByLink:function(aLink,params){fjpsuche.toggleLink(aLink);var allParams=params.replace(/outputtype=ajax_sel/g,"outputtype=ajax").split('&');var aForm=document.forms['formlink'];for(i=0;i<allParams.length;i++){aParam=allParams[i].split('=');if(aParam.length==2){var inputField=document.createElement('input');inputField.setAttribute('type','hidden');inputField.setAttribute('name',aParam[0]);inputField.setAttribute('value',aParam[1]);aForm.appendChild(inputField);}}
var hrefStr=''+aLink.href;aForm.action=hrefStr;if(hrefStr.indexOf("?")>0){aForm.action=hrefStr.substring(0,hrefStr.indexOf("?"));}
aLink.href='javascript:fjpsuche.submitFormByLink();';return false;},submitFormByLink:function(){document.forms['formlink'].submit();}}
var canvascheck=document.createElement('canvas');var isIE=window.navigator.systemLanguage?1:0;var isVM=document.namespaces?1:0;var isJG=0;var isCV=canvascheck.getContext?1:0;var jg=new Array();if(isVM){if(document.namespaces['v']==null){var e=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","roundrect","oval","rect","arc","image"],s=document.createStyleSheet();for(var i=0;i<e.length;i++){s.addRule("v\\:"+e[i],"behavior: url(#default#VML); antialias: true;");}document.namespaces.add("v","urn:schemas-microsoft-com:vml");}}
function showCoords(map,ele,x,y,w,h){}
function getClasses(classes,string){var temp='';for(var j=0;j<classes.length;j++){if(classes[j]!=string){if(temp){temp+=' ';}
temp+=classes[j];}}
return temp;}
function getClassValue(classes,string){var temp=0;var pos=string.length;for(var j=0;j<classes.length;j++){if(classes[j].indexOf(string)==0){temp=Math.min(classes[j].substring(pos),100);break;}}
return Math.max(0,temp);}
function getClassRGBColor(classes,string,color){var temp,val=color,pos=string.length;for(var j=0;j<classes.length;j++){if(classes[j].indexOf(string)==0){temp=classes[j].substring(pos);val=temp.toLowerCase();break;}}
if(!val.match(/^[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)){val=color||'000000';}
if(!isCV){return val;}else{function hex2dec(hex){return(Math.max(0,Math.min(parseInt(hex,16),255)));}
var cr=hex2dec(val.substr(0,2)),cg=hex2dec(val.substr(2,2)),cb=hex2dec(val.substr(4,2));return cr+','+cg+','+cb;}}
function getClassAttribute(classes,string){var temp=0;var pos=string.length;for(var j=0;j<classes.length;j++){if(classes[j].indexOf(string)==0){temp=1;break;}}
return temp;}
function getMaps(className){var children=document.getElementsByTagName('img');var elements=new Array();var i=0;var mapname='';var child;var classNames;var j=0;var mapid='';for(i=0;i<children.length;i++){child=children[i];classNames=child.className.split(' ');for(j=0;j<classNames.length;j++){if(classNames[j]==className){mapname=child.useMap.split("#");if(mapname[1]!=''&&mapname[1].length>=1){mapid=document.getElementsByName(mapname[1]);if(mapid){elements.push(child);break;}}}}}
return elements;}
function fadeCanvas(id,opac){var obj=document.getElementById(id);if(obj.fading==1&&opac<=100){obj.style.opacity=opac/100;opac+=10;window.setTimeout("fadeCanvas('"+id+"',"+opac+")",10);}}
function setAreaOver(obj,id,bd,co,op,nb,f,z){var a,i,j,d,c,o,b,n,l,r,v,u,x,y,p,k=0,t='',r=obj.getAttribute('rel'),context,canvas=document.getElementById(id);if(r!=null){d=r.split(",");v=d.unshift(obj.id);}else{d=new Array(obj.id);}
function setAttr(){if(l.indexOf('forcegroup')!=-1){k=getClassAttribute(u,"forcegroup");}else{k=0;}
if(l.indexOf('iopacity')!=-1){o=getClassValue(u,"iopacity")/100;}else{o=op;}
if(l.indexOf('iborder')!=-1){b=getClassRGBColor(u,"iborder",bd);}else{b=bd;}
if(l.indexOf('icolor')!=-1){c=getClassRGBColor(u,"icolor",co);}else{c=co;}
if(l.indexOf('noborder')!=-1){n=getClassAttribute(u,"noborder");}else{n=nb;}}
if(isVM){for(a=0;a<d.length;a++){obj=document.getElementById(d[a]);if(obj){p='',l=obj.className,u=l.split(" "),v=obj.coords.split(",");if(k==0){setAttr();}
if(obj.shape.toLowerCase()=='rect'){t+='<v:rect strokeweight="1" filled="t" stroked="'+(n<1?"t":"f")+'" strokecolor="#'+b+'" style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+parseInt(v[0])+'px;top:'+parseInt(v[1])+'px;width:'+parseInt(v[2]-v[0])+'px;height:'+parseInt(v[3]-v[1])+'px;"><v:fill color="#'+c+'" opacity="'+o+'" /></v:rect>';}else if(obj.shape.toLowerCase()=='circle'){t+='<v:oval strokeweight="1" filled="t" stroked="'+(n<1?"t":"f")+'" strokecolor="#'+b+'" style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+parseInt(v[0]-v[2])+'px;top:'+parseInt(v[1]-v[2])+'px;width:'+(parseInt(v[2])*2)+'px;height:'+(parseInt(v[2])*2)+'px;"><v:fill color="#'+c+'" opacity="'+o+'" /></v:oval>';}else{for(j=2;j<v.length;j+=2){p+=parseInt(v[j])+','+parseInt(v[j+1])+',';}
t+='<v:shape strokeweight="1" filled="t" stroked="'+(n<1?"t":"f")+'" strokecolor="#'+b+'" coordorigin="0,0" coordsize="'+canvas.width+','+canvas.height+'" path="m '+parseInt(v[0])+','+parseInt(v[1])+' l '+p+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+canvas.width+'px;height:'+canvas.height+'px;"><v:fill color="#'+c+'" opacity="'+o+'" /></v:shape>';}}}canvas.innerHTML=t;}else if(isCV){if(f<1){canvas.fading=0;canvas.style.opacity=0;}
context=canvas.getContext("2d");for(a=0;a<d.length;a++){obj=document.getElementById(d[a]);if(obj){l=obj.className,u=l.split(" "),v=obj.coords.split(",");if(k==0){setAttr();}context.beginPath();if(obj.shape.toLowerCase()=='rect'){context.rect(0.5+parseInt(v[0]),0.5+parseInt(v[1]),parseInt(v[2]-v[0]),parseInt(v[3]-v[1]));context.closePath();}else if(obj.shape.toLowerCase()=='circle'){context.arc(0.5+parseInt(v[0]),0.5+parseInt(v[1]),parseInt(v[2]),0,(Math.PI/180)*360,false);}else{context.moveTo(parseInt(v[0]),parseInt(v[1]));for(j=2;j<v.length;j+=2){context.lineTo(parseInt(v[j]),parseInt(v[j+1]));}context.closePath();}context.fillStyle='rgba('+c+','+o+')';context.strokeStyle='rgba('+b+',1)';context.fill();if(n<1){context.stroke();}}}if(f<1){canvas.fading=1;fadeCanvas(id,0);}}else{o=op;l=obj.className;u=l.split(" ");if(l.indexOf('forcegroup')!=-1){k=getClassAttribute(u,"forcegroup");if(k!=0){if(l.indexOf('iopacity')!=-1){o=getClassValue(u,"iopacity")/100;k=0;}}}
if(isIE){canvas.style.filter="Alpha(opacity="+(o*100)+")";}else{canvas.style.opacity=o;canvas.style.MozOpacity=o;canvas.style.KhtmlOpacity=o;}
for(a=0;a<d.length;a++){obj=document.getElementById(d[a]);if(obj){l=obj.className,u=l.split(" "),v=obj.coords.split(",");if(k==0){if(l.indexOf('forcegroup')!=-1){k=getClassAttribute(u,"forcegroup");}else{k=0;}
if(l.indexOf('icolor')!=-1){c=getClassRGBColor(u,"icolor",co);}else{c=co;}}jg[z].setColor("#"+c);if(obj.shape.toLowerCase()=='rect'){jg[z].fillRect(parseInt(v[0]),parseInt(v[1]),parseInt(v[2]-v[0])+1,parseInt(v[3]-v[1])+1);}else if(obj.shape.toLowerCase()=='circle'){jg[z].fillEllipse(parseInt(v[0]-v[2]),parseInt(v[1]-v[2]),parseInt(v[2])*2+1,parseInt(v[2])*2+1);}else{x=new Array();y=new Array();i=0;for(j=0;j<v.length;j+=2){x[i]=parseInt(v[j]);y[i]=parseInt(v[j+1]);i++;}jg[z].fillPolygon(x,y);}jg[z].paint();}}}}
function setAreaOut(obj,id,f,z){var canvas=document.getElementById(id);if(isVM){canvas.innerHTML='';}else
if(isJG){jg[z].clear();}else if(isCV){var context=canvas.getContext("2d");context.clearRect(0,0,canvas.width,canvas.height);}}
function getCoords(e,n,a,i,x,y,w,h,pw,ph){var t,o,ox,oy,ex,ey,cx,cy,px=0,py=0;if(!e){e=window.event;}
if(e.pageX||e.pageY){px=e.pageX;py=e.pageY;}
ex=e.clientX;ey=e.clientY;if(self.pageXOffset||self.pageYOffset){ox=self.pageXOffset;if(ox>0&&px==ex){ex-=ox;}
oy=self.pageYOffset;if(oy>0&&py==ey){ey-=oy;}}else if(document.documentElement){ox=document.documentElement.scrollLeft;oy=document.documentElement.scrollTop;}else if(document.body){ox=document.body.scrollLeft;oy=document.body.scrollTop;}
if(document.body.scrollHeight!=ph||document.body.scrollWidth!=pw){var o=document.getElementById(i);var t=findPosXY(o);x=t.x;y=t.y;}
cx=Math.min(Math.max(ex+ox-x,0),w);cy=Math.min(Math.max(ey+oy-y,0),h);showCoords(n,a,cx,cy,w,h);}
function findPosXY(ele){var t;var d={x:ele.offsetLeft,y:ele.offsetTop};if(ele.offsetParent){t=findPosXY(ele.offsetParent);d.x+=t.x;d.y+=t.y;}
return d;}
function roundedRect(ctx,x,y,width,height,radius,nopath){if(!nopath)ctx.beginPath();ctx.moveTo(x,y+radius);ctx.lineTo(x,y+height-radius);ctx.quadraticCurveTo(x,y+height,x+radius,y+height);ctx.lineTo(x+width-radius,y+height);ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius);ctx.lineTo(x+width,y+radius);ctx.quadraticCurveTo(x+width,y,x+width-radius,y);ctx.lineTo(x+radius,y);ctx.quadraticCurveTo(x,y,x,y+radius);if(!nopath)ctx.closePath();}
function getRadius(radius,width,height){var part=(Math.min(width,height)/100);radius=Math.max(Math.min(100,radius/part),0);return radius+'%';}
function addMapper(){var themaps=getMaps('mapper');var image,object,bgrnd,canvas,blind,context,mapid,mname,ele,atr;var classes='',newClasses='',func='',tmp,i,j,o,b,c,d,r,t,n,f,x,y,w,h,pw,ph;for(i=0;i<themaps.length;i++){image=themaps[i];object=image.parentNode;if(image.id==''){image.id="gmipam_"+i;}
object.style.position=(object.style.position=='static'||object.style.position==''?'relative':object.style.position);object.style.height=image.height+'px';object.style.width=image.width+'px';object.style.padding=0+'px';object.style.MozUserSelect="none";object.style.KhtmlUserSelect="none";object.unselectable="on";r=0;n=0;f=0;b='0000ff';c='000000';o=33;if(isCV){canvas=document.createElement('canvas');}else if(isVM){canvas=document.createElement(['<var style="zoom:1;overflow:hidden;display:block;width:'+image.width+'px;height:'+image.height+'px;padding:0;">'].join(''));}else{canvas=document.createElement('div');}
canvas.id=image.id+'_canvas';classes=image.className.split(' ');r=getClassValue(classes,"iradius");o=getClassValue(classes,"iopacity");b=getClassRGBColor(classes,"iborder",'0000ff');c=getClassRGBColor(classes,"icolor",'000000');n=getClassAttribute(classes,"noborder");f=getClassAttribute(classes,"nofade");d=getClassAttribute(classes,"showcoords");o=o==0?0.33:o/100;r=parseInt(Math.min(Math.min(image.width/4,image.height/4),r));newClasses=getClasses(classes,"mapper");image.className=newClasses;mname=image.useMap.split("#");mname=mname[1];mapid=document.getElementsByName(mname);if(mapid.length>0){for(j=0;j<mapid[0].areas.length;j++){if(mapid[0].areas[j].shape.match(/(rect|poly|circle)/i)){if(window.opera||mapid[0].areas[j].coords!=''){if(mapid[0].areas[j].id==''){mapid[0].areas[j].id=mname+'_'+j;}
if(isVM||isIE){func=mapid[0].areas[j].onmouseover;if(func!=null){tmp=String(func);func=tmp.substr(23,tmp.length-25);}
mapid[0].areas[j].onmouseover=new Function('setAreaOver(this,"'+canvas.id+'","'+b+'","'+c+'","'+o+'",'+n+','+f+','+i+');'+func);func=mapid[0].areas[j].onmouseout;if(func!=null){tmp=String(func);func=tmp.substr(23,tmp.length-25);}
mapid[0].areas[j].onmouseout=new Function('setAreaOut(this,"'+canvas.id+'",'+f+','+i+');'+func);}else{func=mapid[0].areas[j].getAttribute("onmouseover");mapid[0].areas[j].setAttribute("onmouseover","setAreaOver(this,'"+canvas.id+"','"+b+"','"+c+"','"+o+"',"+n+","+f+","+i+");"+func);func=mapid[0].areas[j].getAttribute("onmouseout");mapid[0].areas[j].setAttribute("onmouseout","setAreaOut(this,'"+canvas.id+"',"+f+","+i+");"+func);}}}}}
canvas.style.height=image.height+'px';canvas.style.width=image.width+'px';canvas.height=image.height;canvas.width=image.width;canvas.left=0;canvas.top=0;canvas.style.position='absolute';canvas.style.left=0+'px';canvas.style.top=0+'px';canvas.fading=0;image.className='';image.style.cssText='';image.left=0;image.top=0;image.style.position='absolute';image.style.height=image.height+'px';image.style.width=image.width+'px';image.style.left=0+'px';image.style.top=0+'px';image.style.MozUserSelect="none";image.style.KhtmlUserSelect="none";image.unselectable="on";if(isIE){image.style.filter="Alpha(opacity=0)";}else{image.style.opacity=0;image.style.MozOpacity=0;image.style.KhtmlOpacity=0;}
if(isCV&&r>0){bgrnd=document.createElement('canvas');}else if(isVM&&r>0){bgrnd=document.createElement(['<var style="zoom:1;overflow:hidden;display:block;width:'+image.width+'px;height:'+image.height+'px;padding:0;">'].join(''));}else{bgrnd=document.createElement('img');bgrnd.src=image.src;}
bgrnd.id=image.id+'_image';bgrnd.left=0;bgrnd.top=0;bgrnd.style.position='absolute';bgrnd.style.height=image.height+'px';bgrnd.style.width=image.width+'px';bgrnd.style.left=0+'px';bgrnd.style.top=0+'px';object.insertBefore(canvas,image);blind=document.createElement('div');blind.id=mname+'_blind';blind.className="blind_area";blind.left=0;blind.top=0;blind.style.position='absolute';blind.style.height=image.height+'px';blind.style.width=image.width+'px';blind.style.left=0+'px';blind.style.top=0+'px';blind.innerHTML=" ";object.insertBefore(blind,image);if(isCV){context=canvas.getContext("2d");context.clearRect(0,0,canvas.width,canvas.height);}else if(!isVM&&!isCV){if(isIE){canvas.style.filter="Alpha(opacity="+(o*100)+")";}else{canvas.style.opacity=o;canvas.style.MozOpacity=o;canvas.style.KhtmlOpacity=o;}
if(typeof(window['jsGraphics'])!=='undefined'){jg[i]=new jsGraphics(canvas);isJG=1;}}
object.insertBefore(bgrnd,canvas);if(isCV&&r>0){bgrnd.height=image.height;bgrnd.width=image.width;context=bgrnd.getContext("2d");context.clearRect(0,0,bgrnd.width,bgrnd.height);roundedRect(context,0,0,bgrnd.width,bgrnd.height,r);context.clip();context.fillStyle='rgba(0,0,0,0)';context.fillRect(0,0,bgrnd.width,bgrnd.height);context.drawImage(image,0,0,bgrnd.width,bgrnd.height);}else if(isVM&&r>0){bgrnd.height=image.height;bgrnd.width=image.width;r=getRadius(r,bgrnd.width,bgrnd.height);bgrnd.innerHTML='<v:roundrect arcsize="'+r+'" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:0px;top:0px;width:'+bgrnd.width+'px;height:'+bgrnd.height+'px;"><v:fill src="'+image.src+'" type="frame" /></v:roundrect>';}
if(d>0){ele=document.getElementById(image.id);w=parseInt(image.width);h=parseInt(image.height);t=findPosXY(ele);x=t.x;y=t.y;ph=document.body.scrollHeight;pw=document.body.scrollWidth;if(isVM||isIE){func=image.onmousemove;if(func!=null){tmp=String(func);func=tmp.substr(23,tmp.length-25);}
image.onmousemove=new Function('getCoords(event,"'+mname+'",0,"'+image.id+'",'+x+','+y+','+w+','+h+','+pw+','+ph+');'+func);}else{func=image.getAttribute("onmousemove");image.setAttribute("onmousemove","getCoords(event,'"+mname+"',0,'"+image.id+"',"+x+","+y+","+w+","+h+","+pw+","+ph+");"+func);}
if(mapid.length>0){for(j=0;j<mapid[0].areas.length;j++){if(mapid[0].areas[j].shape.match(/(rect|poly|circle)/i)){if(window.opera||mapid[0].areas[j].coords!=''){atr=mapid[0].areas[j].id;if(isVM||isIE){func=mapid[0].areas[j].onmousemove;if(func!=null){tmp=String(func);func=tmp.substr(23,tmp.length-25);}
mapid[0].areas[j].onmousemove=new Function('getCoords(event,"'+mname+'","'+atr+'","'+image.id+'",'+x+','+y+','+w+','+h+','+pw+','+ph+');'+func);}else{func=mapid[0].areas[j].getAttribute("onmousemove");mapid[0].areas[j].setAttribute("onmousemove","getCoords(event,'"+mname+"','"+atr+"','"+image.id+"',"+x+","+y+","+w+","+h+","+pw+","+ph+");"+func);}}}}}}}}
var mapperOnload=window.onload;window.onload=function(){if(mapperOnload)mapperOnload();addMapper();}