
function fi(u) {location.href = u;}

function zoom(url, w, h) {
    window.open(url, "zoom", "width="+w+",height="+h+" ,toolbar=no, location=no,status=no,menubar=no,scrollbars=no,resizable=no");
}

function readCookie(name) {

    var cookiename = name + "=";
    
    var ca = document.cookie.split(';');
    
    for(var i=0;i < ca.length;i++) {
    
        var c = ca[i];
        
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        
        if (c.indexOf(cookiename) == 0) return c.substring(cookiename.length,c.length);
    
    }
    
    return null;
}

function inviaCommento(form) {    
                
if( form.testo.value == "" ) {
    alert("contenuto della richiesta vuoto");
    return;
}

var post = "id_articolo=" + form.id_articolo.value;
    post+= "&utente="+ form.utente.value;
    post+= "&email="+ form.email.value;
    post+= "&url="+ form.url.value;
    post+= "&testo="+ form.testo.value;
    post+= "&captcha="+ form.captcha.value;

var xmlhttp = newXMLHttpRequest();

if (xmlhttp!=null) {        
    xmlhttp.open("POST","/admin/commenti/makeReview.php",true);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlhttp.send(post);
    xmlhttp.onreadystatechange = handleResponse(xmlhttp, resultInviaCommento, ResponseType.html);
} else {
    alert("Il tuo browser non supporta XMLHttpRequest")
}
//alert(form.id_articolo.value);
}

function resultInviaCommento(XMLResult) {
alert(XMLResult);
}
