﻿var iButtonPos;
iButtonPos = 20;
function GetValue(strIn)
{
    return (eval(strIn.substr(0,strIn.indexOf("px"))));
}
function SetValue(x)
{
    return (x.toString() + "px");
}
function AddPixels(strIn,iDelta)
{
    var strRetour;
    strRetour = (GetValue(strIn) + iDelta).toString() + "px";
    return(strRetour);
}
function SelectContent(oControl)
{
    var oRange;
     if (oControl.value > "")
    {
        oRange = oControl.createTextRange();
        oRange.findText(oControl.value);
        oRange.select();
    }
}
function AddButton(strId,strTitle)
{
    var oButton;
    oButton = document.getElementById(strId);
    if (oButton)
    {
        oButton.title = strTitle;
        if (PrehistoricNavigator())
        {
            oButton.style.left = SetValue(iButtonPos);
        }
        else
        {
            oButton.style.pixelLeft = iButtonPos;
        }
        oButton.style.visibility = "";
    }
    if (strId == "imgLogo") 
    {
        iButtonPos+=100;
    }
    else
    {
        iButtonPos+=40;
    }
}
function PrehistoricNavigator()
{
    if (window.ActiveXObject)
    {
        return (false);
    }
    else
    {
        return (true);
    }
}
function Affichage169()
{
    if ((screen.width/screen.height) > 1.4)
    {
        return (true);
    }
    else
    {
        return (false);
    }
}

function GetFullWidth()
{
    var iWidth;
	if (PrehistoricNavigator())
	{
	    iWidth = window.innerWidth - 50 ;
	}
	else
	{
	    iWidth = document.body.offsetWidth - 40 ;
	}
    return (iWidth );
}
function GetFullHeight()
{
    var iHeight;
    if (window.location.href.indexOf("minimized") > 0)
    {
	 iHeight = GetFullWidth()  * (screen.height/screen.width) - 150;
    }
    else
    {
	 iHeight = GetFullWidth()  * (screen.height/screen.width) ;
    }
    return (iHeight);}






