vobject = '';

vobject += '<object id="WMPlay" style="' + videoStyle + '";" width="' + videoWidth + '" height="' + videoHeight + '" hspace="0" vspace="0" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" ';
vobject += 'standby="Loading Microsoft&reg; Windows&reg; Media Player components..." type="application/x-oleobject">';
vobject += '<param name="AutoStart" value="' + videoAutostart + '" /><param name="uimode" value="' + videoUimode + '" />';
vobject += '<param name="URL" value="' + urlSrc + '" />';
vobject += '<embed type="application/x-mplayer2" ';
vobject += 'pluginspage="http://www.microsoft.com/windows/windowsmedia/ES/download/default.asp" ';
vobject += 'name="WMPlaye" id="WMPlaye" src="' + urlSrc + '" autostart="' + videoAutostart + '" ';
vobject += 'uimode="' + videoUimode + '" width="' + videoWidth + '" height="' + videoHeight + '" hspace="0" vspace="0"></embed></object>';

d = document.getElementById( 'videoOb' );
d.innerHTML = vobject;

var bWin32IE;
var netscape47;
if ((navigator.userAgent.indexOf("IE") != "-1") && (navigator.userAgent.length > 1)) {
	bWin32IE = true;
} else if (document.layers) {
	netscape47 = true;
} else {
	bWin32IE = false;
	netscape47 = false;
}

function start(){
        if (bWin32IE == true) {
			WMPlay.controls.play();
			document.getElementById( "WMPlay" ).style.visibility = "visible";
        } else if (netscape47 == true) {
			document.WMPlay.controls.Play();
        } else {
			document.getElementById("WMPlay").controls.Play();
		}
}

function stop(){
        if (bWin32IE == true) {
			WMPlay.controls.stop();
			WMPlay.controls.CurrentPosition = 0;
			document.getElementById( "WMPlay" ).style.visibility = "hidden";
        }
		else if (netscape47 == true) {
			document.WMPlay.controls.Stop();
			document.WMPlay.SetCurrentPosition(0);
        } else {
			document.getElementById("WMPlay").controls.Stop();
			document.getElementById("WMPlay").SetCurrentPosition(0);
		}
}


function PauseClick(){
   	if (bWin32IE == true) {
		if (document.WMPlay.playState == 3){
			document.WMPlay.controls.pause();
		}
	} else if (netscape47 == true) {
		if (document.WMPlay.GetPlayState() == 2){
			document.WMPlay.controls.Pause();
		}
   	} else {
			document.getElementById("WMPlay").controls.Pause();
	}
}

function play(){
	document.getElementById( "WMPlay" ).style.visibility = "visible";
	document.getElementById( "WMPlay" ).controls.play();
}

function playVideo(urlSrc)
{
	vobject = '';
	vobject += '<object id="WMPlay" style="' + videoStyle + '";" width="' + videoWidth + '" height="' + videoHeight + '" hspace="0" vspace="0" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" ';
	vobject += 'standby="Loading Microsoft&reg; Windows&reg; Media Player components..." type="application/x-oleobject">';
	vobject += '<param name="AutoStart" value="' + videoAutostart + '" /><param name="uimode" value="' + videoUimode + '" />';
	vobject += '<param name="URL" value="' + urlSrc + '" />';
	vobject += '<embed type="application/x-mplayer2" ';
	vobject += 'pluginspage="http://www.microsoft.com/windows/windowsmedia/ES/download/default.asp" ';
	vobject += 'name="WMPlaye" id="WMPlaye" src="' + urlSrc + '" autostart="' + videoAutostart + '" ';
	vobject += 'uimode="' + videoUimode + '" width="' + videoWidth + '" height="' + videoHeight + '" hspace="0" vspace="0"></embed></object>';
	d = document.getElementById( 'videoOb' );
	d.innerHTML = vobject;
}

function switchState(NewState){
switch (NewState){
		case 1:
	                document.getElementById( "WMPlay" ).style.visibility = "hidden";
	                break;
		case 3:
	                document.getElementById( "WMPlay" ).style.visibility = "visible";
	                break;
	    case 8:
	                document.getElementById( "WMPlay" ).style.visibility = "hidden";
	                break;
	}
}

