// JavaScript Document

	function commericalPopUp(swfId){
		//This writes the pop up window to the page		
		$("body").append("<div id='popAlign'><a id='popUpClose' onClick='PopUp_remove()'>Close X</a><div id='popUpBox'><div id='commericalPlayer'><div id='commercialswf'><a href='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' target='_blank'><img src='/images/upgrade_flash_sm.gif' alt='' width='480' height='387' border='0'   style='width:480px;height:387px;' title='Please upgrade your Flash Player' alt='Please upgrade your Flash Player'/></a></div></div></div></div>");
		//removes pop up window and flash on click 
		$("#popUpClose").click(PopUp_remove);
	
		//set the flv being played don't add '.flv' the flash adds that
		var SWFlocation = '/swf/comercialPopPlayer.swf?xmlPath=/swf/' + swfId
		
		//window.alert(SWFlocation);
		
		//writes flash to the popup
		//var so = new FlashObject(SWFlocation, 'commerical', '480', '387', '8', '#ffffff');
		//so.addParam('scale', 'noscale');
		//so.addParam('wmode', 'window');
		//so.write('commericalPlayer');		

	   //swfobject.embedSWF(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj)
	   swfobject.embedSWF(SWFlocation, "commercialswf", "480", "387", "8", null, null, {wmode: "opaque", quality: "best", bgcolor: "#FFFFFF", allowScriptAccess: "sameDomain"}, null);

		$("#popUpBox").pngfix();
	}
	//remove popUp
	function PopUp_remove(){
		document.getElementById('commericalPlayer').innerHTML = "";
		$('#popUpBox,#popAlign,').remove();
		
	}