var path = '';

function getHTTPObject(){
	if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
 		else if (window.XMLHttpRequest) return new XMLHttpRequest();
 	else {
		alert("Your browser does not support AJAX.");
	return null;
 	}
}

// Change the value of the outputText field
function setOutput(){
	if(httpObject.readyState == 4){
		var response = httpObject.responseText;
		if(response=="success"){
			document.getElementById('cont').innerHTML = '<h2>Thanks! I told you it was easy. =)</h2>';
//	  	popUp_2(""+ path + "/popup/success_" + lang + ".html");
//		document.getElementById('email').value='Enter Email';
		}else{
//	  	popUp_2(""+ path + "/popup/error_" + lang + ".html");
//		document.getElementById('email').value='Enter Email';
		}
	}
       
}
 // Implement business logic
function doWork(){
 	httpObject = getHTTPObject();
	if (httpObject != null) {
 	  httpObject.open("GET", ""+ path + "/includes/lib.php?name="+document.getElementById('name').value+"&email="+document.getElementById('email').value+"&message="+document.getElementById('message').value);
 	  httpObject.send(null);
	  httpObject.onreadystatechange = setOutput;
 	}
}
var httpObject = null;

function loading(the_id){
	document.getElementById(the_id).value='';
	document.getElementById(the_id).style.background="#fff url(/images/loading.gif) center center no-repeat";
}