// create the base ANSW object if it does not exist.
 if (!ANSW) {
     var ANSW = new Object();
 }    
ANSW.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
ANSW.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != -1);
ANSW.isIE = (navigator.userAgent.toLowerCase().indexOf("msie") != -1);
ANSW.ie5 = document.all != null && document.getElementsByTagName != null;
ANSW.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);

function playIt(sUrl) {
    var sPron = document.getElementById('sPron');
    var sSpan = document.getElementById('sSpan');
    if (sPron)
        sPron.innerHTML='<embed src="' + sUrl + '" hidden="true" autostart="true" loop="false" type="audio/mpeg">'
    else if (sSpan)
        sSpan.innerHTML='<embed src="' + sUrl + '" hidden="true" autostart="true" loop="false" type="audio/mpeg">'
    else
        playIt3(sUrl);
}
function playIt2(sUrl) {
      playIt(sUrl);
}
function playIt3(soundUrl)
{
    if (ANSW.isIE==true && ANSW.isOpera==false)
    {
        if (document.all)
            document.all.bgs.src = soundUrl;
    }
    else
    {
         if (ANSW.isSafari==false)
        {
            var IFrameObj = document.getElementById("soundFrame");
            IFrameObj.src = "about:blank";
            IFrameObj.src = soundUrl;
            setTimeout("endPlay()", 10000);
        }
        else
        {
            var IFrameDoc;
            var tries=0;
            setTimeout("initFrame()", 100);
            IFrameDoc.write('<html><head><object data="' + soundUrl + '" src="' + soundUrl + '" type="audio/basic"><\/head><\/html>');
            IFrameDoc.close();
        }
    }
}
function endPlay()
 {
    var IFrameObj = document.getElementById("soundFrame");
    IFrameObj.src = "about:blank"; //so refresh won't replay sound
 }
  function initFrame()
{
    var IFrameObj = document.getElementById("soundFrame");
    if (IFrameObj.contentDocument) IFrameDoc = IFrameObj.contentDocument;
    if (typeof IFrameDoc == "undefined" && tries<2)
    {
        setTimeout("initFrame()",1000);
        tries++;
    }
}


