function MM_showHideLayers() { //v2.0
var i, visStr, args, theObj;
args = MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
visStr   = args[i+2];
if (navigator.appName == 'Netscape' && document.layers != null) {
theObj = eval(args[i]);
if (theObj) theObj.visibility = visStr;
}else if (document.all != null) { //IE
if (visStr == 'show') visStr = 'visible'; //convert vals
if (visStr == 'hide') visStr = 'hidden';
theObj = eval(args[i+1]);
if (theObj) theObj.style.visibility = visStr;
}
}

}

function showHide_buffering(bstr) {
if (bstr) {
MM_showHideLayers('document.layers[\'Buffering\']','document.all[\'Buffering\']','show');
}else{
MM_showHideLayers('document.layers[\'Buffering\']','document.all[\'Buffering\']','hide');
}
}
if ( navigator.appName == "Netscape" ){
navigator.plugins.refresh();
document.write("\x3C" + "applet MAYSCRIPT Code=NPDS.npDSEvtObsProxy.class" )
document.writeln(" WIDTH=5 HEIGHT=5 NAME=appObs\x3E \x3C/applet\x3E")
}

function play(){
if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) {
//mediaplayer1.Play();
MMPlayer1.play();
}else{
//document.mediaplayer1.Play();
document.MMPlayer1.play();
}
}

function pause(){
if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) {
//if (mediaplayer1.PlayState == 2){
if (MMPlayer1.PlayState == 2){
//mediaplayer1.Pause();
document.MMPlayer1.pause();
}else{
//if (mediaplayer1.PlayState == 1) {
if (MMPlayer1.PlayState == 1) {
//mediaplayer1.Play();
document.MMPlayer1.play();
}
}
}else{
//document.mediaplayer1.Pause();
document.MMPlayer1.pause();
}
}

function stop(){
showHide_buffering(true);
if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) {
//mediaplayer1.Stop();
//mediaplayer1.CurrentPosition=0;
MMPlayer1.Mute=1;
}else{
//document.mediaplayer1.Stop();
//document.mediaplayer1.CurrentPosition=0;
document.MMPlayer1.Mute=1;
}
}

function InitializeMarkers ()
{
var iMax, x;

if(navigator.appName == "Netscape"){
parent.frames[2].document.write("\x3CBODY bgcolor=#000000\x3E\x3CCenter\x3E\x3CFONT face='Verdana,Arial,Helvetica' size=2 color=#FFFFFF\x3E\x3CB\x3ETable of Contents\x3C/B\x3E\x3CBR\x3E\x3C/FONT\x3E&nbsp;&nbsp;");
if ((iMax = document.mediaplayer1.GetMarkerCount()) > 0) {
for (x = 1; x <= iMax; x++)
parent.frames[2].document.write("\x3CA href='javascript:parent.frames[1].OnMarkerClicked(" + x + ")'\x3E\x3CFONT face='Verdana,Arial,Helvetica' size=2 color=#FFFFFF\x3E" + document.mediaplayer1.GetMarkerName(x) + "\x3C/FONT\x3E\x3C/A\x3E&nbsp;&nbsp;");
}else
parent.frames[2].document.write("No Markers");
}else{
parent.toc.document.write("\x3CBODY bgcolor=#000000\x3E\x3CCenter\x3E\x3CFONT face='Verdana,Arial,Helvetica' size=2 color=#FFFFFF\x3E\x3CB\x3ETable of Contents\x3C/B\x3E\x3C/FONT\x3E&nbsp;&nbsp;");

if ((iMax = document.mediaplayer1.MarkerCount) > 0) {
for (x = 1; x <= iMax; x++)
parent.toc.document.write("\x3CA href='javascript:top.player.OnMarkerClicked(" + x + ")'\x3E\x3CFONT face='Verdana,Arial,Helvetica' size=2 color=#FFFFFF\x3E" + document.NSPlay.GetMarkerName(x) + "\x3C/FONT\x3E\x3C/A\x3E&nbsp;&nbsp;");
}else
parent.toc.document.write("No Markers");
}
}
/* InitializeMarkers ()*/

