			var allowRightClick = false;
			document.onkeydown = OnKeyPress;
			
			function OnKeyPress() {
				if (document.all)
					if (event.keyCode == 192)
						allowRightClick = true;
			}
			
			function onRightClick() { return allowRightClick; }

function getcookie(cookie_name) {
if(document.cookie)
{
index = document.cookie.indexOf(cookie_name);
if (index != -1)
{
namestart = (document.cookie.indexOf("=", index) + 1);
nameend = document.cookie.indexOf(";", index);
if (nameend == -1) {nameend = document.cookie.length;}
 
return document.cookie.substring(namestart, nameend);
}
}
}

///***************///

var mediaPlayer_sniff_agt = navigator.userAgent.toLowerCase();
var mediaPlayer_sniff_is_ie   = (mediaPlayer_sniff_agt.indexOf("msie") != -1);
var mediaPlayer_sniff_is_mac    = (mediaPlayer_sniff_agt.indexOf("mac") != -1);

var hasWMP = false;
var hasRMP = false;


///****************///

if (mediaPlayer_sniff_is_ie && !mediaPlayer_sniff_is_mac) {
	document.writeln('<scr' + 'ipt language="VBScript">');
	document.writeln('	on error resume next');
	document.writeln('	hasWMP = (IsObject (CreateObject ("MediaPlayer.MediaPlayer.1")))');
	document.writeln('</scr' + 'ipt>');
}

///**************///

if(navigator.plugins) {
	for (var i = 0; i < navigator.plugins.length; i++)	{
		if ((navigator.plugins[i].name.indexOf("Windows Media Player") >= 0) || (navigator.plugins[i].name.indexOf("Windows Media Plugin") >= 0)) {
	 			pluginToTest = navigator.plugins[i];
 			for (var m = 0; m < pluginToTest.length; m++) {
				
				if((pluginToTest[m].type.indexOf('video/x-ms') >= 0) || (pluginToTest[m].type.indexOf('application/x-mplayer2') >= 0)) {
 					mimeTypeToTest = pluginToTest[m];
 					hasWMP = (mimeTypeToTest != null && mimeTypeToTest.enabledPlugin != null);
 				}
 			}
 		}
	
 	}
}


///************///

var playerVersion = '6.4'; // default to old player

///***********///

	function common_mediaplayers_getWMPVersion() {
		/*var detectionResults = detectWMP();
		var version = detectionResults.versionInfo;
		alert('detectionResults.versionInfo=' + detectionResults.versionInfo);
		*/
		
		var wmpVersionMinor = "6.4";
		var mPlayer = '';
		var wmp7 = "WMPlayer.OCX.7";
		
		try {
			if (document.all)
				mPlayer = new ActiveXObject( wmp7 );
			else if ((typeof window.GeckoActiveXObject ? true : false))
				mPlayer = new GeckoActiveXObject( wmp7 );
		  
			wmpVersionMinor = mPlayer.versionInfo;
		
		} catch (e) {
		
			//alert(e);
		}

		mPlayer = null;
		return String( wmpVersionMinor );
		
	}

	function common_mediaplayers_isPlayerSupported() {
		var version = common_mediaplayers_getWMPVersion();
		var majorVersion = parseInt(version);

		var dot1 = version.indexOf('.');
		var dot2 = version.indexOf('.', dot1+1);
		var dot3 = version.indexOf('.', dot2+1);

		var version1 = parseInt( version.substring(dot1+1, dot2) );
		var version2 = parseInt( version.substring(dot2+1, dot3) );
		var version3 = parseInt( version.substring(dot3+1, version.length) );

		if (majorVersion == 9) {
			
			if (version1 > 0 || version2 > 0 || version3 >= 2980)
				return true;
				
		} else if (majorVersion >= 6 || majorVersion < 9) {
		
			return true;
		}

		return false;
	}
	


///*********************///

	playerVersion = parseInt( common_mediaplayers_getWMPVersion() );
	if ( !common_mediaplayers_isPlayerSupported() )
		top.window.location = 'error.html';
		
	var reqRule = '';
	var reqVersion = Number('');
	
	if ( playerVersion < reqVersion )
		top.window.location = 'error.html';


