function onContextMenu(el)
{
    if (el != undefined)
    {
        if (el.tagName.toUpperCase() == "IMG")
        {
            return true;
        }
        else
        {
            return false;
        }
    }    
}

function calePage()
{
    if (screen.availWidth)
    {
        var maxWidth = 1050;
        var maxHeight= 850;
        var larg = screen.availWidth;
        var haut = screen.availHeight;
        var dif1 = larg - maxWidth;
        var dif2 = haut - maxHeight;
        var obj = window.document.getElementById("idPos");
        if (dif1 > 0)
        {
            dif1 = dif1/2;
            obj.style.left=dif1;
        }
        if (dif2 > 50)
        {
            obj.style.top=30;
        }
    }
}

function onLoadIndex()
{
//  alert("screen.width = " + screen.width + " screen.height = " + screen.height);
//  alert("screen.availWidth = " + screen.availWidth + " screen.availHeight = " + screen.availHeight);
    var navigatorName = navigator.appName.toUpperCase();
    var lang = null; var rep = "";
    if (navigator.userLanguage)
    {
        lang = navigator.userLanguage;
    }
    else
    {
        if (navigator.language)
        {
            lang = navigator.language;
        }
    }
    //alert("language = " + lang + " userLanguage = " + navigator.userLanguage + " navigator.language = " + navigator.language);
    if (lang.indexOf("fr") == -1)
    {
        rep = "./en/";
        if (navigator.appName != "Microsoft Internet Explorer")
        {
            window.document.location = rep + "industrial-vacuum-cleaner-SapeAccueilBis.html";
        }
        else
        {
            window.document.location = rep + "industrial-vacuum-cleaner-SapeAccueil.html";
        }
    }
    else
    {
        if (navigator.appName != "Microsoft Internet Explorer")
        {
            window.document.location = "aspirateur-industriel-SapeAccueilBis.html";
        }
    }
    nav = window.document.getElementById("idNavigator");
    nav.innerHTML = navigator.appName + " " + navigator.appVersion;
}

function onLoadAccueilFr()
{
    var navigatorName = navigator.appName.toUpperCase();
    //alert("language = " + lang + " userLanguage = " + navigator.userLanguage + " navigator.language = " + navigator.language);
    if (navigator.appName != "Microsoft Internet Explorer")
    {
        window.document.location = "aspirateur-industriel-SapeAccueilBisFr.html";
    }
    nav = window.document.getElementById("idNavigator");
    nav.innerHTML = navigator.appName + " " + navigator.appVersion;
}

function onLoadAccueilBis()
{
    var lang = ""; var rep = "";
    if (navigator.userLanguage)
    {
        lang = navigator.userLanguage;
    }
    else
    {
        if (navigator.language)
        {
            lang = navigator.language;
        }
    }
    if (lang.indexOf("fr") == -1)
    {
        rep = "./en/";
        if (navigator.appName == "Microsoft Internet Explorer")
        {
            window.document.location = lang + "industrial-vacuum-cleaner-SapeAccueil.html";
        }
        else
        {
            window.document.location = lang + "industrial-vacumm-cleaner-SapeAccueilBis.html";
        }
    }
    if (navigator.appName == "Microsoft Internet Explorer")
    {
        window.document.location = "./index.html";
    }
    nav = window.document.getElementById("idNavigator");
    nav.innerHTML = navigator.appName + " " + navigator.appVersion;
}

function onLoadAccueilBisFr()
{
    if (navigator.appName == "Microsoft Internet Explorer")
    {
        window.document.location = "./aspirateur-industriel-SapeAccueilFr.html";
    }
    nav = window.document.getElementById("idNavigator");
    nav.innerHTML = navigator.appName + " " + navigator.appVersion;
}

function onLoadAccueilEn()
{
    var navigatorName = navigator.appName.toUpperCase();
    if (navigator.appName != "Microsoft Internet Explorer")
    {
        window.document.location = "./industrial-vacuum-cleaner-SapeAccueilBis.html";
    }
    nav = window.document.getElementById("idNavigator");
    nav.innerHTML = navigator.appName + " " + navigator.appVersion;
}

function onLoadAccueilBisEn()
{
    var navigatorName = navigator.appName.toUpperCase();
    if (navigator.appName == "Microsoft Internet Explorer")
    {
        window.document.location = "./industrial-vacuum-cleaner-SapeAccueil.html";
    }
    nav = window.document.getElementById("idNavigator");
    nav.innerHTML = navigator.appName + " " + navigator.appVersion;
}

function affichePlan(bool)
{
    var obj = document.getElementById("plan");
    if (bool)
    {
        obj.style.zIndex = 10;
        obj.style.display = "";
    }
    else
    {
        obj.style.zIndex = 0;
        obj.style.display = "none";    
    }
}