var xmlHttp3;

function subscribeToNewsletter(email) {

    var i;

    xmlHttp3=GetXmlHttpObject3();
    if (xmlHttp3==null) {
        alert("O περιηγητής (browser) σας δεν υποστηρίζει την τεχνολογία AJAX.\n");
        document.getElementById("sendNLLoading").style.display = 'none';
        document.getElementById("sendNL").style.display = 'inline';
        return;
    } 


    if ((email=="") || (email=="Το email σας..."))  { 
        alert("Παρακαλώ εισάγετε το email σας\n\n");
        document.getElementById("sendNLLoading").style.display = 'none';
        document.getElementById("sendNL").style.display = 'inline';
        return;
    }

    var url="/feeds/newsletter.asp";
    url=url+"?email="+escape(email);
    url=url+"&sid="+Math.random();

    //alert(url);
    //alert(xmlHttp3.readyState);
    xmlHttp3.onreadystatechange=stateChanged3;
    xmlHttp3.open("GET",url,true);
    xmlHttp3.send(null);
} 

function stateChanged3() {

    // alert(xmlHttp3.readyState);

    if (xmlHttp3.readyState==4) {
        document.getElementById("sendNLLoading").style.display = 'none';
        document.getElementById("sendNL").style.display = 'inline';
        alert(xmlHttp3.responseText);
    }
}

function GetXmlHttpObject3() {
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        return new XMLHttpRequest();
    }
    if (window.ActiveXObject) {
        // code for IE6, IE5
        return new ActiveXObject("Microsoft.XMLHTTP");
    }
    return null;
}
