
// general functions on all pages

// defined hook to ttlms top

		var ttlms_connect;
		if(window.ttlms_connect==undefined)
			if(parent.ttlms_connect)
				ttlms_connect = parent.ttlms_connect;
			else
				if(opener.ttlms_connect)
					ttlms_connect = opener.ttlms_connect;

		// More Info Media Only Popups
		var MoreInfoMediaOnly = new Array(0);
		var MoreInfoSizes = new Array(0);

// Functions


	// Macromedia Functions

	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_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=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	
// popup Functions


function DoMore(theM,theS)
{
	ttlms_connect.DoMore(theM,theS,MoreInfoMediaOnly,MoreInfoSizes);
} 
function DoLink(theLink,theS)
{
	ttlms_connect.DoLink(theLink,theS);
}
/*
function EQ_Ans(isRight,txt)
{
	var t = "";
	if(txt!=undefined)
		t = txt;
	if(t=="")
	{
		if(isRight)
			t = "Correct.";
		else
			t = "Incorrect.";
	}
	alert(t);
}
*/
function DoMoreQ(theM)
{
	ttlms_connect.DoMoreQ(theM);
} 
function DoLinkQ(theLink)
{
	ttlms_connect.DoLinkQ(theLink);
}


// JavaScript InsertObject functions

	function InsertObjectMOV(doc,c,fn,w,h,auto)
	{
		// Quicktime
		if( (typeof doc != 'undefined') && (typeof c != 'undefined') && (typeof fn != 'undefined') )
		{
			if(typeof w == 'undefined')
				w = 320;
			if(typeof h == 'undefined')
				h = 255;
			if(typeof auto == 'undefined')
				auto = "true";
			doc.writeln("<object width='" + w + "' height='" + h + "' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>");
			doc.writeln("<param name='src' value='../media/" + c + "/" + fn+ "'>");
			doc.writeln("<param name='controller' value='true'>");
			doc.writeln("<param name='autoplay' value='" + auto + "'>");
			doc.writeln("<param name='target' value='myself'>");
			doc.writeln("<param name='pluginspage' value='http://www.apple.com/quicktime/download/'>");
			doc.writeln("<embed ");
			doc.writeln("height='" + h + "' ");
			doc.writeln("width='" + w + "' ");
			doc.writeln("controller='true' ");
			doc.writeln("autoplay='" + auto + "' ");
			doc.writeln("target='myself' ");
			doc.writeln("src='../media/" + c + "/" + fn+ "' ");
			doc.writeln("bgcolor='#000000' ");
			doc.writeln("border='0' ");
			doc.writeln("pluginspage='http://www.apple.com/quicktime/download/indext.html'></embed>");
			doc.writeln("</object>");
		}
	else
		alert("Must provide document reference, course ID, and filename");
	}

	function InsertObjectSWF(doc,c,fn,w,h)
	{
		// Quicktime
		if( (typeof doc != 'undefined') && (typeof c != 'undefined') && (typeof fn != 'undefined') )
		{
			if(typeof w == 'undefined')
				w = 320;
			if(typeof h == 'undefined')
				h = 255;
			if(typeof auto == 'undefined')
				auto = "true";
			doc.writeln("<object width='" + w + "' height='" + h + "' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'>");
			doc.writeln("<param name='src' value='../media/" + c + "/" + fn+ "'>");
			doc.writeln("<param name='target' value='myself'>");
			doc.writeln("<param name='quality' value='high'>");
			doc.writeln("<param name='pluginspage' value='http://www.macromedia.com/go/getflashplayer'>");
			doc.writeln("<embed ");
			doc.writeln("height='" + h + "' ");
			doc.writeln("width='" + w + "' ");
			doc.writeln("target='myself' ");
			doc.writeln("src='../media/" + c + "/" + fn+ "' ");
			doc.writeln("bgcolor='#FFFFFF' ");
			doc.writeln("TYPE='application/x-shockwave-flash'");
			doc.writeln("quality='high'");
			doc.writeln("pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
			doc.writeln("</object>");
		}
	else
		alert("Must provide document reference, course ID, and filename");
	}
	

