/**
 *	Class to encapsulate the functionality of a cross-browser dialog window.
 *	An instance of the Dialog object is created and the open() method called
 *	to open the dialog.
 *
 *	@author		Unknown
 *	@version	1.0
 *	@copyright	Katana Productions Pty Ltd 2001
 *
 *	@param	contentSrc	The source file for the content HTML to be displayed.
 *	@param	features	  The window's features as described by the window.open() method.
 *	@param	title	      The window's title.
*/
function Dialog(contentSrc, features, title)
{
	this.contentSrc = contentSrc;
	this.features = features;
  this.title = title;
  this.buttonSrc = '/dialogs/BottomFrame.htm';
  this.buttonHeight = 50;
	this.returnValue = null;
}

/**
 *	Returns the content window.
 *
 *	@returns A window object.
*/
Dialog.prototype.getContentWin = function()
{
	return this.window.frames('ContentFrame');
}

/**
 *	Opens the dialog window.
*/
Dialog.prototype.open = function()
{
  this.window = window.open('/dialogs/Dialog.htm', '_blank', this.features);
	this.window.dialog = this;
}

/**
 *	Closes the dialog window.
*/
Dialog.prototype.close = function()
{
	this.window.close();
}

/**
 *	Event handler when action button is pressed.
 *	The 'this' object actually refers to the HTML element that fired the event.
 *	Use 'this.dialog' to retrieve your instance of the Dialog object.
 */
Dialog.prototype.onaction = function()
{
	this.dialog.close();
}

/**
 *	Event handler when cancel button is pressed.
 *	The 'this' object actually refers to the HTML element that fired the event.
 *	Use 'this.dialog' to retrieve your instance of the Dialog object.
*/
Dialog.prototype.oncancel = function()
{
	this.dialog.close();
}