var xmlHttp;








function sendfriends(){

xmlHttp=GetXmlHttpObject();

if (xmlHttp==null){

  alert ("Browser does not support HTTP Request");

  return;

  }

var url="php-commands.php";

url=url+"?emails="+escape(document.getElementById('emails').value);

url=url+"&me="+escape(document.getElementById('me').value);

url=url+"&sid="+Math.random();

xmlHttp.open("GET",url,true);

xmlHttp.onreadystatechange=stateChanged;

xmlHttp.send(null);

}






function stateChanged(){

if(xmlHttp.readyState==4){




if (xmlHttp.responseText=='good'){

		document.getElementById('contact').style.display='none';
		document.getElementById('tellfriend').innerHTML='<br><BR><BR><span class="error">Thank you. Your message has been sent.  <a onmouseover="this.style.cursor=\'pointer\'" onclick="document.getElementById(\'tellfriend\').style.visibility=\'hidden\'">Close</a></span>';
		
		
}else {
	
	document.getElementById('apDiv3error').innerHTML="There was an error.  Please make sure you only type email addresses and commas.";		

}

}

}







function GetXmlHttpObject()

{

if (window.XMLHttpRequest)

  {

  // code for IE7+, Firefox, Chrome, Opera, Safari

  return new XMLHttpRequest();

  }

if (window.ActiveXObject)

  {

  // code for IE6, IE5

  return new ActiveXObject("Microsoft.XMLHTTP");

  }

return null;

}