function VerifForm(formulaire)
{
	adresse = formulaire.email.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
	{
		formulaire.submit();
		return(true);
	}
	else
	{
		alert('Entrez une adresse e-mail valide !');
		return(false);
	}
}

function HiddenTable(tid1, tid2)
{
	if (document.getElementById(tid1).style.display == "none")
	{
	    document.getElementById(tid2).style.display = "none";
	    document.getElementById(tid1).style.display = "";
	}
	else if (document.getElementById(tid2).style.display == "none")
	{
	    document.getElementById(tid2).style.display = "";
	    document.getElementById(tid1).style.display = "none";
	}
}

function HiddenShowTable(tid)
{
	if (document.getElementById(tid).style.display == "none")
	{
	    document.getElementById(tid).style.display = "";
	}
	else 
	{
	    document.getElementById(tid).style.display = "none";
	}
}

function log_out()
{
	if (confirm('Êtes vous sûr de vouloir vous déconnecter ?'))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function confirm_submit(message)
{
	if (confirm(message))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function confirm_action(message)
{
	if (confirm(message))
	{
		return true;
	}
	else
	{
		return false;
	}
}

function affichage_popup(nom_de_la_page, nom_interne_de_la_fenetre, width, height)
{
   window.open(nom_de_la_page, nom_interne_de_la_fenetre, config='height='+height+', width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no');
}

function sendData(page, param, elementID)
{
	elementID = (elementID == "") ? "contenu" : elementID;
	
	if(document.all)
	{
		var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
	}
	else
	{
		var XhrObj = new XMLHttpRequest();
	}

	var content = document.getElementById(elementID);
		
	XhrObj.open("POST", page);

	XhrObj.onreadystatechange = function()
	{
		if (XhrObj.readyState == 4 && XhrObj.status == 200)
		{
			content.innerHTML = XhrObj.responseText;
		}
	}

	XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	XhrObj.send(param);
}

function change_photo(photo_name)
{
	document.getElementById('main_photo').src = photo_name;
}