/*
##########################################################################################################################
USAGE: 		
				call the mediaPlayerClass() constructor to create a new object to access the methods below

CONSTRUCTOR ARGUMENTS:

				pluginObject: name of the plugin embedded in the web page
				divtag: (optional); if you embed the player w/in a div tag, you will need to
						pass the structure for netscape support e.g. myDiv.anotherDiv.

METHODS:
				see bottom of page for complete details
				

EXAMPLE:	
				var myplayer = new mediaPlayerClass('wmp');
				myplayer.setFullscreen(true);
##########################################################################################################################
*/
	
	var mediaPlayerClass_instanceName = '';
	function mediaPlayerClass( pluginObject, instanceName, isCustom ) {
		
		mediaPlayerClass_instanceName = instanceName;
		this.ua 				= navigator.userAgent.toLowerCase();
		this.isGeckoAX 				= (this.ua.search(/\(ax/) > -1 && this.ua.search(/gecko/) > -1);
		this.axBrowser 				= ( this.isGeckoAX || typeof document.all == 'object' );
		this.plugin 				= pluginObject;
		this.isCustom				= ( parseInt(isCustom) == 1 );
		
	//	buffering code
		this.buffTimer				= null;
		this.trackBuffering 		= player_class_trackBuffering;		
		this.hasBufferStarted 		= 0;
		
	// player functionality
		this.play 					= player_class_startMediaPlayer;
		this.open 					= player_class_openFile;
		this.stop 					= player_class_stopPlayer;
		this.pause 					= player_class_pausePlayer;
		this.playNext  				= player_class_SetNextEntry;
		this.playPrevious  			= player_class_playPreviousEntry;
		this.catchErrors 			= player_class_catchErrorEvents;
		this.catchPlayStateChanges 	= player_class_catchPlayStateEvents;
		this.catchScriptEvents 		= player_class_catchScriptCommandEvents;
		this.enableContextMenu 		= player_class_enableContextMenu;
		this.throwError 			= player_class_throwError;
		this.setFileName 			= player_class_setMediaPlayerSourceFile
		
	// player properties
		this.getAutoStart 			= player_class_getAutoStart;
		this.setAutoStart 			= player_class_setAutoStart;
		this.getProtocol 			= player_class_getProtocol;
		this.getVolume 				= player_class_getVolume;
		this.setVolume 				= player_class_setVolume;
		this.incrVolume 			= player_class_increaseVolume;
		this.decrVolume 			= player_class_decreaseVolume;
		this.setMute				= player_class_setMute;
		this.setFullscreen 			= player_class_setFullscreen;
		this.setLanguage 			= player_class_setLanguage;
		this.ShowStats 				= player_class_displayStatsInfo;
		this.getCodecs				= player_class_getCodecs;
		//this.getPlayerVersion		= player_class_getWMPVersion;
		this.hasCodecs				= player_class_hasCodecs;
	
	// playlist info
		this.hasNextClipEntry 		= player_class_hasNextPlaylistEntry;
		this.setClipEntry 			= player_class_setPlaylistEntry; //wmp && ie only
		this.getClipEntry 			= player_class_getPlaylistEntry; //wmp only at this time
		this.getPlaylistTitle 		= player_class_getPlaylistMetaTitle; //wmp only at this time
		
	// get clip info
		this.getClipTitle 			= player_class_getClipTitle;
		this.getClipCopyright 		= player_class_getClipCopyright;
		this.getClipParameter 		= player_class_getClipParameter;
		this.getClipFileName 		= player_class_getFileName;
		this.getClipAuthor 			= player_class_getClipAuthor;
		this.getClipDescription 	= player_class_getClipDescription;
		this.getClipCreationDate 	= player_class_getClipCreationDate;
		this.getClipDuration 		= player_class_getClipDuration;
		this.getFramePosition 		= player_class_getPlaybackPosition;
		
	// playstate properties
		this.getPlayState 			= player_class_getPlayState;
		this.getOpenState 			= player_class_getOpenState;
		this.getPlayStateString 	= player_class_translatePlayState;
		this.isBuffering 			= player_class_isBuffering;
		this.isStopped 				= player_class_isStopped;
		this.isPaused 				= player_class_isPaused;
		this.isPlaying 				= player_class_isPlaying;
		this.isFullscreen 			= player_class_isFullscreen;
		this.getOpenStateString 	= player_class_translateOpenState;
		
	// event handlers
	// these will need to be overwritten by developers when needed; otherwise they 
	// will not have any functionality
		
		this.onBuffering 			= doNothing;
		this.onClose 				= doNothing;
		this.onContacting 			= doNothing;
		this.onError 				= doNothing;
		this.onNewSong 				= doNothing; // wmp only
		this.onPause 				= doNothing;
		this.onPlay 				= doNothing;
		this.onSeekForward 			= doNothing;
		this.onSkipForward 			= doNothing;
		this.onStop 				= doNothing;
		this.onScriptCommand 		= doNothing;
		this.onClosed 				= doNothing;
		this.onLoading 				= doNothing;
		this.onLocating 			= doNothing;
		this.onConnecting 			= doNothing;
		this.onOpening 				= doNothing;
		this.onOpen 				= doNothing;
	
	// event handlers via plugin output
		this.BufferingEvent			= player_class_bufferingEvent;
		this.ScriptCommandEvent		= player_class_scriptCommandEvent;
		this.PlayStateChangeEvent 	= player_class_playStateChangeEvent;
		this.NewSongEvent			= player_class_newSongEvent;
		this.ErrorEvent				= player_class_errorEvent;
		this.OpenStateChangeEvent 	= player_class_openStateChangeEvent;
		
	// faceplate
		this.language 				= 'us';
		this.timeCodeTimer 			= null;
		this.updateStatus 			= player_class_updateStatus;
		this.updateStatusIcon 		= player_class_updateStatusIcon;
		this.startTimeCode 			= player_class_startTimeCode;
		this.stopTimeCode 			= player_class_stopTimeCode;
		this.updateTimeCode 		= player_class_updateTimeCodeDisplay;
		this.filterTime 			= player_class_filterTimecode;
		this.getDisplayText 		= player_class_getFacePlateStatusText;
	}


//
// private api
// 
	mediaPlayerClass.classObj = null;
	mediaPlayerClass.plugin = null;




//##########################################################################################################
//
//	PLAYER CORE FUNCTIONALITY
//
//##########################################################################################################


function player_class_startMediaPlayer() {

	if (arguments.length > 0) this.setFileName(arguments[0]);
	this.plugin.Play();
}

function player_class_setMediaPlayerSourceFile(fileURL) {

	if (this.axBrowser)
		this.plugin.FileName = fileURL;
	else
		this.plugin.SetFileName(fileURL);
}

function player_class_openFile(asxURL) {

	this.plugin.Open(asxURL);
}

function player_class_stopPlayer() {

	this.plugin.Stop();
	//**************************************************************************************************************************************************************************************************
	// Nattie just added this, due to the reason that stop() don't start over again, it just does as pause() does because of the fact that this script is created for streaming technology
	mPlayer.setFileName(this.plugin.FileName); // this.plugin.FileName -> the filename that the plugin plays
	this.plugin.Stop();
	//**************************************************************************************************************************************************************************************************
}

function player_class_pausePlayer() {

	this.plugin.Pause();
}

function player_class_SetNextEntry() {

	this.plugin.Next();
}

function player_class_setPlaylistEntry(indexVal) {

//	This method was solely created for use within HTA, a feature of Internet
//	Explorer.  As such, it doesn't exist within the WMP6 Netscape plug-in.
	
	if (this.axBrowser)
		this.plugin.SetCurrentEntry(indexVal);

}

function player_class_getPlaylistEntry() {

//	This method was solely created for use within HTA, a feature of Internet
//	Explorer.  As such, it doesn't exist within the WMP6 Netscape plug-in.

	if (this.axBrowser) 
		return this.plugin.GetCurrentEntry();
}

function player_class_hasNextPlaylistEntry() {

	var hasNextSong = false;
	if(this.axBrowser) {
		
		var totalEntries = this.plugin.EntryCount;
		var currEntry = this.plugin.GetCurrentEntry();
		
	} else {
		
		//HACK HACK HACK: applet doesnt know GetEntryCount()
		// and will throw an error
		var totalEntries = 1; //this.plugin.GetEntryCount();
		var currEntry = 0; //this.plugin.GetCurrentEntry();
	}
	
	if (currEntry < totalEntries)
		hasNextSong = true;
		
	return hasNextSong;
}

function player_class_playPreviousEntry() {

	this.plugin.Previous()
}

function player_class_getAutoStart() {

	if (this.axBrowser)
		this.plugin.AutoStart;
	else
		this.plugin.GetAutoStart();
}

function player_class_setAutoStart(boolVal) {

	if (this.axBrowser)
		this.plugin.AutoStart = boolVal;
	else
		this.plugin.SetAutoStart(boolVal);
}

function player_class_setFullscreen(boolVal) {

	//dont change property if its the same as current state
	if ( this.isFullscreen() == boolVal )
		return;
	
	var displaySize = (boolVal) ? 3:0;
	
	if ( this.axBrowser )
		this.plugin.DisplaySize = displaySize;
	else
		this.plugin.SetDisplaySize(displaySize);

	//going to full screen stops the player
	this.play();
}

function player_class_setVolume(level) {

	// level should be an integer between 0 - 100
	var volLevel = Math.round(level);
	
	if (volLevel <= 0 || volLevel == '')
		return;
	
	var newVolLevel = -25 * (100 - volLevel);
	//alert('newVolLevel: ' + newVolLevel);
	if (this.axBrowser)
		this.plugin.Volume = newVolLevel;
	else
		this.plugin.SetVolume(newVolLevel);
}

function player_class_increaseVolume() {

	var currVol = this.getVolume();
	
	if (arguments.length > 1)
		volumeIncr = arguments[0];
	else
		volumeIncr = 10;
	
	var newVolume = currVol + volumeIncr;
	this.setVolume(newVolume);
	
}

function player_class_decreaseVolume() {

	var currVol = this.getVolume();

	if (arguments.length > 1)
		volumeDecr = arguments[0];
	else
		volumeDecr = -10;
	
	var newVolume = currVol + volumeDecr;
	this.setVolume(newVolume);
}

function player_class_getVolume() {

	var volume = 0;
	
	if (this.axBrowser)
		tempVolume = this.plugin.Volume;
	else
		tempVolume = this.plugin.GetVolume();
		
	volume = 100 - (tempVolume / -25);

	return volume;
}

function player_class_setMute(muteOrNot) {
	if (muteOrNot == true) {
		// this.plugin."mute function"
	}
	else {
		// this.plugin."mute function"
	}
}

function player_class_getProtocol() {

	//alert('player_class_getProtocol called');
	protocol =  this.plugin.SourceProtocol;
		
	switch (protocol) {
	
		case 1:
			// Multicasting with no control connection.
			protocol = 'Multicast';
			break;
		case 2:
			// Multicasting with control connection
			protocol = 'MulticastPlus';
			break;
		case 3:
			// User Datagram Protocol
			protocol = 'UDP';
			break;
		case 4:
			// Transmission Control Protocol
			protocol = 'TCP';
			break;
		case 5:
			// MSBD protocol. Typically used to connect directly to the encoder for test purposes
			protocol = 'MSBD';
			break;
		case 6:
			// Hypertext Transfer Protocol
			protocol = 'HTTP';
			break;
		case 7:
			// Local file playback
			protocol = 'Local';
			break;
	}
	
	return protocol;
}

function player_class_getPlaybackPosition() {
	
	var position = '';
	if (this.axBrowser)
		position = this.plugin.CurrentPosition;
	else
		position = this.plugin.GetCurrentPosition();

	return position;
}

//##########################################################################################################












//##########################################################################################################
//
//	PLAYSTATE FUNCTIONS
//
//##########################################################################################################

function player_class_getOpenState() {

	if (this.axBrowser)
		return this.plugin.OpenState;
	else	
		return this.plugin.GetOpenState();
}

function player_class_getPlayState() {

	//alert(this.axBrowser);
	if (this.axBrowser)
		return this.plugin.PlayState;
	else	
		return this.plugin.GetPlayState();
}

function player_class_translatePlayState(intPlayState) {

	var playing = 'playing';
	var contacting = 'contacting';
	var stopped = 'stopped';
	var paused = 'paused';
	var buffering = 'buffering';
	var closed = 'closed'
	var scanningForward = 'scanning forward';
	var scanningBackward = 'scanning backward';
	var skippingNext = 'skipping to next';
	var skippingPrevious = 'skipping to previous';

	var unknown = 'unknown';
	
	var state = String( intPlayState );
	
	switch (state) {
		case '0':
			return stopped;
		case '1':
			return paused;
		case '2':
			return playing;
		case '3':
			return buffering;
		case '4':
			return scanningForward;
		case '5':
			return scanningBackward;
		case '6':
			return skippingNext;
		case '7':
			return skippingPrevious;
		case '8':
			return closed;
		default:
			return unknown;
	}
}

function player_class_translateOpenState(intOpenState) {

	var closed = 'closed';
	var loading = 'loading';
	var locating = 'locating';
	var connecting = 'connecting';
	var opening = 'opening'
	var open = 'open';
	var unknown = 'unknown';
	
	var state = String( intOpenState );
	
	switch (state) {
		case '0':
			return closed;
		case '1':
			return loading;
		case '2':
			return loading;
		case '3':
			return locating;
		case '4':
			return connecting;
		case '5':
			return opening;
		case '6':
			return open;
		default:
			return unknown;
	}
}

function player_class_isPlaying() {

	var playState = this.getPlayStateString( this.getPlayState() );
	return (playState == "playing");
}

function player_class_isStopped() {

	var playState = this.getPlayStateString( this.getPlayState() );
	return (playState == "stopped");
}

function player_class_isPaused() {

	var playState = this.getPlayStateString( this.getPlayState() );
	return (playState == "paused");
}

function player_class_isBuffering() {

	var playState = this.getPlayStateString( this.getPlayState() );
	return (playState == "buffering");
}


function player_class_isFullscreen() {

	if (this.axBrowser)
		var displaySize = this.plugin.DisplaySize;
	else
		var displaySize = this.plugin.GetDisplaySize();
	
	return (displaySize == 3);
}

//##########################################################################################################









/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// start media player init/setup functions

function player_class_catchPlayStateEvents(boolVal) {

	if (!this.axBrowser) {
		
		document.appObs.setByProxyDSPlayStateChangeObserver(this.plugin, boolVal);
		document.appObs.setByProxyDSNewStreamObserver(this.plugin, boolVal);
	}
	
} 

function player_class_catchErrorEvents(boolVal) {

	boolVal = true;
	if (this.axBrowser) {

		this.plugin.SendWarningEvents = boolVal;
		this.plugin.SendErrorEvents = boolVal;

	} else {
			
		document.appObs.setByProxyDSWarningObserver(this.plugin, boolVal);
		document.appObs.setByProxyDSErrorObserver(this.plugin, boolVal);
	}
	
}

function player_class_catchScriptCommandEvents(boolVal) {
	
	if (!this.axBrowser)
		document.appObs.setByProxyDSScriptCommandObserver(this.plugin, boolVal);
}

function player_class_enableContextMenu(boolVal) {

	if (this.axBrowser)
		this.plugin.EnableContextMenu = boolVal;
	else
		this.plugin.EnableContextMenu(boolVal);
}

// end media player init/setup functions
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////













//##########################################################################################################
//
//	PLAYLIST/MEDIA INFO FUNCTIONS
//
//##########################################################################################################

function player_class_getClipDescription() {

	var clipDescription = String( this.plugin.GetMediaInfoString(12) );
	return clipDescription.replace(/\0/g, '');
}

function player_class_getFileName() {

	var clipFileName = String( this.plugin.GetMediaInfoString(0) );
	return clipFileName.replace(/\0/g, '');
}

function player_class_getClipTitle() {

	var clipTitle = String( this.plugin.GetMediaInfoString(8) );
	return clipTitle.replace(/\0/g, '');
}

function player_class_getClipAuthor() {

	var clipAuthor = String( this.plugin.GetMediaInfoString(9) );
	return clipAuthor.replace(/\0/g, '');
}

function player_class_getClipCopyright() {

	var clipCopyright = String( this.plugin.GetMediaInfoString(10) );
	return clipCopyright.replace(/\0/g, '');
}

function player_class_getClipParameter(entryIndex, paramName) {

	var paramValue = String( this.plugin.GetMediaParameter(entryIndex, paramName) );
	return paramValue.replace(/\0/g, '');
}

function player_class_getPlaylistMetaTitle() {

	var title = String( this.plugin.GetMediaInfoString(1) );
	return title.replace(/\0/g, '');
}

function player_class_getClipDuration() {
	
	var duration = -1;
	
	if (this.axBrowser)			
		duration = new String( this.plugin.Duration );
	else			
		duration = new String( this.plugin.GetDuration() );

	return duration.replace(/\0/g, '');
}

function player_class_getClipCreationDate() {
	
	var date;
	if (this.axBrowser)			
		date = new String( this.plugin.CreationDate );
	else			
		date = new String( this.plugin.GetCreationDate() );
	
	return date.replace(/\0/g, '');
}

//##########################################################################################################










//##########################################################################################################
//
//	EVENT HANDLERS
//
//##########################################################################################################


function doNothing() {

	//this is a required function, really it is!!
}



function player_class_throwError(errCode, errDescription, caller) {
	
	this.onError(errCode, errDescription);
}

//// functions below are called directly from the media player script event handlers
function player_class_errorEvent() {
	
	if (this.axBrowser) {
	
		errCode = this.plugin.ErrorCode;
		errDescription = this.plugin.ErrorDescription;

	} else {

		errCode = this.plugin.GetErrorCode();
		errDescription = this.plugin.GetErrorDescription();
	}
	
	this.throwError( String( errCode ), String( errDescription ), 'player_class_errorEvent()');
}


//
//	BUFFERING CODE
//


// wmp seems to not throw this event thru the playStateChange event but it throws it directly from
// its buffer event handler; so we catch it here + pass it to the normal event handler

	function x( thisX, time ) {
		
		if ( this.z == 1 ) {
			var i = 0;
			while ( i < time ) {
		
				eval(thisX);
				i++;
			}
		}
	}
	
	function player_class_bufferingEvent(bStart) {
		
		if (bStart && !this.hasBufferStarted) {
			
			this.updateStatusIcon( 'buffering' );
			this.hasBufferStarted = 1;
			this.buffTimer = window.setInterval( mediaPlayerClass_instanceName + '.trackBuffering()', 350 );
			
		} else if (!bStart) {
			
			this.hasBufferStarted = 0;
			window.clearInterval( this.buffTimer );
			this.PlayStateChangeEvent(); // manually throw this because the player doesnt throw a playStateChange
		}
		this.onBuffering(bStart);
	}
	
	function player_class_trackBuffering() {
	
		var buffering, bufferProgress;

		if (this.axBrowser)
			bufferProgress = Number( this.plugin.BufferingProgress );
		else
			bufferProgress = Number( this.plugin.GetBufferingProgress() );
				
		if (bufferProgress >= 100) {

			window.clearInterval( this.buffTimer );
			return;
		}
			
		buffering = this.filterTime(bufferProgress) + '/100%';
			
		this.updateStatus( this.getDisplayText('buffering') + ' : ' + buffering);
	}
	

function player_class_newSongEvent() {
	// this may be called before mediaPlayer object is created, e.g. wmp
	
	if (this == null) return;
	this.onNewSong();
}

function player_class_playStateChangeEvent(newState) {
	
	var newState = String( this.getPlayState() );
	var actualState = this.getPlayStateString( newState );
	var translatedActualState = this.getDisplayText(actualState);
	//output('player_class_playStateChangeEvent(' + newState + ') called: ' + actualState);
	
	/*
		0 = mpStopped : Playback is stopped. 
		1 = mpPaused : Playback is paused. 
		2 = mpPlaying : Stream is playing. 
		3 = mpWaiting : Waiting for stream to begin; not used
		4 = mpScanForward : Stream is scanning forward; not used
		5 = mpScanReverse : Stream is scanning in reverse; not used
		6 = mpSkipForward : Skipping to next
		7 = mpSkipReverse : Skipping to previous; not used
		8 = mpClosed : Stream is not open; not used
		10 = mpReady: player is ready to play a file (wmp 7.x)
	*/
	
	switch (newState) {

		case '0':
			this.stopTimeCode();
			this.updateStatus( translatedActualState );
			this.updateStatusIcon( actualState );
			// mediaPlayer_OnStop();
			this.onStop();
			break;
		case '1':
			this.updateStatus( translatedActualState );
			this.updateStatusIcon( actualState );
			//mediaPlayer_OnPause();
			this.onPause();
			break;
		case '2':
			this.startTimeCode();
			//mediaPlayer_OnPlay();
			this.onPlay();
			break;
		case '3':
		// onBuffering event will handle the display of this state
			//mediaPlayer_OnBuffering();
			this.onBuffering();
			break;
		case '4':
			//mediaPlayer_OnSeekForward();
			this.onSeekForward();
			break;
		case '5':
			mediaPlayer_OnSeekReverse();
			break;
		case '6':
			//mediaPlayer_OnSkipForward();
			this.onSkipForward();
			break;
		case '7':
			mediaPlayer_OnSkipReverse();
			break;
		case '8':
			this.updateStatus( translatedActualState );
			this.updateStatusIcon( actualState );
			//mediaPlayer_OnClose();
			this.onClose();
			break;
		case '10':
			this.updateStatus( translatedActualState );
			this.updateStatusIcon( actualState );
			//mediaPlayer_OnContacting();
			this.onContacting();
			break;
		default:
			break;
	}
	
	//this.updateStatusIcon( actualState );
}


function player_class_openStateChangeEvent(openState) {
	
	var newState = String( this.getOpenState() );
	var actualState = this.getOpenStateString( newState );
	var translatedActualState = this.getDisplayText(actualState);
	//output('player_class_openStateChangeEvent(' + newState + ') called: ' + actualState);
	
	/*
		0 = nsClosed : Content file is closed
		1 = nsLoadingASX : Loading a Windows Media metafile
		2 = nsLoadingNSC : Loading an .nsc station file
		3 = nsLocating : Locating the server
		4 = nsConnecting : Connecting to the server
		5 = nsOpening : Opening or listening for the stream
		6 = nsOpen : Content file is open
	*/
	
	switch (newState) {

		case '0':
			this.updateStatus( translatedActualState );
			this.updateStatusIcon( actualState );
			//mediaPlayer_OnClose();
			this.onClose();
			break;
		case '1':
			//mediaPlayer_OnLoading();
			this.onLoading();
			break;
		case '2':
			//mediaPlayer_OnLoading();
			this.onLoading();
			break;
		case '3':
			//mediaPlayer_OnLocating();
			this.onLocating();
			break;
		case '4':
			this.updateStatus( translatedActualState );
			this.updateStatusIcon( actualState );
			//mediaPlayer_OnConnecting();
			this.onConnecting();
			break;
		case '5':
			this.updateStatus( translatedActualState );
			this.updateStatusIcon( actualState );
			//mediaPlayer_OnOpening();
			this.onOpening();
			break;
		case '6':
			//mediaPlayer_OnOpen();
			this.onOpen();
			break;
		default:
			break;
	}
}


//// some functions below are called from the above event handler functions
//
// NOTE TO DEVELOPERS:
// these function below will doNothing() unless overwritten
// w/in the client-side code
/*
	example:
	
	function myNewOnPlayFunction() {
		[ do some stuff ]
	}
	mPlayer.onPlay = myNewOnPlayFunction;
*/


function mediaPlayer_OnBuffering(bStart) { this.onBuffering(bStart); }

function mediaPlayer_OnClose() { this.onClose(); }

function mediaPlayer_OnContacting() { this.onContacting(); }

function mediaPlayer_OnPause() { this.onPause(); }

function mediaPlayer_OnPlay() { this.onPlay(); }

function player_class_scriptCommandEvent(sType, sParam) { this.onScriptCommand(sType, sParam); }

function mediaPlayer_OnSeekForward() { this.onSeekForward(); }

function mediaPlayer_OnSkipForward() { this.onSkipForward(); }

function mediaPlayer_OnStop() { this.onStop(); }

function mediaPlayer_OnLoading() { this.onLoading(); }

function mediaPlayer_OnLocating() { this.onLocating(); }

function mediaPlayer_OnConnecting() { this.onConnecting(); }

function mediaPlayer_OnOpening() { this.onOpening(); }

function mediaPlayer_OnOpen() { this.onOpen(); }

//##########################################################################################################









//##########################################################################################################
//
//	CUSTOM FACEPLATE
//
//##########################################################################################################


	function player_class_setLanguage(countryPrefix) {
	
		if (countryPrefix != '') this.language = countryPrefix;
	}

	function player_class_updateStatus( what ) {
		
		if ( !this.isCustom ) return;
		
		var text = what.substring(0,1).toUpperCase() + what.substring(1, what.length);
		if (document.all) status_display.innerHTML = text;
		else document.getElementById('status_display').innerHTML = text;
	}
	
	function player_class_updateStatusIcon(playState) {
		
		if ( !this.isCustom ) return;
		
		var imgObj = eval( 'img_' + playState.toLowerCase() );
		document.images['status_icon'].src = imgObj.src;
	}

	var img_buffering = new Image();
		img_buffering.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422184619/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_buffering.gif';
	var img_playing = new Image();
		img_playing.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422184807/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_playing.gif';
	var img_aborting = new Image();
		img_aborting.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422210619/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_aborting.gif';
	var img_connecting = new Image();
		img_connecting.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422184133/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_connecting.gif';
	var img_opening = new Image();
		img_opening.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422184133/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_opening.gif';
	var img_paused = new Image();
		img_paused.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422184718/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_paused.gif';
	var img_stopped = new Image();
		img_stopped.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422210626/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_stopped.gif';
	var img_closed = new Image();
		img_closed.src = 'http://a1568.g.akamai.net/7/1568/1600/20030422210626/launchtoday.launch.yahoo.com/common/resources/images/wmp_faceplate/img_closed.gif';


//
// TIMECODE
//

	function player_class_startTimeCode() {
		
		if ( this.timeCodeTimer != null )
			this.stopTimeCode();
		this.updateTimeCode();
		this.updateStatusIcon( 'playing' );
		this.timeCodeTimer = window.setInterval(mediaPlayerClass_instanceName + '.updateTimeCode()', 900);
	}
	
	function player_class_stopTimeCode() {
		
		if ( this.timeCodeTimer != null )
			window.clearInterval( this.timeCodeTimer );
		this.timeCodeTimer = null;
	}
	
	function player_class_updateTimeCodeDisplay() {
		
		if ( !this.isPlaying() || this.hasBufferStarted ) {
			this.stopTimeCode();
			return;
		}
		
		var duration = this.getClipDuration();
			duration = this.filterTime( parseInt(duration/60) ) + ':' + this.filterTime( parseInt(duration%60) );
		
		var currTime = this.getFramePosition();
			currTime = this.filterTime( parseInt(currTime/60) ) + ':' + this.filterTime( parseInt(currTime%60) );
		
		this.updateStatus( this.getDisplayText('playing') + ' ' + currTime + ' / ' + duration);
	}
	
	function player_class_filterTimecode(what) {
		
		if (isNaN(what) || what < 0) what = 0;
		var time = new String(what);
		if (time.length < 2) time = '0' + time;
		return time;
	}
	
	function player_class_displayStatsInfo() {
		this.plugin.ShowDialog(1);
	}
	
	function player_class_getFacePlateStatusText(status) {
		 
		var lang = this.language;
		switch(lang) {
		
		// ITALIAN
			case 'it':
				switch(status) {
				
					case 'opening':
						return 'Apertura in corso';
						break;
					case 'locating':
						return 'Localizzazione in corso';
						break;
					case 'loading':
						return 'Archiviazione';
						break;
					case 'connecting':
						return 'Connessione al server in corso';
						break;
					case 'buffering':
						return 'Buffering';
						break;
					case 'playing':
						return 'Riproduzione';
						break;
					case 'paused':
						return 'In pausa';
						break;
					case 'stopped':
						return 'Interrotto';
						break;
					case 'closed':
						return 'Chiuso';
						break;
					default:
						return 'unknown';
						break;
				}
				break;

		// GERMAN
			case 'de':
				switch(status) {
				
					case 'opening':
						return '&#0214;ffnen';
						break;
					case 'locating':
						return 'Lokalisieren';
						break;
					case 'loading':
						return 'Laden';
						break;
					case 'connecting':
						return 'Verbinden';
						break;
					case 'buffering':
						return 'Zwischenspeichern';
						break;
					case 'playing':
						return 'Wiedergabe';
						break;
					case 'paused':
						return 'Pause';
						break;
					case 'stopped':
						return 'Gestoppt';
						break;
					case 'closed':
						return 'Geschlossen';
						break;
					default:
						return 'unknown';
						break;
				}
				break;
			
		// SPANISH
			case 'es':
				switch(status) {
				
					case 'opening':
						return 'Abriendo';
						break;
					case 'locating':
						return 'Localizando';
						break;
					case 'loading':
						return 'Cargando';
						break;
					case 'connecting':
						return 'Conectando';
						break;
					case 'buffering':
						return 'Almacenando en b&#0250;fer';
						break;
					case 'playing':
						return 'Reproduciendo';
						break;
					case 'paused':
						return 'En pausa';
						break;
					case 'stopped':
						return 'Detenido';
						break;
					case 'closed':
						return 'Cerrado';
						break;
					default:
						return 'unknown';
						break;
				}
				break;
		
		// FRENCH
			case 'fr':
				switch(status) {
				
					case 'opening':
						return 'Ouverture';
						break;
					case 'locating':
						return 'Recherche';
						break;
					case 'loading':
						return 'T&#0233;l&#0233;chargement';
						break;
					case 'connecting':
						return 'En connection...';
						break;
					case 'buffering':
						return 'T&#0233;l&#0233;chargement';
						break;
					case 'playing':
						return 'Lecture';
						break;
					case 'paused':
						return 'Pause';
						break;
					case 'stopped':
						return 'Stop';
						break;
					case 'closed':
						return 'Fermeture';
						break;
					default:
						return 'unknown';
						break;
				}
				break;
				
		// ESPANOL
			case 'mx':
				switch(status) {
				
					case 'opening':
						return 'Abriendo';
						break;
					case 'locating':
						return 'Localizando';
						break;
					case 'loading':
						return 'Cargando';
						break;
					case 'connecting':
						return 'Conectando';
						break;
					case 'buffering':
						return 'Almacenando en b&#0250;fer';
						break;
					case 'playing':
						return 'Reproduciendo';
						break;
					case 'paused':
						return 'En pausa';
						break;
					case 'stopped':
						return 'Detenido';
						break;
					case 'closed':
						return 'Cerrado';
						break;
					default:
						return 'unknown';
						break;
				}
				break;
		
		// ENGLISH
			default:
				switch(status) {
				
					case 'opening':
						return 'Opening';
						break;
					case 'locating':
						return 'Locating';
						break;
					case 'loading':
						return 'Loading';
						break;
					case 'connecting':
						return 'Connecting';
						break;
					case 'buffering':
						return 'Buffering';
						break;
					case 'playing':
						return 'Playing';
						break;
					case 'paused':
						return 'Paused';
						break;
					case 'stopped':
						return 'Stop';
						break;
					case 'closed':
						return 'Closed';
						break;
					default:
						return 'unknown';
						break;
				}
				break;

		// FILIPINO
			case 'fi':
				switch(status) {
				
					case 'opening':
						return 'binubuksan';
						break;
					case 'locating':
						return 'hinahanap';
						break;
					case 'loading':
						return 'sinasakay';
						break;
					case 'connecting':
						return 'dinudugtong';
						break;
					case 'buffering':
						return 'binabaper';
						break;
					case 'playing':
						return 'naglalaro';
						break;
					case 'paused':
						return 'nakahinto muna';
						break;
					case 'stopped':
						return 'nakahinto';
						break;
					case 'closed':
						return 'nakapatay';
						break;
					default:
						return 'di alam';
						break;
				}
				break;
		}
	}
	
//##########################################################################################################






	function player_class_getCodecs() {
		
		var codecs = new Array( new Array(), new Array() );
		for ( var i = 0; i < this.plugin.CodecCount; i++ ) {
			
			codecs[0][i] = this.plugin.GetCodecDescription(i+1);
			if ( !this.plugin.GetCodecInstalled(i+1) )
				codecs[1][i] = codecs[0][i];
		}
		return codecs;
	}


// this function MUST be placed after we create all the referenced methods above
// or it wont work

	function createMediaPlayerMethods() {
	
		// dont need to do it this way
	}
	function player_class_hasCodecs() {
			
		var codecs = this.getCodecs();
		var requiredCodecs = String( codecs[0] ).toLowerCase();
		var uninstalledCodecs = String( codecs[1] ).toLowerCase();
		if ( requiredCodecs.indexOf('video 9') > -1 && uninstalledCodecs.indexOf('video 9') > -1 )
			return false;
		else
			return true;
	}
	
	


///**********************///
		var env = '';
		var isAXBrowser = ('1' == '1') ? 1:0;
		var clientID = '1';
		var playerID = '4';
		var clientSpaceID = '396500550';
		var userID = '1458698114';
		var playerSkin = '';
		var showPath = 'p%2F3.xml';
		var bandwidth = '56';
		var targetWindow = 'LaunchVideoTarget';
		var videoID = '1093293';
		var skipSegments = '';
		var forceSplash = '';
		var splashDone = '';
		var helpURL = 'help.html';
		var helpWinParams = '';
		var xtraParams = '';
		var countryCode = '';
	
	
		self.focus();
		
		if (!hasWMP)  window.location.href = "error.html";
		
		function continueOn() {

			top.window.location = 'mediaplayerconfig.asp?cid=' + clientID + '&ps=' + playerSkin + '&sx=' + showPath + '&tw=' + targetWindow + '&vid=' + videoID + '&bw=' + bandwidth + '&a=save&pv=' + playerVersion + '&sgm=' + skipSegments + '&fs=' + forceSplash + '&sd=' + splashDone + xtraParams;
		}

		function openHelp() {
	
			var helpWin = window.open(helpURL, 'helpWin', helpWinParams);
		}

		var mPlayer;
		function pageInit() {
			
			var showCustom = (isAXBrowser) ? 1:0;
			mPlayer = new mediaPlayerClass(document.wmp, 'mPlayer', showCustom);
			mPlayer.setLanguage(countryCode);
			mPlayer.onError = newErrorEvent;
			mPlayer.onNewSong = newVideoEvent;
			// mPlayer.onPlay = newVideoEvent; // note for Nattie, this is commented by default
			// mPlayer.onPause = newVideoEvent; // note for Nattie, this is commented by default
			// mPlayer.onBuffering = newVideoEvent; // note for Nattie, this is commented by default
			mPlayer.catchErrors(true);
			mPlayer.catchPlayStateChanges(true);
			mPlayer.setAutoStart( true );
			mPlayer.open(fileToBePlayed);
		}
		
		function newVideoEvent() {
			
			if ( !mPlayer.hasCodecs() ) {
			
				var errorID = 15001;
				var codecs = mPlayer.getCodecs();
				var vCodec = codecs[0][1];
				if (vCodec.indexOf('V8') > -1)
					errorID = 15003;
				
				handleCodecFailure(errorID);
			}
		}
		
		function newErrorEvent() {
		
			var errorID = parseInt(arguments[0]);
			var errorDescription = '';;
			
			for (var i = 0; i < arguments.length; i++) {
				errorDescription += arguments[i].toString() + ', ';
			}
			//alert('errorDescription=' + errorDescription);
		
		// need to catch codec installation failures
			if ( errorDescription.indexOf('-1072885673') > -1 || errorDescription.indexOf('portion of the file cannot be played') > -1 || errorDescription.indexOf('unable to download an appropriate decompressor') > -1 ) {
			
				handleCodecFailure(15002);
			}
		}
		
		function handleCodecFailure(errID) {
			
			logQOSEvent(errID);
			//alert(mPlayer.getCodecs())
			//alert('we noticed that you do not have the proper codec installed; we will default to the windows 8 codec');
			// var oCookie = new common_class_cookies( env );
			// oCookie.setCookie('vCodec', 8);
			// oCookie = null;
			mPlayer.stop();
			setTimeout( "mPlayer.open('two.mp3')", 500 );
		}
		
		var oQOS = null;
		function logQOSEvent(errID) {
		
			if ( oQOS == null )
				oQOS = new common_class_playerQOS(env, document.images['qosLogger']);
				
			oQOS.logError( errID, playerID, clientSpaceID, 000000, 000000, bandwidth, playerVersion, userID );
		}

//********* remember this |======>> mPlayer <<======| is the object of the player






//##########################################################################################################
//
//	Now, here's the code that can be be overridden.                                   ...Nattie, the JAVAKLA
//
//##########################################################################################################

// put the image directory here:
var imageDirectory = "images/"

//function changeLang(wikaCode) {
//countryCode = wikaCode
//mPlayer.setLanguage(countryCode);/
//}
var tvfileUrl;

function initCall(fileToBePlayed) {
//tvFileUrl = getcookie('tvFileUrl');

this.fileToBePlayed = 'http://www.islamcocg.com/ph/images/stories/audio/Tunay_na_Relihiyon.mp3';
//this.fileToBePlayed = tvFileUrl;

pageInit();
}

function setToFullscreen() {
  mPlayer.setFullscreen(true);
}

function processVolume(iv0,iv1,iv2,iv3,iv4,iv5,iv6,iv7,iv8,iv9) {
// change first all the images to their default values
var theVolImages = new Array(document.vi0,document.vi1,document.vi2,document.vi3,document.vi4,document.vi5,document.vi6,document.vi7,document.vi8,document.vi9);
var theVolImagesSrc = new Array(imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif", imageDirectory + "off.gif");
for (ctr=0;ctr<10;ctr++) {
	theVolImages[ctr].src = theVolImagesSrc[ctr];
}
// replace the images
var volImage = new Array(iv0,iv1,iv2,iv3,iv4,iv5,iv6,iv7,iv8,iv9);
var counter;
for (counter=0;counter<10;counter++) {
	if (volImage[counter] != null) {
		volImage[counter].src = imageDirectory + "on.gif"; // note: insert the directory (if there's any) of the images inside ""
		continue;
	}
	else {
		break;
	}
}
mPlayer.setVolume(counter*10);
}

function playPause() {
	if (mPlayer.isPlaying() && !mPlayer.isStopped()) {
		document.playPauseImage.src = imageDirectory + "pause.gif";
		mPlayer.pause();
	}
	else if (mPlayer.isPaused) {
		document.playPauseImage.src = imageDirectory + "play.gif";
		mPlayer.play();
	}
}

function mute() {
    if (navigator.appName=="Netscape") {
        if (document.wmp.GetMute()=="0") {
            document.wmp.SetMute(1);
			document.muteimage.src = imageDirectory + "muteon.gif";
        } else if (document.MediaPlayerGetMute()=="1") {
            document.wmp.SetMute(0);
			document.muteimage.src = imageDirectory + "muteoff.gif";
        }
    } else {
        if (document.wmp.Mute==0) {
            document.wmp.Mute = 1;
			document.muteimage.src = imageDirectory + "muteon.gif";
        } else if (document.wmp.Mute==1) {
            document.wmp.Mute = 0;
			document.muteimage.src = imageDirectory + "muteoff.gif";
        }
    }
}