
function useQT() {
	return navigator.appVersion.indexOf("Mac") > 0 || (browser.isGecko && !browser.isNS);
}

function pause() {
	if (useQT()) {
		QTWin.close();
	}else{
		try{ //if stop first then pause, there is an error, so we catch it here
			if (document.mediaPlayer.fileName != "" || document.mediaPlayer1.fileName != ""){
				setIsPlay(0);
			}				
			if (document.mediaPlayer.fileName != ""){
				document.mediaPlayer.Pause();
			}
			
			if (document.mediaPlayer1.fileName != ""){
				document.mediaPlayer1.Pause();
			}
		}catch(er){}
	}
}
function stop() {
	if (useQT()) {
		QTWin.close();
	}else{
		if (document.mediaPlayer.fileName != "" || document.mediaPlayer1.fileName != ""){
			setIsPlay(0);						
		}
				
		if (document.mediaPlayer.fileName != ""){
			document.mediaPlayer.stop();
			document.mediaPlayer.SelectionStart = 0; //back to start				
		}
		if (document.mediaPlayer1.fileName != ""){
			document.mediaPlayer1.stop();
			document.mediaPlayer1.SelectionStart = 0; //back to start				
		}
	}
}
function setIsPlay(isp) {
	document.playerStateForm.isPlay.value = isp;
}
function replay() {
	if (document.playerStateForm.isPlay.value == 1){		
		play(); 
	}
}