// contents
// player controls, get marker numbers & current marker, 
// image rotator, text rotator, auto play, & image rollovers
function writespeed(volumeis) {
	var cookiefull=document.cookie;
	var cookieArray = cookiefull.split(";");
	var jb = cookieArray.length;
	var speedb="speed=";
	for (var ib=0; ib < jb; ib++) {
		if (cookieArray[ib].search(speedb)!=-1) {
			var speedis=cookieArray[ib].replace(speedb, "")
		document.write("<OBJECT ID=Player width=320 height=240 CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 BORDER=0 STANDBY=Loading... TYPE=application/x-oleobject>")
		document.write("<PARAM NAME=URL VALUE=_video_"+speedis+".asx>")
		document.write("<PARAM NAME=uiMode VALUE=none>")
		document.write("<PARAM NAME=Volume VALUE="+volumeis+"></OBJECT>")
			break;
			}
		}
	}

function audiospeed(volumeis) {
	var cookiefulla=document.cookie;
	var cookieArraya = cookiefulla.split(";");
	var ja = cookieArraya.length;
	var speeda="speed=";
	for (var ia=0; ia < ja; ia++) {
		if (cookieArraya[ia].search(speeda)!=-1) {
			var speedisa=cookieArraya[ia].replace(speeda, "")
			if (speedisa=="56") {
				var speedaudio="_56"; }
			else {	var speedaudio=""; }
		document.write("<OBJECT ID=Player width=0 height=0 CLASSID=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 BORDER=0 STANDBY=Loading... TYPE=application/x-oleobject>")
		document.write("<PARAM NAME=URL VALUE=_audio"+speedaudio+".asx>")
		document.write("<PARAM NAME=uiMode VALUE=none>")
		document.write("<PARAM NAME=Volume VALUE="+volumeis+"></OBJECT>")
			break;
			}
		}
	}
	
var pageLine = "";

// Player controls: case sensitive
	function Play()
		{ Player.controls.play(); 	}
   	function Stop()
   		{ Player.controls.stop(); }
   	function Pause()
   		{ Player.controls.pause(); }
// 	function Rewind()
// 		{ Player.controls.fastReverse(); }
// 	function Fwd()
// 		{ Player.controls.fastForward(); }
   	function Prev()
   		{ Player.controls.previous(); 
		Player.controls.play(); }
   	function Next()
   		{ Player.controls.next(); }
   	function PlayItem()
   		{ Player.controls.playItem(); }
   	function CurrentItem()
   		{ Player.controls.currentItem(); }
   	function CurrentMarker()
   		{ Player.controls.currentMarker(); }
   	function CurrentPosition()
   		{ Player.controls.currentPosition(); }
   	function CurrentPosStr()
   		{ Player.controls.currentPositionString(); }

		
		
	function Rewind()
	{
		var currentMarker = document.Player.controls.currentMarker;
		if(currentMarker > 1)
		{
			document.Player.controls.currentMarker = currentMarker - 1;
			document.Player.controls.play();
		}
	}
	
	function Fwd()
	{
		var markerCount = document.Player.currentMedia.markerCount;
		var currentMarker = document.Player.controls.currentMarker;
		if(currentMarker < markerCount)
		{
			document.Player.controls.currentMarker = currentMarker + 1;
			document.Player.controls.play();
		}
	}
			
	function Mute() {
	    if (navigator.appName=="Netscape") {
	        if (document.Player.GetMute()=="0") {
	            document.Player.SetMute(1);
	        } else if (document.PlayerGetMute()=="1") {
	            document.Player.SetMute(0);
	        }
	    } else {
	        if (document.Player.Mute==0) {
	            document.Player.Mute = 1;
	        } else if (document.Player.Mute==1) {
	            document.Player.Mute = 0;
	        }
	    }
	}
	
// Get Marker Numbers

function SetSectionPagesNavigation()
{
var markerCount = document.Player.currentMedia.markerCount;
	pageLine = "";
	j=0;
	for (i=1; i<=markerCount; i++)
	{
	var JumpName = Player.currentMedia.getMarkerName(i);
		if(isNaN(JumpName)) {
 			j++; 
			pageLine = pageLine + "&nbsp;<a class=ScreenTextLink href='javascript:getMarker(" + i + ")'>" + j + "</a>&nbsp; |";
		}
	}
		document.all.section_nav.innerHTML = pageLine;
}

