//document.writeln('<sc'+'ript language="javascript" type="text/javascript" src="/scripts/js/request.js"></sc'+'ript>');
document.writeln('<sc'+'ript language="javascript" type="text/javascript" src="/scripts/js/detect_flash.js"></sc'+'ript>');
Co_Player_Translations=Co_Translations={MediaPlayer_Required:'This media selection requires that<br><<Media_PlayerName>> be installed on your computer.',GreaterVersion_Required:'This media selection requires that a never version of<br><<Media_PlayerName>> be installed on your computer.',Download_Link_Text:'<a <<download_link>>>Click here</a> to download this software for free.',To_Adjust_Settings:'To adjust your preferred Media Player<br>click on \'Settings\' below.',Flash_Presentation:'Flash Presentation',Click_To_Launch:'Click here to launch this presentation',Choose_Preferred_Player:'Choose your preferred Media Player',Note_When_Available:'<b>Note:</b> Much of our content may only be available in only one of these formats. We will attempt to honor your preference when it is available.',Choose_Connection_Speed:'Choose your connection speed','56K_Dialup':'56K - Dialup','100K_Low_Broadband':'100K - Low Broadband','300K_High_Broadband':'300K - High Broadband',Save_And_Play:'Save and Play',Cancel:'Cancel',Download_Windows_Media:'Download Windows Media Player',Download_Real:'Download Real Media Player', Download_Flash:'Download Flash Player',Current_Version:'Current version',Required_Version:'Required version'};
var agt = navigator.userAgent.toLowerCase();var is_fx = (agt.indexOf('firefox')!=-1);var is_chrome = (agt.indexOf("chrome")!=-1);var is_mac = (agt.indexOf('mac') != -1);var is_win98 = (agt.indexOf('windows 98') != -1);
var settings;var tools_container;var container;var resizeFull=function() {return;};
function FileNames() {this.kb300={text:"300"};this.kb100={text:"100"};this.kb56={text:"56"};for (var obj in this) {this[obj].height=0;this[obj].width=0;this[obj].fileid=null;};}
var files = {autostart:1,serverpath:'',CurrentPosition:"0",Media_Type:"Unknown",SaveLocation:false,Windows_Media:{avail:false,FileNames:new FileNames(),name:"wm",FullName:"Windows Media Player", RealName:"Windows Media Player"},Real:{avail:false,FileNames:new FileNames(),name:"real",FullName:"RealPlayer", RealName:"Real Player"},Flash:{avail:false,FileNames:new FileNames(),name:"flash",FullName:"Flash",RealName:"Flash Player",Version:[7,0,0]}}
var fullpath=function(){if (files.isFlash) return settings.current.FileName; else return files.serverpath + '/multimedia/MediaPlayer/play.asp?id='+settings.current.speed.fileid + (settings.current.name=='real'?'&player=real':'') + (is_win98?'&win98=true':'');}
function isObject(o) {if (!o) return false; return (typeof(o) == "object");}
String.prototype.Replace=function(o,n){return this.split(o).join(n);}

