var agt=navigator.userAgent.toLowerCase();
var bIE=(navigator.appName.indexOf("Internet",0)!=-1)?true:false;
var bNN4=document.layers;
var bNN=(navigator.appName.indexOf("Netscape",0)!=-1)?true:false;
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );


function Player(doc,format,playerURL,width,imagewindow,imagewindowheight,controlpanel,controlpanelheight,status,statusheight,writePlayer) {

	this.doc=doc;
	this.format=format;
	this.playerURL=playerURL;
	this.width=width;
	this.imagewindow=imagewindow;
	this.imagewindowheight=imagewindowheight;
	this.controlpanel=controlpanel;
	this.controlpanelheight=controlpanelheight;
	this.status=status;
	this.statusheight=statusheight;
	this.writePlayer=writePlayer;
	this.strPlayer="";
	this.intLiveTimestamp = null;
	
	var d=this.doc;

	if(this.format.indexOf("rm")!=-1) {
		strStart="";
		strImagewindow="";
		strControlPanel="";
		strStatus="";
		strEnd="";
		strStart =	"<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>" ;
		if(this.imagewindow<=0 && this.controlpanel<=0 && this.status<=0) this.width=0;
		if(this.imagewindow==1 || (this.width<=0 && this.imagewindow<=0 && this.controlpanel<=0 && this.status<=0)){
			if(bNN || !is_win) strImagewindow = "<TR><TD ALIGN=middle><EMBED NAME=MEDIAPLAYER TYPE='audio/x-pn-realaudio-plugin' HEIGHT="+this.imagewindowheight+" WIDTH="+this.width+" BORDER=0 CONTROLS='ImageWindow'  SRC='" + playerURL + "'" + " PLUGINSPAGE='http://www.real.com/products/player/index.html' CONSOLE='Clip1' AUTOSTART='True' ></EMBED></TD></TR>";
			 else strImagewindow = "<TR><TD ALIGN=middle><OBJECT ID=MEDIAPLAYER classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='"+this.width+"' HEIGHT='"+this.imagewindowheight+"'><PARAM NAME='TYPE' VALUE='audio/x-pn-realaudio-plugin'><PARAM NAME='CONSOLE' VALUE='Clip1'><PARAM NAME='SRC' VALUE='" + playerURL + "'><PARAM NAME='AUTOSTART' VALUE='TRUE'><PARAM NAME='CONTROLS' VALUE='ImageWindow'></OBJECT></TD></TR>";
		}
		if(this.controlpanel==1){
			if(bNN || !is_win) strControlPanel = "<TR><TD ALIGN=middle><EMBED "+ (this.imagewindow!=1?"NAME=MEDIAPLAYER ":"")+" TYPE='audio/x-pn-realaudio-plugin' HEIGHT="+this.controlpanelheight+" WIDTH="+this.width+" BORDER=0 CONTROLS='ControlPanel'  "+(this.imagewindow!=1?"SRC='" + playerURL + "'":"") + " PLUGINSPAGE='http://www.real.com/products/player/index.html' CONSOLE='Clip1' AUTOSTART='True' ></EMBED></TD></TR>";
			else strControlPanel = "<TR><TD ALIGN=middle><OBJECT "+ (this.imagewindow!=1?"ID=MEDIAPLAYER":"")+" classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='"+this.width+"' HEIGHT='"+this.controlpanelheight+"'><PARAM NAME='TYPE' VALUE='audio/x-pn-realaudio-plugin'><PARAM NAME='CONSOLE' VALUE='Clip1'>"+(this.imagewindow!=1?"<PARAM NAME='SRC' VALUE='" + playerURL + "'>":"")+"<PARAM NAME='AUTOSTART' VALUE='TRUE'><PARAM NAME='CONTROLS' VALUE='ControlPanel'></OBJECT></TD></TR>";
		}
		if(this.status==1){
			sfieldwidth=Math.ceil((this.width*5)/10);
			pfieldwidth=this.width-sfieldwidth;
		}
		if(this.status==1){
			if(bNN || !is_win) strStatus = "<TR><TD VALIGN=top><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD VALIGN=top><EMBED "+ (this.imagewindow!=1 && this.controlpanel!=1?"NAME=MEDIAPLAYER":"")+" TYPE='audio/x-pn-realaudio-plugin' HEIGHT="+this.statusheight+" WIDTH="+sfieldwidth+" BORDER=0 CONTROLS='StatusField'" +(this.imagewindow!=1?"SRC='" + playerURL + "'":"") + " PLUGINSPAGE='http://www.real.com/products/player/index.html' AUTOSTART='True' CONSOLE='Clip1'></EMBED></TD><TD VALIGN=top><EMBED TYPE='audio/x-pn-realaudio-plugin' HEIGHT="+this.statusheight+" WIDTH="+pfieldwidth+" BORDER=0 CONTROLS='PositionField' PLUGINSPAGE='http://www.real.com/products/player/index.html' AUTOSTART='True' CONSOLE='Clip1'></EMBED></TD></TR></TABLE></TD></TR>"
			else  strStatus = "<TR><TD VALIGN=top><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD VALIGN=top><OBJECT "+ (this.imagewindow!=1 && this.controlpanel!=1?"ID=MEDIAPLAYER":"")+" classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='"+sfieldwidth+"' HEIGHT='"+this.statusheight+"'><PARAM NAME='TYPE' VALUE='audio/x-pn-realaudio-plugin'><PARAM NAME='CONSOLE' VALUE='Clip1'>"+(this.imagewindow!=1 && this.controlpanel!=1?"<PARAM NAME='SRC' VALUE='" + playerURL + "'>":"")+"<PARAM NAME='AUTOSTART' VALUE='TRUE'><PARAM NAME='CONTROLS' VALUE='StatusField'></OBJECT></TD><TD VALIGN=top><OBJECT classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='"+sfieldwidth+"' HEIGHT='"+this.statusheight+"'><PARAM NAME='TYPE' VALUE='audio/x-pn-realaudio-plugin'><PARAM NAME='CONSOLE' VALUE='Clip1'><PARAM NAME='AUTOSTART' VALUE='TRUE'><PARAM NAME='CONTROLS' VALUE='PositionField'></OBJECT></TD></TR></TABLE></TD></TR>"
		}
		strEnd="</TABLE>";
		this.strPlayer=strStart+strImagewindow+strControlPanel+strStatus+strEnd;
	} else if(this.format.indexOf("wm")!=-1) {
		pheight=((this.imagewindow==1)?this.imagewindowheight:0)+((this.controlpanel==1)?this.controlpanelheight:0)+((this.status==1)?this.statusheight:0);
		if(bNN4 || !is_win) {
			this.strPlayer ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><EMBED NAME=MEDIAPLAYER ID=MEDIAPLAYER SRC='" + playerURL + "' TYPE='application/x-mplayer2' HEIGHT="+pheight+" WIDTH="+this.width+" BORDER=0 PLUGINSPAGE='http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp' " ;
			if(this.controlpanel==1){
				this.strPlayer+="ShowControls=1  EnableTracker=1 SHOWTRACKER=1 ";			
			}
			else{
				this.strPlayer+="ShowControls=0 ";
			}
			if(this.status==1){
				this.strPlayer+="ShowStatusBar=1 ";
			}
			else{
				this.strPlayer+="ShowStatusBar=0 ";
			}
			this.strPlayer+="ShowAudioControls=0 AUTOSTART=1 AUTOSIZE=0 AnimationAtStart=0 VideoBorderWidth=0 EnableContextMenu=0></EMBED></TD></TR></TABLE>";
		} else {
			this.strPlayer ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><OBJECT NAME=MEDIAPLAYER ID=MEDIAPLAYER WIDTH="+this.width+" HEIGHT="+pheight+" 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'><Param Name='FileName' Value='" + playerURL + "'><PARAM NAME='ShowDisplay' VALUE='False'>" ;
			if(this.controlpanel==1){
				this.strPlayer+="<PARAM NAME='ShowControls' VALUE='True'><PARAM name='ShowTracker' value='True'><PARAM name='EnableTracker' value='True'> ";			
			} else{
				this.strPlayer+="<PARAM NAME='ShowControls' VALUE='False'> ";
			}
			if(this.status==1){
				this.strPlayer+="<PARAM NAME='ShowStatusBar' VALUE='True'> ";
			} else{
				this.strPlayer+="<PARAM NAME='ShowStatusBar' VALUE='False'> ";
			}
			this.strPlayer+="<PARAM NAME='Autostart' VALUE='True'><PARAM NAME='Autosize' VALUE='False'><PARAM NAME='ClickToPlay' VALUE='True'><PARAM NAME='AnimationAtStart' VALUE='True'><PARAM NAME='TransparentAtStart' Value='False'><PARAM name='VideoBorderWidth' value='True'><PARAM name='ShowAudioControls' value='True'><PARAM name='EnableContextMenu' value='False'></OBJECT></TD></TR></TABLE>";
		}
		
	}
	//alert(this.strPlayer)
	if(this.writePlayer) {
		d.writeln(this.strPlayer);
	}

}

