http_request_top100 = false;
host_affiliate_top100 = window.location.host;
document.write('<div style="width:114px; font-size:10px; border:#' + top100_col_border + '; border-style:solid; border-width:1px;" align="center"><div align="center" style="margin:2px"><img src="http://www.top100-solar.it/affiliate/Banner_Servizio_Newsletter_' + top100_col_banner + '.png" border="none" alt="Official Partner site: ' + host_affiliate_top100 + '" style="padding:inherit; margin: 0px" align="center" /></div><form action="javascript:get_top100(document.getElementById(\'form_newsletter_top100\'));" name="form_newsletter_top100" id="form_newsletter_top100" style="display:inline; border:none; padding:inherit; margin:inherit;"><div align="center"><input id="email_newsletter_top100" align="middle" maxlength="50" style="padding:inherit; background-color:#FFFFCC; border-style:inset; width:100px; margin:0px 2px 1px 2px; font-size:10px;"></div><div align="center"><input id="join_newsletter_top100_button" type="button" style="background-color:#' + top100_col_button + '; border-color:#CCCCCC; border-width:1px; color:#' + top100_col_txt_button + '; font-family:Arial, Helvetica, sans-serif; font-size:10px; font-weight:bold; margin:1px;" name="join_newsletter_top100_button" value="Registrami" onclick="javascript:get_top100(this.parentNode);"></div></form><span style="color:#' + top100_col_text + '; font-family:Arial; font-size:10px" name="newsletter_span_top100" id="newsletter_span_top100"></span></div>');

function makePOSTRequest_top100(a, b) {
    if (window.XMLHttpRequest) {
        http_request_top100 = new XMLHttpRequest();
        if (http_request_top100.overrideMimeType) {
            http_request_top100.overrideMimeType('text/html')
        }
    } else if (window.ActiveXObject) {
        try {
            http_request_top100 = new ActiveXObject("Msxml2.XMLHTTP")
        } catch(e) {
            try {
                http_request_top100 = new ActiveXObject("Microsoft.XMLHTTP")
            } catch(e) {}
        }
    }
    if (!http_request_top100) {
        alert('Cannot create XMLHTTP instance');
        return false
    }
    http_request_top100.onreadystatechange = alertContents_top100;
    http_request_top100.open('POST', a, true);
    http_request_top100.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http_request_top100.setRequestHeader("Content-length", b.length);
    http_request_top100.setRequestHeader("Connection", "close");
    http_request_top100.send(b)
}
function alertContents_top100() {
    document.getElementById('newsletter_span_top100').innerHTML = '<img src="http://www.top100-solar.it/images/ajax-spinner_2.gif">';
    if (http_request_top100.readyState == 4) {
        if (http_request_top100.status == 200) {
            result = http_request_top100.responseText;
            document.getElementById('newsletter_span_top100').innerHTML = result;
            setTimeout("document.getElementById('newsletter_span_top100').innerHTML = '';", 7 * 1000)
        } else {
            document.getElementById('newsletter_span_top100').innerHTML = 'Spiacente, ci sono poblemi con la richiesta!<br /> Riprova piu\' tardi.';
            setTimeout("document.getElementById('newsletter_span_top100').innerHTML = '';", 5 * 1000)
        }
    }
}
function get_top100(a) {
    var b = document.getElementById("email_newsletter_top100").value;
    var c = "email_newsletter_top100=" + encodeURI(b) + "&client_id=" + encodeURI(top100_id) + "&url_srv=" + encodeURI("http://www.top100-solar.it") + "&act=" + encodeURI("submit") + "&t_out=" + encodeURI("10");
    if (b) {
        if (!b.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/)) {
            document.getElementById('newsletter_span_top100').innerHTML = 'Indirizzo E-Mail NON valido!';
            setTimeout("document.getElementById('newsletter_span_top100').innerHTML = '';", 3 * 1000)
        } else {
			if (top100_pth) {
				var Post_Path = "/" + top100_pth + "/" + "Api_Client_Top100Solar.php";
			} else {
				var Post_Path = "../Api_Client_Top100Solar.php";
			}
            makePOSTRequest_top100(Post_Path, c)
        }
    } else {
        document.getElementById('newsletter_span_top100').innerHTML = 'Inserisci il tuo indirizzo E-Mail!';
        setTimeout("document.getElementById('newsletter_span_top100').innerHTML = '';", 3 * 1000)
    }
}