// Browser sniff -- the following code does a very simple browser 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

<!--   EN EL FUENTE JAVA NO SE PONE:  <SCRIPT LANGUAGE="JavaScript">
var bControl, bControl_PLY2;
function swap(whichImage, whatURL){
	if (whichImage.src.indexOf('_hi') == -1) {
		whichImage.src = whatURL;
	}
}

function StopClick(){
	document.MediaPlayer1.Stop(); 
	if (bControl == true){
		document.MediaPlayer1.CurrentPosition=0;
	} else {
		document.MediaPlayer1.SetCurrentPosition(0);
	}
}

function StopClick_PLY2(){
	document.MediaPlayer2.Stop(); 
	if (bControl_PLY2 == true){
		document.MediaPlayer2.CurrentPosition=0;
	} else {
		document.MediaPlayer2.SetCurrentPosition(0);
	}
}


function PauseClick(){
   	if (bControl == true) {
		if (document.MediaPlayer1.PlayState == 2){
			document.MediaPlayer1.Pause();
		}
	} else {
		if (document.MediaPlayer1.GetPlayState() == 2){
			document.MediaPlayer1.Pause();
		}
   	}
}
function PauseClick_PLY2(){
   	if (bControl_PLY2 == true) {
		if (document.MediaPlayer2.PlayState == 2){
			document.MediaPlayer2.Pause();
		}
	} else {
		if (document.MediaPlayer2.GetPlayState() == 2){
			document.MediaPlayer2.Pause();
		}
   	}
}


function OnDSPlayStateChangeEvt (oldState, newState){
	doPlayStateChanges(oldState,newState);
}

function OnDSPlayStateChangeEvt_PLY2 (oldState, newState){
	doPlayStateChanges_PLY2(oldState,newState);
}

function loader(){
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) {
		bControl = true;
	} else {
		var plugIn = document.MediaPlayer1;
		bControl = false;
		document.appObs.setByProxyDSPlayStateChangeObserver(plugIn,true); // listen for NewStream Event	
	}
	document.MediaPlayer1.Play(); 
	<!-- para parar tras x seg    timedParar();  -->
}

function loader_PLY2(){
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) {
		bControl_PLY2 = true;
	} else {
		var plugIn = document.MediaPlayer2;
		bControl_PLY2 = false;
		document.appObs.setByProxyDSPlayStateChangeObserver(plugIn,true); // listen for NewStream Event	
	}
	document.MediaPlayer2.Play(); 
	<!-- para parar tras x seg      timedParar_PLY2();  -->
}


function doPlayStateChanges(oldState,newState){
	timerID = setTimeout("document.image1.src = \"play_low.gif\";",0);
	timerID = setTimeout("document.image2.src = \"pause_low.gif\";",0);
	timerID = setTimeout("document.image3.src = \"stop_low.gif\";",0);

	switch(newState) {
	case 0:
		timerID = setTimeout("document.image3.src = \"stop_hi.gif\";",0);
		break;
	case 1:
		timerID = setTimeout("document.image2.src = \"pause_hi.gif\";",0);
		break;
	case 2:
		timerID = setTimeout("document.image1.src = \"play_hi.gif\";",0);
		break;
	}
}
function doPlayStateChanges_PLY2(oldState,newState){
	timerID = setTimeout("document.image1_2.src = \"play_low.gif\";",0);
	timerID = setTimeout("document.image2_2.src = \"pause_low.gif\";",0);
	timerID = setTimeout("document.image3_2.src = \"stop_low.gif\";",0);

	switch(newState) {
	case 0:
		timerID = setTimeout("document.image3_2.src = \"stop_hi.gif\";",0);
		break;
	case 1:
		timerID = setTimeout("document.image2_2.src = \"pause_hi.gif\";",0);
		break;
	case 2:
		timerID = setTimeout("document.image1_2.src = \"play_hi.gif\";",0);
		break;
	}
}


function showClick() // This function is called by the btnShowControls button.
                     // It sets the ShowControls property of Media Player to true.
{
	if (sBrowser == "IE") {
		document.MediaPlayer1.ShowControls = true;
//		document.MediaPlayer1.StatusBar = 1;
//		document.MediaPlayer1.height = 280;
	} else {
		document.MediaPlayer1.SetShowControls(true);
	}
}
function showClick_PLY2() // This function is called by the btnShowControls button.
                     // It sets the ShowControls property of Media Player to true.
{
	if (sBrowser == "IE") {
		document.MediaPlayer2.ShowControls = true;
//		document.MediaPlayer2.StatusBar = 1;
//		document.MediaPlayer2.height = 280;
	} else {
		document.MediaPlayer2.SetShowControls(true);
	}
}



function hideClick() // This function is called by the btnHideControls button.
                     // It sets the ShowControls property of Media Player to false.
{
	if (sBrowser == "IE") {
		document.MediaPlayer1.ShowControls = false;
//		document.MediaPlayer1.StatusBar = 0;
//		document.MediaPlayer1.height = 240;
	} else {
		document.MediaPlayer1.SetShowControls(false);
	}
}
function hideClick_PLY2() // This function is called by the btnHideControls button.
                     // It sets the ShowControls property of Media Player to false.
{
	if (sBrowser == "IE") {
		document.MediaPlayer2.ShowControls = false;
//		document.MediaPlayer2.StatusBar = 0;
//		document.MediaPlayer2.height = 240;
	} else {
		document.MediaPlayer2.SetShowControls(false);
	}
}


function timedParar(){
	var t=setTimeout("document.MediaPlayer1.Pause()",40000)
}

function timedParar_PLY2(){
	var t=setTimeout("document.MediaPlayer2.Pause()",40000)
}