Player.prototype.boolHasPlaylist=false; //this value is set to true if the EVENT_INFO element for audio clips is active and there are multiple audio clips in the MEDIA_URL array

Player.prototype.intGoToPosition=null; //this value is set when the setPosition function is called

Player.prototype.arrPlaylist=null; //values are clip durations, in milliseconds, ordered by MEDIA_SEQUENCE

Player.prototype.arrAudioClips=null; //values are MEDIA_URL objects taken from ep1.mediaurl array

Player.prototype.getPlaylistEntryByTotalOffset=function(intTotalOffset) {
	var intClipOffsets = 0;
	if (!this.boolHasPlaylist || !this.arrPlaylist) return 0;
	for (var i=0;i < this.arrPlaylist.length; i++) {
		intClipOffsets+=this.arrPlaylist[i];
		if (intClipOffsets>intTotalOffset) return i;
	}
	return 0;
}

Player.prototype.getOffsetModulus=function(intTotalOffset) {
	var intEntryIndex = this.getPlaylistEntryByTotalOffset(intTotalOffset);
	var intOffsetTotal = this.getLengthOfPreviousEntries(intEntryIndex);
	return intTotalOffset - intOffsetTotal;
}

Player.prototype.getLengthOfPreviousEntries=function(intEntryIndex) {
	var intClipOffsets = 0;
	if (!this.boolHasPlaylist || !this.arrPlaylist) return 0;
	for (var i=0;i < intEntryIndex; i++) {
		if (this.arrPlaylist[i] && this.arrPlaylist[i]>0) intClipOffsets+=this.arrPlaylist[i];
	}
	return intClipOffsets;
}