function load_cookie() {
  var cookie=GetCookie("MediaPlayer");
  this.player="wm";this.speed="300";this.cookie=cookie;
  if (cookie==null) {this.hascookie=false;return this;}
	this.hascookie=true; cookie=cookie.split("&");this.new_player=false;
  for (var i=0;i<cookie.length;i++) {cookie[i]=cookie[i].split('=');switch (cookie[i][0].toLowerCase()) {case 'speed':this.speed=cookie[i][1];break;case 'player':this.player=cookie[i][1];case 'new':this.new_player=true;break;}}
	if (!this.new_player){this.hascookie=false;this.player="wm";this.speed="300";}
	return this;
}
function load_player() {
	container=document.getElementById('ajax_player_div');
	if (files.Media_Type=="Audio"/*&&(Co_Options.local_network||Co_Options.preview)*/&&files.Windows_Media.avail) {
		var wm=files.Windows_Media.FileNames.kb56;
		var fl=files.Flash.FileNames.kb300;
		files.isFlash=files.Flash.avail=true;
		fl.fileid=wm.fileid;fl.height=120;fl.width=(parseInt(wm.width) + 2);
		files.autostart=1;
		files.Flash.FileName='/images/multimedia/mediaplayer/co_media_player.beta3.swf?v=3.0.0.4';
		files.Flash.ExpressInstall=true;
		files.Flash.FlashVars='aid='+files.aid+'&iid='+wm.fileid;if(files.allow_download)files.Flash.FlashVars+='&allow_download=true';
		fl=wm=null;
		files.Flash.Version=[9,0,124];
	}
	if (files.Flash.avail&&!files.Windows_Media.avail&&files.Real.avail) {
		settings=new Object();
		settings.current=files.Flash;settings.hascookie=true;settings.current.speed=settings.current.FileNames.kb300;
		var PlayerVersion=Co_Tools.getPlayerVersion();
		var RequiredVersion=new Co_Tools.Internal.PlayerVersion(files.Flash.Version);
		if(!PlayerVersion.versionIsValid(RequiredVersion)) {no_player('noflash', true,RequiredVersion,PlayerVersion);}else if (typeof(pluginlist)!="undefined"&&pluginlist.indexOf("Flash") == -1&&ie&&win) {no_player('noflash', true);files.Flash.ExpressInstall=false;}else{files.Flash.ExpressInstall=false;}
		load_flash();
	}
	else {
		if (!settings) settings=load_cookie();if (!settings.hascookie) { if (files.Flash.avail) {settings.hascookie = true;settings={player:'flash',speed:'300'};}else {show_settings(); return; }}
		for (var obj in files) {if (files[obj].name==settings.player) {settings.current=files[obj];break;}}
		for (var obj in settings.current.FileNames) {if (settings.current.FileNames[obj].text==settings.speed) {settings.current.speed=settings.current.FileNames[obj];break}}
		if (!settings.current.avail) {var obj = settings.current.speed;switch(settings.current.name) { case "flash" : if(files.Windows_Media.avail)settings.current=files.Windows_Media; else if (files.Real.avail) settings.current=files.Real; break;case "wm" : if(files.Flash.avail)settings.current=files.Flash; else if (files.Real.avail) settings.current=files.Real; break; case "real" : if(files.Flash.avail)settings.current=files.Flash; else if (files.Windows_Media.avail) settings.current=files.Windows_Media; break; };settings.current.speed=settings.current.FileNames["kb"+obj.text];}
		if (settings.current.speed.fileid==null) {for (var obj in settings.current.FileNames) {if (settings.current.FileNames[obj].fileid!=null) {settings.current.speed=settings.current.FileNames[obj]; break;}}}
		if (typeof(pluginlist)!="undefined"){if ((pluginlist.indexOf(settings.current.FullName) == -1&&ie&&win)||!settings.current.avail) {no_player('no'+settings.current.name); return; }}
//		if (!settings.current.avail) {alert("NO PLAYER");}
		if (settings.current.name!='flash')files.isFlash=false;
		get_rootContainer().className="";
		switch (settings.current.name) { case 'wm' : load_wm();break;case 'real':load_real();break; 
		
		case 'flash' : 
			get_rootContainer().className="Flash";
			files.isFlash=true;
			var PlayerVersion=Co_Tools.getPlayerVersion();
			var RequiredVersion=new Co_Tools.Internal.PlayerVersion(files.Flash.Version);
			if(!PlayerVersion.versionIsValid(RequiredVersion)) {no_player('noflash', true,RequiredVersion,PlayerVersion);}else if (typeof(pluginlist)!="undefined"&&pluginlist.indexOf("Flash") == -1&&ie&&win) {no_player('noflash', true);files.Flash.ExpressInstall=false;}else{files.Flash.ExpressInstall=false;}
			load_flash();
		
		break;}
	}
}
function no_player(err, no_redirect,required_version,cur_version) {
	if (Request.Querystring('err')!=''||no_redirect) {
		for(var item in Co_Translations) {
			if(!Co_Player_Translations[item])Co_Player_Translations[item]=Co_Translations[item];
		}
		var err_html='';var download_link='';
		
		if(settings.current.name=="flash"&&required_version) {
			err_html+=Co_Player_Translations.GreaterVersion_Required.Replace("<<Media_PlayerName>>", settings.current.RealName) + "<br><br>";
		}
		else {
			err_html+=Co_Player_Translations.MediaPlayer_Required.Replace("<<Media_PlayerName>>", settings.current.RealName) + "<br><br>";
		}
		switch(settings.current.name) {
			case "wm": download_link='href=\"http://windowsmedia.com/download\" target=\"_blank\"';break;
			case "real": download_link='href=\"/artice.asp?aid=578435\" target=\"_blank\"';break;
			case "flash":download_link='href=\"http://macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\"';break;
		}
		err_html+=Co_Player_Translations.Download_Link_Text.Replace("<<download_link>>", download_link)+"<br><br>";
		if(settings.current.name!="flash")err_html+=Co_Player_Translations.To_Adjust_Settings+"<br><br>";
		if(settings.current.name=="flash"&&required_version){err_html+="<div style='font-size:10px;'>["+Co_Player_Translations.Current_Version+": "+cur_version.ToString()+" - "+Co_Player_Translations.Required_Version+": "+required_version.ToString()+"]</div>";}

		if (container.style.position=="absolute"){container.style.position="relative";container.style.top="0px";}
		container.innerHTML=err_html;
	}
	else {
		var new_href=document.location.href.replace((Request.isapi?'/':'&')+'err'+(Request.isapi?'/':'=')+err, '');
		new_href=new_href.replace('?err='+err, '');
		
	//	var qstring=Request.Querystring().substr(1).split('&');var s='';for (var i=0;i<qstring.length;i++) {if (qstring[i].split('=')[0]=='err') s=qstring[i];};new_href=new_href.Replace(s, '');
		if (Request.isapi) {document.location.href=new_href+'/err/'+err;} else document.location.href=new_href+(new_href.indexOf('?')==-1?'?err='+err:'&err='+err);
	}
}

