function reloadPage(init) {  //reloads the window if Nav4 resized  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();}reloadPage(true);function LA_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.LA_p) d.LA_p=new Array();    var i,j=d.LA_p.length,a=LA_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.LA_p[j]=new Image; d.LA_p[j++].src=a[i];}}}function LA_swapImgRestore() { //v3.0  var i,x,a=document.LA_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function LA_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=LA_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function LA_swapImage() { //v3.0	var i,j=0,x,a=LA_swapImage.arguments; document.LA_sr=new Array; for(i=0;i<(a.length-2);i+=3)	if ((x=LA_findObj(a[i]))!=null){document.LA_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}function OpenMovie(URL)
{
	window.open("../movieLauncher.html?asset=" + URL,"","toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,scrolling=yes,resizable=yes,width=500,height=400,left=0,top=0");
}function OpenMovie2(URL, VideoName)
{
	window.open("../../movieLauncher.html?asset=" + URL,"","toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,scrolling=yes,resizable=yes,width=500,height=400,left=0,top=0");
}

function embedIFrameNavigation(source)
{
	document.write( '<iframe src="' + source + '" height="94" scrolling="no"></iframe>' );
}

function embedIFrame(source)
{
	document.write( '<iframe src="' + source + '" height="100%" scrolling="auto"></iframe>' );
}

function OpenFooterAsset(URL)
{
	window.open(URL,"Applied_Mathematics_Multimedia_Resources","toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,scrolling=yes,resizable=yes,width=750,height=550,left=0,top=0");
}

function launchwin(URL, name, parameters)
{
	var movie = "";
	var referrer = document.referrer;
	
	if (referrer.indexOf("Budgeting") > -1) movie = "HTML/number/Budgeting/Movies/math4a.mov";
	
	OpenMovie2(movie, "Movie");
}

function embedMovie()
{
	var movie = "";
		
	if (parent.window.location.search.indexOf("&") > -1)
	{
		movie = parent.window.location.search.substring(7, parent.window.location.search.indexOf("&"));
	}
	else
	{
		movie = parent.window.location.search.substring(7, parent.window.location.search.length);
	}
	
	document.write("<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='100%' height='93%' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>");
		document.write("<param name='src' value='" + movie +"' />");
		document.write("<param name='controller' value='true' />");
		document.write("<param name='autoplay' value='true' />");
		document.write("<param name='enablejavascript' value='true' />");
		document.write("<param name='scale' value='tofit' />");
		document.write("<param name='kioskmode' value='true' />");
		document.write("<param name='bgcolor' value='#000000' />");
			
		document.write("<embed ");
			document.write("src='" + movie + "'");
			document.write("width='100%'");
			document.write("height='93%'");
			document.write("autoplay='true'");
			document.write("scale='tofit'");
			document.write("kioskmode='true'");
			document.write("bgcolor='#000000'");
			document.write("type='video/quicktime'");
			document.write("pluginspage='http://www.apple.com/quicktime/download/'");
			document.write("enablejavascript='true'");
			document.write("controller='true'");
		document.write("></embed>");
			
	document.write("</object>");
}

function embedDirectorObject(asset, height, width, color)
{
	document.write( '<object ');
		document.write( 'classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" ');
		document.write( 'codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0" ');
		document.write( 'width="' + width + '" ');
		document.write( 'height="' + height + '" ');
		document.write( 'bgcolor="' + color + '" ');
		document.write( 'id="shockMovie" ');
		document.write( 'name="shockMovie"> ');
		
	document.write( '<param name="src" value="' + asset + '">');
		document.write( '<embed ' );
		document.write( '  src="' + asset + '" ' );
		document.write( '  bgcolor="' + color + '" ' );
		document.write( '  width="' + width + '" ' );
		document.write( '  height="' + height + '" ' );
		document.write( '  swRemote="swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\' " ');
		document.write( '  swStretchStyle="none" ' );
		document.write( '  type="application/x-director"' );
		document.write( '  pluginspage="http://www.macromedia.com/shockwave/download/" ' );
		document.write( '  swLiveConnect="true">');
		document.write( '</embed>' );
	document.write( '</object>');
}

function embedFlashObject(asset, height, width, color)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write('height="' + height + '"');
	document.write('width="' + width + '">');
	document.write('<param name="src" value="' + asset + '">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="align" value="middle">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="bgcolor" value="' + color + '">');
	document.write( '<embed ' );
	document.write( '  src="' + asset + '" ' );
	document.write( '  name="' + name + '"' );
	document.write( '  height="' + height + '" ' );
	document.write( '  width="' + width + '" ' );
	document.write( '  align="middle" ' );
	document.write( '  quality="high" ' );
	document.write( '  allowScriptAccess="sameDomain" ' );
	document.write( '  scale="tofit" ' );
	document.write( '  pluginspage="http://www.macromedia.com/go/getflashplayer" ' );
	document.write( '  bgcolor="' + color + '" ' );
	document.write( '  type="application/x-shockwave-flash">' );
	document.write( '</embed>' );
	document.write('</object>');
}