
// New Sound Function 16.08.2009 by: Cyber-Web.biz
function wr(stringToWrite) {document.write(stringToWrite);}



// You never need to use altID, only when you will play many instances of same sound from cache
function play(soundfile,loop,altID) {

		if (altID!=null) var objID = altID; else objID = soundfile;
		var  content='<object type="application/x-mplayer2" ';
		content+=' pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ';
		content+=' Name="'+objID+'" src='+soundfile+' AutoStart=true ShowStatusBar=1 volume=-1 loop='+loop+' >';
		content+=' </object> ';
		
		content+='<embed name="'+objID+'" src='+soundfile+' autoplay="true" AUTOSTART="true" loop="100" hidden="true" volume="60%" > ';
		content+='<NOEMBED><BGSOUND src='+soundfile+'></NOEMBED>';
		content+='</embed> ';


	try {

		document.getElementById(objID).innerHTML = content;
	} catch (err) {//object doesnt exist create new

	   var oDiv = document.createElement ("DIV"); 
	   oDiv.id = objID;
	   oDiv.style.position = "absolute";
	   oDiv.style.left = -2000;
	   oDiv.innerHTML=content;
	   document.body.appendChild (oDiv);
	   delete oDiv;
	}


}

function stop(soundfile) {
	document.getElementById(soundfile).innerHTML = "";

}

