/* The following function creates an XMLHttpRequest object... */

function vds_createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

/* vdshttp holds our new XMLHttpRequest object. */
var vdshttp = vds_createRequestObject(); 

/* when the server is done, replace the button table with the new contents */
function vds_handleEntity(){
	// State 4 means the response is finished
	if(vdshttp.readyState == 4) { 
		var response = vdshttp.responseText;
		
		if (vdebug) alert(response);
		document.getElementById('vesignbox').innerHTML = response;
	}
}

/* called when the email signup button is clicked */
function vds_signup_email(){
	var email  = document.vesignform.vesignfield.value;
	if (vdebug) alert(email);
	var postList = 'email='+email;

	vdshttp.open('GET', '/vesignup.php?email='+escape(email),true);
	vdshttp.onreadystatechange = vds_handleEntity; 
	vdshttp.send(postList);
	return false;
}

function vds_clear_email() {
	document.vesignform.vesignfield.value = "";
}
	