function affichePopUp (nom)
{
      var popup = EL (nom);
      var pos   = getDocumentScroll();

      popup.style.display = 'block';
      popup.style.top     = (pos.y + 100) + "px";

      toggleCurtain();

      return false;
}

// Contactez-nous page (window.open) to centre pop-up
function affichePopUpContactUs (nom)
{
      var popup = EL (nom);
      var pos   = getDocumentScroll();

      popup.style.display = 'block';
      popup.style.top     = (pos.y + 220) + "px";
      popup.style.left     = (pos.x - 150) + "px";

      toggleCurtain();

      return false;
}

function masquePopUp (nom)
{
      var popup = EL (nom);

      popup.style.display = 'none';

      return false;
}

function getDocumentScroll()
{
    var scroll = {};

    scroll.x = 0;
    scroll.y = 0;

    if (typeof window.pageYOffset == 'number')
    {
        scroll.y = window.pageYOffset;
        scroll.x = window.pageXOffset;
    }
    else if (document.body && (document.body.scrollLeft || document.body.scrollTop))
    {
        scroll.y = document.body.scrollTop;
        scroll.x = document.body.scrollLeft;
    }
    else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
    {
        scroll.y = document.documentElement.scrollTop;
        scroll.x = document.documentElement.scrollLeft;
    }

    return scroll;
}

function addWindowOnUnload(func)
{
    var windowonbeforeunload = window.onbeforeunload;

    window.onbeforeunload = function()
    {
        if( windowonbeforeunload != null )
        {
            windowonbeforeunload();
        }

        func();
    }
}
function trim(val)
{
    var retour = "";

    for(var i=0;i < val.length;i++)
    {
        if(val.charAt(i) != " ")
        {
            retour += val.charAt(i);
        }
    }

    return retour;
}