var iPF=1;
function forward()
{
    iPF++;
    if(iPF>4)
        iPF = 4;
    else
        home.updatefc(iPF+'', updatefc_callback);
    
}
function backward()
{
    iPF--;
    if(iPF<1)
        iPF = 1;
    else
        home.updatefc(iPF+'', updatefc_callback);    
}
function updatefc_callback(Ris)
{
    if(Ris!=null && Ris.value!=null)
    {
        document.getElementById("btce").innerHTML = Ris.value;
    }
}
var iRoll = 0;
var currentCode = "";
var currentObj = null;
var inRoll = false;
var ti = null;
function roll(pathVideo)
{
    if(inRoll)
        return;
    
    inRoll = true;    
        
    if(iRoll==0)
        currentObj.src =pathVideo+"/videohq.jpg";
    else
        currentObj.src = pathVideo + "/videohq" + iRoll + ".jpg";    
    
    if(currentObj.complete)
        iRoll++;
        
    if(iRoll>4)
        iRoll = 0;

    ti = setTimeout("roll('"+pathVideo+"');", 600);
    inRoll = false;
}
function deroll(code, iidd, pathVideo)
{
    clearTimeout(ti);
    document.getElementById(iidd).src = pathVideo + "/videohq.jpg";
    iRoll = 0;
}
