// --------------------------------------------------------------------------------
// variable diverses
// --------------------------------------------------------------------------------
	var msie = navigator.userAgent.indexOf('MSIE') != -1 ? true : false;

// ------------------------------------------------------------------------------------
// 												F O N C T I O N    G L O B A L E 
// ------------------------------------------------------------------------------------

	// ------------------------------------------------------------------------------------
	// renvoi l'objet correspondant en fonction du browner lors de appel : globale
	// ------------------------------------------------------------------------------------

	if(!document.getElementById && document.all){document.getElementById = function(id) {return document.all[id];};}
	else if(!document.getElementById && !document.all){document.getElementById = function(id) {return { style: {} };};}

	function G_obj(objname){
		eval('testObj = document.getElementById("'+objname+'");');
		return testObj;
		}
	
	// ------------------------------------------------------------------------------------
	// Vérifie la syntaxe générale d'un Email 
	// ------------------------------------------------------------------------------------
	function G_bSyntaxeEmail(sMail){
		var re=/^[a-z\d]+((\.|-|_)[a-z\d]+)*@((?![-\d])[a-z\d-]{0,62}[a-z\d]\.){1,4}[a-z]{2,6}$/gi;
		return (sMail.match(re)==sMail)&&(sMail.substr(sMail.lastIndexOf("@")).length<=256);
		}

	// ------------------------------------------------------------------------------------
	// L'extension du nom de domaine est-t-elle correcte ?
	// ------------------------------------------------------------------------------------
	function G_bDomainTLD(sMail){
		var re=/^(ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cat|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw|aero|arpa|biz|com|coop|edu|eu|gov|info|int|mil|museum|name|net|org|pro|jobs|travel)$/gi;
		return sMail.substr(sMail.lastIndexOf(".") + 1).match(re)!=null;
		}

	// ------------------------------------------------------------------------------------
	// La fonction globale de test du mail
	// ------------------------------------------------------------------------------------
	function G_testmail(sMail){
		if (!G_bSyntaxeEmail(sMail)){return false;}
	  else if (!G_bDomainTLD(sMail)){return false;}
	  else {return true;}
		}

	// ------------------------------------------------------------------------------------
	// recuperation des tailles de la page
	// ------------------------------------------------------------------------------------

	function G_getPageSize(){
		var xScroll, yScroll, vScroll, hScroll, windowWidth, windowHeight,pageWidth, pageHeight;
		if (window.innerHeight && window.scrollMaxY) {xScroll = document.body.scrollWidth;yScroll = window.innerHeight + window.scrollMaxY;}
		else if (document.body.scrollHeight > document.body.offsetHeight){xScroll = document.body.scrollWidth;yScroll = document.body.scrollHeight;}
		else {xScroll = document.body.offsetWidth;yScroll = document.body.offsetHeight;}
		if (self.innerHeight){windowWidth = self.innerWidth;windowHeight = self.innerHeight;}
		else if (document.documentElement && document.documentElement.clientHeight) {windowWidth = document.documentElement.clientWidth;windowHeight = document.documentElement.clientHeight;}
		else if (document.body){windowWidth = document.body.clientWidth;windowHeight = document.body.clientHeight;}
		if(yScroll < windowHeight){pageHeight = windowHeight;}else{pageHeight = yScroll;}
		if(xScroll < windowWidth){pageWidth = windowWidth;}else{pageWidth = xScroll;}
		if (self.pageYOffset) {vScroll = self.pageYOffset; hScroll = self.pageXOffset;}
		else if (document.documentElement && document.documentElement.scrollTop){vScroll = document.documentElement.scrollTop;hScroll = document.documentElement.scrollLeft;}
		else if (document.body) {vScroll = document.body.scrollTop;hScroll = document.body.scrollLeft;}
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight, hScroll , vScroll);
		return arrayPageSize;
		}
		
	function G_getObjetWidth(objet){
		return objet.offsetWidth;
		}

	function G_getObjetHeight(objet){
		return objet.offsetHeight;
		}

	function F_log_a(objet){
		objet.style.backgroundColor = "#ffffa0";
		objet.style.Color = "#000050";
		}

	function F_log_d(objet){
		objet.style.backgroundColor = "#ffffff";
		objet.style.Color = "#000000";
		}
	
	function G_float(ide){
		reg=new RegExp("[^0-9.,]", "gi");
		ide.value=ide.value.replace(reg, "");
		ide.value=ide.value.replace(",", ".");
		}

	function G_aff_select(visibl){
		if(msie){
			selects = document.getElementsByTagName("select");
	    for (i = 0; i != selects.length; i++) {selects[i].style.visibility = visibl;}
			}
		}