// JavaScript Document

			//--------------------------------------Step 1------------------------------------------------------------//
			
			function createRequestObject() {
			var tmpXmlHttpObject;
			
			//depending on what the browser supports, use the right way to create the XMLHttpRequest object
			if (window.XMLHttpRequest) { 
				// Mozilla, Safari would use this method ...
				tmpXmlHttpObject = new XMLHttpRequest();
			
			} else if (window.ActiveXObject) { 
				// IE would use this method ...
				tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			return tmpXmlHttpObject;
			}
			
			//----------------------------------------- Step 2---------------------------------------------------------//
			//call the above function to create the XMLHttpRequest object
			var http = createRequestObject();
			
			
			//-------------------------------------------Step 3-------------------------------------------------------//
		
			function makeGetRequest(post_response_var,post_callmebackphone,post_address) {
			//make a connection to the server ... specifying that you intend to make a GET request 
			//to the server. Specifiy the page name and the URL parameters to send
			var post_response_var = post_response_var;
		
			document.getElementById('callmebackvar').value = "";
			document.getElementById('callmebackphone').value = "";
			document.getElementById('load_pic').style.visibility = 'visible';
			
			
			http.open('get', post_address+'?response_var='+ post_response_var+'&callmebackphone='+post_callmebackphone);
		
			
			//assign a handler for the response
			http.onreadystatechange = processResponse;	
			//actually send the request to the server
			http.send(null);
			}
			
				function processResponse() {
			//check if the response has been received from the server
			if(http.readyState == 4){
			
			
				//read and assign the response from the server
				var response = http.responseText;
					
				//do additional parsing of the response, if needed
				
		
				//in this case simply assign the response to the contents of the <div> on the page. 
				
				document.getElementById('display_response').innerHTML = response;
				
				document.getElementById('load_pic').style.visibility = 'hidden';
				
				document.getElementById('display_response').style.visibility = 'visible';
				
				//If the server returned an error message like a 404 error, that message would be shown within the div tag!!. 
				//So it may be worth doing some basic error before setting the contents of the <div>
				
				setTimeout('return_to_normal()',20000)
		;
			}}
			
			
//---------------------------------------------------------------------------------------

			
			//-------------------------------------------Step 3-------------------------------------------------------//
		
			function makeGetRequest2(post_response_var) {
			//make a connection to the server ... specifying that you intend to make a GET request 
			//to the server. Specifiy the page name and the URL parameters to send
			var post_response_var = post_response_var;
		
			document.getElementById('subscribenews').value = "";
			document.getElementById('load_pic').style.visibility = 'visible';
			
			http.open('get', 'content/form_mailer.php?response_var2='+ post_response_var);
			
			//assign a handler for the response
			http.onreadystatechange = processResponse;	
			//actually send the request to the server
			http.send(null);
			}
			
				function processResponse() {
			//check if the response has been received from the server
			if(http.readyState == 4){
			
			
				//read and assign the response from the server
				var response = http.responseText;
					
				//do additional parsing of the response, if needed
				
		
				//in this case simply assign the response to the contents of the <div> on the page. 
				
				document.getElementById('display_response').innerHTML = response;
				
				
				document.getElementById('load_pic').style.visibility = 'hidden';
				
				document.getElementById('display_response').style.visibility = 'visible';
				
				//If the server returned an error message like a 404 error, that message would be shown within the div tag!!. 
				//So it may be worth doing some basic error before setting the contents of the <div>
				
				setTimeout('return_to_normal()',20000)
		;
			}}
			

//---------------------------------------------------------------------------------------
			
			function return_to_normal()
		{
			document.getElementById('display_response').innerHTML = '';
			document.getElementById('display_response').style.visibility = 'hidden';
			document.getElementById('callmebackvar').value = '';
		}
			
		