var ind = 0;
var max = 0;

function testParent1(id)
{
    var objParent = parent.parent.window.document.getElementById(id);
    if (objParent == null)
    {
        location.href = "index.html";
    }
}

function testParent2(id)
{
    var objParent = parent.parent.window.document.getElementById(id);
    if (objParent == null)
    {
        var obj = window.document.getElementById("enteteSape");
        obj.style.display = "block";
        obj = window.document.getElementById("bodyOnglet");
        obj.style.top  = 120;
        obj.style.left = 15; 
    }
}

function onContextMenu(el)
{
    if (el != undefined)
    {
        if (el.tagName.toUpperCase() == "IMG")
        {
            return true;
        }
        else
        {
            return false;
        }
    }    
}

function setInd(i)
{
    ind = i;
}

function setMax(i)
{
    max = i;
}

function onSuivant()
{
    var obj;
    if (ind < max)
    {
        obj = window.document.getElementById("spec" +ind);
        obj.style.display="none";
        ind++;
        obj = window.document.getElementById("spec" +ind);
        obj.style.display="block";
    }
    if (ind == max)
    {
        obj = window.document.getElementById("suivant");
        obj.style.display="none";
    }
    if (ind > 0)
    {
        obj = window.document.getElementById("precedent");
        obj.style.display="block";
    }

}

function onPrecedent()
{
    var obj;
    if (ind > 0)
    {
        obj = window.document.getElementById("spec" +ind);
        obj.style.display="none";
        ind--;
        obj = window.document.getElementById("spec" +ind);
        obj.style.display="block";
    }
    if (ind == 0)
    {
        obj = window.document.getElementById("precedent");
        obj.style.display="none";
    }
    if (ind < max)
    {
        obj = window.document.getElementById("suivant");
        obj.style.display="block";

    }
}
