if( !window.Element ){ var Element = function( ){ } ; }
// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

document.getElementsByClassName = function(clsName){
    var retVal = new Array();
    var elements = document.getElementsByTagName("*");
    for(var i = 0;i < elements.length;i++){
        if(elements[i].className.indexOf(" ") >= 0){
            var classes = elements[i].className.split(" ");
            for(var j = 0;j < classes.length;j++){
                if(classes[j] == clsName)
                    retVal.push(elements[i]);
            }
        }
        else if(elements[i].className == clsName)
            retVal.push(elements[i]);
    }
    return retVal;
}

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

function $( id ){ return document.getElementById( id ); }

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

function setCursor(etat){
		this.onmouseover=function(){
			document.body.style.cursor=etat;
			};
		this.onmouseout=function(){
			document.body.style.cursor='auto';
			};
}
Element.prototype.setCursor=setCursor;

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

// pour définir une instance d'objet requete asynchrone
function getXhr(){
	if( window.XMLHttpRequest ){ return new XMLHttpRequest( ) ; }
	else if( window.ActiveXObject ){
		try{ return new ActiveXObject( "Msxml2.XMLHTTP" ) ; }
		catch (e){ return new ActiveXObject( "Microsoft.XMLHTTP" ) ; }
	}else{
		alert( "Votre navigateur ne supporte pas les objets XMLHTTPRequest, veuillez le mettre à jour" ) ;
		return false;
	}
}

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

function center(){
	var wo=this.offsetWidth;
	var we=document.body.parentNode.offsetWidth;
	this.style.left=(we/2)-(wo/2)+"px";
	var ho=this.offsetHeight;
	var sTop=document.body.parentNode.scrollTop;
	var he=document.body.offsetHeight;
	if( this.className != 'infoDiv' ){
	     this.style.top=sTop+80+"px"; // (he/2)-(ho/2)+sTop+"px";
	}
}
Element.prototype.center=center;

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

function OfstLeft(){
	if(this.offsetParent){
		return ( this.offsetLeft + this.offsetParent.OfstLeft() );
	}else{
		return (this.offsetLeft);
	}
}
Element.prototype.OfstLeft=OfstLeft;

// -------------------------------------------------------------------

function OfstTop(){
	if(this.offsetParent){
		return ( this.offsetTop + this.offsetParent.OfstTop() );
	}else{
		return (this.offsetTop);
	}
}
Element.prototype.OfstTop=OfstTop;

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

function switchDisplay( ){
	var obj=this;
	obj.style.display="none";
	var etat;
	var diswitch = function( obj ){
		var set;
		etat=obj.style.display;
		if( etat == "block" ){ set = 'none'; }
		if( etat == "none" ){  set = 'block'; }
		obj.style.display=set;
	}
	for( var i=0 ; i<arguments.length ; i++ ){
		arguments[i].onclick=function(){
			diswitch( obj );
			};
		arguments[i].setCursor('pointer');
	}
}
Element.prototype.switchDisplay=switchDisplay;

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

function classDisplay( nom, val ){
	var tab=document.getElementsByClassName( nom );
	for(var i=0;i<tab.length;i++){
		tab[i].style.display=val;
	}
}

// (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·) (·)

