	var len = 0;
	var pos = 0;
	var stoppati = false;
	var livo = false;
	var len = 0;
	var pos = 0;
	var timed = 1000;
	var Loadbal="";
	var pippo="";

function play() {
	stoppati = false;
	if (document.mPlayer.CanPlayPause()) {
		document.mPlayer.DoPlay();
		CheckType();
	}
}

function pause() {
	if (document.mPlayer.CanPause()) {
	document.mPlayer.DoPause();
	}
}

function stop() {
	stoppati = true;
	if (document.mPlayer.CanStop()) {
		document.mPlayer.DoStop();
	}
}

function mute() {
	isMute = true;
	if (document.mPlayer.CanPlayPause()) {
	document.mPlayer.SetMute(isMute);
	}
}

function Positioner() {
	if (document.mPlayer.CanStop()) {
		
document.mPlayer.SetPosition(select.value);
	}
}

function CheckType() {
	livo = document.mPlayer.GetLiveState();
}

function SetControlDI() {
	CheckType();
	idi=setInterval('ControlVideo()',timed);
}

function ControlVideo() {
	CheckType();
	if (livo == true){
			if 
(document.mPlayer.GetPlayState()==0) {
				play();
			}
	} else {
		if (stoppati==false){
			if 
(document.mPlayer.GetPlayState()==0) {
				play();
			}
		}
		len = document.mPlayer.getLength();
		if (len>0) {
			pos = 
document.mPlayer.GetPosition();
			if ((len - pos)<timed) {
				
setTimeout('stop()',timed-100);
			} else {
				stoppati = false;
			}
		}
	}
}

function LoadBalance() {
        Loadbal="http://www.digitalidentity.it/webstudio/loadbalance.cgi?IP=" + "10.0.0.1";
	messageWin=window.open (Loadbal, 'newWin', 'scrollbars=no,status=no,titlebar=no,width=30,height=30,screenX=40,screenY=0');
	messageWin.close();
	stoppati = false;
	document.mPlayer.SetLoop(false);
	document.mPlayer.SetEnableContextMenu(false);
	if (balance==2){
		document.mPlayer.DoNextEntry();
	}
}

function NoErrors() {
	document.mPlayer.SetWantErrors(1);
}


