//Returns everything after the "=" in the location string. Can be used in flash to load variables.
function getVar()
{
	url = String(window.location);
	theVar = url.replace("&launch=true","").indexOf("goLesson=");
	
	if(theVar == -1)
	{
		return("goLesson=undefined");
	}
	else
	{
		return("goLesson="+url.substring(theVar + 9));
	}
}

//Dynamically creates the flash object and embed tags
function createFlashObj(fileName, fileWidth, fileHeight)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0" width="' + fileWidth + '" height="' + fileHeight + '", name="flashObj">');
		document.write('<param name="movie" value="' + fileName + '">');
		document.write('<param name="flashVars" value="' + getVar() + '">');
		document.write('<param name="menu" value="false">');
		document.write('<param name="quality" value="high">');
		document.write('<embed src="' + fileName + '" width="' + fileWidth + '" height="' + fileHeight + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashVars="' + getVar() + '" menu="false"></embed>');
	document.write('</object>');
}

//Used to open pdf's (or media type files) in an external html file - bypasses the "blocked content" issue with I.E. 6+ -->
function openAsset(fUrl)
{
	//alert(fUrl);
	window.open("openAsset.html?asset=" + fUrl,"","toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,scrolling=yes,resizable=yes,width=500,height=475,left=0,top=0");
}

function OpenFooterAsset(URL)
{
	window.open(URL,"Math_5_Live","toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,scrolling=yes,resizable=yes,width=750,height=550,left=0,top=0");
}
