// SOUND FILES


var ayAudio = new Array(maxquest); 
i=0;
while (i<maximumtalk) { 
ayAudio[i] = "/sounds/"+ar[i]+".mp3"; 
i++;}

if (soundquiz=="h") {
ayAudio[maximumtalk] = "/sounds/canyouspell.mp3";
ayAudio[maximumtalk2] = "/sounds/correct.mp3"; 
ayAudio[maximumtalk3] = "/sounds/wrong.mp3"; 
ayAudio[maximumtalk4] = "/sounds/notintime.mp3"; 
}
else {
ayAudio[maximumtalk] = "/sounds/ask.mp3";  
ayAudio[maximumtalk2] = "/sounds/correct.mp3"; 
ayAudio[maximumtalk3] = "/sounds/incorrect.mp3"; 
ayAudio[maximumtalk4] = "/sounds/notintime.mp3"; 
}


function AudioCheck() {
var n = navigator.appName
//if (n=="Netscape") this.ns = true;
if (n=="Microsoft Internet Explorer" && document.all) this.ie = true;
else this.noAudio = true;
}

onload = function() {
is = new AudioCheck();
startmeup();
if (is.noAudio) return;

var s = '';
for (i=0; i<ayAudio.length; i++)
s += "<EMBED SRC='"+ayAudio[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"

if (is.ns) {
//auEmb = new Layer(0,window);
auEmb = new Layer(0);
with (auEmb.document) { open();write(s);close() };
}
else document.body.insertAdjacentHTML("BeforeEnd",s);

auCon = is.ns? auEmb.document.embeds:auIEEmb;
auCon.ctrl = function(au,play) {
if (is.ie) this.src = play? ayAudio[au]:'';
else eval( "this[au]." + (play? "play()":"stop()") );
}
is.auDone = true;
}
function playAudio(whAu) { if (window.auCon) auCon.ctrl(whAu,1) }
function stopAudio(whAu) { if (window.auCon) auCon.ctrl(whAu,0) }


