function init_ajax()
{
	var xhr = null;
	// Firefox
	if(window.XMLHttpRequest){xhr = new XMLHttpRequest();}
	// Internet Explorer
	else if(window.ActiveXObject){xhr = new ActiveXObject("Microsoft.XMLHTTP");}
	// XMLHttpRequest non supporté par le navigateur
	else {alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");return;}
	return xhr;
}
//---------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------
function load_ajax(connexion,script_php,variable,exec)
{
	connexion.open('POST', script_php, true);
	connexion.onreadystatechange = function()
									{
										if(connexion.readyState == 4)
										{
											//alert(connexion.responseText);
											var tmp = connexion.responseText;
											var var_explode = connexion.responseText.split('!!');
											var tmp1 = var_explode[0];
											var tmp2 = var_explode[1];
											var tmp3 = var_explode[2];
											var tmp4 = var_explode[3];
											eval(exec);
										}
									}
	connexion.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	connexion.send(variable);
}
//--------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------
function loadform(varia)
{
			var variables = new Array;
		var m = document.getElementById(varia);
		var data = '';
		
		for(var i=0;i<m.elements.length;i++)
		{	
			// traitement bouton radio
			if(m.elements[i].type == 'radio')
			{
				if(m.elements[i].checked){variables[i] = '&'+m.elements[i].name+'='+m.elements[i].value;}
				else{variables[i] = '';}
			}
			// traitement champ text
			if(m.elements[i].type == 'text')
			{
				variables[i] = '&'+m.elements[i].name+'='+m.elements[i].value;
			}
			// traitement champ caché			
			if(m.elements[i].type == 'hidden')
			{
				variables[i] = '&'+m.elements[i].name+'='+m.elements[i].value;
			}
			// traitement liste déroulante			
			if(m.elements[i].tagName == 'SELECT')
			{
				variables[i] = '&'+m.elements[i].name+'='+m.elements[i].value;
			}
			// traitement zone de texte			
			if(m.elements[i].tagName == 'TEXTAREA')
			{
				variables[i] = '&'+m.elements[i].name+'='+m.elements[i].value;
			}
			// traitement case à cocher
			if(m.elements[i].type == 'checkbox')
			{
				if(m.elements[i].checked){variables[i] = '&'+m.elements[i].name+'=oui';}
				else{variables[i] = '&'+m.elements[i].name+'=non';}
			}
			// suppression du bouton dans le formulaire
			if(m.elements[i].type == 'button'){variables[i] = '';}
			
			data = data+variables[i];
		}
		// supprime le & en debut de chaine
		data = data.replace(/^&/, '');
		return(data);
}
//---------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------
function formulaire(nom, script)
{
		var variable = loadform(nom);
		var exec = "alert(tmp);";
		
		load_ajax(init_ajax(),script,variable,exec);
}
//--------------------------------------------------------------
//--------------------------------------------------------------
function init() {
			//==========================================================================================
			// if supported, initialize TransMenus
			//==========================================================================================
			// Check isSupported() so that menus aren't accidentally sent to non-supporting browsers.
			// This is better than server-side checking because it will also catch browsers which would
			// normally support the menus but have javascript disabled.
			//
			// If supported, call initialize() and then hook whatever image rollover code you need to do
			// to the .onactivate and .ondeactivate events for each menu.
			//==========================================================================================
			if (TransMenu.isSupported()) {
				TransMenu.initialize();

				// hook all the highlight swapping of the main toolbar to menu activation/deactivation
				// instead of simple rollover to get the effect where the button stays hightlit until
				// the menu is closed.

				
				
				

				//document.getElementById("liens").onmouseover = function()	{ ms.hideCurrent();	this.className = "hover"; }
				//document.getElementById("liens").onmouseout = function() { this.className = ""; }

				//document.getElementById("accueil").onmouseover = function()	{ ms.hideCurrent();	this.className = "hover"; }
				//document.getElementById("accueil").onmouseout = function() { this.className = ""; }

				//document.getElementById("aide").onmouseover = function()	{ ms.hideCurrent();	this.className = "hover"; }
				//document.getElementById("aide").onmouseout = function() { this.className = ""; }

				//document.getElementById("contact").onmouseover = function()	{ ms.hideCurrent();	this.className = "hover"; }
				//document.getElementById("contact").onmouseout = function() { this.className = ""; }
			}
			
	}

function init2() {

if (TransMenu2.isSupported()) {
				TransMenu2.initialize();

				// hook all the highlight swapping of the main toolbar to menu activation/deactivation
				// instead of simple rollover to get the effect where the button stays hightlit until
				// the menu is closed.

				menu8.onactivate = function() { document.getElementById("listref1").className = "hover"; };
				menu8.ondeactivate = function() { document.getElementById("listref1").className = ""; };
				menu8.item_click = function() { menu8.addItem.className = "thickbox"; };

				//menu9.onactivate = function() { document.getElementById("listref2").className = "hover"; };
				//menu9.ondeactivate = function() { document.getElementById("listref2").className = ""; };

				//menu10.onactivate = function() { document.getElementById("listref3").className = "hover"; };
				//menu10.ondeactivate = function() { document.getElementById("listref3").className = ""; };

				//menu11.onactivate = function() { document.getElementById("listref4").className = "hover"; };
				//menu11.ondeactivate = function() { document.getElementById("listref4").className = ""; };
				
				//menu12.onactivate = function() { document.getElementById("listref5").className = "hover"; };
				//menu12.ondeactivate = function() { document.getElementById("listref5").className = ""; };
				
				//menu13.onactivate = function() { document.getElementById("listref6").className = "hover"; };
				//menu13.ondeactivate = function() { document.getElementById("listref6").className = ""; };
				
				//menu14.onactivate = function() { document.getElementById("listref7").className = "hover"; };
				//menu14.ondeactivate = function() { document.getElementById("listref7").className = ""; };
				
				//menu8.item_click = function() { document.getElementById("listref1").className = "thickbox"; };
               
				
				//document.getElementById("listref1").item_click = function()	{ this.className = "thickbox"; }
				//document.getElementById("liens").onmouseout = function() { this.className = ""; }

				//document.getElementById("accueil").onmouseover = function()	{ ms.hideCurrent();	this.className = "hover"; }
				//document.getElementById("accueil").onmouseout = function() { this.className = ""; }

				//document.getElementById("aide").onmouseover = function()	{ ms.hideCurrent();	this.className = "hover"; }
				//document.getElementById("aide").onmouseout = function() { this.className = ""; }

				//document.getElementById("contact").onmouseover = function()	{ ms.hideCurrent();	this.className = "hover"; }
				//document.getElementById("contact").onmouseout = function() { this.className = ""; }
			}
			}
			
			