
// ****************************************************************
// * We need to be constantly aware of the user's screen size    *
// ****************************************************************

function placeIframe()
{			
		// Let's see what the available screen size is
		
		var sHeight = this.getSize().y;
		var sWidth = this.getSize().x;
		
		
		// how big is the iFrame?				
		var divHeight = $('iFrameDiv').getSize().y;
		var divWidth = $('iFrameDiv').getSize().x;
		
		
		var ratioDiv 		= divWidth/divHeight;
		var ratioStage 	= sWidth/sHeight;
		
		// Where should we put it?
		
		//var putMeHereH = (sHeight / 2) - (divHeight / 2) +48;
		var Xpos = 0;//submenu width ;
		var Ypos =	sHeight/2 -83; // the height of the top bar
		// 17 is the bottom bar
		
		var targetW;
		var targetH;
		
		if(BrowserDetect.browser == 'Firefox')
		{
		
			targetW=  sWidth+17;
		targetH = sHeight-17 - Ypos;
		}
		else
		{
			targetW=  sWidth;
			targetH = sHeight-Ypos;
		}
		
		// OK, let's put it there
		
		$('iFrameDiv').setStyle('top', Ypos);
		$('iFrameDiv').setStyle('left',Xpos );		
		
		$('iFrameDiv').setStyle('pixelWidth', targetW);
		$('iFrameDiv').setStyle('pixelHeight', targetH);		
		
		$('myIframe').setStyle('height', targetH);
		$('myIframe').setStyle('width', targetW);
		
		// That's the end of placeIframe()
}



// ****************************************************************
// * When the DOM is ready, this will fire                        *
// ****************************************************************

window.addEvent("domready", function()
{
	// let's get everything right on the first load	
	placeIframe();	
	// END OF DOMREADY
});


// ****************************************************************
// * If the Window resizes, this will fire                        *
// ****************************************************************

window.addEvent("resize", function()
{
	// if the image is resized, let's do our background magic once more
	placeIframe();
	// END OF RESIZE	
});


