//used for ActiveX Controls for IE

//script name: ActiveXControls.js
//LiveMathRenderer
function insertLiveMath(width, height, lineSeparater, downloadURL)
{
  lineSeparator = "\n";
  document.write("<object id='LMPlugin' name='LMPlugin' classid='clsid:483912CF-8995-4434-AD61-6163756E05DF' ");
  document.write("codebase='http://qs130.pair.com/webprim4/mathshop/livemath/download/activex/AXTNS.ocx#Version=3,5,0,14\' ");
  document.write("align='baseline' border='0' width='" + width + "' height='" + height + "'>");

  document.write(lineSeparator);
  document.write("<param name='type' value='plugin/x-theorist'> ");
  document.write("<param name='src' value='" + downloadURL + "'>");
  document.write(lineSeparator);
  document.write("<embed src='" + downloadURL + "' width='" + width + "' height='" + height + "' type='plugin/x-theorist' ");
  document.write("pluginspage='http://glikk.pair.com/webprim3/3.0/?type=downplug&lang=enl'>");
  document.write(lineSeparator);
  document.write("</embed>");
  document.write("<noembed>");
  document.write("	No support for LiveMath Objects ");
  document.write("</noembed>");
  document.write("</object>");
  document.write(lineSeparator);
}

function insertFlashMovie(width, height, id, movieValue, embedSrc, embedWidth, embedHeight, embedName, wmodeValue)
{
  //alert("Here in insert method");
  var objectString = "";
  objectString += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + width + "' height='"+height +"' id='"+ id + "'>\n";
  objectString += "<param name='quality' value='high'>\n";
  if(wmodeValue != null || wmodeValue != "")
  {
    objectString += "<param name='wmode' value='"+wmodeValue+"'>\n";
  } 
  objectString += "<param name='menu' value='false'>\n";
  objectString += "<param name='movie' value='" + movieValue + "'>";
  objectString += "<embed menu='false' src='"+embedSrc+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+embedWidth+ "' height='" + embedHeight+"' name='"+embedName+"' swLiveConnect='true' ";
  if(wmodeValue != null || wmodeValue != "")
  {
    objectString += "wmode='"+wmodeValue+"'";
  }
  objectString +=  "></embed>\n";
  objectString += "</object>\n";
  //alert(objectString);
  document.write(objectString);
}

