function ModalWindow(handler){this._modalHandler=handler;this._openHandler=null;this._closeHandler=null;this._onShown=null}ModalWindow.prototype={get_modalHandler:function(){return this._modalHandler},set_modalHandler:function(value){this._modalHandler=value},get_openHandler:function(value){return this._openHandler},set_openHandler:function(value){this._openHandler=value},get_closeHandler:function(){return this._closeHandler},set_closeHandler:function(value){this._closeHandler=value},get_onShown:function(){return this._onShown},set_onShown:function(value){this._onShown=value},get_handlers:function(){return {open:this._openHandler,close:this._closeHandler}},set_handlers:function(value){if(value.open!=null)this._openHandler=value.open;if(value.close!=null)this._closeHandler=value.close},show:function(){var p=$find(this.get_modalHandler());if(p!=null){var handler=this.get_openHandler(),close=this.get_closeHandler(),name=this.get_modalHandler().replace("Behavior",""),shown=this.get_onShown();p.add_showing(function(){handler();$("#popup_container_inner").empty()});p.add_shown(function(){shown!=null&&shown();$("#popup_container_inner").remove();$("#"+p.get_PopupControlID()).find("div[id$=Loader]").show();$.unblockUI()});p.show()}},layout:function(){var p=$find(this.get_modalHandler());p!=null&&p._layout()},hide:function(){var p=$find(this.get_modalHandler());if(p!=null){var handler=this.get_closeHandler(),name=this.get_modalHandler().replace("Behavior","");p.add_hiding(function(){$("#"+name+"_hidden").remove();$("span[id$='SmartC'][open='true']").parent().find("img[tooltipclose=yes]").click();handler!=null&&handler()});p.hide()}},hideLoader:function(){var p=$find(this.get_modalHandler());$("#"+p.get_PopupControlID()).find("div[id$=Loader]").hide()}};function _hideReferAndWin(){var checked=$("#dontshow").is("[checked=true]"),COOKIE_NAME=".ReferAndWin",shortexpoptions={path:"/",expires:1},longexpoptions={path:"/",expires:36500};if(checked)$.cookie(COOKIE_NAME,"1",longexpoptions);else $.cookie(COOKIE_NAME,"1",shortexpoptions)}function _hideVivaMailbox(){var checked=$("#vivabox_dontshow").is("[checked=true]"),COOKIE_NAME=".UserIsAwareOfVivaMailbox",shortexpoptions={path:"/",expires:1},longexpoptions={path:"/",expires:36500};if(checked)$.cookie(COOKIE_NAME,"1",longexpoptions);else $.cookie(COOKIE_NAME,"1",shortexpoptions)}