function OnMarkerClicked (marker)
{
if (navigator.appName == "Netscape")
document.mediaplayer1.SetCurrentMarker(marker);
else
document.mediaplayer1.CurrentMarker = marker;

}
function fSound(){
        if( g_SoundFlag == "on" ){
            g_SoundFlag = "off";
            document.theForm.Image33.src = "/images/vod_bottom_off.gif";
            document.WMPlay.Mute = 1;
        }
        else{
            g_SoundFlag = "on";
            document.theForm.Image33.src = "/images/vod_bottom.gif";
            document.WMPlay.Mute = 0;
        }
    }
    

/*
*/    
function showmedia(args)
{	
	var src;
	if (args)
	{
		src = args;
	}
	else
	{
		arc = "http://www.mattube.com/image/mattube/04_starcast/loading.swf";
	}
	
document.write ('<OBJECT id=mediaplayer1 style=LEFT: 0px; TOP: 0px codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,05,0809 ')
document.write ('type=application/x-oleobject height=131 standby=loading microsoft windows media player components... ')
document.write ('width=180 classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 name=mediaplayer1>')
document.write ('<PARAM NAME=AudioStream VALUE=-1>')
document.write ('<PARAM NAME=AutoSize VALUE=0>')
document.write ('<PARAM NAME=AutoStart VALUE=1>')
document.write ('<PARAM NAME=AnimationAtStart VALUE=0>')
document.write ('<PARAM NAME=AllowScan VALUE=-1>')
document.write ('<PARAM NAME=AllowChangeDisplaySize VALUE=0>')
document.write ('<PARAM NAME=AutoRewind VALUE=-1>')
document.write ('<PARAM NAME=Balance VALUE=0>')
document.write ('<PARAM NAME=BaseURL VALUE=>')
document.write ('<PARAM NAME=BufferingTime VALUE=5>')
document.write ('<PARAM NAME=CaptioningID VALUE=>')
document.write ('<PARAM NAME=ClickToPlay VALUE=0>')
document.write ('<PARAM NAME=CursorType VALUE=1>')
document.write ('<PARAM NAME=CurrentPosition VALUE=-1>')
document.write ('<PARAM NAME=CurrentMarker VALUE=0>')
document.write ('<PARAM NAME=DefaultFrame VALUE=>')
document.write ('<PARAM NAME=DisplayBackColor VALUE=0>')
document.write ('<PARAM NAME=DisplayForeColor VALUE=16777215>')
document.write ('<PARAM NAME=DisplayMode VALUE=0>')
document.write ('<PARAM NAME=DisplaySize VALUE=4>')
document.write ('<PARAM NAME=Enabled VALUE=-1>')
document.write ('<PARAM NAME=EnableContextMenu VALUE=0>')
document.write ('<PARAM NAME=EnablePositionControls VALUE=-1>')
document.write ('<PARAM NAME=EnableFullScreenControls VALUE=-1>')
document.write ('<PARAM NAME=EnableTracker VALUE=-1>')
document.write ('<PARAM NAME=Filename VALUE="' + src + '">')
document.write ('<PARAM NAME=InvokeURLs VALUE=-1>')
document.write ('<PARAM NAME=Language VALUE=-1>')
document.write ('<PARAM NAME=Mute VALUE=0>')
document.write ('<PARAM NAME=PlayCount VALUE=1>')
document.write ('<PARAM NAME=PreviewMode VALUE=0>')
document.write ('<PARAM NAME=Rate VALUE=1>')
document.write ('<PARAM NAME=SAMILang VALUE=>')
document.write ('<PARAM NAME=SAMIStyle VALUE=>')
document.write ('<PARAM NAME=SAMIFileName VALUE=>')
document.write ('<PARAM NAME=SelectionStart VALUE=-1>')
document.write ('<PARAM NAME=SelectionEnd VALUE=-1>')
document.write ('<PARAM NAME=SendOpenStateChangeEvents VALUE=-1>')
document.write ('<PARAM NAME=SendWarningEvents VALUE=-1>')
document.write ('<PARAM NAME=SendErrorEvents VALUE=-1>')
document.write ('<PARAM NAME=SendKeyboardEvents VALUE=0>')
document.write ('<PARAM NAME=SendMouseClickEvents VALUE=-1>')
document.write ('<PARAM NAME=SendMouseMoveEvents VALUE=0>')
document.write ('<PARAM NAME=SendPlayStateChangeEvents VALUE=-1>')
document.write ('<PARAM NAME=ShowCaptioning VALUE=0>')
document.write ('<PARAM NAME=ShowControls VALUE=0>')
document.write ('<PARAM NAME=ShowAudioControls VALUE=-1>')
document.write ('<PARAM NAME=ShowDisplay VALUE=0>')
document.write ('<PARAM NAME=ShowGotoBar VALUE=0>')
document.write ('<PARAM NAME=ShowPositionControls VALUE=-1>')
document.write ('<PARAM NAME=ShowStatusBar VALUE=0>')
document.write ('<PARAM NAME=ShowTracker VALUE=0>')
document.write ('<PARAM NAME=TransparentAtStart VALUE=-1>')
document.write ('<PARAM NAME=VideoBorderWidth VALUE=0>')
document.write ('<PARAM NAME=VideoBorderColor VALUE=0>')
document.write ('<PARAM NAME=VideoBorder3D VALUE=0>')
document.write ('<PARAM NAME=Volume VALUE=-600>')
document.write ('<PARAM NAME=WindowlessVideo VALUE=0></OBJECT>')


}