function insertimPopup(appParams)
{
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="417" height="360" id="popupim" align="middle" tabindex="1"');
  document.write('<param name="allowScriptAccess" value="sameDomain" /> ');
  document.write('<param name="movie" value="popupim.swf' + appParams + '"> ');
  document.write('<param name="quality" value="high"> <param name="bgcolor" VALUE="#FFFFFF"> ');
  document.write('<embed src="popupim.swf' + appParams + '" quality="high" bgcolor="#FFFFFF"  ');
  document.write(' width="417" height="360"  name="popupim" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  document.write('</object>');
  
}


//browser check for quicktime
/**
<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="123" height="166" data="/images/ellis_QT_check.mov">
	<PARAM name="SRC" VALUE="/images/ellis_QT_check.mov">
	<PARAM name="AUTOPLAY" VALUE="true">
	<PARAM name="CONTROLLER" VALUE="false">
</object>
<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="123" height="166" data="/images/cardean_QT_check.mov">
	<PARAM name="SRC" VALUE="/images/cardean_QT_check.mov">
	<PARAM name="AUTOPLAY" VALUE="true">
	<PARAM name="CONTROLLER" VALUE="false">
</object>
 */
function insertQuicktime(data)
{
  document.write("<object CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='123' height='166' data='" + data+ "'>\n");
  document.write("<PARAM name='SRC' VALUE='" + data+ "'>\n");
  document.write("<PARAM name='AUTOPLAY' VALUE='true'>\n");
  document.write("<PARAM name='CONTROLLER' VALUE='false'>\n");
  document.write("<PARAM name='LOOP' VALUE='true'>\n");
  document.write("<embed src='"+ data +"' width='123' height='166' autoplay='true' controller='false'></embed>");
  document.write("</object>\n");
}

//browser check for shockwave
/*
<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"
	codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0" 
	width="135"
	height="135"
	id="ellis_shocktest">
	<param name="src" value="/images/ellis_shocktest.dcr">
	<param name="swRemote" value="swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true'">
	<param name="swStretchStyle" value="none">
	<param name="bgColor" value="white"> 
</object>

<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"
	codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0" 
	width="135"
	height="135"
	id="cardean_shocktest">
	<param name="src" value="/images/cardean_shocktest.dcr">
	<param name="swRemote" value="swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true'">
	<param name="swStretchStyle" value="none">
	<param name="bgColor" value="white"> 

</object>

  insertShockwave("ellis_shocktest","/images/ellis_shocktest.dcr");
  insertShockwave("cardean_shocktest","/images/cardean_shocktest.dcr");

 */
function insertShockwave(id,  srcValue)
{
  document.write("<object classid='clsid:166B1BCA-3F9C-11CF-8075-444553540000' type='application/x-shockwave-flash' codebase='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0' width='135'	height='200' id='" + id + "'>\n");
  document.write("<param name='src' value='"+srcValue+"'>\n");
  document.write("<param name='swRemote' value='swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\''>\n");
  document.write("<param name='swStretchStyle' value='none'>\n");
  document.write("<param name='bgColor' value='white'>\n"); 
  document.write("<embed src='"+ srcValue +"' width='123' height='200' autoplay='true' controller='false'></embed>\n");
  document.write("</object>\n");
}

/**
 * Browser check for Flash
 */
function insertFlash(fcs)
{ 
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'); 
	document.write('        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ');
	document.write('        WIDTH="400" HEIGHT="150" id="connection" ALIGN=""> ');
	document.write('    <PARAM NAME=movie VALUE="connection.swf?fcs=' + fcs+ '"> ');
	document.write('    <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> '); 
	document.write('    <EMBED src="connection.swf?fcs='+fcs+'" ');
	document.write('           quality=high bgcolor=#FFFFFF  WIDTH="400" HEIGHT="150" '); 
	document.write('           NAME="connection" ALIGN="" TYPE="application/x-shockwave-flash" '); 
	document.write('           PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"> ');
	document.write('    </EMBED>');
	document.write('</OBJECT>');
}

//md5 test
function insertMd5Test()
{
  var s = "";
  s += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ";
  s += "codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' ";
  s += "width='550' height='400' id='md5test' align='middle'>\n";
  s += "<param name='allowScriptAccess' value='sameDomain' />\n";
  s += "<param name='movie' value='md5test.swf' />\n";
  s += "<param name='quality' value='high' />\n";
  s += "<param name='bgcolor' value='#ffffff' />\n";
  s += "<embed src='md5test.swf' quality='high' bgcolor='#ffffff' width='550' height='400' name='md5test' ";
  s += "align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' ";
  s += "pluginspage='http://www.macromedia.com/go/getflashplayer' />\n";
  s += "</object>\n";
  document.write(s);
}

//flash detect
function insertFlashDetect()
{
  document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  document.write('CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,30,0"');
  document.write('         WIDTH="525"');
  document.write('         HEIGHT="210"');
  document.write('         ID="theMovie">');
  document.write('  <PARAM NAME="src" VALUE="flash.swf">');
  document.write('  <EMBED SRC="flash.swf"');
  document.write('         PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"');
  document.write('         WIDTH="525"');
  document.write('         HEIGHT="210"');
  document.write('         NAME="theMovie">');
  document.write('  </EMBED>');
  document.write(' </OBJECT>');
}

//generic_quizframe.jsp
/*
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
  codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" 
  ID="transaction" width="640" height="480">

  <param name=movie value="/flash_components/quiz/quiz_shell.swf?grade_id=<%=gradeID%>&course_id=<%=courseID%>&section_id=<%=sectionID%>&isComplete=<%= isComplete %>&type=<%= quizType %>">
  <param name="quality" value="high" />
  <param name="menu" value="false" />
  <param name="wmode" value="opaque" />
  <param name=FlashVars value="config_url=<%=configURL%>&quiz_title=<%=quizTitle%>" />                         
  <embed src="/flash_components/quiz/quiz_shell.swf" 
    quality="high" menu="false" WIDTH="640" FlashVars="config_url=<%=configURL%>&quiz_title=<%=quizTitle%>" 
    HEIGHT="480" TYPE="application/x-shockwave-flash"  
    pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" 
    name = "transaction" swLiveConnect="true">
  </EMBED>
 </object>
 */
function insertQuizframe(params, flashVars)
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
  document.write('codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" ');
  document.write('ID="transaction" width="640" height="480">');

  document.write('<param name=movie value="/flash_components/quiz/quiz_shell.swf?'+params+'">');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="menu" value="false" />');
  document.write('<param name="wmode" value="opaque" />');
  document.write('<param name=FlashVars value="'+flashVars+'" />');
  document.write('<embed src="/flash_components/quiz/quiz_shell.swf" ');
  document.write('  quality="high" menu="false" WIDTH="640" FlashVars="'+flashVars+'"'); 
  document.write('  HEIGHT="480" TYPE="application/x-shockwave-flash"');
  document.write('  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ');
  document.write('  name = "transaction" swLiveConnect="true">');
  document.write('</EMBED>');
  document.write('</object>');
}

/*
  inlinevideo
  <embed src = "<%= lafURL.getImageURL(course_id,id + ".mov") %>" width = "<%= width %>" height = "<%= height %>"></embed>
*/
function insertInlineVideo(src, width, height)
{
  document.write("<embed src ='" + src + "' width = '" +  width + "' height='" + height + "'></embed>");
}

/*
splash.jsp
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
 codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" ID=P471473b71 width=330 height=160>
<param name=movie value="<%= movieURL %>">
<PARAM NAME=quality VALUE=high>  
<EMBED src="<%= movieURL %>" quality=high  WIDTH=330 HEIGHT=160 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</object>
*/

function insertSplash(movieURL)
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  document.write(' codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" ID=P471473b71 width=330 height=160>');
  document.write('<param name=movie value="' + movieURL + '">');
  document.write('<PARAM NAME=quality VALUE=high>');  
  document.write('<EMBED src="' + movieURL + '" quality=high  WIDTH=330 HEIGHT=160 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
  document.write('</object>');
}
/*
for FlashInline Renderer and ChatRenderer
*/
function insertActiveSrc(src)
{
  document.write(src);
}

function createBadge(width, height, url)
{
  document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + width + "' height='"+height+"'>");
  document.write("<param name='movie' value='"+url+"'></param>");
  document.write("<param name='wmode' value='transparent'></param>");
  document.write("<embed src='"+url+"' type='application/x-shockwave-flash' wmode='transparent' width='"+width+"' height='"+height+"'></embed>");
  document.write("</object>");
}



