var videoAdURL = "";
var videoAdClickURL = "";
var orgVideoURL = new Array();
document.domain = "Micro2000";

function setVideo(){
	for (i=0; i<arguments.length; i++){
		with(document){
			writeln('<SCR'+'IPT FOR="'+arguments[i]+'"');
			writeln('        EVENT="EndOfStream()" ');
			writeln('        LANGUAGE="JScript">');
			writeln('   if ('+arguments[i]+'.FileName == videoAdURL){');
			writeln('		if (videoAdClickURL != ""){');
			writeln('			'+arguments[i]+'.ClickToPlay = true;');
			writeln('			'+arguments[i]+'.SendMouseClickEvents = false;');
			writeln('		}');
			writeln('		'+arguments[i]+'.FileName = orgVideoURL["'+arguments[i]+'"];');
			writeln('	}');
			writeln('</SCR'+'IPT>');
			writeln('<SCR'+'IPT FOR="'+arguments[i]+'"');
			writeln('        EVENT="Click()" ');
			writeln('        LANGUAGE="JScript">');
			writeln('   if (videoAdClickURL != ""){');
			writeln('   	adWin = window.open(videoAdClickURL,"adWin","");');
			writeln('   	adWin.focus();');
			writeln('   }');
			writeln('</SCR'+'IPT>');
		}
	}
}

function setMediaPlayer(){
	for (i=0; i<arguments.length; i++){
		with(document){
			writeln('<SCR'+'IPT FOR="'+arguments[i]+'"');
			writeln('        EVENT="EndOfStream()" ');
			writeln('        LANGUAGE="JScript">');
			writeln('   if ('+arguments[i]+'.FileName == videoAdURL){');
			writeln('		if (videoAdClickURL != ""){');
			writeln('			'+arguments[i]+'.ClickToPlay = true;');
			writeln('			'+arguments[i]+'.SendMouseClickEvents = false;');
			writeln('		}');
			writeln('		'+arguments[i]+'.FileName = orgVideoURL["'+arguments[i]+'"];');
			writeln('	}');
			writeln('</SCR'+'IPT>');
			writeln('<SCR'+'IPT FOR="'+arguments[i]+'"');
			writeln('        EVENT="Click()" ');
			writeln('        LANGUAGE="JScript">');
			writeln('   if (videoAdClickURL != ""){');
			writeln('   	adWin = window.open(videoAdClickURL,"adWin","");');
			writeln('   	adWin.focus();');
			writeln('   }');
			writeln('</SCR'+'IPT>');
		}
	}
}

function videoType(playpath){
	if (playpath.indexOf("56k.asx") > -1 || playpath.indexOf("_n.asx") > -1)
		return "56k";
	if (playpath.indexOf("300k.asx") > -1 || playpath.indexOf("_b.asx") > -1)
		return "300k";
	return "";
}

function PlayVideo(playid, playpath){
	if (navigator.platform == "Win32"){
		if (navigator.userAgent.indexOf("IE") > -1){
			orgVideoURL[playid] = playpath;
			eval(playid + ".autoStart = true;");
			if (videoAdURL != ""){
				if (videoAdClickURL != ""){
					eval(playid + ".SendMouseClickEvents = true;");
					eval(playid + ".ClickToPlay = false;");
					eval(playid + ".CursorType = 1;");
				}
				eval(playid + ".Filename = '" + videoAdURL + "';");
			}else{
				eval(playid + ".Filename = '" + orgVideoURL[playid] + "';");
			}
		}else{
			eval("document." + playid + ".SetAutoStart(true);");
			eval("document." + playid + ".SetFileName('" + playpath + "');");
		}
	}else{
		if (navigator.userAgent.indexOf("IE") > -1){
			this.location = playpath;
		}else{
			temp = window.open(playpath,"temp","width=1,height=1,top=10000,left=10000");
			temp.blur();
			setTimeout("temp.close();",100);
		}
	}
}