function flashWrite(id, file, width, height, param, vars) {
    var flashStr = '<object id="' + id + '" height="' + height + '" width="' + width + '" ';
    flashStr += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" ';
    flashStr += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" VIEWASTEXT>';
    flashStr += '<param name="movie"   value="' + file + '" />';
    flashStr += '<param name="quality" value="high" />';
    flashStr += '<param name="enableContextMenu" value="0" />';

    var embParam = "";

    if (param != undefined) {
        var params = param.split("&");

        for (i = 0; i < params.length; i++) {
            var p = params[i].split("|");
            flashStr += '<param name="' + p[0] + '" value="' + p[1] + '" />';
            embParam = embParam + p[0] + '="' + p[1] + '" ';
        }
    }

    if (vars != undefined) {
        flashStr += '<param name="FlashVars" value="' + vars + '" />';
        embParam = embParam + 'flashVars="' + vars + '" ';
    }

    flashStr += '<embed id="' + id + '" name="' + id + '" src="' + file + '" ';
    flashStr += 'enableContextMenu="false" quality="high" width="' + width + '" height="' + height + '" ' + embParam
    flashStr += 'type="application/x-shockwave-flash"';
    flashStr += 'pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
    flashStr += '</object>';

    //alert(flashStr);
    document.write(flashStr);
}

function flashshow(file, width, height,id, param, vars) {
    var flashStr = '<object id="' + id + '" height="' + height + '" width="' + width + '" ';
    flashStr += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" ';
    flashStr += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" VIEWASTEXT>';
    flashStr += '<param name="movie"   value="' + file + '" />';
    flashStr += '<param name="quality" value="high" />';
    flashStr += '<param name="enableContextMenu" value="0" />';

    var embParam = "";

    if (param != undefined) {
        var params = param.split("&");

        for (i = 0; i < params.length; i++) {
            var p = params[i].split("|");
            flashStr += '<param name="' + p[0] + '" value="' + p[1] + '" />';
            embParam = embParam + p[0] + '="' + p[1] + '" ';
        }
    }

    if (vars != undefined) {
        flashStr += '<param name="FlashVars" value="' + vars + '" />';
        embParam = embParam + 'flashVars="' + vars + '" ';
    }

    flashStr += '<embed id="' + id + '" name="' + id + '" src="' + file + '" ';
    flashStr += 'enableContextMenu="false" quality="high" width="' + width + '" height="' + height + '" ' + embParam
    flashStr += 'type="application/x-shockwave-flash"';
    flashStr += 'pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
    flashStr += '</object>';

    //alert(flashStr);
    document.write(flashStr);
}

