if(typeof (mobile)=="undefined"){var mobile={}
}mobile.FeatureActionController=new Class.create({_options:null,_responseCodes:{1:"AJAX_RESULT_SUCCESS",2:"AJAX_RESULT_ERROR",3:"AJAX_RESULT_TAN_REQUIRED"},initialize:function(A){this._options=Object.extend({handleSuccess:Prototype.emptyFunction,handleTan:Prototype.emptyFunction,handleError:Prototype.emptyFunction,handleLoading:Prototype.emptyFunction,actionParam:{Reserve:{set:"reserve",remove:"unreserve"},Visibility:{set:"visibilityClosed",remove:"visibilityPublic"},SetHomepage:{set:"setHomepageFeature",remove:"removeHomepageFeature"},EyeCatcher:{set:"setEyeCatcher",remove:"removeEyeCatcher"},TopCategory:{set:"setTopInCategory",remove:"removeTopInCategory"},UploadSticky:{set:"setUploadSticky",remove:"removeUploadSticky"},ExportOnly:{set:"setForExportOnly",remove:"removeForExportOnly"},RenewAd:{set:"renew",remove:"renew"}}},A)
},sendRequest:function(A,B){new Ajax.Request(A,{evalJSON:true,requestHeaders:{Accept:"application/json"},method:"post",parameters:{t:new Date().getTime()},onCreate:function(C){this._options.handleLoading(C)
}.bind(this,B),onComplete:function(D,C){switch(this._responseCodes[C.responseJSON.responseId]){case"AJAX_RESULT_SUCCESS":this._options.handleSuccess(D,C);
break;
case"AJAX_RESULT_TAN_REQUIRED":this.openTanRequest(D,C);
break;
case"AJAX_RESULT_ERROR":this._options.handleError(D,C);
break;
default:this._options.handleError(D,C)
}}.bind(this,B),onFailure:function(C){this._options.handleError(B,C)
}.bind(this,B)})
},setReverseAction:function(C){var B=C.href.split("?")[0];
var A=C.href.toQueryParams();
if(C.className.indexOf("-off")!=-1){this.setElementStatus(C,"on");
A.action=this._options.actionParam[C.rel].remove
}else{this.setElementStatus(C,"off");
A.action=this._options.actionParam[C.rel].set
}C.href=B+"?"+$H(A).toQueryString()
},setElementStatus:function(target,state){if(state=="on"){target.className=target.className.split("-off")[0];
target.title=eval("mobile.PageParams.messageFeature."+target.rel+"Alt_On")
}else{target.className=target.className+"-off";
target.title=eval("mobile.PageParams.messageFeature."+target.rel+"Alt_Off")
}},openTanRequest:function(C,B){if(typeof (B.responseJSON.tanService)!="undefined"){if(typeof (A)=="undefined"){var A=mobile.lightbox(mobile.PageParams.casTanRequestUrl+B.responseJSON.tanService,{className:"tan-request",iframe:true})
}A.open()
}}});
if(typeof (mobile)=="undefined"){var mobile={}
}mobile.QueuedUploader=Class.create({_form:null,_options:null,_iframe:null,_hiddenForm:null,_fileInputs:null,_currentFileInput:null,initialize:function(B,A){this._form=$(B);
this._options=Object.extend({inputElementsSelector:"input, select",action:this._form.getAttribute("action"),preSubmitAction:null,postSubmitAction:null,submitFailedAction:null,uploadStartedAction:null,uploadFinishedAction:null},A);
this._setupHandlers()
},_setupHandlers:function(){this._form.observe("submit",this._formSubmitHandler.bind(this))
},_formSubmitHandler:function(C){C.stop();
var B=this._form.select(this._options.inputElementsSelector).partition(function(D){return D.type.toLowerCase()=="file"
});
var A=B.first().findAll(function(D){return D.value!=""
});
if(Prototype.Browser.WebKit||Prototype.Browser.MobileSafari){A.each(function(D){D.replace(D.cloneNode(false))
});
this._fileInputs=A
}else{if(!Prototype.Browser.IE){this._fileInputs=A.invoke("cloneNode",false)
}else{A.each(function(D){D.replaceNode(D.cloneNode(false))
});
this._fileInputs=A
}}if(this._fileInputs.size()>0){(this._options.uploadStartedAction||Prototype.emptyFunction)(this._fileInputs);
if(!this._iframe){this._iframe=this._createTargetIframe();
this._iframe.observe.bind(this._iframe,"load",this._iframeLoadedHandler.bind(this)).defer()
}if(!this._hiddenForm){this._hiddenForm=this._createHiddenForm()
}else{this._hiddenForm.update("")
}this._hiddenForm.setAttribute("action",this._options.action);
this._hiddenForm.target=mobile.QueuedUploader._HIDDEN_IFRAME_NAME;
B.last().each(function(D){this._hiddenForm.insert({bottom:D.cloneNode(false)})
},this);
this._uploadFile.bind(this).defer()
}else{}},_uploadFile:function(){if(this._currentFileInput){(this._options.postSubmitAction||Prototype.emptyFunction)(this._currentFileInput,this._fileInputs);
this._currentFileInput.remove();
this._currentFileInput=null
}if(this._fileInputs.first()){this._currentFileInput=this._fileInputs.shift();
this._hiddenForm.insert({bottom:this._currentFileInput});
if(!this._options.preSubmitAction||this._options.preSubmitAction(this._currentFileInput,this._fileInputs)){this._hiddenForm.submit()
}}else{(this._options.uploadFinishedAction||Prototype.emptyFunction)()
}},_iframeLoadedHandler:function(){var A=Prototype.Browser.IE?document.frames(this._iframe.name).document.body.innerHTML:this._iframe.contentDocument.body.innerHTML;
if(A!="OK"){if(this._options.submitFailedAction&&!this._options.submitFailedAction(this._currentFileInput,this._fileInputs)){return false
}}this._uploadFile()
},_createTargetIframe:function(){var A=new Element("iframe",{name:mobile.QueuedUploader._HIDDEN_IFRAME_NAME,style:"display: none",src:"javascript:void(0);"});
document.body.insert({bottom:A});
return A
},_createHiddenForm:function(){var A=this._form.cloneNode(false);
A.setStyle({display:"none"});
A.id=mobile.QueuedUploader._HIDDEN_FORM_ID;
document.body.insert({bottom:A});
return A
}});
Object.extend(mobile.QueuedUploader,{_HIDDEN_IFRAME_NAME:"_hiddenTargetIframe",_HIDDEN_FORM_ID:"_hiddenFormId"});
if(typeof (mobile)=="undefined"){var mobile={}
}mobile.TabController=Class.create({_options:null,initialize:function(B,A){this._options=Object.extend({onChange:Prototype.emptyFunction,getContentWrapper:Prototype.emptyFunction},A);
document.observe("click",function(C){var D=C.element();
if(D.hasClassName(B)){C.stop();
this.changeTab(D)
}}.bind(this))
},changeTab:function(C){var A=this._getActiveTab(C);
if(A==C){return false
}var B=this._getActiveContent(A);
A.up("li").removeClassName("active");
B.hide();
C.parentNode.addClassName("active");
C.blur();
this._getContent(C);
this._options.onChange(C)
},_getContent:function(D){var C=$(D.rel);
if(C){C.mobile_toggle()
}else{var A=this._options.getContentWrapper(D);
if(A){var B=this._createLoadingDiv(A);
new Ajax.Updater({success:A},D.href,{insertion:Insertion.Bottom,method:"get",evalScripts:true,onFailure:function(E){location.reload()
},onComplete:function(E){B.hide();
$(D.rel).mobile_toggle()
}})
}}},_getActiveTab:function(A){return A.up("ul").down("li.active a")
},_getActiveContent:function(A){return $(A.rel)
},_createLoadingDiv:function(A){var B=new Element("div",{className:"loading"});
B.innerHTML='<img alt="" src="'+mobile.PageParams.imagePath+'loading_big.gif"/>';
A.insert({bottom:B});
return B
}});
if(typeof (mobile)=="undefined"){var mobile={}
}mobile.ToggleBox=Class.create({_options:null,_boxElement:null,_controlElement:null,_contentElement:null,initialize:function(B,A){this._boxElement=$(B);
this._options=Object.extend({toggleLinkClass:"toggleLink",toggleBoxContentClass:"toggleRow",controlElement:"box-header"},A);
this._contentElement=this._boxElement.down("."+this._options.toggleBoxContentClass);
this._controlElement=this._boxElement.down("."+this._options.controlElement);
this._controlElement.observe("click",(function(C){C.stop();
C.element().blur();
this._boxElement.toggleClassName("hidden")
}).bind(this))
}});
document.observe("mobile:ready",function(){documentBody.select(".toggleBox").each(function(A){new mobile.ToggleBox(A)
})
});
if(typeof (mobile)=="undefined"){var mobile={}
}mobile.UploadStatus=Class.create({_lightbox:null,_content:null,_currentFileIndex:-1,_fileNames:null,_fileNameElements:null,initialize:function(B,A){this._lightbox=B;
this._options=Object.extend({okClickedAction:null},A)
},startUpload:function(A){this._fileNames=(A||[]).map(function(C){var B=C.replace(/^(.*\\)/,"");
if(B.length>30){B=B.substr(0,15)+"&hellip;"+B.substr(B.length-15,15)
}return B
});
this._content=this._lightbox.container;
this._createStatusContent();
this._lightbox.open()
},uploadFinished:function(){this._content.down(".footer").show()
},progressUpload:function(B,D,C){var A=this._fileNames.size()-D.size()-1;
this._fileNameElements[A].className=C
},_createStatusContent:function(){var A=$("uploadStatusContentHolder").innerHTML;
this._content.update(A);
this._content.down("ul.files").update(this._fileNames.map(function(B){return"<li>"+B+"</li>"
}).join("\n").stripScripts());
this._fileNameElements=this._content.select("ul.files li");
if(this._options.okClickedHandler){this._content.down("input.okButton").observe("click",this._options.okClickedHandler)
}}});
if(typeof (Control)=="undefined"){Control={}
}var $proc=function(A){return typeof (A)=="function"?A:function(){return A
}
};
var $value=function(A){return typeof (A)=="function"?A():A
};
Object.Event={extend:function(A){A._objectEventSetup=function(B){this._observers=this._observers||{};
this._observers[B]=this._observers[B]||[]
};
A.observe=function(D,B){if(typeof (D)=="string"&&typeof (B)!="undefined"){this._objectEventSetup(D);
if(!this._observers[D].include(B)){this._observers[D].push(B)
}}else{for(var C in D){this.observe(C,D[C])
}}};
A.stopObserving=function(C,B){this._objectEventSetup(C);
if(C&&B){this._observers[C]=this._observers[C].without(B)
}else{if(C){this._observers[C]=[]
}else{this._observers={}
}}};
A.observeOnce=function(D,C){var B=function(){C.apply(this,arguments);
this.stopObserving(D,B)
}.bind(this);
this._objectEventSetup(D);
this._observers[D].push(B)
};
A.notify=function(F){this._objectEventSetup(F);
var D=[];
var B=$A(arguments).slice(1);
try{for(var C=0;
C<this._observers[F].length;
++C){D.push(this._observers[F][C].apply(this._observers[F][C],B)||null)
}}catch(E){if(E==$break){return false
}else{throw E
}}return D
};
if(A.prototype){A.prototype._objectEventSetup=A._objectEventSetup;
A.prototype.observe=A.observe;
A.prototype.stopObserving=A.stopObserving;
A.prototype.observeOnce=A.observeOnce;
A.prototype.notify=function(F){if(A.notify){var B=$A(arguments).slice(1);
B.unshift(this);
B.unshift(F);
A.notify.apply(A,B)
}this._objectEventSetup(F);
var B=$A(arguments).slice(1);
var D=[];
try{if(this.options&&this.options[F]&&typeof (this.options[F])=="function"){D.push(this.options[F].apply(this,B)||null)
}for(var C=0;
C<this._observers[F].length;
++C){D.push(this._observers[F][C].apply(this._observers[F][C],B)||null)
}}catch(E){if(E==$break){return false
}else{throw E
}}return D
}
}}};
Element.addMethods({observeOnce:function(C,D,B){var A=function(){B.apply(this,arguments);
Element.stopObserving(C,D,A)
};
Element.observe(C,D,A)
}});
Object.extend(Event,(function(){var B=Event.cache;
function C(J){if(J._prototypeEventID){return J._prototypeEventID[0]
}arguments.callee.id=arguments.callee.id||1;
return J._prototypeEventID=[++arguments.callee.id]
}function G(J){if(J&&J.include(":")){return"dataavailable"
}if(!Prototype.Browser.IE){J={mouseenter:"mouseover",mouseleave:"mouseout"}[J]||J
}return J
}function A(J){return B[J]=B[J]||{}
}function F(L,J){var K=A(L);
return K[J]=K[J]||[]
}function H(K,J,L){var O=C(K);
var N=F(O,J);
if(N.pluck("handler").include(L)){return false
}var M=function(P){if(!Event||!Event.extend||(P.eventName&&P.eventName!=J)){return false
}Event.extend(P);
L.call(K,P)
};
if(!(Prototype.Browser.IE)&&["mouseenter","mouseleave"].include(J)){M=M.wrap(function(R,Q){var P=Q.relatedTarget;
var S=Q.currentTarget;
if(P&&P.nodeType==Node.TEXT_NODE){P=P.parentNode
}if(P&&P!=S&&!P.descendantOf(S)){return R(Q)
}})
}M.handler=L;
N.push(M);
return M
}function I(M,J,K){var L=F(M,J);
return L.find(function(N){return N.handler==K
})
}function D(M,J,K){var L=A(M);
if(!L[J]){return false
}L[J]=L[J].without(I(M,J,K))
}function E(){for(var K in B){for(var J in B[K]){B[K][J]=null
}}}if(window.attachEvent){window.attachEvent("onunload",E)
}return{observe:function(L,J,M){L=$(L);
var K=G(J);
var N=H(L,J,M);
if(!N){return L
}if(L.addEventListener){L.addEventListener(K,N,false)
}else{L.attachEvent("on"+K,N)
}return L
},stopObserving:function(L,J,M){L=$(L);
var O=C(L),K=G(J);
if(!M&&J){F(O,J).each(function(P){L.stopObserving(J,P.handler)
});
return L
}else{if(!J){Object.keys(A(O)).each(function(P){Event.stopObserving(L,P)
});
return L
}}var N=I(O,J,M);
if(!N){return L
}if(L.removeEventListener){L.removeEventListener(K,N,false)
}else{L.detachEvent("on"+K,N)
}D(O,J,M);
return L
},fire:function(L,K,J){L=$(L);
if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement
}var M;
if(document.createEvent){M=document.createEvent("HTMLEvents");
M.initEvent("dataavailable",true,true)
}else{M=document.createEventObject();
M.eventType="ondataavailable"
}M.eventName=K;
M.memo=J||{};
if(document.createEvent){L.dispatchEvent(M)
}else{L.fireEvent(M.eventType,M)
}return Event.extend(M)
}}
})());
Object.extend(Event,Event.Methods);
Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});
Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()});
(function(){function A(D){var E;
if(D.wheelDelta){E=D.wheelDelta/120
}else{if(D.detail){E=-D.detail/3
}}if(!E){return 
}var C=Event.element(D);
var B=C.fire("mouse:wheel",{delta:E});
if(B.stopped){Event.stop(D);
return false
}}document.observe("mousewheel",A);
document.observe("DOMMouseScroll",A)
})();
var IframeShim=Class.create({initialize:function(){this.element=new Element("iframe",{style:"position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);display:none",src:"javascript:void(0);",frameborder:0});
$(document.body).insert(this.element)
},hide:function(){this.element.hide();
return this
},show:function(){this.element.show();
return this
},positionUnder:function(A){var A=$(A);
var C=A.cumulativeOffset();
var B=A.getDimensions();
this.element.setStyle({left:C[0]+"px",top:C[1]+"px",width:B.width+"px",height:B.height+"px",zIndex:A.getStyle("zIndex")-1}).show();
return this
},setBounds:function(A){for(prop in A){A[prop]+="px"
}this.element.setStyle(A);
return this
},destroy:function(){if(this.element){this.element.remove()
}return this
}});
if(typeof (Draggable)!="undefined"){Draggable.prototype.draw=function(I){var H=Position.cumulativeOffset(this.element);
if(this.options.ghosting){var A=Position.realOffset(this.element);
H[0]+=A[0]-Position.deltaX;
H[1]+=A[1]-Position.deltaY
}var G=this.currentDelta();
H[0]-=G[0];
H[1]-=G[1];
if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){H[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;
H[1]-=this.options.scroll.scrollTop-this.originalScrollTop
}var C=[0,1].map(function(L){return(I[L]-H[L]-this.offset[L])
}.bind(this));
if(this.options.snap){if(typeof this.options.snap=="function"){C=this.options.snap(C[0],C[1],this)
}else{if(this.options.snap instanceof Array){C=C.map(function(L,M){return Math.round(L/this.options.snap[M])*this.options.snap[M]
}.bind(this))
}else{C=C.map(function(L){return Math.round(L/this.options.snap)*this.options.snap
}.bind(this))
}}}if(this.options.onDraw){this.options.onDraw.bind(this)(C)
}else{var B=this.element.style;
if(this.options.constrainToViewport){var K=document.viewport.getDimensions();
var E=this.element.getDimensions();
var F=parseInt(this.element.getStyle("margin-top"));
var J=parseInt(this.element.getStyle("margin-left"));
var D=[[0-J,0-F],[(K.width-E.width)-J,(K.height-E.height)-F]];
if((!this.options.constraint)||(this.options.constraint=="horizontal")){if((C[0]>=D[0][0])&&(C[0]<=D[1][0])){this.element.style.left=C[0]+"px"
}else{this.element.style.left=((C[0]<D[0][0])?D[0][0]:D[1][0])+"px"
}}if((!this.options.constraint)||(this.options.constraint=="vertical")){if((C[1]>=D[0][1])&&(C[1]<=D[1][1])){this.element.style.top=C[1]+"px"
}else{this.element.style.top=((C[1]<=D[0][1])?D[0][1]:D[1][1])+"px"
}}}else{if((!this.options.constraint)||(this.options.constraint=="horizontal")){B.left=C[0]+"px"
}if((!this.options.constraint)||(this.options.constraint=="vertical")){B.top=C[1]+"px"
}}if(B.visibility=="hidden"){B.visibility=""
}}}
}if(typeof (Prototype)=="undefined"){throw"Control.Window requires Prototype to be loaded."
}if(typeof (IframeShim)=="undefined"){throw"Control.Window requires IframeShim to be loaded."
}if(typeof (Object.Event)=="undefined"){throw"Control.Window requires Object.Event to be loaded."
}Control.Window=Class.create({initialize:function(B,C){Control.Window.windows.push(this);
this.container=false;
this.isOpen=false;
this.href=false;
this.sourceContainer=false;
this.ajaxRequest=false;
this.remoteContentLoaded=false;
this.numberInSequence=Control.Window.windows.length+1;
this.indicator=false;
this.effects={fade:false,appear:false};
this.indicatorEffects={fade:false,appear:false};
this.options=Object.extend({beforeOpen:Prototype.emptyFunction,afterOpen:Prototype.emptyFunction,beforeClose:Prototype.emptyFunction,afterClose:Prototype.emptyFunction,height:null,width:null,className:false,position:"center",offsetLeft:0,offsetTop:0,iframe:false,hover:false,indicator:false,closeOnClick:false,iframeshim:true,fade:false,fadeDuration:0.75,draggable:false,onDrag:Prototype.emptyFunction,resizable:false,minHeight:false,minWidth:false,maxHeight:false,maxWidth:false,onResize:Prototype.emptyFunction,constrainToViewport:false,method:"post",parameters:{},onComplete:Prototype.emptyFunction,onSuccess:Prototype.emptyFunction,onFailure:Prototype.emptyFunction,onException:Prototype.emptyFunction,onRemoteContentLoaded:Prototype.emptyFunction,insertRemoteContentAt:false},C||{});
this.indicator=this.options.indicator?$(this.options.indicator):false;
if(B){if(typeof (B)=="string"&&B.match(Control.Window.uriRegex)){this.href=B
}else{this.container=$(B);
this.createDefaultContainer(B);
if(this.container&&((this.container.readAttribute("href")&&this.container.readAttribute("href")!="")||(this.options.hover&&this.options.hover!==true))){if(this.options.hover&&this.options.hover!==true){this.sourceContainer=$(this.options.hover)
}else{this.sourceContainer=this.container;
this.href=this.container.readAttribute("href");
var A=this.href.match(/^#(.+)$/);
if(A&&A[1]){this.container=$(A[1]);
this.href=false
}else{this.container=false
}}this.sourceContainerOpenHandler=function(E){this.open(E);
E.stop();
return false
}.bindAsEventListener(this);
this.sourceContainerCloseHandler=function(E){this.close(E)
}.bindAsEventListener(this);
this.sourceContainerMouseMoveHandler=function(E){this.position(E)
}.bindAsEventListener(this);
if(this.options.hover){this.sourceContainer.observe("mouseenter",this.sourceContainerOpenHandler);
this.sourceContainer.observe("mouseleave",this.sourceContainerCloseHandler);
if(this.options.position=="mouse"){this.sourceContainer.observe("mousemove",this.sourceContainerMouseMoveHandler)
}}else{this.sourceContainer.observe("click",this.sourceContainerOpenHandler)
}}}}this.createDefaultContainer(B);
if(this.options.insertRemoteContentAt===false){this.options.insertRemoteContentAt=this.container
}var D={margin:0,position:"absolute",zIndex:Control.Window.initialZIndexForWindow()};
if(this.options.width){D.width=$value(this.options.width)+"px"
}if(this.options.height){D.height=$value(this.options.height)+"px"
}this.container.setStyle(D);
if(this.options.className){this.container.addClassName(this.options.className)
}this.positionHandler=this.position.bindAsEventListener(this);
this.outOfBoundsPositionHandler=this.ensureInBounds.bindAsEventListener(this);
this.bringToFrontHandler=this.bringToFront.bindAsEventListener(this);
this.container.observe("mousedown",this.bringToFrontHandler);
this.container.hide();
this.closeHandler=this.close.bindAsEventListener(this);
if(this.options.iframeshim){this.iFrameShim=new IframeShim();
this.iFrameShim.hide()
}this.applyResizable();
this.applyDraggable();
Event.observe(window,"resize",this.outOfBoundsPositionHandler);
this.notify("afterInitialize")
},open:function(C){if(this.isOpen){this.bringToFront();
return false
}if(this.notify("beforeOpen")===false){return false
}if(this.options.closeOnClick){if(this.options.closeOnClick===true){this.closeOnClickContainer=$(document.body)
}else{if(this.options.closeOnClick=="container"){this.closeOnClickContainer=this.container
}else{if(this.options.closeOnClick=="overlay"){Control.Overlay.load();
this.closeOnClickContainer=Control.Overlay.container
}else{this.closeOnClickContainer=$(this.options.closeOnClick)
}}}this.closeOnClickContainer.observe("click",this.closeHandler)
}if(this.href&&!this.options.iframe&&!this.remoteContentLoaded){this.remoteContentLoaded=true;
if(this.href.match(/\.(jpe?g|gif|png|tiff?)$/i)){var A=new Element("img");
A.observe("load",function(D){this.getRemoteContentInsertionTarget().insert(D);
this.position();
if(this.notify("onRemoteContentLoaded")!==false){if(this.options.indicator){this.hideIndicator()
}this.finishOpen()
}}.bind(this,A));
A.writeAttribute("src",this.href)
}else{if(!this.ajaxRequest){if(this.options.indicator){this.showIndicator()
}this.ajaxRequest=new Ajax.Request(this.href,{method:this.options.method,parameters:this.options.parameters,onComplete:function(D){this.notify("onComplete",D);
this.ajaxRequest=false
}.bind(this),onSuccess:function(D){this.getRemoteContentInsertionTarget().insert(D.responseText);
this.notify("onSuccess",D);
if(this.notify("onRemoteContentLoaded")!==false){if(this.options.indicator){this.hideIndicator()
}this.finishOpen()
}}.bind(this),onFailure:function(D){this.notify("onFailure",D);
if(this.options.indicator){this.hideIndicator()
}}.bind(this),onException:function(D,E){this.notify("onException",D,E);
if(this.options.indicator){this.hideIndicator()
}}.bind(this)})
}}return true
}else{if(this.options.iframe&&!this.remoteContentLoaded){this.remoteContentLoaded=true;
if(this.options.indicator){this.showIndicator()
}this.getRemoteContentInsertionTarget().insert(Control.Window.iframeTemplate.evaluate({href:this.href}));
var B=this.container.down("iframe");
B.onload=function(){this.notify("onRemoteContentLoaded");
if(this.options.indicator){this.hideIndicator()
}B.onload=null
}.bind(this)
}}this.finishOpen(C);
return true
},close:function(A){if(!this.isOpen||this.notify("beforeClose",A)===false){return false
}if(this.options.closeOnClick){this.closeOnClickContainer.stopObserving("click",this.closeHandler)
}if(this.options.fade){this.effects.fade=new Effect.Fade(this.container,{queue:{position:"front",scope:"Control.Window"+this.numberInSequence},from:1,to:0,duration:this.options.fadeDuration/2,afterFinish:function(){if(this.iFrameShim){this.iFrameShim.hide()
}this.isOpen=false;
this.notify("afterClose")
}.bind(this)})
}else{this.container.hide();
if(this.iFrameShim){this.iFrameShim.hide()
}}if(this.ajaxRequest){this.ajaxRequest.transport.abort()
}if(!(this.options.draggable||this.options.resizable)&&this.options.position=="center"){Event.stopObserving(window,"resize",this.positionHandler)
}if(!this.options.draggable&&this.options.position=="center"){Event.stopObserving(window,"scroll",this.positionHandler)
}if(this.options.indicator){this.hideIndicator()
}if(!this.options.fade){this.isOpen=false;
this.notify("afterClose")
}return true
},position:function(D){if(this.options.position=="mouse"){var G=[Event.pointerX(D),Event.pointerY(D)];
this.container.setStyle({top:G[1]+$value(this.options.offsetTop)+"px",left:G[0]+$value(this.options.offsetLeft)+"px"});
return 
}var H=this.container.getDimensions();
var C=document.viewport.getDimensions();
Position.prepare();
var B=(Position.deltaX+Math.floor((C.width-H.width)/2));
var A=(Position.deltaY+((C.height>H.height)?Math.floor((C.height-H.height)/2):0));
if(this.options.position=="center"){this.container.setStyle({top:(H.height<=C.height)?((A!=null&&A>0)?A:0)+"px":0,left:(H.width<=C.width)?((B!=null&&B>0)?B:0)+"px":0})
}else{if(this.options.position=="relative"){var G=this.sourceContainer.cumulativeOffset();
var F=G[1]+$value(this.options.offsetTop);
var E=G[0]+$value(this.options.offsetLeft);
this.container.setStyle({top:(H.height<=C.height)?(this.options.constrainToViewport?Math.max(0,Math.min(C.height-(H.height),F)):F)+"px":0,left:(H.width<=C.width)?(this.options.constrainToViewport?Math.max(0,Math.min(C.width-(H.width),E)):E)+"px":0})
}else{if(this.options.position.length){var F=$value(this.options.position[1])+$value(this.options.offsetTop);
var E=$value(this.options.position[0])+$value(this.options.offsetLeft);
this.container.setStyle({top:(H.height<=C.height)?(this.options.constrainToViewport?Math.max(0,Math.min(C.height-(H.height),F)):F)+"px":0,left:(H.width<=C.width)?(this.options.constrainToViewport?Math.max(0,Math.min(C.width-(H.width),E)):E)+"px":0})
}}}if(this.iFrameShim){this.updateIFrameShimZIndex()
}},ensureInBounds:function(){if(!this.isOpen){return 
}var A=document.viewport.getDimensions();
var C=this.container.cumulativeOffset();
var B=this.container.getDimensions();
if(C.left+B.width>A.width){this.container.setStyle({left:(Math.max(0,A.width-B.width))+"px"})
}if(C.top+B.height>A.height){this.container.setStyle({top:(Math.max(0,A.height-B.height))+"px"})
}},bringToFront:function(){Control.Window.bringToFront(this);
this.notify("bringToFront")
},destroy:function(){this.container.stopObserving("mousedown",this.bringToFrontHandler);
if(this.draggable){Resizables.removeObserver(this.container);
this.draggable.handle.stopObserving("mousedown",this.bringToFrontHandler);
this.draggable.destroy()
}if(this.resizable){Resizables.removeObserver(this.container);
this.resizable.handle.stopObserving("mousedown",this.bringToFrontHandler);
this.resizable.destroy()
}if(this.container&&!this.sourceContainer){this.container.remove()
}if(this.sourceContainer){if(this.options.hover){this.sourceContainer.stopObserving("mouseenter",this.sourceContainerOpenHandler);
this.sourceContainer.stopObserving("mouseleave",this.sourceContainerCloseHandler);
if(this.options.position=="mouse"){this.sourceContainer.stopObserving("mousemove",this.sourceContainerMouseMoveHandler)
}}else{this.sourceContainer.stopObserving("click",this.sourceContainerOpenHandler)
}}if(this.iFrameShim){this.iFrameShim.destroy()
}Event.stopObserving(window,"resize",this.outOfBoundsPositionHandler);
Control.Window.windows=Control.Window.windows.without(this);
this.notify("afterDestroy")
},applyResizable:function(){if(this.options.resizable){if(typeof (Resizable)=="undefined"){throw"Control.Window requires resizable.js to be loaded."
}var A=null;
if(this.options.resizable===true){A=new Element("div",{className:"resizable_handle"});
this.container.insert(A)
}else{A=$(this.options.resziable)
}this.resizable=new Resizable(this.container,{handle:A,minHeight:this.options.minHeight,minWidth:this.options.minWidth,maxHeight:this.options.constrainToViewport?function(B){return(document.viewport.getDimensions().height-parseInt(B.style.top||0))-(B.getHeight()-parseInt(B.style.height||0))
}:this.options.maxHeight,maxWidth:this.options.constrainToViewport?function(B){return(document.viewport.getDimensions().width-parseInt(B.style.left||0))-(B.getWidth()-parseInt(B.style.width||0))
}:this.options.maxWidth});
this.resizable.handle.observe("mousedown",this.bringToFrontHandler);
Resizables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){if(this.iFrameShim){this.updateIFrameShimZIndex()
}this.notify("onResize")
}.bind(this)))
}},applyDraggable:function(){if(this.options.draggable){if(typeof (Draggables)=="undefined"){throw"Control.Window requires dragdrop.js to be loaded."
}var A=null;
if(this.options.draggable===true){A=new Element("div",{className:"draggable_handle"});
this.container.insert(A)
}else{A=$(this.options.draggable)
}this.draggable=new Draggable(this.container,{handle:A,constrainToViewport:this.options.constrainToViewport,zindex:this.container.getStyle("z-index"),starteffect:function(){if(Prototype.Browser.IE){this.old_onselectstart=document.onselectstart;
document.onselectstart=function(){return false
}
}}.bind(this),endeffect:function(){document.onselectstart=this.old_onselectstart
}.bind(this)});
this.draggable.handle.observe("mousedown",this.bringToFrontHandler);
Draggables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){if(this.iFrameShim){this.updateIFrameShimZIndex()
}this.notify("onDrag")
}.bind(this)))
}},createDefaultContainer:function(A){if(!this.container){this.container=new Element("div",{id:"control_window_"+this.numberInSequence});
$(document.body).insert(this.container);
if(typeof (A)=="string"&&$(A)==null&&!A.match(/^#(.+)$/)&&!A.match(Control.Window.uriRegex)){this.container.update(A)
}}},finishOpen:function(A){this.bringToFront();
if(this.options.fade){if(typeof (Effect)=="undefined"){throw"Control.Window requires effects.js to be loaded."
}if(this.effects.fade){this.effects.fade.cancel()
}this.effects.appear=new Effect.Appear(this.container,{queue:{position:"end",scope:"Control.Window."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2,afterFinish:function(){if(this.iFrameShim){this.updateIFrameShimZIndex()
}this.isOpen=true;
this.notify("afterOpen")
}.bind(this)})
}else{this.container.show()
}this.position(A);
if(!(this.options.draggable||this.options.resizable)&&this.options.position=="center"){Event.observe(window,"resize",this.positionHandler,false)
}if(!this.options.draggable&&this.options.position=="center"){Event.observe(window,"scroll",this.positionHandler,false)
}if(!this.options.fade){this.isOpen=true;
this.notify("afterOpen")
}return true
},showIndicator:function(){this.showIndicatorTimeout=window.setTimeout(function(){if(this.options.fade){this.indicatorEffects.appear=new Effect.Appear(this.indicator,{queue:{position:"front",scope:"Control.Window.indicator."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2})
}else{this.indicator.show()
}}.bind(this),Control.Window.indicatorTimeout)
},hideIndicator:function(){if(this.showIndicatorTimeout){window.clearTimeout(this.showIndicatorTimeout)
}this.indicator.hide()
},getRemoteContentInsertionTarget:function(){return typeof (this.options.insertRemoteContentAt)=="string"?this.container.down(this.options.insertRemoteContentAt):$(this.options.insertRemoteContentAt)
},updateIFrameShimZIndex:function(){if(this.iFrameShim){this.iFrameShim.positionUnder(this.container)
}}});
Object.extend(Control.Window,{windows:[],baseZIndex:9999,indicatorTimeout:250,iframeTemplate:new Template('<iframe src="#{href}" width="100%" height="100%" frameborder="0"></iframe>'),uriRegex:/^(\/|\#|https?\:\/\/|[\w]+\/)/,bringToFront:function(A){Control.Window.windows=Control.Window.windows.without(A);
Control.Window.windows.push(A);
Control.Window.windows.each(function(C,D){var B=Control.Window.baseZIndex+D;
C.container.setStyle({zIndex:B});
if(C.isOpen){if(C.iFrameShim){C.updateIFrameShimZIndex()
}}if(C.options.draggable){C.draggable.options.zindex=B
}})
},open:function(B,C){var A=new Control.Window(B,C);
A.open();
return A
},initialZIndexForWindow:function(A){return Control.Window.baseZIndex+(Control.Window.windows.length-1)
}});
Object.Event.extend(Control.Window);
Control.Window.LayoutUpdateObserver=Class.create({initialize:function(A,B){this.w=A;
this.element=$(A.container);
this.observer=B
},onStart:Prototype.emptyFunction,onEnd:function(B,A){if(A.element==this.element&&this.iFrameShim){this.w.updateIFrameShimZIndex()
}},onResize:function(B,A){if(A.element==this.element){this.observer(this.element)
}},onDrag:function(B,A){if(A.element==this.element){this.observer(this.element)
}}});
Control.Overlay={id:"control_overlay",loaded:false,container:false,lastOpacity:0,styles:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:9998},ieStyles:{position:"absolute",top:0,left:0,zIndex:9998},effects:{fade:false,appear:false},load:function(){if(Control.Overlay.loaded){return false
}Control.Overlay.loaded=true;
Control.Overlay.container=new Element("div",{id:Control.Overlay.id});
$(document.body).insert(Control.Overlay.container);
if(Prototype.Browser.IE){Control.Overlay.container.setStyle(Control.Overlay.ieStyles);
Event.observe(window,"scroll",Control.Overlay.positionOverlay);
Event.observe(window,"resize",Control.Overlay.positionOverlay);
Control.Overlay.observe("beforeShow",Control.Overlay.positionOverlay)
}else{Control.Overlay.container.setStyle(Control.Overlay.styles)
}Control.Overlay.iFrameShim=new IframeShim();
Control.Overlay.iFrameShim.hide();
Event.observe(window,"resize",Control.Overlay.positionIFrameShim);
Control.Overlay.container.hide();
return true
},unload:function(){if(!Control.Overlay.loaded){return false
}Event.stopObserving(window,"resize",Control.Overlay.positionOverlay);
Control.Overlay.stopObserving("beforeShow",Control.Overlay.positionOverlay);
Event.stopObserving(window,"resize",Control.Overlay.positionIFrameShim);
Control.Overlay.iFrameShim.destroy();
Control.Overlay.container.remove();
Control.Overlay.loaded=false;
return true
},show:function(A,B){if(Control.Overlay.notify("beforeShow")===false){return false
}Control.Overlay.lastOpacity=A;
Control.Overlay.positionIFrameShim();
Control.Overlay.iFrameShim.show();
if(B){if(typeof (Effect)=="undefined"){throw"Control.Window requires effects.js to be loaded."
}if(Control.Overlay.effects.fade){Control.Overlay.effects.fade.cancel()
}Control.Overlay.effects.appear=new Effect.Appear(Control.Overlay.container,{queue:{position:"end",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.notify("afterShow")
},from:0,to:Control.Overlay.lastOpacity,duration:(B===true?0.75:B)/2})
}else{Control.Overlay.container.setStyle({opacity:A||1});
Control.Overlay.container.show();
Control.Overlay.notify("afterShow")
}return true
},hide:function(A){if(Control.Overlay.notify("beforeHide")===false){return false
}if(Control.Overlay.effects.appear){Control.Overlay.effects.appear.cancel()
}Control.Overlay.iFrameShim.hide();
if(A){Control.Overlay.effects.fade=new Effect.Fade(Control.Overlay.container,{queue:{position:"front",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.notify("afterHide")
},from:Control.Overlay.lastOpacity,to:0,duration:(A===true?0.75:A)/2})
}else{Control.Overlay.container.hide();
Control.Overlay.notify("afterHide")
}return true
},positionIFrameShim:function(){if(Control.Overlay.container.visible()){Control.Overlay.iFrameShim.positionUnder(Control.Overlay.container)
}},positionOverlay:function(){Control.Overlay.container.setStyle({width:document.body.clientWidth+"px",height:document.body.clientHeight+"px"})
}};
Object.Event.extend(Control.Overlay);
Control.ToolTip=Class.create(Control.Window,{initialize:function($super,A,C,B){$super(C,Object.extend(Object.extend(Object.clone(Control.ToolTip.defaultOptions),B||{}),{position:"mouse",hover:A}))
}});
Object.extend(Control.ToolTip,{defaultOptions:{offsetLeft:10}});
Control.Modal=Class.create(Control.Window,{initialize:function($super,A,B){Control.Modal.InstanceMethods.beforeInitialize.bind(this)();
$super(A,Object.extend(Object.clone(Control.Modal.defaultOptions),B||{}))
}});
Object.extend(Control.Modal,{defaultOptions:{overlayOpacity:0.5,closeOnClick:"overlay"},current:false,open:function(A,B){var C=new Control.Modal(A,B);
C.open();
return C
},close:function(){if(Control.Modal.current){Control.Modal.current.close()
}},InstanceMethods:{beforeInitialize:function(){Control.Overlay.load();
this.overlayFinishedOpening=false;
this.observe("beforeOpen",Control.Modal.Observers.beforeOpen.bind(this));
this.observe("afterOpen",Control.Modal.Observers.afterOpen.bind(this));
this.observe("afterClose",Control.Modal.Observers.afterClose.bind(this))
}},Observers:{beforeOpen:function(){if(!this.overlayFinishedOpening){Control.Overlay.observeOnce("afterShow",function(){this.overlayFinishedOpening=true;
this.open()
}.bind(this));
Control.Overlay.show(this.options.overlayOpacity,this.options.fade?this.options.fadeDuration:false);
throw $break
}else{Control.Window.windows.without(this).invoke("close")
}},afterOpen:function(){Control.Modal.current=this
},afterClose:function(){Control.Overlay.hide(this.options.fade?this.options.fadeDuration:false);
Control.Modal.current=false;
this.overlayFinishedOpening=false
}}});
Control.LightBox=Class.create(Control.Window,{initialize:function($super,A,B){this.allImagesLoaded=false;
if(B.modal){var B=Object.extend(Object.clone(Control.LightBox.defaultOptions),B||{});
B=Object.extend(Object.clone(Control.Modal.defaultOptions),B);
B=Control.Modal.InstanceMethods.beforeInitialize.bind(this)(B);
$super(A,B)
}else{$super(A,Object.extend(Object.clone(Control.LightBox.defaultOptions),B||{}))
}this.hasRemoteContent=this.href&&!this.options.iframe;
if(this.hasRemoteContent){this.observe("onRemoteContentLoaded",Control.LightBox.Observers.onRemoteContentLoaded.bind(this))
}else{this.applyImageObservers()
}this.observe("beforeOpen",Control.LightBox.Observers.beforeOpen.bind(this))
},applyImageObservers:function(){var A=this.getImages();
this.numberImagesToLoad=A.length;
this.numberofImagesLoaded=0;
A.each(function(B){B.observe("load",function(C){++this.numberofImagesLoaded;
if(this.numberImagesToLoad==this.numberofImagesLoaded){this.allImagesLoaded=true;
this.onAllImagesLoaded()
}}.bind(this,B));
B.hide()
}.bind(this))
},onAllImagesLoaded:function(){this.getImages().each(function(A){this.showImage(A)
}.bind(this));
if(this.hasRemoteContent){if(this.options.indicator){this.hideIndicator()
}this.finishOpen()
}else{this.open()
}},getImages:function(){return this.container.select(Control.LightBox.imageSelector)
},showImage:function(A){A.show()
}});
Object.extend(Control.LightBox,{imageSelector:"img",defaultOptions:{},Observers:{beforeOpen:function(){if(!this.hasRemoteContent&&!this.allImagesLoaded){throw $break
}},onRemoteContentLoaded:function(){this.applyImageObservers();
if(!this.allImagesLoaded){throw $break
}}}});
if(typeof (mobile)=="undefined"){var mobile={}
}Object.extend(Control.Modal.Observers,{beforeOpen:function(){if(!this.overlayFinishedOpening){Control.Overlay.observeOnce("afterShow",function(){this.overlayFinishedOpening=true;
this.open()
}.bind(this));
Control.Overlay.show(this.options.overlayOpacity,this.options.fade?this.options.fadeDuration:false);
throw $break
}else{Control.Overlay.positionIFrameShim();
Control.Window.windows.without(this).invoke("close");
if(!mobile.loadingLightbox){mobile.loadingLightbox=mobile.lightboxLoading()
}mobile.loadingLightbox.open()
}},afterOpen:function(){Control.Modal.current=this;
if(mobile.loadingLightbox&&mobile.loadingLightbox.isOpen){mobile.loadingLightbox.close()
}}});
mobile.lightbox=function(C,D){var H=D||{};
if(typeof (D)!="undefined"){H.className="mobile-lightbox"+((typeof (D.className)!="undefined")?" "+D.className:"")
}else{H.className="mobile-lightbox"
}var B=new Element("div",{className:"window-header"});
var G=new Element("h3",{className:"window-title"});
if(C&&typeof (C.nodeType)!="undefined"&&C.nodeType==Node.ELEMENT_NODE&&C.hasAttribute("title")){G.update(C.readAttribute("title"))
}var F=new Element("a",{className:"window-close"});
F.update(mobile.Translation.close);
var E=new Element("div",{className:"window-contents"});
var A=new Control.Modal(C,Object.extend({closeOnClick:F,insertRemoteContentAt:E,overlayOpacity:0.8,iframeshim:false,appear:true,method:"get"},H||{}));
A.container.insert(B);
B.insert(G);
B.insert(F);
A.container.insert(E);
return A
};
mobile.lightboxPlain=function(B,C){var E=C||{};
if(typeof (C)!="undefined"){E.className="mobile-lightbox-plain"+((typeof (C.className)!="undefined")?" "+C.className:"")
}else{E.className="mobile-lightbox-plain"
}var D=new Element("div",{className:"window-contents"});
var A=new Control.Modal(B,Object.extend({insertRemoteContentAt:D,overlayOpacity:0.8,appear:true,method:"get"},E||{}));
A.container.insert(D);
return A
};
mobile.lightboxLoading=function(B,C){var D=C||{};
D.className="loading-lightbox";
var E=new Element("div",{className:"loading"});
E.innerHTML='<img alt="" src="'+mobile.PageParams.imagePath+'loading_big.gif"/>';
var A=new Control.Window(B,Object.extend({appear:true},D||{}));
A.container.insert(E);
return A
};