// JavaScript Documentvar url = "./php/ajaxShowComments.php?storyID="; // url to the page we want to call//function to make our ajax callfunction showComments(storyID) {	 try	 {	 	//this if makes sure we are not already working (busy)	 	if (!isWorking && http) 	 	{			http.open("GET", url + escape(storyID), true); 		 	http.onreadystatechange = handleHttpResponse; //function to call on our state change			isWorking = true; //we now are working(busy)		 	http.send(null);		}		 }	 catch (e)	 {		alert (e);	 	 }}// The server-side script function handleHttpResponse() { 	if (http.readyState == 4) // 4 signals we are ready	{		try		{			 if (http.responseText.indexOf('invalid') == -1) //making sure we aren't working(busy)			 {				 // Split the ||| delimited response into an array  				 results = http.responseText.split("|||");				 //if the returnedstring is empty then don't change anything				 if (results[0] != "")				 { // else we need to show comments and set our toggle link to hide comments					document.getElementById('comment' + results[1]).innerHTML = results[0]; 					document.getElementById('toggleComment' + results[1]).innerHTML = "<a href='index.php' onClick='toggleComments(" + results[1] + ");return false;'>Toggle Comments (" + results[2] +")</a>";				 }				 				 isWorking = false; // we are done working now (not busy)			 }		 }		 catch (e)		 {			alert(e);					 }	 }}var isWorking = false;function getHTTPObject() {	  http_request = false;		// all this was borrowed from somewhere on the intraweb (internet)        if (window.XMLHttpRequest) { // Mozilla, Safari,...            http_request = new XMLHttpRequest();            if (http_request.overrideMimeType) {                http_request.overrideMimeType('text/xml');            }        } else if (window.ActiveXObject) { // IE            try {                http_request = new ActiveXObject("Msxml2.XMLHTTP");            } catch (e) {                try {                    http_request = new ActiveXObject("Microsoft.XMLHTTP");                } catch (e) {}            }        }        if (!http_request) {            alert('Giving up :( Cannot create an XMLHTTP instance');            return false;        }	return http_request;} var http = getHTTPObject(); // We create the HTTP Object //function to show or hide our commentsfunction toggleComments(storyID){	try 	{		if (document.getElementById('comment' + storyID).style.display == 'none') {		state = 'block';		}		else {		state = 'none';		}		 		document.getElementById('comment' + storyID).style.display = state;	}	catch (e){		alert (e);	}}function howtoForFlickrHighslide(){	alert("To navigate the gallery, use the left and right arrow keys.  ESC key will exit");}/////////////// calendar ajax //////////////////////*function changeCalMonth(storyID) {	 try	 {	 	//this if makes sure we are not already working (busy)	 	if (!isWorking && http) 	 	{			http.open("GET", url + escape(storyID), true); 		 	http.onreadystatechange = handleHttpCalendarResponse; //function to call on our state change			isWorking = true; //we now are working(busy)		 	http.send(null);		}		 }	 catch (e)	 {		alert (e);	 	 }}// The server-side script function handleCalendarHttpResponse() { 	if (http.readyState == 4) // 4 signals we are ready	{		try		{			 if (http.responseText.indexOf('invalid') == -1) //making sure we aren't working(busy)			 {				 // Split the ||| delimited response into an array  				 results = http.responseText.split("|||");				 //if the returnedstring is empty then don't change anything				 if (results[0] != "")				 { // else we need to show comments and set our toggle link to hide comments					document.getElementById('comment' + results[1]).innerHTML = results[0]; 					document.getElementById('toggleComment' + results[1]).innerHTML = "<a href='index.php' onClick='toggleComments(" + results[1] + ");return false;'>Toggle Comments (" + results[2] +")</a>";				 }				 				 isWorking = false; // we are done working now (not busy)			 }		 }		 catch (e)		 {			alert(e);					 }	 }}*/
