//------------------------------------------------------------------------------------------
// Programmeur 		: (c) Daniel Lavoie
// Annee			: 2007
// Fichier 			: utils_screen.js
// But 				: librairie des functions retounant des valeurs de l'ecran du visiteur
// Modification		: -
//------------------------------------------------------------------------------------------

function utils_screen_largeur_document() {
    var windowWidth=0;
    if (typeof(window.innerWidth)=='number') {
        windowWidth=window.innerWidth;
    }
    else {
     if (document.documentElement&&
       document.documentElement.clientWidth) {
         windowWidth = document.documentElement.clientWidth;
    }
    else {
     if (document.body&&document.body.clientWidth) {
         windowWidth=document.body.clientWidth;
      }
     }
    }
    return windowWidth;
}

function utils_screen_hauteur_document() {
    var windowHeight=0;
    if (typeof(window.innerHeight)=='number') {
        windowHeight=window.innerHeight;
    }
    else {
     if (document.documentElement&&
       document.documentElement.clientHeight) {
         windowHeight = document.documentElement.clientHeight;
    }
    else {
     if (document.body&&document.body.clientHeight) {
         windowHeight=document.body.clientHeight;
      }
     }
    }
    return windowHeight;
}

function utils_screen_hauteur_page() {
	//return document.body.clientHeight;
	
	var x,y;
    var test1 = document.body.scrollHeight;
    var test2 = document.body.offsetHeight
    if (test1 > test2) // all but Explorer Mac
    {
        x = document.body.scrollWidth;
        y = document.body.scrollHeight;
    }
    else // Explorer Mac;
         //would also work in Explorer 6 Strict, Mozilla and Safari
    {
        x = document.body.offsetWidth;
        y = document.body.offsetHeight;
    }
    return y;
}

function utils_screen_position_scroll_vertial() {
    D=document;
    db=!D.documentElement.clientWidth?D.body:D.documentElement  //quirk IE6
    gk=window.Event?1:0/*Gecko*/;
    sy=gk?pageYOffset:db.scrollTop;                             //scroll v
    return sy;
}