(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(E,D,C,B,A){if(Goingup.popUpWin){if(!Goingup.popUpWin.closed){Goingup.popUpWin.close()}}Goingup.popUpWin=open(E,"popUpWin","toolbar=0,location=0,directories=0,status=0,menubar=no,scrollbars=0,resizable=0,copyhistory=0,width="+B+",height="+A+",left="+D+", top="+C+",screenX="+D+",screenY="+C+"")};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(){jQuery("form.__ajax__").submit(function(){var A={show_inline_loader_for:jQuery(".submit_btn_room",this),callBefore:function(B){Goingup.Dialog.showLoadingBox("","200px")},callAfterSuccess:function(C,B){},callAfterFailed:function(C,B){}};return Goingup.Form.Submit(this,null,A)})};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(){return{onchangeAplied:false,timeOut:{},movingVars:{moving:false,topWidth:0,leftWidth:0},defaultWidth:null,showLoadingBox:function(D,B){var C={msg_title:(typeof D!="undefined"&&D!=""?D:"Please wait..."),html:'<div><div class="loading_box"></div></div>',buttons:[]};if(typeof B!="undefined"&&B!=""){C.width=B}Goingup.Dialog.Show(C)},Options:{dialogId:"div_modal_window",blockbgId:"div_backgroundblacklayer"},Selectors:{id:"#div_modal_window",title:".head>h1",body:".body",buttons:".foot>.btns",footer:".foot",moveHandler:".head",blockbg:"#div_backgroundblacklayer"},Templates:{btn:'<a href="javascript:;" class="[class]" onclick="[onclick]"><span class="r"><span class="m">[value]</span></span></a>'},getButtonHtml:function(E,D,B){var E=typeof E!="undefined"?E:"OK";var D=typeof D!="undefined"?D:"Goingup.Dialog.Hide()";var B=typeof B!="undefined"?B:"button";var C=Goingup.Dialog.Templates.btn;C=C.replace(/\[class\]/g,B).replace(/\[onclick\]/g,D).replace(/\[value\]/g,E);return C},OK:function(){Goingup.Dialog.Submit()},blockUI:function(){var C=Goingup.Dialog;if(jQuery(C.Selectors.blockbg).length==0){var D=jQuery('<div id="'+C.Options.blockbgId+'" style=" position: absolute;	opacity: 0.5; filter: alpha(opacity=50); background-color:#000000; height:100%; width:100%; left:0px; top:0px; margin:0; padding:0; z-index:99;"></div>');jQuery("body").append(D)}else{var D=jQuery(C.Selectors.blockbg)}var B=Goingup.getPageSize();D.height(B[1]);D.width(B[0]);if(!D.is(":visible")){D.fadeIn(300)}},redrawUI:function(){var B=Goingup.Dialog;if(jQuery(B.Selectors.blockbg).length==0){var C=jQuery('<div id="'+B.Options.blockbgId+'" style=" position: absolute;	opacity: 0.5; filter: alpha(opacity=50); background-color:#000000; height:100%; width:100%; left:0px; top:0px; margin:0; padding:0; z-index:99;"></div>');jQuery("body").append(C)}else{var C=jQuery(B.Selectors.blockbg)}Goingup.Dialog.moveCenter()},startMoving:function(F){var B=Goingup.Dialog;B.movingVars.moving=true;var E=jQuery(Goingup.Dialog.Selectors.id);var G=E.offset();var D=B.mouseX(F);var C=B.mouseY(F);B.movingVars.topWidth=C-G.top;B.movingVars.leftWidth=D-G.left},endMoving:function(C){var B=Goingup.Dialog;B.movingVars.moving=false},moveCenter:function(){var B=Goingup.Dialog;clearTimeout(B.timeOut.moveCenter);B.timeOut.moveCenter=setTimeout(function(){var D=jQuery(B.Selectors.blockbg);if(D.is(":visible")){var C=Goingup.getPageSize();D.height(C[1]);D.width(C[0]);jQuery(B.Selectors.id).ScrollCenter()}},100)},mouseX:function A(B){if(B.pageX){return B.pageX}else{if(B.clientX){return B.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)}else{return null}}},mouseY:function(B){if(B.pageY){return B.pageY}else{if(B.clientY){return B.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}else{return null}}},Submit:function(){jQuery(Goingup.Dialog.Selectors.id).find("form").submit()},Show:function(D,H){var C=Goingup.Dialog;var G=D.msg?D.msg:"";if(typeof (D.html)=="string"){G=G+" "+D.html}if(typeof H!="undefined"&&H=="auto"){if(!G){return true}}if(G!=""&&G!=null){if(D.msg_title){jQuery(C.Selectors.title,C.Selectors.id).html(D.msg_title)}else{jQuery(C.Selectors.title,C.Selectors.id).html("Message")}if(D.width){var J=jQuery(C.Selectors.id).width();if(parseInt(D.width)!=parseInt(J)){C.defaultWidth=jQuery(C.Selectors.id).css("width");if(C.defaultWidth=="0px"){C.defaultWidth="auto"}jQuery(C.Selectors.id).css("width",D.width)}}else{if(C.defaultWidth!=null){jQuery(C.Selectors.id).css("width",C.defaultWidth)}}jQuery(C.Selectors.body,C.Selectors.id).html(G);jQuery(C.Selectors.buttons,C.Selectors.id).empty();jQuery(C.Selectors.buttons,C.Selectors.id).html('<div style="clear: both;"></div>');if(typeof D.buttons!="undefined"&&D.buttons!=null&&D.buttons.length>0&&D.buttons!="none"){var I=D.buttons;for(var E=0;E<I.length;E++){var B=I[E]["class"]?I[E]["class"]:"button";var F=jQuery(Goingup.Dialog.getButtonHtml(I[E].value,I[E].onclick,B));jQuery(C.Selectors.buttons,C.Selectors.id).prepend(F)}jQuery(C.Selectors.footer,C.Selectors.id).show()}else{if(typeof D.buttons=="undefined"){var F=jQuery(Goingup.Dialog.getButtonHtml());jQuery(C.Selectors.buttons,C.Selectors.id).prepend(F);jQuery(C.Selectors.footer,C.Selectors.id).show()}else{jQuery(C.Selectors.footer,C.Selectors.id).css("min-height","20px")}}Goingup.Dialog._show(D)}else{Goingup.Dialog.Hide()}},Hide:function(B){Goingup.Dialog._hide()},_show:function(C){var B=Goingup.Dialog;Goingup.Dialog.blockUI();var D=jQuery(B.Selectors.id);if(B.onchangeAplied==false){B.onchangeAplied=true;jQuery(window).resize(function(){if(B.movingVars.moving==false){Goingup.Dialog.redrawUI()}});jQuery(window).scroll(function(){if(B.movingVars.moving==false){Goingup.Dialog.redrawUI()}});jQuery("body").mousemove(function(G){if(B.movingVars.moving==true){var F=B.mouseX(G)-B.movingVars.leftWidth;var E=B.mouseY(G)-B.movingVars.topWidth;D.css({left:F,top:E})}return false});jQuery(B.Selectors.moveHandler,B.Selectors.id).mousedown(function(E){B.startMoving(E);return false});jQuery(B.Selectors.moveHandler,B.Selectors.id).mouseup(function(E){B.endMoving(E);return false})}jQuery(B.Selectors.id).ScrollCenter().fadeIn(200);if(jQuery(Goingup.Dialog.Selectors.id).find("form").find("input[type='file']").length==0){jQuery(Goingup.Dialog.Selectors.id).find("form").unbind().submit(function(){if(jQuery(this).hasClass("_no_ajax")){return true}var G=this.id;var F={loader_class:C.loader_class!=null?C.loader_class:null,show_inline_loader_for:".foot>.btns"};if(G!=null&&Goingup.formOptions[G]!=null){for(var E in Goingup.formOptions[G]){F[E]=Goingup.formOptions[G][E]}}return Goingup.Form.Submit(this,null,F)})}},_hide:function(){var B=Goingup.Dialog;jQuery(B.Selectors.blockbg).fadeOut(200);jQuery(B.Selectors.id).fadeOut(200)}}}();Goingup.Request=function(options){var params=options.params!=null?options.params:{};var current_data=params;var mode=(options&&options.mode)?options.mode:"standard";current_data=Goingup.Form.applyHiddenParams(current_data);var showDialogData=options!=null&&typeof options.showDialogData!="undefined"?options.showDialogData:true;var loader_class=options!=null&&options.loader_class!=null&&options.loader_class!=""?options.loader_class:"inline_loader";if(options!=null){if(options.callBefore instanceof Function){options.callBefore()}if(options.show_inline_loader_for!=null){if(options.inline_loader_no_message){jQuery(options.show_inline_loader_for).html(jQuery("<div></div>").attr("class",loader_class))}else{jQuery(options.show_inline_loader_for).html(jQuery("<div></div>").attr("class",loader_class).html("Please wait..."))}}}jQuery.ajax({type:options.method?options.method:"get",url:options.url?options.url:window.location.href.replace(/\?.*|#.*/,""),data:current_data,dataType:"json",success:function(data){if(!data.ok){if(typeof (data.blocks)!="undefined"&&data.blocks.length>0){for(var _i=0;_i<data.blocks.length;_i++){if(typeof data.blocks[_i]!="undefined"&&data.blocks[_i].selector&&data.blocks[_i].html){jQuery(data.blocks[_i].selector).html(data.blocks[_i].html)}}}if(showDialogData){Goingup.Dialog.Show(data,mode)}if(options!=null){if(options.callAfterFailed instanceof Function){options.callAfterFailed(data)}}}else{if(typeof (data.blocks)!="undefined"&&data.blocks.length>0){for(var _i=0;_i<data.blocks.length;_i++){if(typeof data.blocks[_i]!="undefined"&&data.blocks[_i].selector&&data.blocks[_i].html){jQuery(data.blocks[_i].selector).html(data.blocks[_i].html)}}}if(showDialogData){Goingup.Dialog.Show(data,mode)}if(typeof data.js!="undefined"&&data.js!=null&&data.js!=""){eval(data.js)}if(options!=null){if(options.callAfterSuccess instanceof Function){options.callAfterSuccess(data)}}}if(options!=null){if(options.callAfter instanceof Function){options.callAfter(data)}}},error:function(){var data={ok:false,msg:"Request failed, check your connection!",msg_title:"Internal error"};if(options!=null&&options.callAfterFailed instanceof Function){options.callAfterFailed(data)}else{Goingup.Dialog.Show(data,mode)}}});return false};Goingup.MarkErrorFields=function(C,A){C.find("*").removeClass("x-error");if(typeof A=="undefined"){return false}for(var B=0;B<A.length;B++){C.find("[name^='"+A[B]+"']").addClass("x-error")}};Goingup.Form=function(){return{result:false,hiddenParams:{__request_type__:"ajax"},applyHiddenParams:function(params){for(var i in Goingup.Form.hiddenParams){if(params instanceof Array){var obj={name:i,value:Goingup.Form.hiddenParams[i]};params[params.length]=obj}else{if(params instanceof Object){params[i]=Goingup.Form.hiddenParams[i]}else{if(params.constructor=String){params+="&"+i+"="+Goingup.Form.hiddenParams[i]}}}}return params},Submit:function(objFm,params,options){if(options!=null&&options.overrideFunction instanceof Function){Goingup.Dialog.Hide();var p=jQuery(objFm).serializeArray();var data={};for(var i=0;i<p.length;i++){data[p[i]["name"]]=p[i]["value"]}return options.overrideFunction(data)}if(Goingup.Form.result==true){return true}var mode=(options&&options.mode)?options.mode:"standard";var showDialogData=options!=null&&typeof options.showDialogData!="undefined"?options.showDialogData:true;var current=jQuery(objFm);var current_data=(params!=null)?params:current.serializeArray();current_data=Goingup.Form.applyHiddenParams(current_data);var loader_class=options!=null&&options.loader_class!=null&&options.loader_class!=""?options.loader_class:"inline_loader";if(options!=null){if(options.callBefore instanceof Function){options.callBefore(objFm)}if(options.show_inline_loader_for!=null){if(options.inline_loader_no_message){jQuery(options.show_inline_loader_for).html(jQuery("<div></div>").attr("class",loader_class))}else{jQuery(options.show_inline_loader_for).html(jQuery("<div></div>").attr("class",loader_class).html("Please wait..."))}}}if(options!=null&&options.loading!=null&&options.loading==false){}else{jQuery.each(current.find(":input[type='submit']"),function(){jQuery(this).attr("name",jQuery(this).val());jQuery(this).val("Loading...")})}jQuery.ajax({type:current.attr("method"),url:current.attr("action"),data:current_data,dataType:"json",success:function(data){if(!data.msg_title){data.msg_title="Message"}jQuery.each(current.find(":input[type='submit']"),function(){jQuery(this).val(jQuery(this).attr("name"));jQuery(this).blur()});if(!data.ok){if(typeof (data.blocks)!="undefined"&&data.blocks.length>0){for(var _i=0;_i<data.blocks.length;_i++){if(typeof data.blocks[_i]!="undefined"&&data.blocks[_i].selector&&data.blocks[_i].html){jQuery(data.blocks[_i].selector).html(data.blocks[_i].html)}}}Goingup.MarkErrorFields(current,data.idents);if(showDialogData){Goingup.Dialog.Show(data,mode)}if(options!=null){if(options.callAfterFailed instanceof Function){options.callAfterFailed(data,objFm)}}}else{if(typeof data["return"]!="undefined"&&data["return"]!=null&&data["return"]!=false){Goingup.Form.result=true;return jQuery(objFm).submit()}if(typeof (data.blocks)!="undefined"&&data.blocks.length>0){for(var _i=0;_i<data.blocks.length;_i++){if(typeof data.blocks[_i]!="undefined"&&data.blocks[_i].selector&&data.blocks[_i].html){jQuery(data.blocks[_i].selector).html(data.blocks[_i].html)}}}if(showDialogData){Goingup.Dialog.Show(data,mode)}if(typeof data.js!="undefined"&&data.js!=null&&data.js!=""){eval(data.js)}if(options!=null){if(options.callAfterSuccess instanceof Function){options.callAfterSuccess(data,objFm)}else{Goingup.Dialog.Show(data)}}}if(options!=null){if(options.callAfter instanceof Function){options.callAfter(data,objFm)}}},error:function(data){if(options!=null&&options.callAfterFailed instanceof Function){var data={ok:false,msg:"Request failed, check your connection!",msg_title:"Internal Error!"};options.callAfterFailed(data)}Goingup.MarkErrorFields(current,data.idents);Goingup.Dialog.Show(data)}});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};
