	function GetXmlHttpObject(handler)
		{ 
		var objXmlHttp=null
		
		if (navigator.userAgent.indexOf("Opera")>=0)
		{
		alert("This example doesn't work in Opera") 
		return 
		}
		if (navigator.userAgent.indexOf("MSIE")>=0)
		{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
		strName="Microsoft.XMLHTTP"
		} 
		try
		{ 
		objXmlHttp=new ActiveXObject(strName)
		objXmlHttp.onreadystatechange=handler 
		return objXmlHttp
		} 	
		catch(e)
		{ 
		alert("Error. Scripting for ActiveX might be disabled") 
		return 
		} 
		} 
		if (navigator.userAgent.indexOf("Mozilla")>=0)
		{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
		}
  }

	/***********************Registration Page *************************************************/
		function regisubmit(path){
			var url=path+"/fcontact/registration.php";
			email = document.getElementById('email').value;
			url=url + "?email=" + email;
			
			password = document.getElementById('password').value;
			url=url + "&password=" + password;
			
			repassword = document.getElementById('repassword').value;
			url=url + "&repassword=" + repassword;
			
			firstname = document.getElementById('firstname').value;
			url=url + "&firstname=" + firstname;
			
			lastname = document.getElementById('lastname').value;
			url=url + "&lastname=" + lastname;
			
			address = document.getElementById('address').value;
			 url=url + "&address=" + encodeURIComponent(address);
			
						
			city = document.getElementById('city').value;
			url=url + "&city=" + city;
			
			state = document.getElementById('state').value;
			url=url + "&state=" + state;
			
			zipcode = document.getElementById('zipcode').value;
			url=url + "&zipcode=" + zipcode;
			
			phone = document.getElementById('phone').value;
			url=url + "&phone=" + phone;
			
			mobile = document.getElementById('mobile').value;
			url=url + "&mobile=" + mobile;
			
			roletype = document.getElementById('roletype').value;
			url=url + "&roletype=" + roletype;
			
			mode = document.getElementById('mode').value;
			url=url + "&mode=" + mode;
			
			bymail = document.getElementById('bymail').value;
			url=url + "&bymail=" + bymail;
			
			
			var fruit;
			var selection = document.contactusFORM.region;
				for (i=0; i<selection.length; i++)
					  if (selection[i].checked == true)
  							  fruit=selection[i].value;
			
			url=url + "&region=" + fruit;
			
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponseregisubmit);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseregisubmit() {
			if (xmlHttp.readyState == 4) {
			 	//alert(xmlHttp.responseText);
				
				if((xmlHttp.responseText).search("You are already registered. Please use a different email address.")>0){
					
					alert("You are already registered. Please use a different email address.");
					}
				
			  document.getElementById("totalregistraion").innerHTML=xmlHttp.responseText;
			  
			  /*var closebox= xmlHttp.responseText.split("Processing...Please Wait");
			  if(closebox[1]!=undefined){
			  loginfunctalert();	
			  }*/
			  
			}
		}
		
		function regisubmit_print(path){
			var url=path+"/fcontact/registration_print.php";
			email = document.getElementById('email').value;
			url=url + "?email=" + email;
			
			password = document.getElementById('password').value;
			url=url + "&password=" + password;
			
			repassword = document.getElementById('repassword').value;
			url=url + "&repassword=" + repassword;
			
			firstname = document.getElementById('firstname').value;
			url=url + "&firstname=" + firstname;
			
			lastname = document.getElementById('lastname').value;
			url=url + "&lastname=" + lastname;
			
			zipcode = document.getElementById('zipcode').value;
			url=url + "&zipcode=" + zipcode;
			
			roletype = document.getElementById('roletype').value;
			url=url + "&roletype=" + roletype;
			
			mode = document.getElementById('mode').value;
			url=url + "&mode=" + mode;
			
			bymail = document.getElementById('bymail').value;
			url=url + "&bymail=" + bymail;
			
			
			var fruit;
			var selection = document.contactusFORM.region;
				for (i=0; i<selection.length; i++)
					  if (selection[i].checked == true)
  							  fruit=selection[i].value;
			
			url=url + "&region=" + fruit;
			//alert(url);
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponseregisubmit);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
		}
	/***********************Registration Page ENDS**************************************/	
	function loginfunct_print(path){
			
			var url=path+"/fcontact/userlogin.php";
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponseregisubmit);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
		}
	
	
	
	/***********************Registration Page *************************************************/
		function forget(path){
			var url=path+"/fcontact/forgotpassword.php";
			email = document.getElementById('email').value;
			url=url + "?email=" + email;
			
			forgotpwdmode = document.getElementById('forgotpwdmode').value;
			url=url + "&forgotpwdmode=" + forgotpwdmode;
			
		
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponseregisubmitF);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseregisubmitF() {
			if (xmlHttp.readyState == 4) {
			 	//alert(xmlHttp.responseText);
				
			  document.getElementById("forgetpass").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
	/***********************Registration Page ENDS**************************************/
	
	
	/***********************Edit Profile Page *************************************************/
		function editProfile(path){
			
			var url=path+"/fcontact/profile.php";
			
			password = document.getElementById('password').value;
			url=url + "?password=" + password;
			
			firstname = document.getElementById('firstname').value;
			url=url + "&firstname=" + firstname;
			
			lastname = document.getElementById('lastname').value;
			url=url + "&lastname=" + lastname;
			
			address = document.getElementById('address').value;
			 url=url + "&address=" + encodeURIComponent(address);
						
			city = document.getElementById('city').value;
			url=url + "&city=" + city;
			
			state = document.getElementById('state').value;
			url=url + "&state=" + state;
			
			zipcode = document.getElementById('zipcode').value;
			url=url + "&zipcode=" + zipcode;
			
			phone = document.getElementById('phone').value;
			url=url + "&phone=" + phone;
			
			mobile = document.getElementById('mobile').value;
			url=url + "&mobile=" + mobile;
			
			
			var fruit;
			var selection = document.contactusFORM.region;
				for (i=0; i<selection.length; i++)
					  if (selection[i].checked == true)
  							  fruit=selection[i].value;
			
			url=url + "&region=" + fruit;
			
			roletype = document.getElementById('roletype').value;
			url=url + "&roletype=" + roletype;
			
			mode = document.getElementById('mode').value;
			url=url + "&mode=" + mode;
			
		
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponseEditsubmit);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseEditsubmit() {
			if (xmlHttp.readyState == 4) {
			 	//alert(xmlHttp.responseText);
				
			  document.getElementById("totalregistraion").innerHTML=xmlHttp.responseText;
			   var closebox= xmlHttp.responseText.split("Processing...Please Wait");
			  if(closebox[1]!=undefined){
			  loginfunctalert2();	
			  }
			  
			}
		}
		
	/***********************Registration Page ENDS**************************************/
	
	
	/***********************userlogin Page *************************************************/
		function loginfunct(path){
			
			var url=path+"/fcontact/userlogin.php";
			email = document.getElementById('email').value;
			url=url + "?email=" + email;
			
			password = document.getElementById('password').value;
			url=url + "&password=" + password;
			
			mode = document.getElementById('mode').value;
			url=url + "&mode=" + mode;
			
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponselogin);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
		}
		
		function handleHttpResponselogin() {
			if (xmlHttp.readyState == 4) {
			 	//alert(xmlHttp.responseText);
				
			  document.getElementById("lodinid").innerHTML=xmlHttp.responseText;
			  var closebox= xmlHttp.responseText.split("Processing...Please Wait");
			  if(closebox[1]!=undefined){
			  loginfunctalert();	
			  }
			 
			}
		}
		
	/***********************userlogin Page ENDS**************************************/	
	
	function loginfunctalert(){
			$(document).trigger('close.facebox');
			parent.location.reload();
			//window.location.href="index.php";
		
		}
		
	
		function loginfunctalert2(){
			$(document).trigger('close.facebox');
			//parent.location.reload();
		
		}
		
		
		
		/***********************Add To Folio Page *************************************************/
		function addtofolio(path,addetailid,certificateid1,urls){
			var url=path+"/certificateajax.php";
			var action="addtofolio";
			
			url=url + "?addetailid=" + addetailid;
			url=url + "&certificateid1=" + certificateid1;
			url=url + "&action=" +action;
			url=url+ "&" +urls;
			
			//alert(url);
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponseAddFolio);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
			
		}
		
		function handleHttpResponseAddFolio() {
			if (xmlHttp.readyState == 4) {
			 //	alert(xmlHttp.responseText);
			  document.getElementById("wrapper").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
	/*************************************************************/	
	
	
	/***********************Registration Page *************************************************/
		function sendtofriend(path){
			var url=path+"/sendtofriend.php";
			
			friendemail = document.getElementById('friendemail').value;
			url=url + "?friendemail=" + friendemail;
			
			comment = document.getElementById('comment').value;
			url=url + "&comment=" + encodeURIComponent(comment);
			 
			
			mode = document.getElementById('mode').value;
			url=url + "&mode=" + mode;
			
			certificateid = document.getElementById('certificateid').value;
			url=url + "&certificateid=" + certificateid;
			
			addetailid = document.getElementById('addetailid').value;
			url=url + "&addetailid=" + addetailid;
			
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			
			xmlHttp=GetXmlHttpObject(handleHttpResponseSendtofriend);
			xmlHttp.open("GET",url);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseSendtofriend() {
			if (xmlHttp.readyState == 4) {
			 	//alert(xmlHttp.responseText);
				
			  document.getElementById("ssmMid4reg").innerHTML=xmlHttp.responseText;
			  var closebox= xmlHttp.responseText.split("Processing...Please Wait");
			  if(closebox[1]!=undefined){
				alert("The certificate details has been successfully sent");
			  loginfunctalert2();	
			  }
			}
		}
		
/************************************************************************************************/
	function removeCertficateList(usercertificateid){
			var action="removecertificate";
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponseCertlist);
			xmlHttp.open("GET","savingfolioajax.php?usercertificateid="+usercertificateid+"&action="+action);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseCertlist() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
			  document.getElementById("mainRawAdlist").innerHTML=xmlHttp.responseText;
			  
			}
		}
/************************************************************************************************/	


/************************************************************************************************/
	function expirecertificate(){
			var action="expirecert";
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponseExpire);
			xmlHttp.open("GET","savingfolioajax.php?action="+action);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseExpire() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
			  document.getElementById("mainRawAdlist").innerHTML=xmlHttp.responseText;
			  
			}
		}
/************************************************************************************************/

/************************************************************************************************/
	function savecertificate(){
			var action="savecertificate";
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponseSave);
			xmlHttp.open("GET","savingfolioajax.php?action="+action);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseSave() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
			  document.getElementById("mainRawAdlist").innerHTML=xmlHttp.responseText;
			  
			}
		}
/************************************************************************************************/


/************************************************************************************************/
	function adddisplayajaxfun(advertiserid,addetailid){
			var action="addtofav";
			//alert ("adddisplayajax.php?action="+action+"advertiserid="+advertiserid);
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponseaddtofav);
			xmlHttp.open("GET","adddisplayajax.php?action="+action+"&advertiserid="+advertiserid+"&addetailid="+addetailid);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseaddtofav() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
			  document.getElementById("diplayajax").innerHTML=xmlHttp.responseText;
			  
			}
		}
/************************************************************************************************/
