function refer_us_to_someone()			
{
	var to_name=document.getElementById('to_name').value;	
	var to_email=document.getElementById('to_email').value;	
	var your_name=document.getElementById('your_name').value;	
	var your_email=document.getElementById('your_email').value;	
	var comments=document.getElementById('comments').value;
					
	if(to_name!="" && to_email !="" && your_name!="" && your_email!="" && comments!=""){

		var xmlhttp;					
		try{					
			xmlhttp=new XMLHttpRequest();					
		} 					
		catch(e){
			try{
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");					
			}
			catch(e){
				try{
					xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");										
				}
					catch(e){
						alert("AJAX Not Supported");
					}
				}
			}
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState!=4){												
				var display=document.getElementById('refer-us-to-someone');
				display.innerHTML="<br /><img src='images/ajax_loader.gif' />";
			}																	
			if(xmlhttp.readyState==4){
				var display=document.getElementById('refer-us-to-someone');									
				display.innerHTML=xmlhttp.responseText;													
			}						
		}												
		var url="/submit-refer-us-to-someone.php";data="to_name="+URLEncode(to_name)+"&to_email="+URLEncode(to_email)+"&your_name="+URLEncode(your_name)+"&your_email="+URLEncode(your_email)+"&comments="+URLEncode(comments);						
		if (xmlhttp) {
			//alert (url +"?"+ data);
			//xmlhttp.onreadystatechange=xmlhttpChange;
			xmlhttp.open("POST",url,true);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			xmlhttp.send(data);
		}										
		}else{
			alert("Please fill out all required fields");
		}			
}		
