//-------------------------------
// Sound FX
//
// Description - sound fx when mouse cursor rolls over an image
// Compatibility - Netscape Communicator 4.xx, IE 4+
//

var aySound = new Array();
aySound[0] = "fx/links.wav";
aySound[1] = "fx/egg.wav";

IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (document.layers)?true:false; //(document.layers)?1:0;
ver4 = IE||NS? 1:0;

if (IE)
	document.write('<BGSOUND ID="auIEContainer">');

function auPreload() {
	if (!ver4) return;
	
	if (NS)
		auEmb = new Layer(0,window);
	else if (IE) {
		soundDIV = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
		document.body.insertAdjacentHTML("BeforeEnd",soundDIV);
	} 
	
	var Str = '';

	for (i=0;i<aySound.length;i++)
		Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>";
		
	if (IE)
		auEmb.innerHTML = Str;
	else if (NS){
		auEmb.document.open();
		auEmb.document.write(Str);
		auEmb.document.close();
	}
		
	auCon = IE? document.all.auIEContainer:auEmb;
	auCon.control = auCtrl;
}

function auCtrl(whSound,play) {
	if (IE)
		this.src = play? aySound[whSound]:'';
	else if (NS)
		eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}

function playSound(whSound)
{
	if (window.auCon)
		auCon.control(whSound,true);
}

function stopSound(whSound) 
{
	if (window.auCon)
		auCon.control(whSound,false);
}