Player.prototype.intPlayerCurrentPositionMs = 0;
Player.prototype.getPosition=function() {
	var position = 0;
		
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER']) position = this.doc.embeds['MEDIAPLAYER'].GetPosition();
		} else {
			if(this.doc.MEDIAPLAYER) position = this.doc.MEDIAPLAYER.GetPosition();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) position = this.doc.embeds['MEDIAPLAYER'].GetCurrentPosition()*1000;
			} else {
			if(this.doc.MEDIAPLAYER) position = this.doc.MEDIAPLAYER.CurrentPosition*1000;
			}
	}
	 //subtracts the streamoffset value from the player position
	if (this.streamoffset && this.streamoffset <= position) position = position - this.streamoffset;
	
	 //this code adds the total durations for previous entries in the playlist
	if (this.boolHasPlaylist) {
		
		var tempposition = position + this.getLengthOfPreviousEntries(this.getCurrentEntry());
		//if the position changes dramatically, RealPlayer may be in transition between clips, so wait
		//call this only if the delta is large, if it is Real, and if it is not changing chapters
		if (tempposition-this.intPlayerLastPositionMs>1500 && this.format.indexOf("rm")!=-1 && this.intGoToPosition==null) { 
			tempposition = position + this.getLengthOfPreviousEntries(this.getCurrentEntry()-1);
		} else if(tempposition-this.intPlayerLastPositionMs<1500) this.intGoToPosition=position;
		position = tempposition;
	}
	
	this.intPlayerLastPositionMs = this.intPlayerCurrentPositionMs;
	this.intPlayerCurrentPositionMs = position;
	
	 //checks whether the position should be in a different playlist entry and acts accordingly
	//if (this.boolHasPlaylist && this.intGoToPosition!=null) this.setPlaylistPosition();
	
	return position;
}

Player.prototype.getPositionAbsolute=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER']) return this.doc.embeds['MEDIAPLAYER'].GetPosition();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetPosition();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return this.doc.embeds['MEDIAPLAYER'].GetCurrentPosition()*1000;
			} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.CurrentPosition*1000;
			}
	}
	return 0;
}

Player.prototype.setPlaylistPosition=function() {
	if (this.intGoToPosition==null || !this.boolHasPlaylist) return;
	var intGoToEntryIndex = this.getPlaylistEntryByTotalOffset(this.intGoToPosition);
	//alert("intGoToEntryIndex: "+intGoToEntryIndex);
	//alert("this.getCurrentEntry(): "+this.getCurrentEntry());
	
	 //if we are in the correct clip, set the position
	if (this.getCurrentEntry()==intGoToEntryIndex) {
		this.setPosition(this.intGoToPosition/1000);
		return;
	} 
	
	 // we need to change the playlist entry index
	 this.setCurrentEntry(intGoToEntryIndex);
	/*if(this.format.indexOf("rm")!=-1) {
		if (this.getCurrentEntry()>intGoToEntryIndex) this.gotoPrevEntry();
		else if (this.getCurrentEntry()<intGoToEntryIndex) this.gotoNextEntry();
	} else { //Windows Media code
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) this.doc.embeds['MEDIAPLAYER'].SetCurrentEntry(intGoToEntryIndex-0+1);
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.SetCurrentEntry(intGoToEntryIndex-0+1);
		}
	}*/
}

