// This function receives an integer from the buttons above and resets the current 
//	position of the file to that marker.
function seektomarker(iWhichMarker){
    if ((navigator.userAgent.indexOf("IE") > -1) && (navigator.platform == "Win32")) {
	// This is an error handler.  If the user tries to scan to a marker which doesn't
	//     exist, the player will pop an error message.  By using this code, we
	//     can create a custom error message.
	if (iWhichMarker <= document.mediaplayer.MarkerCount) {
		// This resets the current marker in the file.
		document.mediaplayer.CurrentMarker = iWhichMarker;
	} else {  
		alert("This index doesn't exist.");
	}
    } else {
	if (iWhichMarker <= document.mediaplayer.GetMarkerCount()) {
		document.mediaplayer.SetCurrentMarker(iWhichMarker);
	} else {
		alert("This index doesn't exist.");
	}

    }
}

function set (newfile) {
if (sBrowser == "IE") {
mediaplayer.AutoStart = true;
mediaplayer.Filename = newfile + '.asx';
} else {
document.mediaplayer.SetAutoStart(true);
document.mediaplayer.SetFilename(newfile + '.asx');
}
}

function stop(){
	document.mediaplayer.Stop(); 
	if (sBrowser == "IE"){
		document.mediaplayer.CurrentPosition=0;
	} else {
		document.mediaplayer.SetCurrentPosition(0);
	}
}

var playerStatus;

function pause(){
     if (sBrowser == "IE"){
		 playerStatus =  document.mediaplayer.playState;
	 } else {
		 playerStatus = document.mediaplayer.GetPlayState();
	 }

	 if (playerStatus == 1) {
    	document.mediaplayer.Play();
  	 } 
  	 else if (playerStatus == 2) {
    	document.mediaplayer.Pause();
	 }
}

function play(){
	document.mediaplayer.Play(); 
}

//     Browser sniff -- check and rates the 
//     browser as either Internet Explorer on a Win32 platform or not, so that we 
//     know to use the ActiveX model, or the plug-in Model.


    var sBrowser = navigator.userAgent;  
if ((sBrowser.indexOf("IE") > -1) && (navigator.platform == "Win32"))
{
	sBrowser = "IE";
} else {
	sBrowser = "nonIE";
}

// 		end browser sniff
                  
