/**
* Assign the view handler
*/

viewHandler = StoreProduct;

/**
* Creates a new object with methods used by the Store Product page
*
* @author				Matt Gifford
* @copyright			2008 Timeshifting Interactive Limited
*/
function StoreProduct()
	{
	// Step 1. Define Properties

	var _instance = this;




	// Step 2. Define Public Methods

	/**
	* Sets up the initial page state and event handlers
	*/
	this.init = function()
		{
		// Call generic page init method
		this.base.init.call(this);

		// Add event handlers to thumbnails
		var thumbs = document.getElementById('storeProductBodyThumbnails').getElementsByTagName('img');
		for (var x = 0; x < thumbs.length; x++)
			{
			thumbs[x].onclick = function()
				{
				var newSrc = this.src.replace('Small', 'Large');
				document.getElementById('fullsize').src = newSrc;
				}
			}
		}
	

	/**
	* Displays the popup magazine cover
	*
	* @param		filename		The filename to open
	* @return		void
	*/
	this.coverPopup = function(filename)
		{
		var leftOffset = parseInt(window.screen.width) ? ((parseInt(window.screen.width)/2)-165) : 40;
		var topOffset = parseInt(window.screen.height) ? ((parseInt(window.screen.height)/2)-260) : 40;
		window.open(
			filename,
			'exerciseGroupCover',
			'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=311,height=506,top=' + topOffset + ',left=' + leftOffset
			);
		}
	}
