var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid){
	var page_request = false
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
	page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE
	try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
				}
				}
				else
				return false
				page_request.onreadystatechange=function(){
					loadpage(page_request, containerid)
				}
					page_request.open('GET', url, true)
					page_request.send(null)
		}

function loadpage(page_request, containerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(containerid).innerHTML=page_request.responseText
	else if (page_request.readyState == 4) 
		document.getElementById(containerid).innerHTML="Loading...";
	else if (page_request.readyState == 3) 
		document.getElementById(containerid).innerHTML="In progress...";
		
	}
	

function toggleProcedure(currProcedure,thisExpander) {
		thisProcedure = document.getElementById(currProcedure).style;
		thisExpander = document.getElementById(currProcedure);
		if (thisProcedure.display == "block") {
			thisProcedure.display = "none";
			thisExpander.backgroundImage = "hgh";
		}
		else {
			thisProcedure.display = "block";
			thisExpander.backgroundImage = "hghg";
		}
	return false
}


function menuHorizontal(currProcedure,currBouton) {
		
		thisBouton = document.getElementById(currBouton).style;
		if(currProcedure!='exigences'){
			thisProcedure = document.getElementById(currProcedure).style;


			// initialisation de l'affichage
			// tous à none
			document.getElementById("intro").style.display = "none";
			document.getElementById("formulaires").style.display = "none";
			
			document.getElementById("menuHorizontalIntro").style.backgroundColor = "#FFFFFF";
			document.getElementById("menuHorizontalExigences").style.backgroundColor = "#FFFFFF";
			document.getElementById("menuHorizontalFormulaire").style.backgroundColor = "#FFFFFF";
			
			
			// affichage de la section courante
			thisProcedure.display = "block";
		}
		thisBouton.backgroundColor = "#D1D8E4";
		
	return false
}


function menuHorizontal2(currProcedure,currBouton) {
		thisProcedure = document.getElementById(currProcedure).style;
		thisBouton = document.getElementById(currBouton).style;
		
		// initialisation de l'affichage
		// tous à none
		document.getElementById("intro").style.display = "none";
		document.getElementById("formulaires").style.display = "none";

		document.getElementById("menuHorizontalIntro").style.backgroundColor = "#FFFFFF";
		document.getElementById("menuHorizontalExigences").style.backgroundColor = "#FFFFFF";
		document.getElementById("menuHorizontalFormulaire").style.backgroundColor = "#FFFFFF";
		
		
		
		// affichage de la section courante
		thisProcedure.display = "block";
		thisBouton.backgroundColor = "#D1D8E4";
		
	return false
}



function initialisationGenotypage() {
		document.getElementById("intro").style.display = "block";
		document.getElementById("formulaires").style.display = "none";
		
		document.getElementById("menuHorizontalIntro").style.backgroundColor = "#FFFFFF";
		document.getElementById("menuHorizontalExigences").style.backgroundColor = "#FFFFFF";
		document.getElementById("menuHorizontalFormulaire").style.backgroundColor = "#FFFFFF";
		
	return false
}


function initialisationGenotypage2() {
		document.getElementById("intro").style.display = "block";
		document.getElementById("formulaires").style.display = "none";
		
		document.getElementById("menuHorizontalIntro").style.backgroundColor = "#FFFFFF";
		document.getElementById("menuHorizontalExigences").style.backgroundColor = "#FFFFFF";
		document.getElementById("menuHorizontalFormulaire").style.backgroundColor = "#FFFFFF";
		
	return false
}
