if (!document.all) {
	Window.prototype.$ = function (id_tag) {
		if ( typeof(document.getElementById( id_tag )) == 'object' )
			return document.getElementById( id_tag );
		else {
			return document.getElementsByTagName(id_tag);
		}
	}

	Function.prototype.$ = function (id_tag) {
		if ( typeof(document.getElementById( id_tag )) == 'object' )
			return document.getElementById( id_tag );
		else {
			return document.getElementsByTagName(id_tag);
		}
	}

	
	// Definir une propriete color pour tout elementHTML
	HTMLElement.prototype.__defineSetter__ ("color", function ( color) {
		this.style.color = color;
	});

	HTMLElement.prototype.__defineGetter__ ("color", function () {
		return this.style.color;
	});
	
	
	// Definir une propriete Childdren qui se comporte comme celle d'IE
	HTMLElement.prototype.__defineGetter__ ("children", function () {
		array_nodes = new Array(), i = 0, taille = this.childNodes.length;
		for ( i; i < taille; i++) {
			if ( this.childNodes[i].nodeType == 1 )
				array_nodes.push(this.childNodes[i]);
		}
		return array_nodes;
	});

	// Redefinir une propriete firstChild qui se comporte comme celle d'IE
	HTMLElement.prototype.__defineGetter__("firstChild", function () {
		var i = 0;
		while (this.childNodes[i].nodeType == 3) i++;
		return this.childNodes[i];
	});
	
	// Redefinie la propriété toelement pour moz <=> a relatedTarget
	Event.prototype.__defineGetter__("toElement", function () {
		 var node = this.relatedTarget;
		 while (node.firstChild.nodeType != 1) {
			node = node.firstChild;
		 }
		 return node;
	});

	// Redefinie la propriété toelement pour moz <=> a targer
	Event.prototype.__defineGetter__("fromElement", function () {
	});

	// Redefinir une propriete lastChild qui se comporte comme celle d'IE
	HTMLElement.prototype.__defineGetter__("lastChild", function () {
		var i = this.childNodes.length;
		while (this.childNodes[i].nodeType == 3) i--;
		return this.childNodes[i];
	});
	
	// InnerText est rendu possible sous Mozilla 
	Node.prototype.__defineSetter__ ("innerText", function ( value ) {
		this.innerHTML = value;
	});
	
	Node.prototype.__defineSetter__ ("onmouseenter", function () {
		
	});


	//document.getElementById('test').bind('onclick',1,2,3);
	// Appel pour chaque element du tableau la fonction passe en parametre
	/*
	Array.prototype.__defineSetter__ ("each", function ( fnc, param1, param2) {
		array_returned = new Array();
		for (var i=0; i< this.length; i++) 
				array_returned.push(fnc(this[i], param1, param2));
		return array_returned;
	});

	// Definir une méthode de l'objet Array qui retourne les elements du tableau d'origines si needle est trouvé
	Array.prototype.find = function ( array_origine, needle) {
		array_returned = new Array();
		for (var i=0; i< this.length; i++) 
			if ( this[i].indexOf(needle) != -1 )
				array_returned.push( array_origine[i]);
			return array_returned; 
	}
	*/
	// Rajoute une méthode à l'objet String, ajoute une sous chaine à une chaine deja presente
	String.prototype.addSubStr = function ( substr, start) {
			var debut_chaine = this.substr(0, start);
			var fin_chaine = this.substr(start, this.length);
			return debut_chaine + substr + fin_chaine;
	}

	HTMLElement.prototype.insertAdjacentText = function ( position, text ) {
		pos = null;
		textnode = document.createTextNode(text);
		switch ( position ) {
			case 'BeforeBegin' :
				this.parentNode.insertBefore(textnode, this);
				break;
			case 'AfterBegin' :
					this.insertBefore(textnode,this.firstChild);
				break;
			case 'BeforeEnd' :
					this.appendChild(textnode);
				break;
			case 'AfterEnd' :
				if (this.nextSibling) 
					this.parentNode.insertBefore(textnode,this.nextSibling);
				else
					this.parentNode.appendChild(textnode);
				break;
		}
	}
}