// holds an instance of XMLHttpRequest



var xmlHttp = createXmlHttpRequestObject();

var globalAction = ""; 	// keeps track of which operation is currently being done

var globalIDNum = 0; 	// keeps track of which record ID is being operated on



// creates an XMLHttpRequest instance



function createXmlHttpRequestObject()

{

	var xmlHttp;	// reference to the XMLHttpRequest object

	

	// Create the XMLHttpRequest Object for all versions of IE up to and including IE6

	try

	{

		// try to create XMLHttpRequest object

		

		xmlHttp = new XMLHttpRequest();

	}

	catch(e)

	{

		// assume IE6 or older

		

		var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");

		

		// try every ID until on works

		

		for (var i=0; i < XmlHttpVersions.length && !xmlHttp; i++)

		{

			try

			{

				// try to create the XMLHttpRequest object

				

				xmlHttp = new ActiveXObject(XmlHttpVersions[i]);

				

			}

			catch(e){}

		}

	}

		

	// return the created object or display an error message

		

	if(!xmlHttp)

	{

		alert("Error creating the XMLHttpRequest object.");

	}

	else

	{

		return xmlHttp;

	}

}



// called to read a file from the server







function process(action,IDNum, IDNum2, IDNum3)

{

	// only continue if xmlHttp isn't void

	

	if(xmlHttp)

	{

		globalAction = action;				// Set the globalAction

		id1 = IDNum;				// Set the globalIDNum

		id2 = IDNum2;				// Set the globalIDNum

		id3 = IDNum3;				// Set the globalIDNum

		// try to connect to the server

		

		try

		{

			

			// Change the div contents from plain text to a Select Box

			

			

			if(action == "LoadSnap")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_snap.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				var selStatus = "sort_id";

				var sort_id = document.getElementById(selStatus).value;

				var params = "action=" + globalAction + "&type=" + id1 + "&sort_id=" + sort_id; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="LoadSnap";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

										

			

				

			}

			

			if(action == "LoadSnapInd")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_snap_ind.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				//var selStatus = "sort_id";

				//var sort_id = document.getElementById(selStatus).value;

				var params = "action=" + globalAction + "&id=" + id1 + "&sort_id=" + id2; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="LoadSnap";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

										

			

				

			}

			

			if(action == "LoadSnapAll")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_snap_all.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				var selStatus = "sort_id";

				var sort_id = document.getElementById(selStatus).value;

				var params = "action=" + globalAction + "&id=" + id1 + "&type=" + id2 + "&sort_id=" + sort_id; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="LoadSnap";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

										

			

				

			}

			

			if(action == "load_video")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_video.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				//var product = "product";

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="load_video";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			

			if(action == "load_video_home")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_video_home.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				//var product = "product";

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="load_video_home";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			

			if(action == "load_cities")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_cities.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				var selStatus = "country";

				var id = document.getElementById(selStatus).value;

				var params = "action=" + globalAction + "&id=" + id; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="load_cities";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

										

			

				

			}

			

			

			

			if(action == "add_friend")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "add_friend.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				//var product = "product";

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="add_friend_" + id1;

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			

			if(action == "add_friend_individual")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "add_friend_individual.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				//var product = "product";

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="add_friend_individual";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			

			

			

			if(action == "load_wall")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_wall.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				//var product = "product";

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="load_wall";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			if(action == "load_my_wall")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "load_my_wall.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				//var product = "product";

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="load_wall";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			

			if(action == "add_wall_comment")

			{

				

				

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "submit_wall_comment.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.

				var doc = document.form; // reference the form being used

				var selStatus = "comment";

				var comment = document.getElementById(selStatus).value;

				

				var selStatus2 = "wall_profile_id";

				var wall_profile_id = document.getElementById(selStatus2).value;

				

				

				

				var params = "action=" + globalAction + "&comment=" + comment + "&wall_profile_id=" + wall_profile_id; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change				

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="load_wall";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			

			if(action == "delete_wall_comment")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "delete_wall_comment.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.

				

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="load_wall";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}
			
			
			
			if(action == "load_my_teams")
			{
					location.reload(true);
			}
			
			
			if(action == "delete_team")

			{

				

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "remove_team.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.

				

				

				var params = "action=" + globalAction + "&id=" + id1; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="remove_team";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

			}

			

			

			if(action == "album_next")

			{

				//alert("Hello: " + id2);

				// Connect asynchonously to the php to update database

				var ddajaxtabssettings={}

				var method = "POST";		// Set to the method ("GET" or "POST") used to pass variables to the server-side page

				var url = "album_next.php";	// Set to the url of the server-side page being connected to

				var async = true;			// Setting this argument to true is the backbone of AJAX. It allows for connecting to 

											// a server-side page for processing asynchronously.



				//var doc = document.form_event; // reference the form being used

				var selStatus = "id";

				var id = document.getElementById(selStatus).value;

				var selStatus2 = "seq";

				var seq = document.getElementById(selStatus2).value;
				
				var selStatus3 = "group_id";
				
				var group_id = document.getElementById(selStatus3).value;

				var params = "action=" + globalAction + "&id=" + id + "&seq=" + seq + "&move=" + id1 + "&category_id=" + id2 + "&group_id=" + group_id; // Parameters to be passed.

			

				xmlHttp.open(method, url, async);

				xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');	// Set the Content-Type Header

				xmlHttp.onreadystatechange = handleStateChange;	// Set to the function that will handle the state change

				xmlHttp.send(params);	// Set to the parameter list (as a string) being passed to the server-side script

										// If using the "GET" method, this should be set to null.

										

				ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)

				ddajaxtabssettings.loadstatustext="<img src='images/loading.gif' />" 

				divId="album_next";

				document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"

										

			

				

			}

			

		

		}

		

		// display the error in case of failure

		catch(e)

		{

			alert("Can't connect to server:\n" + e.toString());

		}

	}

}







