<!--
function doFlash(id, width, height, swf, pic, name){

swfobject.registerObject(id, "7.0.0");

document.write('<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+swf+'" /><param name="FlashVars" value="img='+pic+'" /><param name="quality" value="high" /><param name="loop" value="false" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><!--[if !IE]>--><object width="'+width+'" height="'+height+'" data="'+swf+'" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+swf+'" /><param name="FlashVars" value="img='+pic+'" /><param name="quality" value="high" /><param name="loop" value="false" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><!--<![endif]--><div><img src="'+pic+'" alt="'+name+'" /></div><!--[if !IE]>--></object><!--<![endif]--></object>');

}

function doFlash2(id, width, height, swf){

swfobject.registerObject(id, "7.0.0");

document.write('<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" ><param value="high" name="quality" /><param value="transparent" name="wmode" /><param value="'+swf+'" name="src" /><!--[if !IE]>--><object type="application/x-shockwave-flash" data="'+swf+'" width="'+width+'" height="'+height+'" ><param value="high" name="quality" /><param value="transparent" name="wmode" /><param value="'+swf+'" name="src" /><!--<![endif]--><!--[if !IE]>--></object><!--<![endif]--></object>');

}

function doFlash3(id, width, height, swf, pic, name){

swfobject.registerObject(id, "7.0.0");

document.write('<div id="media_icon_2"><object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+swf+'" /><param name="FlashVars" value="img='+pic+'" /><param name="quality" value="high" /><param name="loop" value="true" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><!--[if !IE]>--><object width="'+width+'" height="'+height+'" data="'+swf+'" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+swf+'" /><param name="FlashVars" value="img='+pic+'" /><param name="quality" value="high" /><param name="loop" value="true" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><!--<![endif]--><div id="media_icon"><img src="'+pic+'" alt="'+name+'" /></div><!--[if !IE]>--></object><!--<![endif]--></object></div>');

}

function checkBrowserName(name){
   var agent = navigator.userAgent.toLowerCase();
   if (agent.indexOf(name.toLowerCase())>-1) {
      return true;
   }
   return false;
}

var quicktimeVersion = 0;
function getQuicktimeVersion() {
	var agent = navigator.userAgent.toLowerCase(); 	
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Quicktime plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		for (i=0; i < navigator.plugins.length; i++ ) {
			var plugin =navigator.plugins[i];
			if (plugin.name.indexOf("QuickTime") > -1) {
				quicktimeVersion = parseFloat(plugin.name.substring(18));
			}
		}
	}
	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('dim obQuicktime \n');
		document.write('set obQuicktime = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1") \n');
		document.write('if IsObject(obQuicktime) then \n');
		document.write('   if obQuicktime.IsQuickTimeAvailable(0) then \n');
		document.write('      quicktimeVersion = CInt(Hex(obQuicktime.QuickTimeVersion) / 1000000) \n');
		document.write('   end if \n');
		document.write('end if \n');
		document.write('</scr' + 'ipt\> \n');
	}
	// Can't detect in all other cases
	else {
		quicktimeVersion = quicktimeVersion_DONTKNOW;
	}
	return quicktimeVersion;
}
quicktimeVersion_DONTKNOW = -1;

function doMedia(alt) {
   if (checkBrowserName('android') && checkBrowserName('opera')) {
      doFlash3("video","80","48","/flash/fmt.swf","/files/media_logo.png", alt);
   }
   else if (checkBrowserName('iphone')) {
      doFlash3("video","80","48","/flash/fmt.swf","/files/media_logo.png", alt);
   }
   else if (checkBrowserName('ipad')) {
      doFlash3("video","80","48","/flash/fmt.swf","/files/media_logo.png", alt);
   }
   else if (checkBrowserName('safari') && !checkBrowserName ('chrome') && !checkBrowserName ('chromium')) {
      doFlash3("video","80","48","/flash/fmt.swf","/files/media_logo.png", alt);
   }
   else if (checkBrowserName('MSIE')) {
      doFlash3("video","80","48","/flash/fmt.swf","/files/media_logo.png", alt);
   }
   else {
      document.write('<span id="media_icon_2"><span id="media_icon"><img alt="'+alt+'" src="/files/media_logo.png"/></span></span>');
      jwplayer('media_icon_2').setup({
         'levels': [
            {file: "/media/fmt.mp4"},
            {file: "/media/fmt.webm"},
            {file: "/media/fmt.ogv"}
          ],
          width: 80,
          height: 48,
          icons: false,
          autostart: true,
          controlbar: "none",
          repeat: "always",
          duration: 12
      });
   }
}
// -->

