function login(table){
	document.getElementById('log_result').innerHTML = "";
	$.post(path+"lib/php/login.ajax.php",{
	  login: document.getElementById('log_login').value,
	  password: document.getElementById('log_password').value,
	  remember: document.getElementById('log_remember').checked,
	  qui: table
	},function(request){
		if(isNaN(request)) {
			document.getElementById('log_result').innerHTML = request;
		} else {
			if(table=="user"){
				window.location = path+"?mrc="+request;
			}else{
				window.location = path;
			}
			$(document.getElementById('login_but')).html("D&eacute;connexion");
			$(document.getElementById('login_but')).set("href", path+"?logout");
			$(document.getElementById('login_but')).removeClass("thickbox");
			$(document.getElementById('login_but')).unclick();
			TB_remove()
		}
	});
	return false;
}

function updateInfoSubmit() {
	$("#errorCourrielUpdate").css("display", "none");
	$.post(path+"lib/php/updateinfo.ajax.php",{
	  email: document.getElementById('emailtoupdate').value
	},function(request){
		if(request == "true") {
			TB_remove();
			window.location="?msg=1";
		} else {
			$("#errorCourrielUpdate").html(request);
			$("#errorCourrielUpdate").css("display", "inline");
		}		
	});
}


$(function() {
	setTimeout(function() {
		$("#notification").fadeOut("normal", function(){$("#notification").remove()})
	},5000);
	//alert($("#col1").height()+" "+$("#col2").height())
	//*
	if($("#col1").height() > $("#col2").height()){
		$("#col2").height($("#col1").height()+"px");
	}else if ($("#col2").height() > $("#col1").height()){
		$("#col1").height($("#col2").height()+"px");
	}	
	//*/
	//changeMe = $("#col2").height() - $("#col1").height() + 5
	//$("#col1 .halfGray").before("<div style=\"height:"+changeMe+"px;\"></div>")
});

/*
function validateEmail(){
	$.post(path+"lib/php/validateEmail.ajax.php",{
	  courriel: document.getElementById('courriel').value
	}, function(request){
		//alert("1"+request);
		if(request=="existe") {
			document.getElementById('courrielExiste').value = "existe";// + document.getElementById('courriel').value;
			_courrielExiste = "existe";
		}else{
			document.getElementById('courrielExiste').value = "pas";// + document.getElementById('courriel').value;	
			_courrielExiste = "pas";
		}
	});
}
*/