(function(A){A.fn.ScrollCenter=function(B){var C={sTop:function(){return window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop},wHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight},sLeft:function(){return window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft},wWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body.clientWidth}};return this.each(function(F){if(F==0){var I=A(this);var E=I.height();var H=I.width();var D=C.sTop()+(C.wHeight()/2)-(E/2);var G=C.sLeft()+(C.wWidth()/2)-(H/2);I.animate({marginTop:"0",top:D,left:G},"fast","swing")}})}})(jQuery);if(Goingup==null){var Goingup={}}Goingup.formOptions={};Goingup.popUpWin=0;Goingup.popUpWindow=function(F,E,D,B,A,C){var C=typeof C!="undefined"?parseInt(C):0;if(Goingup.popUpWin){if(!Goingup.popUpWin.closed){Goingup.popUpWin.close()}}Goingup.popUpWin=open(F,"popUpWin","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars="+C+",resizable=0,copyhistory=0,width="+B+",height="+A+",left="+E+", top="+D+",screenX="+E+",screenY="+D+"")};Goingup.loadScript=function(A){var B=document.createElement("script");B.src=A;B.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(B)};Goingup.loadCSS=function(A){var B=document.createElement("link");B.href=A;B.rel="stylesheet";B.type="text/css";document.getElementsByTagName("head")[0].appendChild(B)};Goingup.parseUrlParams=function(A){var D=A.split("&");var C={};for(var B=0;B<D.length;B++){var E=D[B].split("=");C[E[0]]=E[1]}return C};Goingup.ajaxForms=function(A){jQuery("form.__ajax__",A).submit(function(E){var I=$(this);var G=I.attr("id");var C=Goingup.formOptions[G]?Goingup.formOptions[G]:{};var D=jQuery(".submit_btn_room",I);var F=D.html();var H={show_inline_loader_for:D,callBefore:function(J){if(C.callBefore instanceof Function){C.callBefore()}if(I.attr("_loading")=="yes"){Goingup.Dialog.showLoadingBox("","200px")}}};var B=H;if(Goingup.formOptions[G]){if(Goingup.formOptions[G] instanceof Object){for(k in Goingup.formOptions[G]){B[k]=Goingup.formOptions[G][k]}}}return Goingup.Form.Submit(this,null,B)})};Goingup.http_bild_query=function(H,G){var B=(typeof G!="undefined")?G:escape("&");var D,F;var C=[];var E=0;for(key in H){if(H[key] instanceof Array){C[E]=Goingup.http_bild_query_from_obj(key,H[key])}else{if(H[key]!=null){D=encodeURIComponent(key);F=encodeURIComponent((H[key].toString()));F=F.replace(/%20/g,"+");C[E]=D+"="+F}}E++}var A=C.join(B);return A};Goingup.http_bild_query_from_obj=function(B,G){var A=escape("&");var D=B;var F="";var C=[];var E=0;for(key in G){F=encodeURIComponent((G[key].toString()));F=F.replace(/%20/g,"+");D=B+"["+key+"]";D=encodeURIComponent(D);C[E]=D+"="+F;E++}return C.join(A)};Goingup.Dialog=function(){jQuery(window).keypress(function(e){switch(e.keyCode){case 27:Goingup.Dialog.Hide();break}});return{template:'<div id="div_modal_window" class="modalwindow" style="display:none">					<div class="border_top"><div class="in-r"><div class="in-m"></div></div></div>				    <div class="content">						<div class="in-r">					    	<div class="head">					        	<h1></h1>					        </div>					        <div class="body">					        						        </div>					        <div class="foot">								<div class="misc"></div>					        	<div class="btns">					            </div>					        </div>				    	</div>				    	<a class="btn_close" href="#" onclick="Goingup.Dialog.Hide();"></a>					</div>				    <div class="border_bottom"><div class="in-r"><div class="in-m"></div></div></div>				</div>',onchangeAplied:false,timeOut:{},movingVars:{moving:false,topWidth:0,leftWidth:0},defaultWidth:null,showLoadingBox:function(title,width){var data={msg_title:(typeof title!="undefined"&&title!=""?title:"Please wait..."),html:'<div><div class="loading_box"></div></div>',buttons:[]};if(typeof width!="undefined"&&width!=""){data.width=width}this.Show(data)},Options:{dialogId:"div_modal_window",blockbgId:"div_backgroundblacklayer"},Selectors:{id:"#div_modal_window",title:".head>h1",body:".body",buttons:".foot>.btns",misc:".foot>.misc",footer:".foot",moveHandler:".head",blockbg:"#div_backgroundblacklayer"},Templates:{btn:'<a href="javascript:;" class="[class]" ><span class="r"><span class="m">[value]</span></span></a>'},getButtonHtml:function(value,cls){var value=typeof value!="undefined"?value:"OK";var cls=typeof cls!="undefined"?cls:"button";var tpl=this.Templates.btn;tpl=tpl.replace(/\[class\]/g,cls).replace(/\[value\]/g,value);return tpl},getButton:function(value,onclick,cls){var value=typeof value!="undefined"?value:"OK";var cls=typeof cls!="undefined"?cls:"button";var onclick=typeof onclick!="undefined"?onclick:"cancel";var onclick_action=null;var btn=jQuery(this.getButtonHtml(value,cls));var $this=this;switch(onclick){case"ok":btn[0].onclick=function(){$this.OK()};break;case"cancel":btn[0].onclick=function(){$this.Hide()};break;default:btn[0].onclick=function(){if(onclick!=""){eval(onclick)}};break}return btn},OK:function(){this.Submit()},blockUI:function(){var ob=this;if(jQuery(ob.Selectors.blockbg).length==0){var div=jQuery('<div id="'+ob.Options.blockbgId+'"></div>');jQuery("body").append(div)}else{var div=jQuery(ob.Selectors.blockbg)}var pageSize=Goingup.getPageSize();div.height(pageSize[1]);div.width(pageSize[0]);if(!div.is(":visible")){div.fadeIn(300)}},redrawUI:function(){var ob=this;if(jQuery(ob.Selectors.blockbg).length==0){var div=jQuery('<div id="'+ob.Options.blockbgId+'"></div>');jQuery("body").append(div)}else{var div=jQuery(ob.Selectors.blockbg)}this.moveCenter()},startMoving:function(e){var ob=this;ob.movingVars.moving=true;var oPopup=jQuery(this.Selectors.id);var offset=oPopup.offset();var mouseX=ob.mouseX(e);var mouseY=ob.mouseY(e);ob.movingVars.topWidth=mouseY-offset.top;ob.movingVars.leftWidth=mouseX-offset.left},endMoving:function(e){var ob=this;ob.movingVars.moving=false},moveCenter:function(){var ob=this;clearTimeout(ob.timeOut.moveCenter);ob.timeOut.moveCenter=setTimeout(function(){var div=jQuery(ob.Selectors.blockbg);if(div.is(":visible")){var pageSize=Goingup.getPageSize();div.height(pageSize[1]);div.width(pageSize[0]);jQuery(ob.Selectors.id).ScrollCenter()}},100)},mouseX: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}}},mouseY:function(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}}},Submit:function(){jQuery(this.Selectors.id).find("form").submit()},Show:function(data,mode){var ob=this;var html=data.msg?data.msg:"";var misc=typeof data.misc!="undefined"?data.misc:"";if(typeof data.html=="string"){html=html+" "+data.html}if(typeof mode!="undefined"&&mode=="auto"){if(!html){return true}}if(html!=""&&html!=null){var popup=jQuery(ob.Selectors.id);if(popup.length==0){popup=jQuery(this.template);jQuery("body").append(popup)}if(data.msg_title){popup.find(ob.Selectors.title).html(data.msg_title)}else{if(data.title){popup.find(ob.Selectors.title).html(data.title)}else{popup.find(ob.Selectors.title).html("Message")}}if(data.width){var w=popup.width();if(parseInt(data.width)!=parseInt(w)){ob.defaultWidth=popup.css("width");if(ob.defaultWidth=="0px"){ob.defaultWidth="auto"}popup.css("width",data.width)}}else{if(ob.defaultWidth!=null){popup.css("width",ob.defaultWidth)}}popup.find(ob.Selectors.misc).html(misc);popup.find(ob.Selectors.body).html(html);popup.find(ob.Selectors.buttons).empty().html('<div style="clear: both;"></div>');if(typeof data.buttons!="undefined"&&data.buttons!=null&&data.buttons.length>0&&data.buttons!="none"){var buttons=data.buttons;for(var i=0;i<buttons.length;i++){var buttonclass=buttons[i]["class"]?buttons[i]["class"]:"button";var button=ob.getButton(buttons[i].value,buttons[i].onclick,buttonclass);popup.find(ob.Selectors.buttons).prepend(button)}popup.find(ob.Selectors.footer).show()}else{if(typeof data.buttons=="undefined"){var button=ob.getButton();popup.find(ob.Selectors.buttons).prepend(button);popup.find(ob.Selectors.footer).show()}else{popup.find(ob.Selectors.footer).css("min-height","20px")}}ob._show(data)}else{ob.Hide()}},Hide:function(data){var ob=this;ob._hide();jQuery(ob.Selectors.id).css("width",ob.defaultWidth)},_show:function(data){var ob=this;ob.blockUI();var oPopup=jQuery(ob.Selectors.id);if(ob.onchangeAplied==false){ob.onchangeAplied=true;jQuery(window).resize(function(){if(ob.movingVars.moving==false){ob.redrawUI()}});jQuery(window).scroll(function(){if(ob.movingVars.moving==false){ob.redrawUI()}});jQuery("body").mousemove(function(e){if(ob.movingVars.moving==true){var left=ob.mouseX(e)-ob.movingVars.leftWidth;var top=ob.mouseY(e)-ob.movingVars.topWidth;oPopup.css({left:left,top:top})}return false});jQuery(ob.Selectors.moveHandler,ob.Selectors.id).mousedown(function(e){ob.startMoving(e);return false});jQuery(ob.Selectors.moveHandler,ob.Selectors.id).mouseup(function(e){ob.endMoving(e);return false})}jQuery(ob.Selectors.id).ScrollCenter().fadeIn(200);if(jQuery(ob.Selectors.id).find("form").find("input[type='file']").length==0){jQuery(ob.Selectors.id).find("form").unbind().submit(function(){if(jQuery(this).hasClass("_no_ajax")){return true}var fmId=this.id;var options={loader_class:data.loader_class!=null?data.loader_class:"inline_loader",show_inline_loader_for:".foot>.btns"};if(fmId!=null&&Goingup.formOptions[fmId]!=null){for(var k in Goingup.formOptions[fmId]){options[k]=Goingup.formOptions[fmId][k]}}return Goingup.Form.Submit(this,null,options)})}},_hide:function(){var ob=this;jQuery(ob.Selectors.blockbg).fadeOut(200);jQuery(ob.Selectors.id).fadeOut(200)}}}();Goingup.RequestHandler=function(){return{processHtmlBlocks:function(blocks){if(typeof (blocks)!="undefined"&&blocks.length>0){for(var _i=0;_i<blocks.length;_i++){if(typeof blocks[_i]!="undefined"&&blocks[_i].selector&&blocks[_i].html){jQuery(blocks[_i].selector).html(blocks[_i].html)}}return true}else{return false}},processVisualizer:function(data,op){var defaults={resultHandler:"inline",inlineBlockId:"__ajax__response__",formInstance:null};var options=jQuery.extend(defaults,op);switch(options.resultHandler){case"popup":if(typeof data.popup!="undefined"){Goingup.Dialog.Show(data.popup)}else{Goingup.Dialog.Show(data)}break;case"inline":var html=data.msg?data.msg:"";if(typeof data.html=="string"){html=html+" "+data.html}if(html){jQuery("#"+options.inlineBlockId).empty().html(html)}if(typeof data.popup!="undefined"){Goingup.Dialog.Show(data.popup)}break;case"marker":if(options.formInstance){Goingup.MarkErrorFields(options.formInstance,data.idents,data.msgs)}if(typeof data.popup!="undefined"){Goingup.Dialog.Show(data.popup)}break;case"popup&marker":if(typeof data.popup!="undefined"){Goingup.Dialog.Show(data.popup)}else{Goingup.Dialog.Show(data)}if(options.formInstance){Goingup.MarkErrorFields(options.formInstance,data.idents,data.msgs)}break;case"inline&marker":var html=data.msg?data.msg:"";if(typeof data.html=="string"){html=html+" "+data.html}if(html){jQuery("#"+options.inlineBlockId).empty().html(html)}if(typeof data.popup!="undefined"){Goingup.Dialog.Show(data.popup)}if(options.formInstance){Goingup.MarkErrorFields(options.formInstance,data.idents,data.msgs)}if(typeof data.popup!="undefined"){Goingup.Dialog.Show(data.popup)}break;default:Goingup.Dialog.Show(data);break}},process:function(data,op){var defaults={resultHandler:"inline",inlineBlockId:"__ajax__response__",formInstance:null,callAfterFailed:function(data){},callAfterSuccess:function(data){},callAfter:function(){}};var options=jQuery.extend(defaults,op);if(typeof data=="undefined"||!data){return false}if(typeof data.ok!="undefined"&&data.ok){if(typeof data["return"]!="undefined"&&data["return"]!=null&&data["return"]!=false){options.formInstance.attr("submitDirectly",true);return jQuery(options.formInstance).submit()}if(typeof data.blocks!="undefined"){this.processHtmlBlocks(data.blocks)}this.processVisualizer(data,options);if(typeof data.js!="undefined"&&data.js!=null&&data.js!=""){eval(data.js)}if(options.callAfterSuccess instanceof Function){options.callAfterSuccess(data,options.formInstance)}}else{if(typeof data.blocks!="undefined"){this.processHtmlBlocks(data.blocks)}this.processVisualizer(data,options);if(options.callAfterFailed instanceof Function){options.callAfterFailed(data,options.formInstance)}}if(options.callAfter instanceof Function){options.callAfter(data,options.formInstance)}}}}();Goingup.Request=function(C){var B={params:{},show_inline_loader_for:null,inline_loader_no_message:false,loader_class:"inline_loader",loading:true,mode:"standard",resultHandler:"popup",inlineBlockId:"__ajax__response__",overrideFunction:null,callBefore:null,callAfterFailed:null,callAfterSuccess:null,callAfter:null,formInstance:null};var A=jQuery.extend(B,C);if(A.callBefore instanceof Function){A.callBefore()}if(A.show_inline_loader_for!=null){if(A.inline_loader_no_message){jQuery(A.show_inline_loader_for).html(jQuery("<div></div>").attr("class",A.loader_class))}else{jQuery(A.show_inline_loader_for).html(jQuery("<div></div>").attr("class",A.loader_class).html("Please wait..."))}}jQuery.ajax({type:A.method?A.method:"get",url:A.url?A.url:window.location.href.replace(/\?.*|#.*/,""),data:Goingup.Form.applyHiddenParams(A.params),dataType:"json",success:function(D){Goingup.RequestHandler.process(D,A)},error:function(){var D={ok:false,msg:"Request failed, check your connection!",msg_title:"Internal error"};Goingup.RequestHandler(D,A)}});return false};Goingup.MarkErrorFields=function(F,A,D){F.find("input,select,textarea,button,image").removeClass("x-error");if(typeof A=="undefined"){return false}var B=false;if(typeof D!=undefined&&D.length>0){B=true}for(var C=0;C<A.length;C++){var E=F.find("[name^='"+A[C]+"']");if(E.length>0){E.addClass("x-error").after(jQuery('<div class="errormarker">*'+D[A[C]]+"</div>"))}}};Goingup.Form=function(){return{result:false,hiddenParams:{__request_type__:"ajax"},applyHiddenParams:function(C){for(var A in Goingup.Form.hiddenParams){if(C instanceof Array){var B={name:A,value:Goingup.Form.hiddenParams[A]};C[C.length]=B}else{if(C instanceof Object){C[A]=Goingup.Form.hiddenParams[A]}else{if(C.constructor=String){C+="&"+A+"="+Goingup.Form.hiddenParams[A]}}}}return C},Submit:function(J,B,H){var C={show_inline_loader_for:null,inline_loader_no_message:false,loader_class:"inline_loader",loading:true,mode:"standard",resultHandler:"popup",inlineBlockId:"__ajax__response__",overrideFunction:null,callBefore:null,callAfterFailed:null,callAfterSuccess:null,callAfter:null,formInstance:null,autostate:true};var K=jQuery.extend(C,H);K.formInstance=jQuery(J);if(K.overrideFunction instanceof Function){var A=K.formInstance.serializeArray();var F={};for(var G=0;G<A.length;G++){F[A[G]["name"]]=A[G]["value"]}return K.overrideFunction(F)}if(K.formInstance.attr("submitDirectly")){return true}if(K.callBefore instanceof Function){K.callBefore(J)}var I=K.formInstance;var E=Goingup.Form.applyHiddenParams((B!=null)?B:I.serializeArray());if(K.autostate){var D=jQuery(K.show_inline_loader_for).children()}if(K.show_inline_loader_for!=null){if(K.inline_loader_no_message){jQuery(K.show_inline_loader_for).html(jQuery("<div></div>").attr("class",K.loader_class))}else{jQuery(K.show_inline_loader_for).html(jQuery("<div></div>").attr("class",K.loader_class).html("Please wait..."))}}if(K.loading==true){jQuery.each(I.find(":input[type='submit']"),function(){jQuery(this).attr("name",jQuery(this).val());jQuery(this).val("Loading...")})}K.formInstance.find("input,select,textarea,button,image").removeClass("x-error");K.formInstance.find(".errormarker").remove();jQuery("#"+K.inlineBlockId).empty();jQuery.ajax({type:I.attr("method"),url:I.attr("action"),data:E,dataType:"json",success:function(L){if(K.loading==true){jQuery.each(I.find(":input[type='submit']"),function(){jQuery(this).val(jQuery(this).attr("name"));jQuery(this).blur()})}if(K.autostate&&!L.ok){jQuery(K.show_inline_loader_for).empty().append(D)}else{}Goingup.RequestHandler.process(L,K)},error:function(L){if(K.callAfterFailed instanceof Function){var L={ok:false,msg:"Request failed, check your connection!",msg_title:"Internal Error!"};Goingup.RequestHandler(L,K)}}});return Goingup.Form.result}}}();Goingup.getPageSize=function(){var C,A;if(window.innerHeight&&window.scrollMaxY){C=window.innerWidth+window.scrollMaxX;A=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){C=document.body.scrollWidth;A=document.body.scrollHeight}else{C=document.body.offsetWidth;A=document.body.offsetHeight}}var B,D;if(self.innerHeight){if(document.documentElement.clientWidth){B=document.documentElement.clientWidth}else{B=self.innerWidth}D=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){B=document.documentElement.clientWidth;D=document.documentElement.clientHeight}else{if(document.body){B=document.body.clientWidth;D=document.body.clientHeight}}}if(A<D){pageHeight=D}else{pageHeight=A}if(C<B){pageWidth=C}else{pageWidth=B}arrayPageSize=new Array(pageWidth,pageHeight,B,D);return arrayPageSize};Goingup.number_format=function(F,C,J,E){var B=F,A=C;var H=function(P,O){var N=Math.pow(10,O);return(Math.round(P*N)/N).toString()};B=!isFinite(+B)?0:+B;A=!isFinite(+A)?0:Math.abs(A);var M=(typeof E==="undefined")?",":E;var D=(typeof J==="undefined")?".":J;var L=(A>0)?H(B,A):H(Math.round(B),A);var K=H(Math.abs(B),A);var I,G;if(K>=1000){I=K.split(/\D/);G=I[0].length%3||3;I[0]=L.slice(0,G+(B<0))+I[0].slice(G).replace(/(\d{3})/g,M+"$1");L=I.join(D)}else{L=L.replace(".",D)}if(L.indexOf(D)===-1&&A>1){L+=D+new Array(A).join(0)+"0"}return L};Goingup.doTooltipsTimeOut=null;Goingup.doTooltips=function(C,A,B){if(C==null){C="body"}var A=typeof A!="undefined"?A:25;var B=typeof B!="undefined"?B:0;jQuery("._tooltip",C).unbind();jQuery("._tooltip",C).mouseover(function(){clearTimeout(Goingup.doTooltipsTimeOut);var G=jQuery(this);var E=jQuery("#_tooltip");if(E.length==0){var D='<div id="_tooltip" style="display:none; position:absolute"></div>';jQuery("body").append(D);E=jQuery("#_tooltip");E.mouseover(function(){clearTimeout(Goingup.doTooltipsTimeOut)});E.mouseout(function(){clearTimeout(Goingup.doTooltipsTimeOut);Goingup.doTooltipsTimeOut=setTimeout(function(){jQuery("#_tooltip").hide()},100)})}else{E=jQuery("#_tooltip")}E.html(G.attr("rel"));var F=G.offset();var I=parseInt(F.left)+parseInt(B);var H=parseInt(F.top)+parseInt(A);E.css({left:I+"px",top:H+"px"}).show();jQuery("#_tooltip").show()});jQuery("._tooltip",C).mouseout(function(){clearTimeout(Goingup.doTooltipsTimeOut);Goingup.doTooltipsTimeOut=setTimeout(function(){jQuery("#_tooltip").hide()},100)})};Goingup.IsNumeric=function(B){if(B==""){return false}var D="0123456789.";var C=true;var A;for(i=0;i<B.length&&C==true;i++){A=B.charAt(i);if(D.indexOf(A)==-1){C=false}}return C};Goingup.truncate=function(B,A,C){var A=typeof A!="undefined"?A:80;var C=typeof C!="undefined"?C:"...";if(B.length>A){B=B.substring(0,A)+C}return B};
