// --------------------------------------------------------------------------------
/*
	Resources:
		http://developer.mozilla.org/en/docs/DOM:window.open
*/
// --------------------------------------------------------------------------------

// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

var Popup =
{
	// --------------------------------------------------------------------------------
	// Private functions
	// --------------------------------------------------------------------------------
	
	// ---
	// Popup a page at the specified position and the specified Width and height
	//
	__pageLTWH: function ( left, top, width, height, pageName, anchorName, wndOptions ) 
	{
		// ---
		var pageUrl = pageName;
	  
		if ( anchorName != "" ) {
		pageUrl = pageName + "#" + anchorName;
		}
	  
	  	// ---
		var options	= "left="    + left   + ","
					+ "top="     + top    + ","
					+ "width="   + width  + ","
					+ "height="  + height
		;
		if ( wndOptions != "" )
		{
			options += ( "," + wndOptions );
		}
	  
	  	// ---
		var wnd = window.open( pageUrl, "rmPopupPage", options )
		wnd.focus();
		return wnd;
	},
	
	// --------------------------------------------------------------------------------
	// Public functions
	// --------------------------------------------------------------------------------
	
	help: function( anchorName ) 
	{
		return this.__pageLTWH( 10, 10, 300, 300, "popup_help.htm", anchorName, "resizable,scrollbars" );
	},
	
	photo: function( title, uriImg )
	{
		var wndOptions = 
			"directories=no," +
			"location=no," + // MSIE 7 will force the presence of the Address Bar!!!
			"menubar=no," + 
			"scrollbars=no," + 
			"status=no," + 
			"toolbar=no," + 
			"resizable=yes"
		;
		return this.__pageLTWH( 
					  0, 0, 200, 200
					  , "/ropemarks-5.0.0/photo.php?title=" + title + "&img=" + uriImg
					  , "" 
					  , wndOptions
		);
	},	

	video: function( title, uriVid )
	{
		var wndOptions = 
			"directories=no," +
			"location=no," + // MSIE 7 will force the presence of the Address Bar!!!
			"menubar=no," + 
			"scrollbars=no," + 
			"status=no," + 
			"toolbar=no," + 
			"resizable=yes"
		;
		return this.__pageLTWH( 
					  0, 0, 200, 200
					  , "/ropemarks-5.0.0/video.php?title=" + title + "&vid=" + uriVid
					  , "" 
					  , wndOptions
		);
	},	
	
	// Currency converter
	oanda: function( title, uriVid )
	{
		var wndOptions = 
			"directories=no," +
			"location=no," + // MSIE 7 will force the presence of the Address Bar!!!
			"menubar=no," + 
			"scrollbars=no," + 
			"status=no," + 
			"toolbar=no," + 
			"resizable=yes"
		;
		return this.__pageLTWH( 
					  0, 0, 640, 450
					  , "http://www.oanda.com/convert/classic?user=ropemarks&lang=en" 
					  , "" 
					  , wndOptions
		);
	}//,	
}; // Class Popup





// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------

var Popunder =
{
	page: function( pageName ) 
	{
		var pageUrl = pageName;
  
		var wnd = window.open( 
							pageUrl, 
							"rmPopunderPage",
							"" // window properties
		);
		wnd.blur();
		return wnd;
	}
}; // Class Popunder

/* EOF */