// System globals
var flashInstalled = false;    // boolean. true if flash is installed

// Check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if(isIE && isWin){ 
 document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
 document.write('on error resume next \n');
 document.write('flashInstalled = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash"))) \n');
 document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

function checkFlash() {
 if(isIE && isWin){
  plugIn  = flashInstalled;
  return plugIn;
 } else {
  if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] 
   && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin 
   && navigator.plugins && navigator.plugins["Shockwave Flash"]){
   //Flash 3 or later is available
   plugIn = true;
   return plugIn;
  } else {
   //Flash 3 is not available
   plugIn = false;
   return plugIn;
  }
 }
}

var Flash = checkFlash();

function buildEmbed(movieSrc,strX,strY) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+ strX +"' height='"+ strY +"'>")
	document.write("<param name=movie value='"+ movieSrc +"'>")
	document.write("<param name=quality value=high>")
	document.write("<embed src='"+ movieSrc +"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+ strX +"' height='"+ strY +"'>")
	document.write("</embed>")
	document.write("</object>")
	//http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0
}

function buildImg(movieSrc,strX,strY) {
	document.write("<img src='"+ movieSrc +"' width='"+ strX +"' height='"+ strY +"'>")
}