// JavaScript Document

// Preload and play audio files with event handler (MouseOver sound)
// designed by JavaScript Archive, (c)1999
// Get more free javascripts at http://jsarchive.8m.com

var aySound = new Array();
// Below: source for sound files to be preloaded

document.write("<BGSOUND ID='iebgsound'>");

aySound[0] = "sounds/frog.wav";
aySound[1] = "sounds/miflats.wav";
aySound[2] = "sounds/yeled.wav";
aySound[3] = "sounds/yalda.wav";
aySound[4] = "sounds/cat.wav";

// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = ((navigator.appName == "Netscape") && 
  	 (navigator.userAgent.indexOf("Mozilla") != -1) && 
  	 (parseFloat(navigator.appVersion) >= 5) && 
  	 (navigator.javaEnabled())) ? 1 : 0;
ver5 = IE||NS? 1:0;
var event_catch=0;

function auPreload() {
	if (!ver5) return;
	var Str = '';
	for (i=0;i<aySound.length;i++){
		Str += "<EMBED SRC='"+aySound[i]+"' width='0' height='0' autostart='false' name='sound"+i+"'>";
		}
	auEmbed = document.getElementById("auEmb");
	if (1) auEmbed.innerHTML = Str;
	else {
		auEmbed.document.open();
		auEmbed.document.write(Str);
		auEmbed.document.close();
		}
	}

function playSound(soundNum) {
	if (event_catch) return;
	event_catch=1;
	if (IE) {
		document.getElementById("iebgsound").src=aySound[soundNum];
	}
	else {
		sound = eval("document.sound" + soundNum);
		try {
			sound.DoPlay();}
		catch (e) {
			sound.Play();}
	}
	event_catch=0;
}

function stopSound(soundNum) {
	if (event_catch) return;
	event_catch=1;
	if (IE){
		document.getElementById("iebgsound").src='';}
	else {
		sound = eval("document.sound" + soundNum);
		try {
			  sound.Stop();
			  sound.Rewind();}
		catch (e) {}
	}
	event_catch=0;
}

