<!-- 判 斷 IE 或 Netscape -->
var bWin32IE;
if ((navigator.userAgent.indexOf("IE") != "-1") && (navigator.userAgent.length > 1)) {
bWin32IE = true;
} else {
bWin32IE = false;
}
<!-- Media Player 控 制 功 能 -->
function setasxfile1 (playtitle) {
MM_showHideLayers('Layer2','','hide','Layer3','','show');
if (bWin32IE == true) {
NSPlay.stop();
NSPlay.autoStar = true;
NSPlay.Filename = playtitle;
} else {
document.NSPlay.stop();
document.NSPlay.SetAutoStart(true);
document.NSPlay.SetFileName(playtitle);
}
}
function start(){
if (bWin32IE == true) {
NSPlay.CurrentPosition = 0;
NSPlay.play();
} else {
document.NSPlay.SetCurrentPosition(0);
document.NSplay.Play();
}
}
function pause(){
MM_showHideLayers('Layer2','','show','Layer3','','hide');
if (bWin32IE == true) {
NSPlay.CurrentPosition = 0;
NSPlay.stop();
} else {
document.NSPlay.SetCurrentPosition(0);
document.NSplay.Pause();
}
}
function stop(){
MM_showHideLayers('Layer2','','show','Layer3','','hide');
if (bWin32IE == true) {
NSPlay.stop();
} else {
document.NSplay.Stop();
document.NSPlay.SetCurrentPosition(0);
}
}
<!--
//
var version="other"
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) version = "n3";
else if (browserName == "Netscape" && browserVer < 3) version = "n2";
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "e4";
else if (browserName == "Microsoft Internet Explorer" && browserVer < 4) version = "e3";
//-->
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible'v='hide')?'hidden':v; }
obj.visibility=v; }
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible'v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</SCRIPT>