// JScript File
function xPopUp(w,h) 
{
		YAHOO.namespace("RRRM.Panel");		
		var x = YAHOO.RRRM.Panel.xPopUp;
		if (x == null) 
		{ 
	  	YAHOO.RRRM.Panel.xPopUp = 
			new YAHOO.widget.Panel("xPopUp", 
				{										 
					visible:false,					 					
					close: true,
					fixedcenter:true,					
					constraintoviewport:true,
				  draggable: false
				} 
			);		
			var x = YAHOO.RRRM.Panel.xPopUp;
			x.setHeader('<span id="xPopUp_Header">&nbsp;</span>');
			x.setBody('<iframe id="xPopUp_Iframe" src="Loading.aspx" scrolling="true" frameborder="0" ></iframe>');
			x.setFooter('<span id="xPopUp_Footer">&nbsp;</span>')		
			x.render(document.body);		
		}	
		this.hide = function () {
		  YAHOO.RRRM.Panel.xPopUp.hide();		 
		}	
		this.ShowUrl = function (str_url,_width,_height,isModal,fixedToCenter,noCache,onHide, title, NoShowClose) 
		{
			  
		  //var bClass = $('xPopUp_h').className;
		  if ($('xPopUp_h'))	  
		    $('xPopUp_h').style.display = 'none';
		  	  		 
		  
	
		  
			$('xPopUp_Iframe').src = noCache?GetNoCacheUrl(str_url):str_url;
			$('xPopUp_Iframe').style.width = (_width) + "px";
			$('xPopUp_Iframe').style.height = (_height - 20) + "px";
			
			
			
			var x = YAHOO.RRRM.Panel.xPopUp;
			x.setHeader('<span id="xPopUp_Header">'+title+'</span>');			
			
			if (NoShowClose) {
			  x.cfg.setProperty("close",false);
			}
			
			x.cfg.setProperty("width", _width + "px");
			x.cfg.setProperty("height", _height + "px");
			x.cfg.setProperty("modal",isModal);
			x.cfg.setProperty("fixedcenter",fixedToCenter);
			
		  if ($('xPopUp_h'))	  
			  $('xPopUp_h').style.display = '';	
			
			x.hideEvent.subscribe(function () {
			   try { $('xPopUp_Iframe').src = 'Loading.aspx';  }
		     catch(e) { }
			});
			
			if (typeof(onHide) == 'function') {								
				x.hideEvent.unsubscribe(onHide);					
				x.hideEvent.subscribe(onHide);	
			}
			x.show();							
		};						 													
}			

