// Procédures globales du projet
function prGetXhr(){
	var xhr = null; 
	if(window.XMLHttpRequest) // Firefox et autres
	xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ // Internet Explorer 
		try {
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
	else { // XMLHttpRequest non supporté par le navigateur 
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		xhr = false; 
		} 
	return xhr
	}
function prSessionAjax()
{
	var xhr = prGetXhr()
	xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
			
				if(xhr.responseText == "")
				{
				document.write('<div align="right">');
				document.write('<a href="login.php" style="font-family:Arial,Verdana;font-size:13px;color:#157EB4"><strong>Se connecter</strong></a>');
				document.write('<span style="color: #999999;font-weight: bold; font-family:Arial, Helvetica, sans-serif;font-size:12px">   |    </span>');
				document.write('<a href="registre.php" style="font-family:Arial,Verdana;font-size:13px;color:#157EB4"><strong>S\'inscrire</strong></a>');
				document.write('</div>');
				}
				else
				{
				document.write('<div align="right">');
				document.write('<span style="font-family:Arial,Verdana;font-size:12px;color:#FFFFFF"">ConnectÃ© : ' + jsSessLogin + '</span></br>' );
				document.write('<a href="logout.php" style="font-family:Arial,Verdana;font-size:13px;color:#157EB4"><strong>Se dÃ©connecter</strong></a>');
				document.write('</div>');
				}
			
			
			
			}
		}
		xhr.open("GET",sPage,true);
		xhr.send(null);
		
}

