YAHOO.namespace("popUpPreview.container");

function popUpPreview(){
	//Member variables
	var _objectName;
	var _height;
	var _width;
	
	this.setObjectName = function(name){
		_objectName = name;
	};

	this.setWidth = function(value){
		_width=value;
	};
	
	this.setHeight = function(value){
		_height=value;
	};

	this.handleiFrameLoad = function(){
		YAHOO.popUpPreview.container.popupPreview.show();
	};
	
	this.callPopUpPreview = function(strTitle,strURL){
		//This line create the panel object
		YAHOO.popUpPreview.container.popupPreview = new YAHOO.widget.Panel("popUpPreviewDiv", 
		{ //set the width and hieght to the values set in the class
		  width : _width + "px",
		  height : _height + "px",
		  //the pop up should be fixed to the center of the screen
		  fixedcenter : true, 
		  //show a close link
		  close:true, 
		  //don't allow dragging of the pop up
		  draggable:true,
		  constraintoviewport:true,
		  //the panel starts out invisible
		  visible:false
		  //this line sets the transision effect, where we are using the slide
		  //effect and setting it's duration to .25 seconds.
		  //effect:[{effect:YAHOO.widget.ContainerEffect.SLIDE,duration:0.25}] 
		 } );
		
		//Sets the header / menu bar of the pop up
		YAHOO.popUpPreview.container.popupPreview.setHeader(strTitle);
		//Sets the body, note the use of the iframe to load the content.  The onload event calls the handleiFrameLoad method to display the pop up
		YAHOO.popUpPreview.container.popupPreview.setBody("<iframe id='popUpPreviewBody' onload='Javascript:" + _objectName + ".handleiFrameLoad();' src='" + strURL + "'></iframe>");
		//render the panel to the page.  this just starts the dynamic conversion call
		YAHOO.popUpPreview.container.popupPreview.render(document.body);		 		
	}
}