// Get Current Marker
function getMarker(num)
{
	document.Player.controls.currentMarker = num;
	document.Player.controls.play();
}
		
// Browsercheck
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()

// Image rotator
var bControl;
var imgArr = new Array();
imgArr[0] = new Image();
imgArr[1] = new Image();
imgArr[2] = new Image();
imgArr[3] = new Image();

imgArr[0].src = "images/clr.gif";
imgArr[1].src = "images/fp.gif";
imgArr[2].src = "images/ar.gif";
imgArr[3].src = "images/qt.gif";



// Auto-play
function loader(){
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) {
		bControl = true;
	} else {
		var plugIn = document.Player;
		bControl = false;
		document.appObs.setByProxyDSScriptCommandObserver(plugIn,true); // listen for ScriptCommand Event	
	}
	document.Player.Play(); 
}

// Browser/Platform Compatibility and other Requirements
// This code will work with Internet Explorer 4+ and Netscape Navigator 4+ on the Win32 platform. 
    if ( navigator.appName == "Netscape" ) 
    {
         //-- This next line ensures that any plugins just installed are updated in the Browser
         //-- without quitting the browser.
        navigator.plugins.refresh();
         // We don't need the APPLET within IE, and APPLET is treated as an implied
         // end to the OBJECT tag by the IE HTML parser.
         // ***Please note that if you do not need to script events, you can safely remove the next two lines
        document.write("\x3C" + "applet MYSCRIPT Code=NPDS.npDSEvtObsProxy.class" )
        document.writeln(" width=5 height=5 name=appObs\x3E \x3C/applet\x3E")
	    document.write("<font size=2 face=verdana,arial>Click inside the Windows Media Player to start the streaming file.</font>");
     }

// top image rollovers
if (document.images) {            
  backon = new Image();   backon.src = "images/back_on.gif"; 
  backoff = new Image();  backoff.src = "images/back_off.gif";
  ffwdon = new Image();   ffwdon.src = "images/ffwd_on.gif"; 
  ffwdoff = new Image();  ffwdoff.src = "images/ffwd_off.gif";
  helpon = new Image();   helpon.src = "images/help_on.gif"; 
  helpoff = new Image();  helpoff.src = "images/help_off.gif";
  nexton = new Image();   nexton.src = "images/next_on.gif"; 
  nextoff = new Image();  nextoff.src = "images/next_off.gif";
  pauseon = new Image();   pauseon.src = "images/pause_on.gif"; 
  pauseoff = new Image();  pauseoff.src = "images/pause_off.gif";
  playon = new Image();   playon.src = "images/play_on.gif"; 
  playoff = new Image();  playoff.src = "images/play_off.gif";
  rwdon = new Image();   rwdon.src = "images/rwd_on.gif"; 
  rwdoff = new Image();  rwdoff.src = "images/rwd_off.gif";
  stopon = new Image();   stopon.src = "images/stop_on.gif"; 
  stopoff = new Image();  stopoff.src = "images/stop_off.gif";
  muteon = new Image();   muteon.src = "images/mute_on.gif"; 
  muteoff = new Image();  muteoff.src = "images/mute_off.gif";
  aon = new Image();   aon.src = "images/a_on.gif"; 
  aoff = new Image();  aoff.src = "images/a_off.gif";
  bon = new Image();   bon.src = "images/b_on.gif"; 
  boff = new Image();  boff.src = "images/b_off.gif";
  con = new Image();   con.src = "images/c_on.gif"; 
  coff = new Image();  coff.src = "images/c_off.gif";
  don = new Image();   don.src = "images/d_on.gif"; 
  doff = new Image();  doff.src = "images/d_off.gif";
}
function imgOn(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "on.src");       
    }
}
function imgOff(imgName) {
    if (document.images) {
        document[imgName].src = eval(imgName + "off.src");
    }
}

// more rollover junk
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_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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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];}
}