﻿Object.extend=function(d,c,a){for(var b in c){if(a==false&&d[b]!=null){continue;}d[b]=c[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;if(typeof IWhost=="undefined"){IWhost="";}if(typeof mid=="undefined"){mid=0;}jQuery.extend({hasURLParam:function(a,b){return($.getURLParam(a,b)!="");},getURLParam:function(a,e){var c="";var g=(a!=undefined&&a!=null)?a:window.location.href;if(g.indexOf("?")>-1){var f=g.substr(g.indexOf("?")).toLowerCase();var h=f.split("&");for(var b=0;b<h.length;b++){var d=h[b].split("=");if(d[0]==e){c=d[1];break;}}}return c;}});IwAG.Events={};IwAG.Events.Authentication=(function(){var uniqueInstance;function Authentication(){var $txtPassword=$("#txtPassword");var $lbtnLogin=$("a[id$=lbtnLogin]");if(typeof $lbtnLogin.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){Loggin_keydown(e);});}return{getInstance:function(){if(!uniqueInstance){uniqueInstance=Authentication();}return uniqueInstance;}};})();$(document).ready(function(){var backButton=new Array();var resizeTimer=null;$.fn.SetDefaultModalPopupFunctions=function(onOpen,onShow,onClose){ModalDialogonOpenFunction=(onOpen!=undefined&&onOpen!=null?onOpen:null);ModalDialogonShowFunction=(onShow!=undefined&&onShow!=null?onShow:null);ModalDialogOnCloseFunction=(onClose!=undefined&&onClose!=null?onClose:null);};$.fn.SetDefaultModalPopupCorners=function(ModalPopUpHeaderImage,mid,bgImageIsSet){var _bg="";if(typeof ModalPopUpHeaderImage!="undefined"&&ModalPopUpHeaderImage!=null&&mid!=undefined&&mid!=null&&mid>0&&mid!=114&&mid!=115){_bg=ModalPopUpHeaderImage;}else{var _backgroundImage2="_Images/V3/layout_head/header_bg.gif";if(typeof PopUpImageDomain!="undefined"&&PopUpImageDomain!=null){_bg=PopUpImageDomain+"/"+_backgroundImage2;if(PopUpImageDomain.lastIndexOf("/")==PopUpImageDomain.length-1){_bg=PopUpImageDomain+_backgroundImage2;}}else{_bg=IWhost+"/"+_backgroundImage2;if(IWhost.lastIndexOf("/")==IWhost.length-1){_bg=IWhost+_backgroundImage2;}}}var bgUrl="url("+_bg+")";if(!bgImageIsSet){bgUrl="";}jQuery.fn.corner=function(options){var settings={tl:{radius:10},tr:{radius:10},bl:{radius:10},br:{radius:10},backgroundImage2:bgUrl,antiAlias:true,autoPad:true,validTags:["div"]};if(options&&typeof(options)!="string"){jQuery.extend(settings,options);}return this.each(function(){new curvyObject(settings,this).applyCorners();});};};$.fn.SetDefaultModalPopupStyle=function(width,height,backgroundColor,cssDialog,backgroundImage,corners){var o=$(this);var bgImageIsSet=true;var ModalPopUpHeaderImage="_Images/V3/layout_head/header_small_long_{0}.gif";if(typeof backgroundImage!="undefined"&&backgroundImage!=null&&backgroundImage!=""){if(backgroundImage.indexOf("/")==0){backgroundImage=backgroundImage.substring(1,backgroundImage.length);}ModalPopUpHeaderImage=backgroundImage;bgImageIsSet=backgroundImage!=" ";}if(typeof PopUpImageDomain!="undefined"&&PopUpImageDomain!=null){if(PopUpImageDomain.lastIndexOf("/")==PopUpImageDomain.length-1){ModalPopUpHeaderImage=PopUpImageDomain+ModalPopUpHeaderImage;}else{ModalPopUpHeaderImage=PopUpImageDomain+"/"+ModalPopUpHeaderImage;}}else{ModalPopUpHeaderImage=IWhost+ModalPopUpHeaderImage;}if(typeof mid!="undefined"&&mid!=null&&mid>0){ModalPopUpHeaderImage=ModalPopUpHeaderImage.replace("{0}",mid);_backgroundImageMID=ModalPopUpHeaderImage;}else{ModalPopUpHeaderImage=ModalPopUpHeaderImage.replace("_{0}","");}var bgUrl=" url("+ModalPopUpHeaderImage+") no-repeat";if(!bgImageIsSet){bgUrl="";}if(corners!=false){o.SetDefaultModalPopupCorners(ModalPopUpHeaderImage,mid,bgImageIsSet);}if(backgroundColor==undefined){backgroundColor="#fff";}if(width!=undefined){$(o).css("width",width+"px");}if(height!=undefined){$(o).css("height",height+(height!="auto"?"px":""));}$(o).css({margin:"0 0 1px -"+o.width()/2+"px",color:"#000000",background:backgroundColor+bgUrl,"border-right":"1px solid #000000","vertical-align":"top",display:"none","table-layout":"fixed","font-size":"11px"});if(cssDialog!=undefined&&cssDialog!=null){$(o).css(cssDialog);}};$.fn.setTransparent=function(){return this.each(function(e){var div=$("<DIV />");for(var n in this.attributes){if(this[n]!=""&&this[n]!=null){if(n.substr(0,2)=="on"){div.bind(n.substr(2),this[n]);}else{if(n!="src"){div.attr(n,this[n]);}}}}div.attr("style",this.style.cssText);div.css({width:this.width+"px",height:this.height+"px",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"', sizingMethod='scale')"});if(this.align=="left"){div.css("float","left");}if(this.align=="right"){div.css("float","right");}if(this.parentNode.href){div.css("cursor","hand");}this.parentNode.replaceChild(div[0],this);div.css({visibility:"visible"});});};$.fn.ImageResize=function(options){var settings={height:200,width:300,validTags:["img"]};if(options&&typeof(options)!="string"){jQuery.extend(settings,options);}var img=$(this).get(0);if(img==null||img==NaN){return;}var height=$(this).height();var width=$(this).width();var ratio=width/height;if(height>=settings.height&&height>=width){var factor=height/settings.height;width=width/factor;$(this).height(settings.height);$(this).width(width);}else{if(width>settings.width&&height<width){var factor=width/settings.width;height=height/factor;$(this).width(settings.width);$(this).height(height);}}$(this).show();};$.fn.MiddleImage=function(jContainer){var image=this.get(0);if(jContainer!=null&&jContainer!=NaN&&image!=null&&image!=NaN){var containerHeight=parseInt(jContainer.css("height"));var imageHeight=parseInt(this.css("height"));var marginTop=(containerHeight-imageHeight)/2;if(marginTop<=0){return;}image.style.marginTop=marginTop+"px";}$(this).show();};$.fn.tooltip=function(html,options){var defaults={background:"#444",color:"#f1f1f1",padding:"5px 0px",opacity:0.95,rounded:true};if($.browser.msie){defaults.opacity=1;}var settings=$.extend({},defaults,options);var showTooltip=function(text,top,left,width){$("#box_tooltip").remove();$('<div id="box_tooltip" style="z-index: 3000;"><div class="box_tooltip_start"></div><div class="box_tooltip_body"></div><div class="box_tooltip_end"></div></div>').prependTo("body").hide().css({top:top+5,left:left+width+15});$(".box_tooltip_body").html(text);$("#box_tooltip").show();};var removeTooltip=function(){$("#box_tooltip").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){$("#box_tooltip").css({top:e.pageY+5,left:e.pageX+15});});}});return this;};$(window).resize(function(){marginLeft=$(window).width()/2;if(resizeTimer){clearTimeout(resizeTimer);}resizeTimer=setTimeout(function(){},100);if($(window).height()<600||$(window).width()<600){$("#ModalContainer").css("position","absolute");}else{$("#ModalContainer").css("position","fixed");}});if($("#modalContent")!=undefined&&$("#modalContent")!=null){$("#modalContent").SetDefaultModalPopupStyle(10,10);}Object.extend(IwAG.Base,{adjustHeight:function(body){body.height($(window).height()).height($(document).height());},LoadPagePartsIntoModalContentPanel:function(Pageurl,PageStringStartIndex,PageStringEndIndex,panel,width,height,top){panel=(panel!=undefined&&panel!=null?panel:"#DataContentPopup");if($.browser.msie&&$.browser.version=="6.0"){w2=window.open(Pageurl,"Window2","scrollbars=yes,height="+height+", width="+width+", left=0, top=0, toolbar=no,menubar=no");}else{IwAG.Base.LoadPagePartsIntoPanel(Pageurl,(PageStringStartIndex!=undefined&&PageStringStartIndex!=null?PageStringStartIndex:"<!--Modal Start-->"),(PageStringEndIndex!=undefined&&PageStringEndIndex!=null?PageStringEndIndex:"<!--Modal Ende-->"),panel,width,height,top);$("#modalContent").SetDefaultModalPopupFunctions(ModalDialogonOpenFunction!=null?ModalDialogonOpenFunction:null,ModalDialogonShowFunction!=null?ModalDialogonShowFunction:null,ModalDialogOnCloseFunction!=null?ModalDialogOnCloseFunction:null);$("#modalContent").SetDefaultModalPopupStyle(width,height);$(panel).after("<iframe id='_statsCounter' src='"+Pageurl+"' style='display:none;' />");IwAG.Base.showModalDialog("#modalContent","#lbtnCloseModal","#img2",null,null,true);}},LoadPagePartsIntoPanel:function(Pageurl,PageStringStartIndex,PageStringEndIndex,panel,width,height,top,RefreshContentInside){$(panel).html("");var refreshContentInside=typeof RefreshContentInside!="undefined"&&RefreshContentInside!=null?RefreshContentInside:true;$.post(Pageurl,function(data){if(width!=undefined&&height!=undefined&&top!=undefined){$("#modalContent").height(height+"px");$("#modalContent").width(width+"px");$("#ModalContainer").css("top",top);$(panel).height(height-50+"px");$(panel).width(width-20+"px");$(panel).css("overflow","hidden");}var start=data.indexOf(PageStringStartIndex);var ende=data.indexOf(PageStringEndIndex);var back="";if(backButton!=null&&backButton.length<ModalBackButtonCounter+1){backButton[ModalBackButtonCounter]="<div id='pModalBack'><a href=\"javascript:ModalBackButtonCounter--;IwAG.Base.LoadPagePartsIntoPanel('"+Pageurl+"','"+PageStringStartIndex+"' ,'"+PageStringEndIndex+"','"+panel+"','"+width+"',' "+height+"', '"+top+'\');"  style="float:left;color:Black;text-decoration:none;" onMouseover="this.style.color=\'#FF6600\'" onMouseout="this.style.color=\'#000\'">&lt;&lt; <b>zur&uuml;ck</b> &gt;&gt;</a></div>';}if(ModalBackButtonCounter==0){back="";}else{back=backButton[ModalBackButtonCounter-1];}$(panel).html("<div style='overflow:auto;height:"+(height-60)+"px;'>"+data.substring(start,ende)+"</div>");$("#pModalBack").remove();if(back!=""){$(panel).before(back);}$(panel+" a").each(function(e){var href=$(this).attr("href");if(refreshContentInside&&href!=undefined&&href.indexOf("javascript:")==-1&&href.length>5&&href.toLowerCase().indexOf(".pdf")==-1){$(this).click(function(){ModalBackButtonCounter++;$("#_statsCounter").attr("src",href);if($.hasURLParam(href,"width")&&$.hasURLParam(href,"height")&&$.hasURLParam(href,"top")){IwAG.Base.LoadPagePartsIntoPanel(href,PageStringStartIndex,PageStringEndIndex,panel,$.getURLParam(href,"width"),$.getURLParam(href,"height"),$.getURLParam(href,"top"),RefreshContentInside);}else{IwAG.Base.LoadPagePartsIntoPanel(href,PageStringStartIndex,PageStringEndIndex,panel,width,height,top,RefreshContentInside);}return false;});}else{$("#_statsCounter").attr("src",Pageurl);}});});},showModalDialog:function(dialog,closeBtn,closeIcon,cssDialog,cssOverlay,roundedCorners){globalDialog=dialog;if(roundedCorners!=undefined&&roundedCorners){if(!(dialog=="#geoPopup"&&$.browser.msie&&$.browser.version=="6.0")){$(dialog).corner();}}if($.browser.msie&&$.browser.version=="6.0"){if(cssDialog!=undefined){$("#ModalContainer").css(cssDialog);}$(dialog).modal({overlayId:"ModalOverlay",containerId:"ModalContainer",onOpen:ModalDialogonOpenFunction!=null?function(){eval(ModalDialogonOpenFunction);}:null,onShow:function(){IwAG.Base.SetModalFocus(closeBtn);ModalDialogonShowFunction!=null?eval(ModalDialogonShowFunction):null;},onClose:ModalDialogOnCloseFunction!=null?function(){eval(ModalDialogOnCloseFunction);}:null});$("select:visible").addClass("hiddenByModal").hide();$("object").hide();$(dialog+" select").show();$("#ModalOverlay").css("height",$(document).height()+"px");$("#ModalOverlay").css("width",$(document).width()+"px");$("#ModalOverlay").css("background","#000");$("#ModalContainer").css("witdh",$(dialog).width()+"px");$(dialog).css({marginLeft:"0px"});}else{$("object").hide();$(dialog).modal({close:true,overlayId:"ModalOverlay",containerId:"ModalContainer",persist:true,onOpen:ModalDialogonOpenFunction!=null?function(){eval(ModalDialogonOpenFunction);}:null,onShow:function(){IwAG.Base.SetModalFocus(closeBtn);ModalDialogonShowFunction!=null?eval(ModalDialogonShowFunction):null;},onClose:ModalDialogOnCloseFunction!=null?function(){eval(ModalDialogOnCloseFunction);}:null});if(cssOverlay!=undefined){$("#ModalOverlay").css(cssOverlay);}else{$("#ModalOverlay").css({background:"#000",opacity:"0.7",cursor:"auto"});}if(cssDialog!=undefined){$(dialog).css(cssDialog);}if($(window).height()<600||$(window).width()<600){var offset=$(dialog).attr("offsetTop");if($(window).height()>$(dialog).height()){marginTop=($(window).height()-$(dialog).height())/2;}else{marginTop=10;}marginLeft=$(window).width()/2;$("#ModalContainer").css("position","absolute");$("#ModalContainer").css("top",$(window).scrollTop()+marginTop-offset+"px");$("#ModalContainer").css("left",$(window).scrollLeft()+marginLeft+"px");}else{$("#ModalContainer").css("left","50%");$("#ModalContainer").css("top","30%");}}if(closeBtn!=undefined&&closeBtn!=null){$(closeBtn).click(function(e){IwAG.Base.CloseModalDialog();return false;});}if(closeIcon!=undefined&&closeIcon!=null){$(closeIcon).click(function(e){IwAG.Base.CloseModalDialog();return false;});}if(closeIcon!=undefined&&closeIcon!=null&&closeBtn!=undefined&&closeBtn!=null){$("#ModalOverlay").click(function(e){$(closeIcon).click();});}},SetModalFocus:function(element){$(element).focus();},CloseModalDialog:function(){if($.browser.msie&&$.browser.version=="6.0"){$("select:hidden.hiddenByModal").removeClass("hiddenByModal").show();}$("object").show();ModalBackButtonCounter=0;backButton=new Array();if($("#_statsCounter")){$("#_statsCounter").remove();}$.modal.close();},initOverlayMessageBox:function(initButton,container){$(initButton).bind("click",function(){if($(container).is(":hidden")){$(container).show();$(document).one("click",function(){$(container).hide();});}else{$(container).hide();}return false;});},parseACData:function(data){var parsed=[];if(typeof data!="undefined"&&data!=null&&data.d!=""){var rows=jQuery.parseJSON(data.d);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.suggest+" "+row.annotation};}}}}return parsed;},autoCompleteForLocation:function(inputBox,servicePath,listHeight,listWidth,autoSubmit,postBack,addParams){if(listHeight==undefined){listHeight=300;}if(listWidth==undefined){listWidth=200;}if(typeof servicePath!="undefined"&&servicePath!=""){var extraParams={};if(typeof addParams!="undefined"&&addParams!=undefined){$.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});}$(inputBox).autocomplete(servicePath,{width:listWidth,max:150,highlight:false,scroll:true,highlight:false,selectFirst:false,scrollHeight:listHeight,cacheLength:0,delay:100,multiple: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.suggest+" "+row.annotation;},formatResult:function(row){return row.suggest+" "+row.annotation;}});$(inputBox).result(function(event,data,formatted){var hidden=$(this).parent().find(">:hidden");if(data!=undefined&&data!=null){hidden.val(data.id);}});if(autoSubmit==true&&postBack!=undefined){$(inputBox).result(function(e){e=e||window.event;var code=e.keyCode||e.which;if(code==13){eval(postBack);}return true;});$(inputBox).keydown(function(e){e=e||window.event;var code=e.keyCode||e.which;if(code==13){$(inputBox).hideautocomplete();eval(postBack);}return true;});}}return true;},setAccordion:function(expandedIndex,iconExpand,iconCollapse){ddaccordion.init({headerclass:"accordionhead",contentclass:"accordionContent",revealtype:"click",collapseprev:true,defaultexpanded:[expandedIndex],onemustopen:true,animatedefault:false,persiststate:true,toggleclass:["",""],togglehtml:["suffix",iconExpand,iconCollapse],animatespeed:"fast",oninit:function(headers,expandedindices){},onopenclose:function(header,index,state,isuseractivated){}});return false;}},true);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 removeURLParam(g,f){var b="";if(g.indexOf("?")>-1){var d=g.substr(g.indexOf("?"));var c=d.split("&");var e=new Array();for(var a=0;a<c.length;a++){if(c[a].toLowerCase().indexOf(f.toLowerCase()+"=")<0){e.push(c[a]);}}b=e.join("&");if(b.indexOf("?")<0){b="?"+b;}}return b;}function hookEvent(a,b,c){if(typeof(a)=="string"){a=document.getElementById(a);}if(a==null){return;}if(a.addEventListener){if(b=="mousewheel"){a.addEventListener("DOMMouseScroll",c,false);}a.addEventListener(b,c,false);}else{if(a.attachEvent){a.attachEvent("on"+b,c);}}}function unhookEvent(a,b,c){if(typeof(a)=="string"){a=document.getElementById(a);}if(a==null){return;}if(a.removeEventListener){if(b=="mousewheel"){a.removeEventListener("DOMMouseScroll",c,false);}a.removeEventListener(b,c,false);}else{if(a.detachEvent){a.detachEvent("on"+b,c);}}}function cancelEvent(a){a=a?a:window.event;if(a.stopPropagation){a.stopPropagation();}if(a.preventDefault){a.preventDefault();}a.cancelBubble=true;a.cancel=true;a.returnValue=false;return false;}var JSON={};JSON.parse=function(s){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(s.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+s+")");}catch(e){return false;}};(function(){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},b={"boolean":function(c){return String(c);},"null":function(c){return"null";},number:function(c){return isFinite(c)?String(c):"null";},string:function(c){if(/["\\\x00-\x1f]/.test(c)){c=c.replace(/([\x00-\x1f\\"])/g,function(d,e){var f=a[e];if(f){return f;}f=e.charCodeAt();return"\\u00"+Math.floor(f/16).toString(16)+(f%16).toString(16);});}return'"'+c+'"';},array:function(d){var e=["["],g,j,h,k=d.length,c;for(h=0;h<k;h+=1){c=d[h];j=b[typeof c];if(j){c=j(c);if(typeof c=="string"){if(g){e[e.length]=",";}e[e.length]=c;g=true;}}}e[e.length]="]";return e.join("");},object:function(d){if(d){if(d instanceof Array){return b.array(d);}var e=["{"],g,j,h,c;for(h in d){c=d[h];j=b[typeof c];if(j){c=j(c);if(typeof c=="string"){if(g){e[e.length]=",";}e.push(b.string(h),":",c);g=true;}}}e[e.length]="}";return e.join("");}return"null";}};JSON.serialize=function(c){return b.object(c);};})();