oRcsf.RegisterObject('Module_Content_Screenad');

function CloseScreenAd() {
	oRcsf.moModules.moContent.moScreenad.CloseDiv();
}

var RCSF_Project_Module_Content_Screenad =
{
	
	OnDomLoaded : function()
	{
		$('body_container').insert({after : '<div id="screenad_wrapper"><div id="screenad_bg"></div><div id="screenad"></div></div>'});
		
		swfobject.embedSWF(
			 this.moCore.maPaths['a_url']['s_project_root'] + 'files/swf/screenad/spinawards_screenad_2009.swf'
			,'screenad'
 			,'100%'
			,'100%'
			,'8'
			,false
			,{
				s_files_root 	: this.moCore.maPaths['a_url']['s_root'] + 'project/files/swf/screenad/'
			}
			,{
				wmode : 'transparent'
			 }
		);
		this.PositionOverlay();
	}

	,CloseDiv : function()
	{
		$('screenad_wrapper').remove();
	}
	
	,PositionOverlay : function()
	{
		
		this.page = RCSF_Base_Util.getPageSize();
		var e_dims = Element.getDimensions(document.body);
		
		//var h = (Prototype.Browser.IE && document.body && $('screenad_wrapper')) 
		//		? parseInt($('screenad_wrapper').style.top) + this.page.height
		//		: 0;
		var h = 0;
		var w = 0;
		
		$('screenad_wrapper').style.height = Math.max(Math.max(this.page.pageWidth,e_dims.width), w) + 'px';
		//alert('width: ' + $('screenad_wrapper').style.width);

		$('screenad_wrapper').style.height = Math.max(Math.max(this.page.pageHeight,e_dims.height), h) + 'px';
		//alert('height: ' + $('screenad_wrapper').style.height);
	}

}