// function that handles the response from the HttpRequestObject

function handleStateChange()

{

	// We wait until the server is ready to respond

	if(xmlHttp.readyState == 4)

	{

		// only continue if status is 200 or OK

		if(xmlHttp.status == 200)

		{

			try

			{

				// Handle the server's response

				

				// Change the div Text to a Select Box

				

				

				if(globalAction == "LoadSnap")

				{

					var divName = document.getElementById("LoadSnap");					

					divName.innerHTML = '<span id="LoadSnap">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "LoadSnapInd")

				{

					var divName = document.getElementById("LoadSnap");					

					divName.innerHTML = '<span id="LoadSnap">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "LoadSnapAll")

				{

					var divName = document.getElementById("LoadSnap");					

					divName.innerHTML = '<span id="LoadSnap">' + xmlHttp.responseText + '</span>';

				}

				

				

				if(globalAction == "load_video")

				{

					var divName = document.getElementById("load_video");					

					divName.innerHTML = '<span id="load_video">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "load_cities")

				{

					var divName = document.getElementById("load_cities");					

					divName.innerHTML = '<span id="load_cities">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "add_friend")

				{

					

					var span_name='add_friend_' + id1;

					var divName = document.getElementById(span_name);					

					divName.innerHTML = '<span id="add_friend_"' + id1 + '">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "add_friend_individual")

				{

					

					var span_name='add_friend_individual';

					var divName = document.getElementById(span_name);					

					divName.innerHTML = '<span id="add_friend_individual">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "load_video_home")

				{

					var divName = document.getElementById("load_video_home");					

					divName.innerHTML = '<span id="load_video_home">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "add_wall_comment")

				{

					

					

					process('load_wall',xmlHttp.responseText);					

				}

				

				if(globalAction == "load_wall")

				{

					var divName = document.getElementById("load_wall");					

					divName.innerHTML = '<span id="load_wall">' + xmlHttp.responseText + '</span>';

				}

				

				if(globalAction == "delete_wall_comment")

				{

					process('load_my_wall');

				}
				
				
				
				if(globalAction == "load_my_teams")
				{

					var divName = document.getElementById("remove_teams");					

					divName.innerHTML = '<span id="remove_teams">' + xmlHttp.responseText + '</span>';

				}
				
				
				
				if(globalAction == "delete_team")

				{

					process('load_my_teams');

				}

				

				

				if(globalAction == "load_my_wall")

				{

					var divName = document.getElementById("load_wall");					

					divName.innerHTML = '<span id="load_wall">' + xmlHttp.responseText + '</span>';

				}

				

					if(globalAction == "album_next")

				{

					var divName = document.getElementById("album_next");					

					divName.innerHTML = '<span id="album_next">' + xmlHttp.responseText + '</span>';

				}

				

				

				

			}

			catch(e)

			{

				// display error message

				//alert("Error reading the response: " + e.toString());

			}

		}

		else

		{

			// display status message

			alert("There was a problem retrieving the data:\n" + xmlHttp.statusText);

		}

	}

}