Player.prototype.setPosition=function(pos, idx, direction) {
	//add streamoffset to position
	if(this.streamoffset) pos=(pos/1)+(this.streamoffset/1000);
	
	if (this.boolHasPlaylist) {
		var intOffset = pos*1000;
		var intGoToEntryIndex = this.getPlaylistEntryByTotalOffset(intOffset);
		
		//this is custom fix for real player player in playlist mode. getCurrentEntry doesn't always doesn't return correct value. following code takes care of that
		if(this.format.indexOf("rm")!=-1 && idx && direction) {
			if(intGoToEntryIndex < idx){
				if(direction == "rewind" && pos==0){
					pos += this.getLengthOfPreviousEntries(idx)/1000;
				} else {
					intGoToEntryIndex = idx;
					pos += this.getLengthOfPreviousEntries(intGoToEntryIndex)/1000;
				}
			}
			intOffset = pos*1000;
		}
		
		if (this.getCurrentEntry()!=intGoToEntryIndex) {
			this.intGoToPosition = intOffset;
			//alert("setting this.intGoToPosition");
			this.setCurrentEntry(intGoToEntryIndex);
			return;
		} else {
			//if (this.getPlayerStatus()!="playing") return;
			//alert("setting position as total: "+intOffset);
			intOffsetModulus = this.getOffsetModulus(intOffset);
			//alert("setting position as modulus: "+intOffsetModulus);
			pos = intOffsetModulus/1000;
			//alert("setting position as seconds: "+pos);
			this.intGoToPosition = null;
			if(pos<1) return; //do nothing if we are near the beginning of the media file
		}
		
	}
	
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].SetPosition(pos*1000);
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.SetPosition(pos*1000);
		}
	} else {
		if (pos!=0)	{ pos = (pos*1)+.001; }
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) {
				this.doc.embeds['MEDIAPLAYER'].SetCurrentPosition(pos);
			}
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.CurrentPosition=pos;
		}
	}
}

Player.prototype.setPositionAbsolute=function(pos) {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].SetPosition(pos*1000);
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.SetPosition(pos*1000);
		}
	} else {
		if (pos!=0)	{ pos = (pos*1)+.001; }
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) {
				this.doc.embeds['MEDIAPLAYER'].SetCurrentPosition(pos);
			}
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.CurrentPosition=pos;
		}
	}
}

Player.prototype.play=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].DoPlay();
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.DoPlay();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].Play();
			} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.Play();
			}
	}
	 
}

Player.prototype.pause=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].DoPause();
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.DoPause();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].Pause();
			} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.Pause();
			}
	}
	 
}

Player.prototype.stop=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].DoStop();
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.DoStop();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].Stop();
			} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.Stop();
			}
	}
	 
}

Player.prototype.getPlayState=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].GetPlayState();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetPlayState();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].GetPlayState();
			} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.playState;
			}
	}
}

Player.prototype.getPlayerStatus=function() {
	var playerstatus="";
	var textStatus = "status";
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER']) playerstatus = this.doc.embeds['MEDIAPLAYER'].GetPlayState();
		} else {
			if(this.doc.MEDIAPLAYER) playerstatus = this.doc.MEDIAPLAYER.GetPlayState();
		}
		if(playerstatus==3){
			//playing
			textStatus = "playing";
		} else if((playerstatus==1)||(playerstatus==2)||(playerstatus==5)){
			//buffering
			textStatus = "buffering";
		} else if(playerstatus==4){
			//paused
			textStatus = "paused";
		} else if(playerstatus==0){
			//stopped
			textStatus = "stopped";;
		}
	} else if(this.format.indexOf("wm")!=-1) {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) playerstatus = this.doc.embeds['MEDIAPLAYER'].GetPlayState();
		} else {
			if(this.doc.MEDIAPLAYER) playerstatus = this.doc.MEDIAPLAYER.playState;
		}
		if(playerstatus==2){
			var pos=0;
			if(bNN4){
				if(this.doc.embeds['MEDIAPLAYER']) pos=this.doc.embeds['MEDIAPLAYER'].GetCurrentPosition()*1000;
			} else {
				if(this.doc.MEDIAPLAYER) pos=this.doc.MEDIAPLAYER.CurrentPosition*1000;
			}
			if(pos==0){
				//buffering
				textStatus = "buffering";
			} else {
				//playing
				textStatus = "playing";
			}
		} else if((playerstatus==6)){
			//buffering
			textStatus = "buffering";
		} else if(playerstatus==1){
			//paused
			textStatus = "paused";
		} else if((playerstatus==0) ||(playerstatus==8)){
			//stopped
			textStatus = "stopped";
		}
	}
	return textStatus;
}

