function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

 function sm(){
 var email='kaktus@inbox.lv';
 email= document.getElementById('subscr_mail').value;
 ///alert(email);
	var xmlhttp = getXmlHttp()
	xmlhttp.open("GET", "/sm.php?email="+email+"&l="+Math.random(), true);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4) {
			if(xmlhttp.status == 200) {
				if(xmlhttp.responseText=='1') alert('Paldies!');
				document.getElementById('subscr_mail').value='';
        	 }
    	}
    };
	xmlhttp.send(null);
 }


