
function actualiseListe(id,li) {

//Connexion au serveur
if (window.XMLHttpRequest) { //Firefox ou IE >= 7.0
    xhr = new XMLHttpRequest();
} else if (window.ActiveXObject) {
    try { // essaie de charger l'objet pour IE
        xhr = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try { // essaie de charger l'objet pour une autre version IE
            xhr = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {
            window.alert("Votre navigateur ne prend pas en charge l'objet XMLHTTPRequest.");
        }
    } 
}

//Fonction déclenchée après l'envoi
xhr.onreadystatechange = function() { 
    if(xhr.readyState == 4) { // 4=ok
        if(xhr.status  == 200) //200 = received, correspond aux codes http
            document.getElementById("liste_commentaire").innerHTML = xhr.responseText;
        else // Autre que 200, par exemple 404
            document.getElementById("liste_commentaire").innerHTML = "Error code " + xhr.status;
    }
}; 

//Ici on envoie la requête
xhr.open('GET', 'ajax_commentaire.php?id='+id+'&debut='+li, true);
xhr.send(null); 

return;

} 


function verif( ) {
		var bool = true
	  	var commentaire = document.getElementById('box_comm').value;
		var pseudo = document.getElementById('box_pseudo').value;
		var mail = document.getElementById('box_mail').value;
		
		if ( commentaire.length == 0  || pseudo.length == 0 || mail.length == 0){
			bool = false;
		}

		if ( bool == false ) {
			alert("Veuillez remplir tous les champs !");
			return false;
		}	
}

function changePartie(type, id) {
	var hide = 'partie_2';
	var show  = 'partie_1';
	
	if (type == 'next') {
		hide = 'partie_1';
		show = 'partie_2';
	}
	
	jQuery('#' + id + ' .' + hide).fadeOut('slow', function() {
		jQuery('#' + id + ' .' + type).hide();
		
		if (type == 'next') {
			jQuery('#' + id + ' .previous').show();
		} else {
			jQuery('#' + id + ' .next').show();
		}
		
		jQuery('#' + id + ' .' + show).fadeIn('slow');
	});
}

function popup(page,largeur,hauteur,options) {
    var top=(screen.height-hauteur)/2; 
    var left=(screen.width-largeur)/2;
    window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); 
} 