xPopUp.loadUrl = function(str_url,_width,_height,isModal, fixedToCenter, noCache, onHide, title, NoShowClose)  
{
  if (YAHOO.RRRM.Util.xpp == null) { YAHOO.RRRM.Util.xpp = new xPopUp(_width,_height) }
		title = title? title:":.";
  YAHOO.RRRM.Util.xpp.ShowUrl(str_url,_width,_height,isModal, fixedToCenter, noCache, onHide, title, NoShowClose);
}
xPopUp.doHide =  function () {
  if (YAHOO.RRRM.Util.xpp != null) {
    YAHOO.RRRM.Util.xpp.hide();
  }
}
YAHOO.namespace('RRRM.Util');
YAHOO.RRRM.Util.xpp = null;


 function xPanel(strDivContainerId,_width,_height,isModal,fixedToCenter) {
      //YAHOO.namespace("YAHOO.RRRM.panels");      
       
      var x = new YAHOO.widget.Panel(strDivContainerId, { visible:false, close:false, constraintoviewport:true, modal:xIsNull(isModal,false)} );            					
    
			if (xDef(_width)) x.cfg.setProperty("width", _width + "px");
			if (xDef(_height)) x.cfg.setProperty("height", _height + "px");
			//if (xDef(isModal))  { x.cfg.setProperty("modal",isModal);}
			if (xDef(fixedToCenter)) x.cfg.setProperty("fixedcenter",fixedToCenter);
                     					
      $(strDivContainerId).style.display = 'none'; 
      x.render(); 
      x.innerElement.innerHTML += String.format("<div id='xClose_{0}' class='container-close'>&nbsp</div><div>&nbsp;</div>",strDivContainerId);
      
      x.close = $('xClose_' + strDivContainerId);
      if (x.close) {
        $ale(x.close,'click',_doHide,true);
      }
      
                       
      this.doShow = function () {
        $(strDivContainerId).style.display = 'block';                    					                                
        x.show();        
      };
      this.doHide = function () {
        _doHide();
      }
      function _doHide () {
        $(strDivContainerId).style.display = 'none';                 					
        x.hide();
      }
          
   }
  
	function $alert(str_msg, str_title, isModal) 
	{
		YAHOO.namespace("RRRM.Util");
		if (!YAHOO.RRRM.Util.xAlert) {
			YAHOO.RRRM.Util.xAlert = new YAHOO.widget.SimpleDialog('_xAlert_',
																							{  width: "300px",
																							   fixedcenter: true,
																							   visible: false,
																							   draggable: false,
																							   close: true,																							  
																								 icon: YAHOO.widget.SimpleDialog.ICON_ALARM ,
																							   constraintoviewport: true,
																							   buttons: [ { text:"Ok", handler:function () {	this.hide(); }, isDefault:true }  ]
																							} );

			YAHOO.RRRM.Util.xAlert.setHeader("<span id= '_xAlert_title'></span>");
			YAHOO.RRRM.Util.xAlert.setBody("<div id='_xAlert_Message'></div>");
			YAHOO.RRRM.Util.xAlert.render(document.body);
		}
		
		try {		
			$('_xAlert_Message').innerHTML = xIsNull(str_msg,'');
			$('_xAlert_title').innerHTML = xIsNull(str_title,'');
			
			YAHOO.RRRM.Util.xAlert.cfg.setProperty("modal",xIsNull(isModal,false));
			YAHOO.RRRM.Util.xAlert.cfg.applyConfig();
			
			YAHOO.RRRM.Util.xAlert.show();
		}
		catch(e) {
			alert("[$alert] " + e);
		}				

		
	}
	
	function $ShowLoading(str_title, str_msg, _width) 
	{
	  _width = (_width) ? _width + "px" : "240px";
	  
		YAHOO.namespace("RRRM.Util");
		if (!YAHOO.RRRM.Util.xMessage) {
			YAHOO.RRRM.Util.xMessage = new YAHOO.widget.Panel("xMessage",  
															{ width:_width, 
															  fixedcenter:true, 
															  close:false, 
															  draggable:false, 
															  modal:true,
															  visible:false
															  //,effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5} 
															} 
														);

			//YAHOO.RRRM.Util.xMessage.setHeader("<span id= '_xxx_title'></span>");
			YAHOO.RRRM.Util.xMessage.setBody("<div style='padding-top:10px;'><div style='text-align:center;padding:2px;'> <img src=\"http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/gp/rel_interstitial_loading.gif\"/></div><div style='padding:2px;text-align:center;'><p id='_xxx_Message'></p></div></div>");
			YAHOO.RRRM.Util.xMessage.render(document.body);
		}
		
		try {	
		  //$('xMessage_h').style.display = 'none';
			$('_xxx_Message').innerHTML = xIsNull(str_msg,'');
			//$('_xxx_title').innerHTML = xIsNull(str_title,':.');					
		}
		catch(e) {
			alert("[$ShowLoading] " + e.message);
		}				
		
		YAHOO.RRRM.Util.xMessage.show();
		
	}
	
	function $HideLoading(str_msg) 
	{
		YAHOO.namespace("RRRM.Util");
		if (YAHOO.RRRM.Util.xMessage) YAHOO.RRRM.Util.xMessage.hide();
	}


//$ready(function () { YAHOO.RRRM.Util.xpp = new xPopUp() });
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
