var domain = document.location.hostname;

//functions
function xmlhttpPost(strURL, params) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.setRequestHeader('Content-length', params.length);
    self.xmlHttpReq.setRequestHeader('Connection', 'close');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(params);
}

function updatepage(str, imgtag)
{
  //document.write(str);
  //document.close();
  //alert(str);
  //eval(str);
document.getElementById('error').innerHTML = str;
}

function postMailingList()
{
	document.getElementById('error').innerHTML = "sending...";
	//var email = document.forms['mailing_list'].email_address.value;
	//var querystring = 'email_address=' + escape(email);
	var email = document.forms['mailing_list'].EmailAddress.value;
	var querystring = 'EmailAddress=' + escape(email) + '&Lists[]=ALL&signup=GO';
	//alert("http://" + domain+ "/imgcount.php?scandir="+image_dir);
	//xmlhttpPost("http://" + domain+ "/cc.php",querystring); 
	xmlhttpPost("http://" + domain+ "/cctemp/signup/index.php",querystring); 
}


