var timer = []
var browser=navigator.appName;
function openYouTube(url)
{
    if (browser == "Microsoft Internet Explorer")
    {
        document.getElementById("main").style.filters[0].opacity= 30;
    }
    else
    {
      document.getElementById("main").style.opacity= 0.3;  
    }
    document.getElementById("youtube").style.visibility="visible";
    document.getElementById("youtube").style.zIndex="10";
    document.getElementById("youtube").innerHTML = "<img src='graphics/close.png' onclick='closeYouTube()'style='position:absolute; z-index:5; margin-left:425px'>"+
    "<object style='position:relative; top:25px;' width='425' height='344'>"+
        "<param name='movie' value='http://www.youtube.com/v/" + url + "&hl=en_US&fs=1&'></param><param name='allowFullScreen' value='true'>"+
        "</param><param name='allowscriptaccess' value='always'></param>"+
        "<embed src='http://www.youtube.com/v/" + url + "&hl=en_US&fs=1&' type='application/x-shockwave-flash'"+
               "allowscriptaccess='always' allowfullscreen='true' width='425' height='344'></embed></object>"
               
}
function closeYouTube(url)
{
     if (browser == "Microsoft Internet Explorer")
    {
        document.getElementById("main").style.filters[0].opacity= 100;
    }
    else
    {
      document.getElementById("main").style.opacity= 1.0;  
    }
    document.getElementById("youtube").style.visibility="hidden";
    document.getElementById("youtube").style.zIndex="-10";
    document.getElementById("youtube").innerHTML="";
}

function popUp()
{
    document.getElementById("audio").innerHTML=""
    document.getElementById("play").src = "controls/play.jpg"
    window.open("player.php", "player", "status=1, width=200px, height=100px, resizable=0")
}

    function fadeInStart(id, index, i)
        {
            clearTimeout(timer[index])
            fadeIn(id, index, i)
            clearTimeout(timer[index+4])
            moveUp(id+"Title", index + 4, 420)
        }
        function fadeOutStart(id, index, i)
        {
            clearTimeout(timer[index])
            fadeOut(id, index, i)
            clearTimeout(timer[index+4])
            moveDown(id+"Title", index +4, 380)
        }
        function fadeIn(id, index, i)
        {
            if (i<1.0)
            {
                i += 0.1
                document.getElementById(id).style.opacity= i
                timer[index] = setTimeout("fadeIn(\'"+id+"\', "+index+", "+i+")", 100)
            }
        }
        function fadeOut(id, index, i)
        {
            if (i>0.6)
            {
                i -= 0.1
                document.getElementById(id).style.opacity= i
                timer[index] = setTimeout("fadeOut(\'"+id+"\', "+index+", "+i+")", 100)
            }
        }
        function moveUp(id, index, i)
        {
            if (i>380)
            {
                i -= 5
                document.getElementById(id).style.top= i + "px"
                timer[index] = setTimeout("moveUp(\'"+id+"\', "+index+", "+i+")", 50)
            }
        }
        function moveDown(id, index, i)
        {
            if (i<420)
            {
                i += 5
                document.getElementById(id).style.top= i +"px"
                timer[index] = setTimeout("moveDown(\'"+id+"\', "+index+", "+i+")", 50)
            }
        }