function guestbook(){	var guestname=document.guestform.guestname.value;	var guestmessage=document.guestform.guestmessage.value;	var passData = 'guestname='+escape(guestname)+'&guestmessage='+escape(guestmessage);	var AJAX = null;	if (window.XMLHttpRequest) {	   AJAX=new XMLHttpRequest();	} else {	   AJAX=new ActiveXObject("Microsoft.XMLHTTP");	}	if (AJAX==null) {	   alert("Sorry - your browser doesn't support AJAX. Try another browser!");							   return false	} else {		//indicate some activity		document.getElementById("gbform").innerHTML="<p>Sending...</p>";		//AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");		//AJAX.open("POST", "processguestbook.php", true);		//POST method above won't work in Windows (IE or Mozilla)!		//so we have to append the var onto the URL for the GET method		url="processguestbook.php?"+passData;		AJAX.open("GET", url, true);		AJAX.onreadystatechange = function() {                      			if (AJAX.readyState==4 || AJAX.readyState=="complete") { 				//1 second aesthetic pause		 		pausecomp(1000);				//Get rid of the form and read the guestbook back in				document.getElementById("gbform").innerHTML="<p>Thanks for the message. Go to the top of the list: </p>";				//indicate we're reloading				document.getElementById("gbdiv").innerHTML="<p>Reloading guest book...</p>";				//1 second aesthetic pause		 		pausecomp(1000);				//read in the data				readguestbook();		  	}                               		}                                  	   	//AJAX.send(passData);		AJAX.send(null);	}}function readguestbook() {   var AJAX = null;                                 // Initialize the AJAX variable.   if (window.XMLHttpRequest) {                     // Does this browser have an XMLHttpRequest object?      AJAX=new XMLHttpRequest();                    // Yes -- initialize it.   } else {                                         // No, try to initialize it IE style      AJAX=new ActiveXObject("Microsoft.XMLHTTP");  //  Wheee, ActiveX, how do we format c: again?   }                                                // End setup Ajax.   if (AJAX==null) {                                // If we couldn't initialize Ajax...	   alert("Sorry - your browser doesn't support AJAX. Try another browser!");						      return false                                  // Return false, couldn't set up ajax   }   AJAX.onreadystatechange = function() {                      // When the browser has the request info..      if (AJAX.readyState==4 || AJAX.readyState=="complete") { //  see if the complete flag is set.		 //1 second aesthetic pause 		 pausecomp(1000);         //callback(AJAX.responseText, AJAX.status);             // Pass the response to our processing function		 document.getElementById("gbdiv").innerHTML=AJAX.responseText;      }                                                        // End Ajax readystate check.   }   var url='readguestbook.php';     // This is the URL we will call.   AJAX.open("GET", url, true);                                  // Open the url this object was set-up with.   AJAX.send(null);                                              // Send the request.}function readnews() {   var AJAX = null;                                 // Initialize the AJAX variable.   if (window.XMLHttpRequest) {                     // Does this browser have an XMLHttpRequest object?      AJAX=new XMLHttpRequest();                    // Yes -- initialize it.   } else {                                         // No, try to initialize it IE style      AJAX=new ActiveXObject("Microsoft.XMLHTTP");  //  Wheee, ActiveX, how do we format c: again?   }                                                // End setup Ajax.   if (AJAX==null) {                                // If we couldn't initialize Ajax...	   alert("Sorry - your browser doesn't support AJAX. Try another browser!");						      return false                                  // Return false, couldn't set up ajax   }   AJAX.onreadystatechange = function() {                      // When the browser has the request info..      if (AJAX.readyState==4 || AJAX.readyState=="complete") { //  see if the complete flag is set.		 //1 second aesthetic pause 		 pausecomp(1000);         //callback(AJAX.responseText, AJAX.status);             // Pass the response to our processing function		 document.getElementById("newsdiv").innerHTML=AJAX.responseText;      }                                                        // End Ajax readystate check.   }   var url='readnews.php';     // This is the URL we will call.   AJAX.open("GET", url, true);                                  // Open the url this object was set-up with.   AJAX.send(null);                                              // Send the request.}function mailus(){	var email=document.mailform.email.value;	var message=document.mailform.message.value;	//alert(guestname+" "+guestmessage);	var passData = 'email='+escape(email)+'&message='+escape(message);	var AJAX = null;	if (window.XMLHttpRequest) {	   AJAX=new XMLHttpRequest();	} else {	   AJAX=new ActiveXObject("Microsoft.XMLHTTP");	}	if (AJAX==null) {	   alert("Sorry - your browser doesn't support AJAX. Try another browser!");							   return false	} else {		//indicate that the mail is sending		document.getElementById("maildiv").innerHTML="<p>Sending...</p>";		//AJAX.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	   	//AJAX.open("POST", "http://www.revolvo.co.uk/processmail.php", true);		//POST method above won't work in Windows (IE or Mozilla)!		//so we have to append the var onto the URL for the GET method		url="processmail.php?"+passData;	   	AJAX.open("GET", url, true);	   	AJAX.onreadystatechange = function() {                      			if (AJAX.readyState==4 || AJAX.readyState=="complete") { 				//2 second aesthetic pause				pausecomp(1000);				//now get rid of the form and show the thank you message				document.getElementById("maildiv").innerHTML="<p>Thanks for the mail - we may be in touch soon.</p>";		  	}                               	   	}                                  	   	//AJAX.send(passData);	   	AJAX.send(null);	}}//Function to pause the code for the specified number of milliseconds//Used for inserting cosmetic pauses when loading in datafunction pausecomp(ms) {	var date = new Date();	var curDate = null;	do { curDate = new Date(); } 	while(curDate-date < ms);} 
