
function jsmove(e, abor) {

    var DocRef;
    if( document.documentElement && document.documentElement.clientWidth) {
        DocRef = document.documentElement;
    } else {
        DocRef = document.body;
    }
    
    // retourne la posi X ou Y de la souris dans la fenêtre
    if (abor == "x" || abor == "y") {
        var x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.clientX+DocRef.scrollLeft;
        var y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.clientY+DocRef.scrollTop;
    
        if (abor == "x") return x;
        if (abor == "y") return y;
    }
    
    // retourne la hauteur d'un élément
    if (abor == "h") {
        var elm = document.getElementById(e);
        if (elm.offsetHeight) {
            var h = elm.offsetHeight;
        } else if (elm.style.pixelHeight) {
            var h = elm.style.pixelHeight;
        }
        return h;
    }
    
    // retourne la largeur d'un élément
    if (abor == "w") {
        var elm = document.getElementById(e);
        if (elm.offsetWidth) {
            var w = elm.offsetWidth;
        } else if (elm.style.pixelWidth) {
            var w = elm.style.pixelWidth;
        }
        return w;
    }
    
    // retourne la posi TOP d'un élément par rapport à son parent
    if (abor == "top") {
        var elm = document.getElementById(e);
        var h = 0;
        if (elm.offsetParent) {
            do {
                h += elm.offsetTop;
            } while (elm = elm.offsetParent);
        }
        return h;
    }
    
    // retourne la posi LEFT d'un élément par rapport à son parent
    if (abor == "left") {
        var elm = document.getElementById(e);
        var w = 0;
        if (elm.offsetParent) {
            do {
                w += elm.offsetLeft;
            } while (elm = elm.offsetParent);
        }
        return w;
    }
    
    // retourne le scroll horizontal d'un élément ou d'une page
    if (abor == "scroll") {
        var elm = document.getElementById(e);
        var scr = 0;
        if ( elm.scrollTop ){
            scr = elm.scrollTop;
        } else if ( elm.pageYOffset ){
            scr = elm.pageYOffset;
        } else if ( elm.scrollY ){
            scr = elm.scrollY;
        }
        return scr;
    }

}


// Cacul de la taille fenetre, ecran et scrolls
// retourne 0=page width, 1=page height, 2=window width, 3=window height, 4=scroll X, 5=scroll Y
function getPageSize(){
	
	var xScroll, yScroll, y_ratio;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
		y_ratio = window.pageYOffset;
	} else if (document.body.scrollTop){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
		y_ratio = document.body.scrollTop;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.documentElement.offsetWidth;
		yScroll = document.documentElement.offsetHeight;
		y_ratio = document.documentElement.scrollTop;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight,xScroll,y_ratio) 
	return arrayPageSize;
}