Object.extend=function(d,a,c){for(var b in a){if(c==false&&d[b]!=null){continue;}d[b]=a[b];}return d;};var IwAG={Base:{}};var globalDialog=null;var marginLeft=null;var marginTop=null;var IsPrintSite=false;var ModalBackButtonCounter=0;var ModalDialogonOpenFunction=null;var ModalDialogonShowFunction=null;var ModalDialogOnCloseFunction=null;var autoCompleterList=new Array();if(typeof IWhost=="undefined"){IWhost="";}if(typeof mid=="undefined"){mid=0;}IwAG.Events={};IwAG.Events.Authentication=(function(){var uniqueInstance;function Authentication(){var $txtPassword=$("input[id$=txtPassword]");var $lbtnLogins=$("a[id$=lbtnLogin]");var $lbtnLogin;if(typeof $lbtnLogins.get(0)=="undefined"){return;}function Loggin_keydown(e){e=e||window.event;var code=e.keyCode||e.which;if(code==13){eval($lbtnLogin.attr("href").replace("javascript:",""));}}$txtPassword.keydown(function(e){$lbtnLogins.each(function(e){$txtPassword=$("#"+$(this).get(0).id.replace("lbtnLogin","pnlLogin")+" .formfield_login #txtPassword");$lbtnLogin=$(this);return false;});Loggin_keydown(e);});}return{getInstance:function(){if(!uniqueInstance){uniqueInstance=Authentication();}return uniqueInstance;}};})();function InitializeAsynch(){var a=$(".alert_window");if(a.length>0){$(document).click(function(){a.hide();});}}$(document).ready(function(){$.fn.ImageResize=function(options){var settings={height:200,width:300};if(options&&typeof(options)!="string"){jQuery.extend(settings,options);}var img=$(this).get(0);if(img==null||img==NaN){return;}var height=img.height;var width=img.width;var ratio=width/height;var targetRatio=settings.width/settings.height;if(height>=settings.height&&targetRatio>=ratio){var factor=height/settings.height;width=width/factor;$(this).removeAttr("width").removeAttr("height").attr("width",width).attr("height",settings.height).height(settings.height).width(width);}else{if(width>settings.width&&targetRatio<ratio){var factor=width/settings.width;height=height/factor;$(this).removeAttr("width").removeAttr("height").attr("width",settings.width).attr("height",height).width(settings.width).height(height);}}$(this).show();return this;};$.fn.tooltip=function(html,options){var defaults={opacity:1};if($.browser.msie){defaults.opacity=1;}var settings=$.extend({},defaults,options);var showTooltip=function(text,top,left,width){$("#calctooltip").remove();$('<div id="calctooltip" class="tooltip"></div>').prependTo("body").hide().offset({top:top+5,left:left+width-56});$(".tooltip").html(text);$("#calctooltip").show();};var removeTooltip=function(){$("#calctooltip").remove();};this.each(function(){var $this=$(this);var title=this.title;if($this.attr("title")!=""){this.title="";$this.hover(function(e){var offset=$this.offset();showTooltip(title,e.pageY,e.pageX,0);},function(){removeTooltip();});$this.mousemove(function(e){$("#calctooltip").css({top:e.pageY+5,left:e.pageX-56});});}});return this;};$.fn.enterHere=function(target){$(this).attr("target",target);$(this).keydown(function(e){e=e||window.event;var code=e.keyCode||e.which;if(code==13){if(typeof Page_ValidationActive=="boolean"){Page_ValidationActive=true;}$("#txtUsername").attr("autocomplete","on");$("#txtPassword").attr("autocomplete","on");if($.browser.msie){window.external.AutoCompleteSaveForm(document.forms[0]);}var id=$(this).attr("target");if($("#"+id).attr("href")!=null&&$("#"+id).attr("href")!=""){if($("#"+id).attr("onclick")!=null&&$("#"+id).attr("onclick")!=""){$("#"+id).click();}eval($("#"+id).attr("href").replace("javascript:",""));}else{if($("#"+id).attr("onclick")!=null&&$("#"+id).attr("onclick")!=""){$("#"+id).click();}__doPostBack(id,"");}}});return this;};Object.extend(IwAG.Base,{showClassicPopUp:function(url,height,width,scrollbar,resizable,name){var rest="";if(typeof(height)!=="undefined"&&height!=null&&height>1){rest+="height="+height;if(typeof(width)!=="undefined"&&width!=null&&width>1){rest+=",width="+width;if(typeof(scrollbar)!=="undefined"&&scrollbar!=null){rest+=",scrollbars="+scrollbar;if(typeof(resizable)!=="undefined"&&resizable!=null){rest+=",resizable="+resizable;}}}}else{rest+="height=300,width=300";}if(typeof name!="string"){name="popup";}var popupwin=window.open(url,name,rest);popupwin.focus();},SetModalFocus:function(element){$(element).focus();},openModalDialog:function(modalID,onOpen,onClose,overlayclose,setFocus,persist){if($(modalID).lenght<1){return;}if(overlayclose===undefined||overlayclose===null){overlayclose=true;}var toPersist=false;if(persist!==undefined&&persist!==null&&typeof persist=="boolean"){toPersist=persist;}$(modalID).modal({closeClass:"close",persist:toPersist,closeHTML:"",opacity:70,overlayClose:overlayclose,onShow:function(){eval(onOpen);$("#feedback").hide();},onClose:function(){eval(onClose);$.modal.close();$("#feedback").show();}});if(setFocus){$(modalID).find("input:text:visible").eq(0).focus();}},parseACData:function(data){var parsed=[];if(typeof data!="undefined"&&data!=null&&data!=""){var rows=null;try{rows=jQuery.parseJSON(data);}catch(e){}if(rows!=null){for(var i=0;i<rows.length;i++){var row=rows[i];if(row){parsed[parsed.length]={data:row,value:row.id,result:row.s+" "+row.a};}}}}return parsed;},autoCompleteForLocation:function(inputBox,servicePath,listHeight,listWidth,autoSubmit,postBack,addParams,fixedPos,autoFill){if(listHeight==undefined){listHeight=300;}if(listWidth==undefined){listWidth=200;}if(typeof servicePath!="undefined"&&servicePath!=""){$(inputBox).unautocomplete();var extraParams={};if(typeof addParams!="undefined"&&addParams!=null){$.each(addParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});}if(extraParams.GeoID==undefined||extraParams.GeoID==null){extraParams=$.extend(extraParams,{GeoID:"108"});}if(extraParams.ValidOnly==undefined||extraParams.ValidOnly==null){extraParams=$.extend(extraParams,{ValidOnly:false});}if(extraParams.PLZ==undefined||extraParams.PLZ==null){extraParams=$.extend(extraParams,{PLZ:null});}if(typeof autoFill!="boolean"){autoFill=false;}var ac=$(inputBox).autocomplete(servicePath,{width:listWidth,max:150,scroll:true,selectFirst:autoFill,autoFill:autoFill,scrollHeight:listHeight,cacheLength:0,delay:100,multiple:false,focusInputOnHide:false,requestType:"POST",dataType:"json",contentType:"application/json; charset=utf-8",extraParams:extraParams,parse:function(data){return IwAG.Base.parseACData(data);},formatItem:function(row){return row.s+" "+row.a;},formatResult:function(row){return row.s+" "+row.a;},fixedPosition:fixedPos});autoCompleterList.push(ac);$(inputBox).result(function(event,data,formatted){var hidden=$(this).nextAll("input:hidden");if(data!=undefined&&data!=null){$.each(hidden,function(){if(this.id.indexOf("Value")>-1){$(this).val(data.s+" "+data.a);}else{if(this.id.indexOf("GeoID")>-1){$(this).val(data.id);}}});}});if(postBack!=undefined){$(inputBox).result(function(e){e=e||window.event;var code=e.keyCode||e.which;if(code==13&&autoSubmit){if(typeof Page_ValidationActive=="boolean"){Page_ValidationActive=true;}eval(postBack);}}).keydown(function(e){e=e||window.event;var code=e.keyCode||e.which;if(code==13){$(inputBox).hideautocomplete();if(autoSubmit){if(typeof Page_ValidationActive=="boolean"){Page_ValidationActive=true;}eval(postBack);}}});}}return true;},hideAllAutoCompletes:function(){if(autoCompleterList==null||autoCompleterList.length==0){return;}for(var i=0;i<autoCompleterList.length;i++){autoCompleterList[i].cancelRequest();autoCompleterList[i].hideautocomplete();}},serialize:function(o){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},s={"boolean":function(x){return String(x);},"null":function(x){return"null";},number:function(x){return isFinite(x)?String(x):"null";},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);});}return'"'+x+'"';},array:function(x){var a=["["],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a[a.length]=v;b=true;}}}a[a.length]="]";return a.join("");},object:function(x){if(x){if(x instanceof Array){return s.array(x);}var a=["{"],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a.push(s.string(i),":",v);b=true;}}}a[a.length]="}";return a.join("");}return"null";}};return s.object(o);},initializeAsynch:function(handler){if(typeof Sys!="undefined"&&typeof Sys.WebForms!="undefined"){Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(handler);}},initializeAsynchEndRequest:function(handler){if(typeof Sys!="undefined"&&typeof Sys.WebForms!="undefined"){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(handler);}},initFeedBackModal:function(){$("#feedback").hide();var accFb=$("[id$=accFeedback]").accordion({header:"dt",icons:{header:"bn_plus",headerSelected:"bn_minus"},autoHeight:false,collapsible:false,active:0});return accFb;}},true);IwAG.Base.initializeAsynch(InitializeAsynch);Object.extend(String,{Format:function(){var s=arguments[0];for(var i=0;i<arguments.length-1;i++){var reg=new RegExp("\\{"+i+"\\}","gm");s=s.replace(reg,arguments[i+1]);}return s;}});});function setData(b){if(typeof b=="undefined"||b==null){return;}for(var a=0;a<b.eo.length;a++){var c=document.getElementById(b.eo[a].i);if(c!=null){c.innerHTML=b.eo[a].v;}}}if(!Array.prototype.indexOf&&!Array.indexOf){Array.prototype.indexOf=function(c){var b=this.length;var a=Number(arguments[1])||0;a=(a<0)?Math.ceil(a):Math.floor(a);if(a<0){a+=b;}for(;a<b;a++){if(a in this&&this[a]===c){return a;}}return -1;};}function goToLink(e,i,d,j,h){var b=j.substr(0,1);if(b=="#"){j=j.replace("#","/");}var c;if(e==0){c="http://";}else{c="http://www.";}if(i==""||d==""){location.href="";}else{var g=encodeURI(c+i+"."+d+j);var f="";if(h!=undefined&&h===true){f="location=yes,resizable=yes,width=800,height=600,left=100,top=200,menubar=yes,scrollbars=yes,toolbar=yes";}var a=window.open(encodeURI(g),"",f);a.focus();}return false;}function removeURLParam(e,c){var d="";if(e.indexOf("?")>-1){var b=e.substr(e.indexOf("?"));if(b.indexOf("#&&")>-1){b=b.replace(b.slice(b.indexOf("#&&"),b.indexOf("==")+2),"");}var a=b.split("&");var f=new Array();for(var g=0;g<a.length;g++){if(a[g].toLowerCase().indexOf(c.toLowerCase()+"=")<0){f.push(a[g]);}}d=f.join("&");if(d.indexOf("?")<0){d="?"+d;}}return d;}function ResizeAdFrame(a){$(a).contents().filter(function(){var b=$(this).find("body").height();if(b==0){$(a).hide();}else{if(b!=$(a).height()){$(a).height(b).attr("height",b);}}});}$(window).load(function(){$(".icon_info").tooltip();var a=$("#Nav_MeineImmowelt_BN");var e=$("[id$=Nav_Login_BN]");var g=$("select[id$=ddlSort]");var d=true;var b=$("#navi_login");var c=$("#basecontainer");var f=$("#basecontainer a[href=#]");$("input[id$=txtPassword]").enterHere($("a[id$=lbtnLogin]").attr("id"));e.click(function(){if(e.parent().hasClass("current")){e.parent().removeClass("current");g.show();}else{e.parent().addClass("current").find("#txtUsername").focus();a.parent().removeClass("current");g.hide();}return false;});b.click(function(){d=false;});c.click(function(){if(d){a.parent().removeClass("current");e.parent().removeClass("current");g.show();}d=true;});f.click(function(){a.parent().removeClass("current");e.parent().removeClass("current");g.show();});});jQuery.extend({hasURLParam:function(b,a){return($.getURLParam(b,a)!="");},getURLParam:function(d,e){var f="";var g=(d!=undefined&&d!=null)?d:window.location.href;if(g.indexOf("?")>-1){var c=g.substr(g.indexOf("?")+1).toLowerCase();var a=c.split("&");for(var h=0;h<a.length;h++){var b=a[h].split("=");if(b[0]==e){f=b[1];break;}}}return f;}});
