// JavaScript Document
<!--
var inter;
var loaded=false;
var flash_VidURL;
var videoDuration = 0;

function checkDuration(){
	dur = window.Player.currentMedia.duration;

	document.getElementById("debug2").innerHTML= "duration : " + dur
	if(dur == 0){
		clearInterval(inter);
		inter = setInterval(chekDurationDelay,200);
	}
	return dur;
	
}
function chekDurationDelay(){
	t = window.Player.currentMedia.duration;
	if(t > 0){
		setVideoDuration(t);
		document.getElementById("debug2").innerHTML= "duration t : " + t;
		clearInterval(inter);
	}else{
		document.getElementById("debug2").innerHTML= "duration inter : " + inter;
	}
}
function setVideoDuration(t){
	try
	{
		if(t != videoDuration){
			//alert("t != videoDuration call > changeFlashSourceFile")
			flash_VidURL != undefined ? changeFlashSourceFile(flash_VidURL) : changeFlashSourceFile("http://www.cast-tv.biz/play/wvx/22475/easyforex_1802.wmv_18106_IL.wvx");
			//getMovieName("plyPlayer").updateFlashSourceFile("http://www.cast-tv.biz/play/?movId=beofh&clid=22475&skcus=1");
			//getMovieName("plyPlayer").updateFlashSourceFile("http://www.cast-tv.biz/play/wvx/22475/easyforex_1802.wmv_18106_IL.wvx");
		}else{
			//alert("setDuration : "+t)
			getMovieName("plyPlayer").setMPVideoDuration(t)
		}
		videoDuration = t;
	}
	catch(err){
		//alert("setVideoDuration err : "+err.description)	
	}
}
function timer(){
    try
    {
	    getMovieName("plyPlayer").updateFlashTime(document["Player"].controls.currentPosition);
		if(document.getElementById("debug1")){
				document.getElementById("debug1").innerHTML=document["Player"].controls.currentPosition;
				//loaded == false ? document.getElementById("debug2").innerHTML=getMovieName("plyPlayer") : null;
				loaded = true

		}
    }
    catch(err)
    {
	    //alert(err.description);
    }
}
function changeFlashSourceFile(str, strSize){
	//alert(str);
	if(strSize == "big"){
		str = "http://www.cast-tv.biz/play/wvx/22475/Big_Player.wmv_18106_IL.wvx";
	}else if(strSize == "small"){
		str = "http://www.cast-tv.biz/play/wvx/22475/Small_Player.wmv_18106_IL.wvx";
	}
	setTimeout(flashFileChangeDelay,250);
	flash_VidURL = str

}
//////////////////////////////////
function flashFileChangeDelay()
{
	//alert("flashFileChangeDelay")
	try
	{
		t = window.Player.currentMedia.duration;
		if(t > 0){
			//alert("flashFileChangeDelay")
			getMovieName("plyPlayer").updateFlashSourceFile(flash_VidURL);
		}else{
			setTimeout(flashFileChangeDelay,250);
		}
	}
	catch(err){
		//alert("flashFileChangeDelay arr : "+err.description)	
	}
}
function changeFlashPly(str){
	try
	{
	    getMovieName("plyPlayer").updateFlashPly(str);
	}
	catch(err){
	}
}
function getMovieName(movieName) {
	
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
   }
   else {
	   return document[movieName]
   }
}
function setFullScren(bol){
	try
	{
	    getMovieName("plyPlayer").setMPFullScren(bol);
	}
	catch(err){	
	}	
}

var WMState = new Array();
WMState[0] = "Undefined";
WMState[1] = "Stopped";
WMState[2] = "Paused";
WMState[3] = "Playing";
WMState[4] = "Scan Forward";
WMState[5] = "Scan Reverse";
WMState[6] = "Buffering";
WMState[7] = "Waiting";
WMState[8] = "Media Ended";
WMState[9] = "Transitioning";
WMState[10] = "Ready";
WMState[11] = "Reconnecting";
function checkStatus(){
	x = window.aspnetForm.Player.playState;
	return WMState[x];
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
function Play() {
	//x = document["Player"].playState;
	//if (x == 2) {
		document["Player"].controls.play();
	//} else {
	//	document["Player"].URL = "http://www.nyhoff.net/swimcity/Crawl-SwimcityMediaCentre-AlexPopovTraining.mpg";
	//}
}
function Pause() {
	//alert("Player.playState : "+document["Player"].Time);
	document["Player"].controls.pause();
}
function Stop() {
	document["Player"].controls.stop();
}
function MuteMe() {
	x = document["Player"].settings.mute;
	if (x == 0) {
		document["Player"].settings.mute = "1";
	} else {
		document["Player"].settings.mute = "0";
	}
}
function UnMuteMe() {
	document["Player"].settings.mute = "0";
}
function VolumeUp() {
	X = document["Player"].settings.volume;
	document["Player"].settings.volume = X+10;
}
function VolumeDown() {
	X = document["Player"].settings.volume;
	document["Player"].settings.volume = X-10;
}
function setMovieVolume(val) {
	document["Player"].settings.volume = val;
}
function Seek(t) {
   document["Player"].controls.currentPosition=t;
}

--> 