function load_wm() {
  if (!isObject(settings)) return;
	var player;var plugin; 
	var hasActiveX=false;
		try{if(window.ActiveXObject) {hasActiveX = true;player = new ActiveXObject("WMPlayer.OCX.7");}else if (window.GeckoActiveXObject) {hasActiveX = true;player = new GeckoActiveXObject("WMPlayer.OCX.7");}} catch(oError) {}
		try {if(navigator.mimeTypes) player = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin;} catch (oError) {}
		var message = "Your browser "+ (hasActiveX ? "does" : " does not") +" support ActiveX. \n";
		message +=  "The WMP ActiveX control is"+ ( player ? "" : " not") +" installed. \n";
		message += "The WMP Plugin "+ (plugin ? "is" : "is not") +" installed. \n";
		
	if (player) { //player 7 is installed	
		var include_embed=true;
		if (typeof(files.Windows_Media.include_embed)!="undefined")include_embed=files.Windows_Media.include_embed;
		var args = {ID:"Player1", name:"Player1", HEIGHT:settings.current.speed.height,width:settings.current.speed.width, standby:"Loading Microsoft Windows Media Player components...", src:fullpath(), stretchToFit:"1",ShowControls:"1",ShowTracker:"1",ShowStatusBar:"1", pluginspage:"http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/",VideoBorder3D:"0",VideoBorderWidth:"0",AutoStart:files.autostart,AnimationAtStart:"1",TransparentAtStart:"1"}
		if (files.CurrentPosition) args.CurrentPosition = files.CurrentPosition;
		if (is_fx && is_mac) {args.url=fullpath();args.classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6";args.type="application/x-mplayer2";args.VideoBorder3D="0";args.VideoBorderWidth="0";args.AutoStart="1";args.AnimationAtStart="1";args.TransparentAtStart="1";args.stretchToFit="-1";}
		else if (is_fx) { args.url=fullpath();if(include_embed) args.classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6";args.type="application/x-ms-wmp";args.VideoBorder3D="0";args.VideoBorderWidth="0";args.AutoStart="1";args.AnimationAtStart="1";args.TransparentAtStart="1";args.stretchToFit="-1";}
		else if (is_mac) { args.classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95";args.FileName=fullpath();args.type="video/x-ms-asf-plugin";args.stretchToFit="-1" }
		else if (navigator.appName == "Netscape" && navigator.userAgent.indexOf('/7') == -1 && !is_chrome) { document.writeln('<APPLET NAME="Player1" HEIGHT="'+setting.current.speed.height+'" WIDTH="'+settings.current.speed.width+'" CODE="WMPNS.WMP">');document.writeln('</APPLET>'); } 
		else {args['URL']=fullpath();args['CLASSID']="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6";args['type']="application/x-mplayer2";}
		if (!is_fx) include_embed = true;
		
		insert_activeX(args, include_embed, null, container);
		
		if (settings.caption) {container.innerHTML+='<DIV style="width:300; height:75; background-color:black;" id="CapText" align="Center"></DIV>';}
		window.onload = function() {
			if (settings.caption) {document.getElementById('Player1').closedCaption.captioningID = "CapText";document.getElementById('Player1').closedCaption.SAMIFileName = settings.caption;}
			if (!document.getElementById('Player1').url) document.getElementById('Player1').URL = fullpath();
			if ((files.CurrentPosition||0)>0) { document.getElementById('Player1').controls.currentPosition = files.CurrentPosition;}
		}
		resizeFull = function() {var player_obj=(is_fx?get_player('Player1'):document.getElementById('Player1'));if (player_obj.playState == 3) player_obj.fullscreen = 'true'; else alert("The video clip must be started before you can set it to full screen mode."); }
	}
	else {// media 7 not installed
		if (settings.current.speed.height = 63) settings.current.speed.height = 80;
		var html='';
		html+='<OBJECT ID="Player1" WIDTH="'+settings.current.speed.width+'" HEIGHT="'+settings.current.speed.height+'" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">';
		html+='<PARAM NAME="FileName" VALUE="'+fullpath()+'">';html+='<PARAM NAME="ID" VALUE="Player1">';
		html+='<PARAM NAME="ShowControls" VALUE="1">';html+='<PARAM NAME="ShowDisplay" VALUE="0">';
		html+='<PARAM NAME="ShowStatusBar" VALUE="1">';html+='<PARAM NAME="AutoSize" VALUE="1">';
		if (files.CurrentPosition) {html+='<PARAM NAME="CurrentPosition" VALUE="'+files.CurrentPosition+'">';}
		html+='<Embed id=Player1 type="video/x-ms-asf-plugin" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"';
		html+=' filename="'+fullpath()+'"';html+=' src="'+fullpath()+'"';
		html+=' Name=Player1';html+=' ShowControls=1';
		html+=' ShowDisplay=0';html+=' ShowStatusBar=1';
		if (files.CurrentPosition) html+=' CurrentPosition="'+files.CurrentPosition+'"';
		html+=' width="'+settings.current.speed.width+'"';html+=' height="'+settings.current.speed.height+'">';
		html+='</embed>';html+='</OBJECT>';
		if (settings.caption) {
			html+='<img src="/images/global/spacer.gif" vspace="0" width="1" hspace="0" height="4" border="0"><br>';
			html+='<div class="text"><img src="/media/images/50/PEqC502275.gif" width="14" height="11" border="0" alt="Closed Captions" align="absbottom" hspace="2">Closed Captions available. <a href="/multimedia/mediaplayer/left.asp?'+document.location.search+'&play9=true">Click here</a> to enable.<br>';
			html+='<img src="/images/global/spacer.gif" vspace="0" width="1" hspace="0" height="5" border="0"><br>';
			html+='<span style="font-size:9px;">Requires Windows Media Player 7 or later.</span></div>';
		}
		container.innerHTML=html;
		resizeFull = function() {document.getElementById('Player1').DisplaySize=3;}
	}
}
function load_real() {
  if (!isObject(settings)) return;
	var args = {id:"video1",name:"video1", CLASSID:"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA", height:settings.current.speed.height,width:settings.current.speed.width,controls:"ImageWindow", console: "Clip1", autostart:(files.autostart==1? "True":"False"), src:fullpath(), type:"audio/x-pn-realaudio-plugin"}
	var html=insert_activeX(args, true,null,null,true);
	html+='<BR>';
	var args = {id:"Controls",name:"Controls", CLASSID:"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA", height:"55",width:settings.current.speed.width, controls:"All", console: "Clip1", type:"audio/x-pn-realaudio-plugin", autostart:false};
	html+=insert_activeX(args, true,null,null,true);
	container.innerHTML=html;
	resizeFull = function() {var player_obj=(is_fx?get_player('video1'):document.getElementById('video1'));if(!player_obj.CanStop()) alert("The video clip must be started before you can set it to full screen mode."); else player_obj.SetFullScreen();}
}

function load_flash() {
  if (!isObject(settings)) return;
		var version=new Co_Tools.Internal.PlayerVersion(files.Flash.Version);
		var args = {id:"flash1", name:"flash1", CLASSID:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version.ToString(), height:settings.current.speed.height,width:settings.current.speed.width, movie:fullpath(),quality:"high",src:fullpath(),pluginspage:"http://www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash", allowScriptAccess:"always"}
		args.FlashVars="";if (settings.current.FlashVars){args.FlashVars = settings.current.FlashVars;};
		if(args.FlashVars!="")args.FlashVars+="&";
		args.FlashVars+="autostart="+(files.autostart==1);
		if (Request.Querystring('preview')!="")args.FlashVars+="&preview="+Request.Querystring('preview');
		args.FlashVars.replace("&&", "&");
		if(files.Flash.allowFullScreen) {
			args.allowFullScreen = "true";
			args.wmode="opaque";
		}
		else {
			args.wmode="transparent";
		}
		if (files.SaveLocation) args.SaveLocation = true;
		if(files.Flash.ExpressInstall){
			var player_type=(navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length);
			if(player_type)player_type="PlugIn";else player_type="ActiveX";
			args.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6";
			args.FlashVars="MMplayerType="+player_type;
			args.FlashVars+="&MMredirectURL="+escape(document.location.href+document.location.search);
			args.FlashVars+="&MMdoctitle="+escape(document.title + " - Flash Player Installation");
			
			args.height = 150;
			args.width = (args.width>310?args.width:310);
			args.src=args.movie="/images/multimedia/mediaplayer/expressInstall.swf?a=5";
			Co_Tools.AddEventListener(window, "load", OnLoad_InserFlash, [args]);
			/*
			window.real_onload=window.onload;
			window.onload = function(e) {
				container.innerHTML+=Insert_Flash(args, null, null, true);
				if(typeof(window.real_onload) == "function") {window.onload=window.real_onload;window.onload(e);}
			}
			*/
		}
		else {
			container.innerHTML+=Insert_Flash(args, null, null, true);
			if (files.Media_Type=="Flash"&&files.SaveLocation) Co_Tools.AddEventListenerEx(window, "beforeunload", player_before_unload)
		}
		resizeFull = function() {var player_obj=(is_fx?get_player('flash1'):document.getElementById('flash1'));player_obj.StopPlay();newwindow=window.open('/multimedia/mediaplayer/flash.asp?fileid='+settings.current.speed.fileid,'flash','statusbar=0,top=0,left=0,width=' + (screen.width - 13) + ',height=' + (screen.height - 40));if (window.focus) {newwindow.focus()};}
}
function OnLoad_InserFlash(args)
{
	get_rootContainer().className="Flash";
	container.innerHTML+=Insert_Flash(args, null, null, true);
}
function player_before_unload(e) {
	if(typeof(player_obj)=="undefined")player_obj=get_player("flash1");
	player_obj.SavePlayPosition();
}
var swfobject={};
swfobject.expressInstallCallback=function(){/*alert("Install Failed");*//*container.innerHTML="";load_player();*/}

function stop_play() {
	switch (settings.current.name) { case 'wm' : var player_obj=(is_fx?get_player('Player1'):document.getElementById('Player1')); player_obj.controls.stop();break;case 'real':var player_obj=(is_fx?get_player('video1'):document.getElementById('video1'));return player_obj.DoStop();break;case 'flash': var player_obj=(is_fx?get_player('flash1'):document.getElementById('flash1'));player_obj.StopPlay();break;}
}
function get_player(id)
{
  if (window.document[id]){return window.document[id];}
  if (Co_BrowserInfo.IsIE) {if (document.embeds && document.embeds[id])return document.embeds[id];}
  else {return document.getElementById(id);}
}
function show_settings() {
	var html='';
	html+='<form name="preferences" method="post" action="'+Request.script_name()+Request.Exclude("showsettings,r")+'">' +
		'<div align="left"><div class="clip-title">'+Co_Player_Translations.Choose_Preferred_Player+'</div>\n' +
  	'<div style="padding-top:7px;"><input type="radio" name="player" value="flash"'+(settings.player=='flash'? ' checked' : '')+' id="pl_f"> <label for="pl_f" style="font-weight:bold;">Flash Player</label></div>' +
	  '<div style="padding-left:23px;"><a href="http://get.adobe.com/flashplayer/" target="_blank">'+Co_Player_Translations.Download_Flash+'</a></div>' +
    '<div style="font-size:11px;"><input type="radio" name="player" value="wm"'+(settings.player=='wm'? ' checked' : '')+' id="pl_wm"><label for="pl_wm" style="font-weight:bold;"> Windows Media Player</label></div>' +
  	'<div style="padding-left:23px;"><a href="http://windowsmedia.com/download" target="_blank">'+Co_Player_Translations.Download_Windows_Media+'</a></div>\n' +
  	'<div><input type="radio" name="player" value="real"'+(settings.player=='real'? ' checked' : '')+' id="pl_r"> <label for="pl_r" style="font-weight:bold;">RealMedia Player</label></div>' +
	  '<div style="padding-left:23px;"><a href="http://www.real.com/player/index.html" target="_blank">'+Co_Player_Translations.Download_Real+'</a></div>' +
  	'<div style="padding:7px;">'+Co_Player_Translations.Note_When_Available+'</div>\n' +
  	'<div class="clip-title" style="padding-top:14px;">'+Co_Player_Translations.Choose_Connection_Speed+'</div>\n' +
		'<div style="padding-top:7px;font-size:11px;">' +
    '<input type="radio" name="Speed" value="56"'+(settings.speed=='56'? ' checked' : '')+' id="sp_56"><label for="sp_56" style="font-weight:bold;"> '+Co_Player_Translations["56K_Dialup"]+'</label><br>\n<input type="radio" name="Speed" value="100"'+(settings.speed=='100'? ' checked' : '')+' id="sp_100"><label for="sp_100" style="font-weight:bold;"> '+Co_Player_Translations["100K_Low_Broadband"]+'</label><br>\n<input type="radio" name="Speed" value="300"'+(settings.speed=='300'? ' checked' : '')+' id="sp_300"><label for="sp_300" style="font-weight:bold;"> '+Co_Player_Translations["300K_High_Broadband"]+'</label></div>\n' +
  	'<div align="right" style="padding-top:7px;">';
  if (Request.Querystring("start").toLowerCase() != "true") {
  	html+='<input type="submit" value=" '+Co_Player_Translations.Save_And_Play+' " name="submit" class="form-button"'
		if (!cookieSupport()) html+=' onclick="this.form.onsubmit=function(){return false;};save_settings();return false;"';
		html+='>&nbsp;&nbsp;';
		if (settings.hascookie) {
			html+='<input type="submit" value=" '+Co_Player_Translations.Cancel+' " name="submit" class="form-button"';
			if (!cookieSupport()) html+=' onclick="this.form.onsubmit=function(){return false;};cancel();return false;"';
			html+='>';
		}
	}
  else {
  	html+='<input type="submit" value=" '+Co_Player_Translations.Save_And_Play+' " name="submit" class="form-button">';
	}
  html+='</div></div>' +
	'</form>';
	if (container) {
		if (container.style.position=="absolute"){container.style.position="relative";container.style.top="0px";container.parentNode.style.height="";container.style.height="";}
	container.innerHTML=html;if (container.parentNode.parentNode.nextSibling) {tools_container=container.parentNode.parentNode.nextSibling.firstChild;tools_container.innerHTML='';}} else document.writeln(html);
} 
function cancel() {
	load_player();tools_container=container.parentNode.parentNode.nextSibling.firstChild;player_tools();
}

function save_settings(pl, sp) {
	var player, speed;
	try{
		var frm=document.forms.preferences;
		player=get_selectedOption(frm.player);if (player!=-1) {player=frm.player[player].value;settings.player=player;"player="+player;} else player="";
		speed=get_selectedOption(frm.Speed);if (speed!=-1) {speed=frm.Speed[speed].value;settings.speed=speed;"speed="+speed;} else speed="";
	}
	catch(e){}
	if (typeof(pl)!="undefined"){settings.player=pl;player="player="+pl;}if (typeof(sp)!="undefined"){settings.speed=sp;speed="speed="+sp;}
	var cookie=player + "&" + speed + "&new=true";;if (cookie.length==1)cookie="";if (cookie.indexOf('&')==0)cookie=cookie.substr(1);
	settings.hascookie=(cookie.length>1);var expires=new Date();expires.setMonth(expires.getMonth()+1);
	SetCookie("MediaPlayer", cookie, expires,"/");
	if (container.style.position=="relative"){container.style.position="absolute";container.style.top="-55px";container.parentNode.style.height="60";container.style.height="60px";}
	container.innerHTML="";
	try {
		tools_container=get_rootContainer().parentNode.parentNode.nextSibling.firstChild;tools_container.innerHTML="";
	}
	catch (e) {tools_container = null;}
	load_player();if (tools_container != null) player_tools();
	return false;
}
function get_selectedOption(fld) {
	for (var i=0;i<fld.length;i++) if (fld[i].checked) return i;
	return -1;
}
function get_rootContainer()
{
	if (container.parentNode.id=="js_player_container")
	{
		return container.parentNode;
	}
	return container;
}

//Browser Cookie Functions
function getCookieVal (offset) {var endstr = document.cookie.indexOf (";", offset);if (endstr == -1) endstr = document.cookie.length;return unescape(document.cookie.substring(offset, endstr));}
function FixCookieDate (date) {var base = new Date(0);var skew = base.getTime(); /* dawn of (Unix) time - should be 0 */ /* Except on the Mac - ahead of its time */ if (skew > 0) date.setTime (date.getTime() - skew); }
function GetCookie (name) {var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while (i<clen){var j=i+alen;if (document.cookie.substring(i,j)==arg)return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if (i==0) break;}return null;}
function SetCookie (name,value,expires,path,domain,secure) {document.cookie = name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");}
function DeleteCookie (name,path,domain) {if (GetCookie(name)) { document.cookie = name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
//End Browser Cookie Functions

function cookieSupport() {
	if (!settings.hascookie) return false;
	if (GetCookie("MediaPlayer")) return true;
	return false;
}
if (typeof(LoadPlayer)=="function") {LoadPlayer();}


//document.onclick = window.onload = function() {
//alert(get_player("video1").GetPosition()) //real player
//alert(get_player("Player1").CurrentPosition) //windows media - not working.
//}