function changeLanguage(lang) {
	jQuery.post("request.php", {
		strFunction : "changeLanguage",
		strArgs : "'" + lang + "'"
	}, function(answer) {
		location.reload();
	});
}
function logout(){
    jQuery.post("acces_web/ajax.php",{ strFunction: "logoutUser", strArgs: ""},
	    function(answer){document.location = "index.php";});
}
function doSubmitLoginRight(){
    user = jQuery.trim(jQuery("#login_right_user").val());
    pass = jQuery.trim(jQuery("#login_right_pass").val());
    
    strError = "";
    if (user == "") {
        strError += "Vous devez saisir l'adresse e-mail !" + "<br />";
    } else if (!checkEmail(user)) {
        strError += "Votre nom d'utilisateur doit &ecirc;tre une adresse d'e-mail valide !" + "<br />";
    }
    if (pass == "") {
        strError += "Vous devez saisir un mot de passe !" + "<br />";
    }
    if (strError == "") {
    	return true;
    } else {
        jError(strError, "Erreurs");
        return false;
    }
}
function doOnBlur1(obj, nSel){
    if (obj.value.replace(/ /g,'') == ''){
    	obj.value = "Recherche";
    }
}
function doOnFocus1(obj,nSel){
    if (obj.value == "Recherche"){
        obj.value = "";
    }
}

function doOnBlur2(obj, nSel){
    if (obj.value.replace(/ /g,'') == ''){
    	obj.value = "identifiant";
    }
}
function doOnFocus2(obj,nSel){
    if (obj.value == "identifiant"){
        obj.value = "";
    }
}
function doOnBlur3(obj, nSel){
    if (obj.value.replace(/ /g,'') == ''){
    	obj.value = "Mot de passe";
    }
}
function doOnFocus3(obj,nSel){
    if (obj.value == "Mot de passe"){
        obj.value = "";
    }
}
function doOnBlur4(obj, nSel){
    if (obj.value.replace(/ /g,'') == ''){
    	obj.value = "par prix";
    }
}
function doOnFocus4(obj,nSel){
    if (obj.value == "par prix"){
        obj.value = "";
    }
}
function doOnBlur(obj, nSel) {
    switch (nSel) {
        case 10:
            if (obj.value.replace(/ /g,'') == '')
                obj.value = "Votre E-mail...";
            break;
    }
}
function doOnFocus(obj,nSel) {
   switch (nSel) {
       case 10:
           if (obj.value == "Votre E-mail...")
               obj.value = "";
           break;
   }
}
function searchForWord(){
    var strText = jQuery("#filter-word").val();
    if(strText == "Recherche" || strText == ""){
        jAlert("Vous devez saisir le champ de recherche !","Rechercher");
        return false;
    } else {
        jQuery("#searchForm").attr("action","recherche,"+rewriteUrl(strText)+".html");
        jQuery("#searchForm").submit();
        return true;
    }
}
