// (c)2011 MrOrange

﻿
mrO.popupView=function(id,className,args){mrO.object.call(this,id,className,args);var defaultSettings={};this.applyDefaultSettings(defaultSettings);};mrO.popupView.prototype=new mrO.object;mrO.popupView.prototype.initObject=mrO.popupView.prototype.init;mrO.popupView.prototype.init=function(args){this.initObject(args);var defaultSettings={};this.applyDefaultSettings(defaultSettings);this.target=this.id;var initArguments=new Object();if(mrO.isDefined(this.settings.BackgroundColor)){initArguments["screenLockerBackground"]=this.settings.BackgroundColor;}
if(mrO.isDefined(this.settings.BackgroundOpacity)){initArguments["screenLockerOpacity"]=this.settings.BackgroundOpacity;}
$.setupJMPopups(initArguments);};mrO.popupView.prototype.updateContent=function(hotelKey){alert(hotelKey);};mrO.popupView.prototype.requestData=function(key){var detailsView=mrO.page.getObject("detailsView");this.target=detailsView.settings.resultElementID;detailsView.clearItems();detailsView.clearOutput();detailsView.getItemData(key);$("#"+this.target).html($("#loading").html());checkDetailsCallBack();};checkDetailsCallBack=function(){var detailsView=mrO.page.getObject("detailsView");if(mrO.isDefined(detailsView)&&detailsView.callInfo.callIsInProgress()){setTimeout("checkDetailsCallBack();",150);return;}
var popupView=mrO.page.getObject("popupView");if(!detailsView.callInfo.latestCallWasSuccessful){$("#"+popupView.target).html($("#failed").html());}
popupView.reload();}
mrO.popupView.prototype.open=function(){var initArguments=new Object();var pointer=this;initArguments["name"]=this.id;if(mrO.isDefined(this.settings.Target)){initArguments["target"]=this.settings.Target;}
else{initArguments["target"]=this.target;}
if(mrO.isDefined(this.settings.Cache)){initArguments["cache"]=this.settings.Cache;}
if(mrO.isDefined(this.settings.BeforeClose)){initArguments["beforeClose"]=function(){eval(pointer.settings.BeforeClose);};}
if(mrO.isDefined(this.settings.AfterClose)){initArguments["afterClose"]=function(){eval(pointer.settings.AfterClose);};}
if(mrO.isDefined(this.settings.Width)){initArguments["width"]=this.settings.Width;}
if(mrO.isDefined(this.settings.Height)){initArguments["height"]=this.settings.Height;}
$.openPopupLayer(initArguments);};mrO.popupView.prototype.close=function(){$.closePopupLayer(this.id);};mrO.popupView.prototype.isOpen=function(){};mrO.popupView.prototype.toggle=function(){};mrO.popupView.prototype.reload=function(){$.reloadPopupLayer(this.id);};