Player.prototype.canPlay=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].CanPlay();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.CanPlay();
		}
	} 
	return false;
}

//added by Brent 2002-08-30
Player.prototype.setVolume=function(val) {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER']) this.doc.embeds['MEDIAPLAYER'].SetVolume(val);
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.SetVolume(val);
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) {
				if(val>40) this.doc.embeds['MEDIAPLAYER'].SetVolume((-1200+(val*12)));
				else this.doc.embeds['MEDIAPLAYER'].SetVolume((-10000+(val*200)));
			} 
		} else {
			if(this.doc.MEDIAPLAYER) {
				if(val==0)this.doc.MEDIAPLAYER.Volume=-10000;
				else if(val>40) this.doc.MEDIAPLAYER.Volume=(-1200+(val*12));
				else this.doc.MEDIAPLAYER.Volume=(-3000+(val*50));
			} 
		}
	}
}

//added by Brent 2002-08-30
Player.prototype.setMute=function(param) {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].SetMute(param);
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.SetMute(param);
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].SetMute(param);
			} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.Mute=param;
			}
	}
}

//added by Brent Rojas 2004-09-09
Player.prototype.getCopyright=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].GetCopyright();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetCopyright();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].GetMediaInfoString(10);
			} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetMediaInfoString(10);
			}
	}
}


//added by Brent 2002-10-25
Player.prototype.getTitle=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].GetTitle();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetTitle();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].GetMediaInfoString(8);
			} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetMediaInfoString(8);
			}
	}
}

Player.prototype.setSource=function(param) {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].SetSource(param);
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.SetSource(param);
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].SetFileName(param);
			} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.FileName = param;
			}
	}
}

Player.prototype.getTotalEntries=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].GetNumEntries();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetNumEntries();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].GetNumEntries();
		} else {
			if(this.doc.MEDIAPLAYER) return  this.doc.MEDIAPLAYER.EntryCount;
		}
	}
}

Player.prototype.getCurrentEntry=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].GetCurrentEntry();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetCurrentEntry();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].GetCurrentEntry();
		} else {
			if(this.doc.MEDIAPLAYER){
				//alert(this.doc.MEDIAPLAYER.controls)
				if((typeof this.doc.MEDIAPLAYER.GetCurrentEntry)+""!="undefined") return (this.doc.MEDIAPLAYER.GetCurrentEntry()-1);
				else return 0;
			}
		}
	}
}

Player.prototype.gotoNextEntry=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].DoNextItem();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.DoNextItem();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].DoNextItem();
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.Next();
		}
	}
}

Player.prototype.gotoPrevEntry=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  this.doc.embeds['MEDIAPLAYER'].DoPrevItem();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.DoPrevItem();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].DoPrevItem();
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.Previous();
		}
	}
}

Player.prototype.getLength=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].GetLength();
		if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.GetLength();
	} else {
		if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].Duration*1000;
		if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.Duration*1000;
	}
}

Player.prototype.setCurrentEntry=function(intEntryIndex) {
	var curEntry=this.getCurrentEntry();
	this.intGoToEntryIndex = intEntryIndex;
	if(this.format.indexOf("rm")!=-1) {
		if (curEntry>intEntryIndex) {
			for(var i=intEntryIndex;i<curEntry;i++) this.gotoPrevEntry();
		} else {
			for(var i=curEntry;i<intEntryIndex;i++) this.gotoNextEntry();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) this.doc.embeds['MEDIAPLAYER'].SetCurrentEntry(intEntryIndex-0+1);
		} else {
			if(this.doc.MEDIAPLAYER) this.doc.MEDIAPLAYER.SetCurrentEntry(intEntryIndex-0+1);
		}
	}
	return true;
}

/*

Player.prototype.canPause=function() {
	if(this.format.indexOf("rm")!=-1) {
		if(bNN){
			if(this.doc.embeds['MEDIAPLAYER'])  return this.doc.embeds['MEDIAPLAYER'].CanPause();
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.CanPause();
		}
	} else {
		if(bNN4){
			if(this.doc.embeds['MEDIAPLAYER']) return  this.doc.embeds['MEDIAPLAYER'].Duration*1000;
		} else {
			if(this.doc.MEDIAPLAYER) return this.doc.MEDIAPLAYER.Duration*1000;
		}
	}
	return false;
}

*/
