/* The following function creates an XMLHttpRequest object... */

function 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
}
var http = createRequestObject(); 

/* Function called to get the product categories list */
function getemail(yn,ye,fn1,fe1,message,tot,copy,sc,qs){
	http.open('get', 'intermediate.php?mode=refer&yn='+yn+'&ye='+ye+'&fn1='+fn1+'&fe1='+fe1+'&message='+message+'&tot='+tot+'&sc='+sc+'&copy='+copy+qs);
	http.onreadystatechange = handleemail; 
	http.send(null);
}

/* Function called to handle the list that was returned from the internal_request.php file.. */
function handleemail(){
	if(http.readyState == 4){ //Finished loading the response		
		var response = http.responseText;
		if(response=="1")
		{
		displayHideBox('3'); displayHideBox('2'); resetshare();
		}
		else
		{
			 document.getElementById("myDivsk").innerHTML="Invalid Security Code";
			 document.getElementById("security_code").value="";
			 document.getElementById("security_code").focus();
		}
		//return false;
		//document.getElementById('LightBox2').innerHTML = response;
		//alert(response);
	}
}
