function PlaySound(url) {
  document.all.sound.src = url;
}
function EvalSound(soundobj){
  var thissound= eval("document."+soundobj);
  thissound.Play();
}
function EvalSound2(soundobj){
  var thissound=document.getElementById(soundobj);
  thissound.Play();
}
function EvalSound3(soundobj){
 var thissound= eval("document."+soundobj);
 try {
     thissound.Play();
 }
 catch (e) {
     thissound.DoPlay();
 }
}
function DHTMLSound(surl) {
  document.getElementById("dummyspan").innerHTML="<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}



function checkthis(x, y, z, a) {
// x = input id, y = target word, z = v id, a = action

if (document.getElementById(x).value==y) document.getElementById(z).innerHTML= "<span class=\"right\">" + y + "</span>";  // 
else {  // else 1 starts
if (a=="l") {  // if 2 starts
document.getElementById(z).innerHTML= "<span class=\"wrong\">" + y + "</span>";  // 
// document.getElementById(x).focus();
}  // if 2 ends
else document.getElementById(z).innerHTML= "<span class=\"wrong\">" + y + "</span> ";  // 
}  // else 1 ends
}  // function checkthis


function checkthistest(x, y, z, a) {
// x = input id, y = target word, z = v id, a = action
// http://auta1.com/+/users/i/png/testok.png
// checkthistest('focusone9', 'good answer', 'ok9', 'l')

if (document.getElementById(x).value==y) document.getElementById(z).innerHTML= "<img border=0 src='http://auta1.com/+/users/i/png/testok.png'>";  // 
else {  // else 1 starts
if (a=="l") {  // if 2 starts
document.getElementById(z).innerHTML= "<img border=0 src='http://auta1.com/+/users/i/png/testnok.png'>";
// document.getElementById(x).focus();
}  // if 2 ends
else document.getElementById(z).innerHTML= "<img border=0 src='http://auta1.com/+/users/i/png/testnok.png'> ";
}  // else 1 ends
}  // function checkthis





function openSoundPlayer(psSoundPath, piType, piHwdId, piSentenceNum, a, w){
    try {
        var sPopupPath = "http://blog.linguistmail.com/pop-up.php?a="+a+"&w="+w;
        window.open(sPopupPath, "LDOCE_SOUNDPLAYER", "width=400,height=175,left=320,top=200,scrollbars=no,status=no,dependent=yes");
    } catch (err) { }
}


function playPronsentence(){
    try {
        var oSentence = document.getElementById("pronsentence");
        if (oSentence)
            oSentence.Play();
    } catch (err) {
       try {
		   window.location.reload(); //Fix to set working the replay on Macintosh (Safari...)
		} catch (e) { }
    }
}

