function writeWMPPagePrep() {
	if (isPlatformsupported) {
	} else {
/*		document.writeln('<head>');		
		document.writeln('<script language="JavaScript" for="ffplayer" event="playstatechange(newState)">');
		document.writeln('onPlayStateChanged(newState);');
		document.writeln('</script>');		
		document.writeln('</head>');		
*/	}
}

function stopSound() {
	if (isPlatformsupported){
		var wmpDiv = document.getElementById("player");
	   	wmpDiv.controls.stop();
	} else {
		fr = document.getElementById('hookLauncherFrame');
		doc = fr.contentDocument;
		//hl = doc.getElementById("hookLauncher");
		// TODO: figure out how to use this object to control the audio stream 
		doc.open("text/html");
		doc.writeln( '<html><body></body></html>');
		doc.close();
	}
}

function onPlayStateChanged(newState) {
	//alert( "onPlayStateChanged "+newState);
}

function playSound(theUrl) {
	if (isPlatformsupported){	
		var wmpDiv = document.getElementById("player");
		//alert(wmpDiv);
		//alert(wmpDiv.AutoStart);
		wmpDiv.URL = theUrl;
		wmpDiv.AutoStart = "True";
	} else {
		str0 = '<html>';
//		str0 += '<head><script language="JavaScript" for="ffplayer" event="playstatechange(newState)">';
//		str0 += 'alert("playStateChaged "+newSate);'
//		str0 += 'onPlayStateChanged(newState);</script></head>';
		str0 += '<body><p class="obj"><object id="ffplayer" data="';
//		str0 += '<body><p class="obj"><object id="ffplayer" src="';
//		str1 = '" type="application/x-mplayer2"';
//		str1 = '" type="video/x-ms-wmv"';
		str1 = '" type="audio/x-ms-wma"';
		str1 += ' width="1" height="1"><param name="ShowStatusBar" value="1"><param name="autostart" value="1"><param name="SendPlayStateChangeEvents" value="true"><param name="volume" value="0">';
		str1 += '</object></p></body></html>';
		fr = document.getElementById('hookLauncherFrame');
		//TODO: check this on other browsers
		doc = fr.contentDocument;
		doc.open("text/html");
		doc.writeln( str0 + theUrl + str1);
		doc.close();
	}
}

