/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var slider=new Array();
slider[1]=new Object();
slider[1].min=0;
slider[1].max=1000;
slider[1].val=0.000;
slider[1].onchange=setBoxValue;

slider[2]=new Object();
slider[2].min=0;
slider[2].max=100;
slider[2].val=30;
slider[2].onchange=setVolume;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function setBoxValue(val, box) {
    val=Math.round(val*1000)/1000;
    document.TVVideoPlay.CurrentPosition = val / 1000 * document.TVVideoPlay.Duration;
}

function setVolume(val, box) {
    val=parseInt(Math.round(val*100)/100);
    document.TVVideoPlay.volume = (-10000 + ((200 * val) - (val*val)));
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


function InitializeTimer()
{
    // Set the length of the timer, in seconds

    secs = 0;
    duration = document.TVVideoPlay.Duration;
    knob1.style.left = 70 - Math.sqrt(-document.TVVideoPlay.volume);
    
    StopTheClock();
    StartTheTimer();
}

function StopTheClock()
{
    if(timerRunning);
        clearTimeout(timerID);
    timerRunning = false;
}

function StartTheTimer() {
    if (document.TVVideoPlay.CurrentPosition == 0)
        knob.style.left = "1";
    else
        knob.style.left = Math.round(document.TVVideoPlay.CurrentPosition / document.TVVideoPlay.Duration * 290);
        
        secs = secs + 1;
        timerRunning = true;
        timerID = self.setTimeout("StartTheTimer()", delay);

}


