function showMore(strArea)
{
	if(strArea == "0")
	{
		allOff();
		document.getElementById("ContentMessage").style.display = "inline";			
	}
	if(strArea == "1")
	{
		allOff();
		document.getElementById("ContentMessageMore").style.display = "inline";		
	}
	if(strArea == "2")
	{
		ContactUs();
	}
	if(strArea == "3")
	{
		allOff();
		document.getElementById("ContactUsMore").style.display = "inline";		
	}
	if(strArea == "4")
	{
		window.open('http://www3.rotherham.gov.uk/Consult/docs/cciframework.pdf','CCIFramework');
	}
	
	
}

function ColourScheme()
{	
	alert("Red\t=\tFuture\nGreen\t=\tLive\nBlack\t=\tHistoric");
}

function EmailReportDisplay()
{
	allOff();
	document.getElementById("EmailReport").style.display = "inline";
}

function LoadDiary()
{
	window.location="diary.aspx";
}

function allOff()
{
	document.getElementById("ContentLeft").style.display = "none";
	document.getElementById("ContentRight").style.display = "none";	
	document.getElementById("ContentRightMenu").style.display = "none";	
	document.getElementById("ContentLeftMenu").style.display = "none";	
	document.getElementById("ContactUs").style.display = "none";
	document.getElementById("ContactUsButton").style.display = "none";	
	document.getElementById("FeedbackButton").style.display = "none";
	document.getElementById("ContentMessage").style.display = "none";	
	document.getElementById("ContentMessageMore").style.display = "none";
	document.getElementById("ContactUsMore").style.display = "none";	
	document.getElementById("feedbackAddress").style.display = "none";	
	document.getElementById("EmailReport").style.display = "none";		
	document.getElementById("btnContactUsMore").style.display = "none";		
	
	
}

function InitialisePage()
{
	allOff();
	BuildFullListing();
	document.getElementById("ContentMessage").style.display = "inline";
}

function Summary()
{
	if (document.getElementById("drpSpeed").value == "0")
	{
		iSearchSummary = 0;
		SearchSummary();
	}
	else
	{
		document.getElementById('txtSummaryStat').innerHTML = "Press search to view results"
	}
}

function Search()
{
	allOff();
	iSearchSummary = 1;
	SearchSummary();
}

function ContactUs()
{
	allOff();
	document.getElementById("ContactUs").style.display = "inline";		
	document.getElementById("txtTitle").value = "eConsult Contact Us Form";
	document.getElementById("ContactUsButton").style.display = "inline";
	document.getElementById("btnContactUsMore").style.display = "inline";
}

function Feedback(strTitle)
{
	allOff();
	document.getElementById("ContactUs").style.display = "inline";		
	document.getElementById("txtTitle").value = strTitle;
	document.getElementById("FeedbackButton").style.display = "inline";
}

function BuildFullListing()
{
	AllAreas = "";
	url = LocalityURL;
	url +="?x=" + Math.floor(Math.random() * 100000);
	xmlhttp13=null;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp13=new XMLHttpRequest()
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp13=new ActiveXObject("Microsoft.XMLHTTP")
	}
	if (xmlhttp13!=null)
	{
		xmlhttp13.onreadystatechange=state_Change_All
		xmlhttp13.open("GET",url,false)
		xmlhttp13.send(null)
	}
	else
	{
		alert("Your browser does not support XMLHTTP.")
	}	
		
	url = WardURL;
	url +="?x=" + Math.floor(Math.random() * 100000);
	xmlhttp13=null;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp13=new XMLHttpRequest()
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp13=new ActiveXObject("Microsoft.XMLHTTP")
	}
	if (xmlhttp13!=null)
	{
		xmlhttp13.onreadystatechange=state_Change_All
		xmlhttp13.open("GET",url,false)
		xmlhttp13.send(null)
	}
	else
	{
		alert("Your browser does not support XMLHTTP.")
	}	
	
	url = AreaURL;
	url +="?x=" + Math.floor(Math.random() * 100000);
	xmlhttp13=null;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp13=new XMLHttpRequest()
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp13=new ActiveXObject("Microsoft.XMLHTTP")
	}
	if (xmlhttp13!=null)
	{
		xmlhttp13.onreadystatechange=state_Change_All
		xmlhttp13.open("GET",url,false)
		xmlhttp13.send(null)
	}
	else
	{
		alert("Your browser does not support XMLHTTP.")
	}	
	
}

function state_Change_All()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp13.readyState==4)
	{
		// if "OK"
		if (xmlhttp13.status==200)
		{
			var response = xmlhttp13.responseXML.documentElement;
			var x=response.getElementsByTagName("ENTRY");
			var prev = "";
			var txt = "";			
			for(i=0;i<x.length;i++)
			{
				prev = txt;
				try
				{			
					xx=x[i].getElementsByTagName("NAME")
					txt = txt + xx[0].firstChild.data + " "; 
				}
				catch(ex)
				{
					txt = prev
				}
			}
			AllAreas = AllAreas + txt;
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp.statusText)
		}
	}
}


function SearchSummary()
{	
	url = ListingURL;
	url +="?x=" + Math.floor(Math.random() * 100000);
	xmlhttp=null
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest()
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	if (xmlhttp!=null)
	{
		xmlhttp.onreadystatechange=state_Change_SearchSummary
		xmlhttp.open("GET",url,false)
		xmlhttp.send(null)
	}
	else
	{
		alert("Your browser does not support XMLHTTP.")
	}	
}

function state_Change_SearchSummary()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	{
		// if "OK"
		if (xmlhttp.status==200)
		{
			var iResultCount = 0;
		
			var response = xmlhttp.responseXML.documentElement;
			var x=response.getElementsByTagName("ENTRY")			
			
			var strFindIn = "";
			var searchWords = document.getElementById('txtSearch').value.split(" ");	
			var iCount = searchWords.length;
			
			var strInnerHTML = "";
			
			var strTitle = "";
			var strStart = "";
			var strEnd = "";
			var strProg = "";
			var strGeo1 = "";
			var iID = "";
			var iMarker = 0;
			
			
			var dateToday = new Date(); 						
			var dateFrom = new Date; 	
			var dateTo = new Date; 	
			var bValid = 0;
			var strFilter = document.getElementById('drpFilter').value;
			var strAndOr = document.getElementById('drpAndOr').value;
			var bFoundOne = 0;
			
			if (iSearchSummary==1)
			{
				strInnerHTML = "<table border='0' cellpadding='0' cellspacing='0' width='100%' class='scrollTable'>";
				strInnerHTML += "<thead class='fixedHeader'><tr>";
				strInnerHTML += "<th>Title</th>";
				strInnerHTML += "<th></th>";
				strInnerHTML += "</tr></thead>";			
				strInnerHTML += "<tbody class='scrollContent'>";
			}
			
			for(i=0;i<x.length;i++)
			{	
				try
				{		
					iID = 0;
					strTitle = "";
					strStart = "";
					strEnd = "";
					strProg = "";
					strGeo1 = "";					
					strFindIn  = "";
					
					strAccess = "";
					try
					{
						xx = x[i].getElementsByTagName("ACCESS");
						strAccess = xx[0].firstChild.data;						
						if (document.getElementById("txtPrivateMarker").value == "Private")
						{
							strAccess = "Public"
						}
					}
					catch(ex){}	
					if (strAccess == "Public")
					{						
						try
						{
							xx = x[i].getElementsByTagName("ID");
							iID = xx[0].firstChild.data;
						}
						catch(ex){}					
						try
						{
							xx = x[i].getElementsByTagName("TITLE");	
							strFindIn += xx[0].firstChild.data + " ";
							strTitle = xx[0].firstChild.data;
						}
						catch(ex){}
						try
						{
							xx = x[i].getElementsByTagName("START_DATE");	
							strFindIn += xx[0].firstChild.data + " ";
							strStart = xx[0].firstChild.data;
						}
						catch(ex){}
						try
						{					
							xx = x[i].getElementsByTagName("END_DATE");	
							strFindIn += xx[0].firstChild.data + " ";	
							strEnd = xx[0].firstChild.data;			
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("PROGRAMME_AREA");
							strFindIn += xx[0].firstChild.data + " ";	
							strProg = xx[0].firstChild.data;					
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("OTHER_AREA");
							strFindIn += xx[0].firstChild.data + " ";	
							strProg = xx[0].firstChild.data;					
						}
						catch(ex){}					
						try
						{						
							xx = x[i].getElementsByTagName("SERVICE_AREA");
							strFindIn += xx[0].firstChild.data + " ";	
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("LEAD_OFFICER");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{
							xx = x[i].getElementsByTagName("AIMS");
							strFindIn += xx[0].firstChild.data + " ";	
						}
						catch(ex){}
						try
						{					
							xx = x[i].getElementsByTagName("SERVICE_AREA");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						
						try
						{
							xx = x[i].getElementsByTagName("GEO_AREA");
							if(xx[0].firstChild.data == "0")
							{						 
								strFindIn += AllAreas;
							}
							
						}
						catch(ex){}
						
						try
						{
							xx = x[i].getElementsByTagName("GEO1_1");
							strFindIn += xx[0].firstChild.data + " ";
							strGeo1 = xx[0].firstChild.data;
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO1_2");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO1_3");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{	
							xx = x[i].getElementsByTagName("GEO2_1");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO2_2");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO2_3");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{		
							xx = x[i].getElementsByTagName("GEO3_1");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO3_2");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO3_3");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						

							xx = x[i].getElementsByTagName("GEO4_1");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO4_2");
							strFindIn += xx[0].firstChild.data + " ";
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("GEO4_3");
							strFindIn += xx[0].firstChild.data + " ";														
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("COMMENTS");
							strFindIn += xx[0].firstChild.data + " ";		
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("RESULTS");
							strFindIn += xx[0].firstChild.data + " ";		
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("KEYWORDS");
							strFindIn += xx[0].firstChild.data + " ";		
						}
						catch(ex){}
						try
						{						
							xx = x[i].getElementsByTagName("URL");
							strFindIn += xx[0].firstChild.data + " ";		
						}
						catch(ex){}
						
						try
						{						
							xx = x[i].getElementsByTagName("EQUEST_URL");
							strFindIn += xx[0].firstChild.data + " ";		
						}
						catch(ex){}
						
						try
						{						
							xx = x[i].getElementsByTagName("IMPACT");
							strFindIn += xx[0].firstChild.data + " ";		
						}
						catch(ex){}
					}								
					strFindIn = strFindIn.toUpperCase();					
					bFoundOne = 0;
					for(y=0;y!=iCount;y++)
					{
						if (strAndOr == 0)
						{
							if(strFindIn.indexOf(searchWords[y].toUpperCase()) == -1)
							{
								break;
							}
						}
						else
						{
							if(strFindIn.indexOf(searchWords[y].toUpperCase()) > -1)
							{
								bFoundOne = 1;
								break;
							}
						}
					}
					
					if ((strAndOr == 0 && y==iCount) || (strAndOr == 1 && bFoundOne == 1))
					{
						strTemp = strInnerHTML;
						if (iMarker == 0)
						{
							strInnerHTML += "<tr id=comm_table_" + iID + " class = 'RowType1' onMouseOver=HighlightRow(this) onMouseOut=HighlightOff1(this)>";
							iMarker++;
						}
						else
						{
							strInnerHTML += "<tr id=comm_table_" + iID + " class = 'RowType2' onMouseOver=HighlightRow(this) onMouseOut=HighlightOff2(this)>";
							iMarker--;
						}
						bValid = 0;
						try
						{	
							dateFrom.setFullYear(strStart.substring(6,10),strStart.substring(3,5),strStart.substring(0,2));
							dateTo.setFullYear(strEnd.substring(6,10),strEnd.substring(3,5),strEnd.substring(0,2));
							if (dateTo < dateToday)
							{
								if (strFilter == 0 || strFilter == 3)
								{
									bValid = 1;
								}
								strInnerHTML += "<td class='past'>" + strTitle  + " (historic)</td>";
							}
							else
							{
								if ((dateFrom <= dateToday) && (dateTo >= dateToday))
								{
									if (strFilter == 0 || strFilter == 1)
									{
										bValid = 1;
									}
									strInnerHTML += "<td class='live'>" + strTitle  + " (live)</td>";						
								}
								else
								{
									if (strFilter == 0 || strFilter == 2)
									{
										bValid = 1;
									}
									strInnerHTML += "<td class='future'>" + strTitle  + " (future)</td>";	
								}
							}
						}
						catch(ex)
						{
							if (strFilter == 0)
							{
								bValid = 1;
							}
							strInnerHTML += "<td>" + strTitle  + "</td>";	
						}					
						if (bValid == 0)
						{
							strInnerHTML = strTemp;
						}
						else
						{
							strInnerHTML += "<td><INPUT style='WIDTH: 80px; HEIGHT: 24px' type='button' value='View' onclick=\"ViewLoad('" + iID + "')\"></td>";							
							iResultCount++;
						}
					}						
					
				}
				catch(ex){}					
				
			}	
			if(iCount>0 && iSearchSummary=="1")
			{
				strInnerHTML += "</tbody>";		
				strInnerHTML += "</table>";
				document.getElementById("ContentLeft").style.display = "inline";
				document.getElementById("ContentLeftMenu").style.display = "inline";	
				document.getElementById("ContentMessage").style.display = "none";
				document.getElementById("ContentLeft").innerHTML = strInnerHTML;
			}
						
			document.getElementById('txtSummaryStat').innerHTML = "Consultations Matching Search Criteria: " + iResultCount;
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp.statusText)
		}		
	}
}

function ViewLoad(iID)
{
	document.getElementById("ContentMessage").style.display = "none";	
	document.getElementById("ContentRight").style.display = "inline";
	document.getElementById("ContentRightMenu").style.display = "inline";		
	iStoreReference = iID
	url = ConsultationURL;
	url +="?x=" + Math.floor(Math.random() * 100000);
	xmlhttp2=null
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp2=new XMLHttpRequest()
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP")
	}
	if (xmlhttp2!=null)
	{
		xmlhttp2.onreadystatechange=state_Change_Detail_Load
		xmlhttp2.open("GET",url,false)
		xmlhttp2.send(null)
	}
	else
	{
		alert("Your browser does not support XMLHTTP.")
	}
}


function state_Change_Detail_Load()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp2.readyState==4)
	{
		// if "OK"
		if (xmlhttp2.status==200)
		{		
			
			var response = xmlhttp2.responseXML.documentElement;
			var x=response.getElementsByTagName("ENTRY");
			var strFeedbackTitle = "";
												
			for(i=0;i<x.length;i++)
			{							
				xx=x[i].getElementsByTagName("ENTRY");				
				try
				{
					xx = x[i].getElementsByTagName("ID");
					testID = xx[0].firstChild.data;					
					if (testID == iStoreReference)
					{	
						document.getElementById("txtConsultNumber").value = iStoreReference
						strFeedbackTitle = "eConsult Feedback Ref " + iStoreReference;	
						
						try
						{
						
							xx = x[i].getElementsByTagName("THEME");						
							
							var iCCI = xx[0].firstChild.data;
							var strMethod = "";
		
							
							if (iCCI >= 64)
							{
								iCCI = iCCI - 64;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Sustainability" + strMethod;		
							}

							if (iCCI >= 32)
							{
								iCCI = iCCI - 32;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Fairness" + strMethod;			
							}
							
							if (iCCI >= 16)
							{
								iCCI = iCCI - 16;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Achieving" + strMethod;				
							}	
							
							if (iCCI >= 8)
							{
								iCCI = iCCI - 8;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Learning" + strMethod;		
							}	
							if (iCCI >= 4)
							{
								iCCI = iCCI - 4;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Alive" + strMethod;			
							}	
							if (iCCI >= 2)
							{
								iCCI = iCCI - 2;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Proud" + strMethod;			
							}	
							if (iCCI >= 1)
							{
								iCCI = iCCI - 1;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Safe" + strMethod;				
							}
							
							document.getElementById("tdTheme").innerHTML = strMethod;		
							
						}
						catch(ex)
						{
							document.getElementById("tdTheme").innerHTML = "";
						}
						
													
						try
						{
						
							xx = x[i].getElementsByTagName("CCI_METHOD");						
							
							var iCCI = xx[0].firstChild.data;
							var strMethod = "";
		
							if (iCCI >= 512)
							{
								iCCI = iCCI - 512;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Other" + strMethod;								
							}			
							if (iCCI >= 256)
							{
								iCCI = iCCI - 256;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Electronic Consultation" + strMethod;	
							}

							if (iCCI >= 128)
							{
								iCCI = iCCI - 128;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Comment Form" + strMethod;			
							}
								
							if (iCCI >= 64)
							{
								iCCI = iCCI - 64;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Face-to-face Interviews" + strMethod;		
							}

							if (iCCI >= 32)
							{
								iCCI = iCCI - 32;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Open day" + strMethod;			
							}
							
							if (iCCI >= 16)
							{
								iCCI = iCCI - 16;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Exhibition/Roadshow" + strMethod;				
							}	
							
							if (iCCI >= 8)
							{
								iCCI = iCCI - 8;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "User Groups" + strMethod;		
							}	
							if (iCCI >= 4)
							{
								iCCI = iCCI - 4;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Reachout" + strMethod;			
							}	
							if (iCCI >= 2)
							{
								iCCI = iCCI - 2;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Focus Groups" + strMethod;			
							}	
							if (iCCI >= 1)
							{
								iCCI = iCCI - 1;
								if (strMethod != "")
								{
									strMethod = ", " + strMethod;
								}
								strMethod = "Questionnaires" + strMethod;				
							}
							
							document.getElementById("tdCCI").innerHTML = strMethod;		
							
						}
						catch(ex)
						{
							document.getElementById("tdCCI").innerHTML = "";
						}	
						
						try
						{
							xx = x[i].getElementsByTagName("COMMENTS");						
							document.getElementById("tdComment").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdComment").innerHTML = "";
						}	

						try
						{
							xx = x[i].getElementsByTagName("CONSULTATION");						
							document.getElementById("tdConsultation").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdConsultation").innerHTML = "";
						}


						try
						{
							xx = x[i].getElementsByTagName("TOTAL_COST");						
							document.getElementById("tdCCICost").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdCCICost").innerHTML = "";
						}



						try
						{
							xx = x[i].getElementsByTagName("RESULTS");						
							document.getElementById("tdResult").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdResult").innerHTML = "";						
						}
						
						try
						{
							xx = x[i].getElementsByTagName("SUPPORT");						
							document.getElementById("tdSupport").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdSupport").innerHTML = "";						
						}
												
						
						
						
						try
						{
							xx = x[i].getElementsByTagName("RESULT_WHEN");
							if (xx[0].firstChild.data == "01/01/1900 00:00:00")
							{
								xx[0].firstChild.data = "";
							}
							document.getElementById("tdResultWhen").innerHTML = xx[0].firstChild.data.substring(0,10);						
						}
						catch(ex)
						{

							document.getElementById("tdResultWhen").innerHTML = "";						
						}
						try
						{
							xx = x[i].getElementsByTagName("RESULT_WHERE");	
							document.getElementById("tdResultWhere").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdResultWhere").innerHTML = "";						
						}						
							
						try
						{
							xx = x[i].getElementsByTagName("IMPACT");						
							document.getElementById("tdImpact").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdImpact").innerHTML = "";						
						}

						try
						{
							xx = x[i].getElementsByTagName("RESULTS_URL");									
							document.getElementById("Link1").innerHTML = "<INPUT type=\"button\" class=\"btnRight\" value=\"Further Detail\" onclick=\"window.location='" + xx[0].firstChild.data + "'\">"							
						}
						catch(ex)
						{
							document.getElementById("Link1").innerHTML = "";
							
						}	

						try
						{
							xx = x[i].getElementsByTagName("EQUEST_URL");									
							document.getElementById("Link2").innerHTML = "<INPUT type=\"button\" class=\"btnRight\" value=\"Online Survey\" onclick=\"window.location='" + xx[0].firstChild.data + "'\">"							
						}
						catch(ex)
						{
							document.getElementById("Link2").innerHTML = "";
							
						}	


						try
						{
							xx = x[i].getElementsByTagName("EQUALITY");						
							document.getElementById("tdEquality").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdEquality").innerHTML = "";						
						}
						try
						{
							xx = x[i].getElementsByTagName("SAMPLE");						
							document.getElementById("tdSample").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdSample").innerHTML = "";						
						}
						try
						{
							xx = x[i].getElementsByTagName("ANALYSE");						
							document.getElementById("tdAnalyse").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdAnalyse").innerHTML = "";						
						}
						try
						{
							xx = x[i].getElementsByTagName("DISSEMINATE");						
							document.getElementById("tdDisseminate").innerHTML = xx[0].firstChild.data;						
						}
						catch(ex)
						{

							document.getElementById("tdDisseminate").innerHTML = "";						
						}																

																		
						try
						{						
							xx = x[i].getElementsByTagName("TITLE");
							document.getElementById("tdTitle").innerHTML = xx[0].firstChild.data;
							//strFeedbackTitle += ", " + xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdTitle").innerHTML = "";						
						}
						
												
						try
						{						
							xx = x[i].getElementsByTagName("START_DATE");
							if (xx[0].firstChild.data == "01/01/1900 00:00:00")
							{
								xx[0].firstChild.data = "";
							}							
							document.getElementById("tdStartDate").innerHTML = xx[0].firstChild.data.substring(0,10);
						}
						catch(ex)
						{
							document.getElementById("tdStartDate").innerHTML = "";						
						}
	
						try
						{						
							xx = x[i].getElementsByTagName("END_DATE");
							if (xx[0].firstChild.data == "01/01/1900 00:00:00")
							{
								xx[0].firstChild.data = "";
							}							
							document.getElementById("tdEndDate").innerHTML = xx[0].firstChild.data.substring(0,10);
						}
						catch(ex)
						{
							document.getElementById("tdEndDate").innerHTML = "";						
						}

						try
						{						
							xx = x[i].getElementsByTagName("PROGRAMME_AREA_NAME");
							document.getElementById("tdProgrammeArea").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdProgrammeArea").innerHTML = "";						
						}																

						try
						{						
							xx = x[i].getElementsByTagName("SERVICE_AREA");
							document.getElementById("tdServiceArea").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdServiceArea").innerHTML = "";						
						}							
						
						try
						{						
							xx = x[i].getElementsByTagName("LEAD_OFFICER");
							document.getElementById("tdLeadOfficer").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdLeadOfficer").innerHTML = "";						
						}							
						try
						{						
							xx = x[i].getElementsByTagName("OTHER_AREA");
							document.getElementById("tdOtherAreas").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdOtherAreas").innerHTML = "";						
						}	
												
						try
						{						
							xx = x[i].getElementsByTagName("AIMS");							
							document.getElementById("tdAim").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdAim").innerHTML = "";						
						}
						////////////////////////////////////////////////
						try
						{						
							xx = x[i].getElementsByTagName("HARDTOREACH");							
							document.getElementById("tdHard").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdHard").innerHTML = "";						
						}						
						
						try
						{	
							xx = x[i].getElementsByTagName("BARRIERS");
							var strBuildString = "";
							var iCCI = xx[0].firstChild.data;

							if (iCCI >= 32)
							{
								iCCI = iCCI - 32;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Other" + strBuildString;
								try
								{						
									xx = x[i].getElementsByTagName("BARRIERSOTHER");
									strBuildString = strBuildString + "(" + xx[0].firstChild.data + ")";
								}
								catch(ex)
								{}									
											
							}
							
							if (iCCI >= 16)
							{
								iCCI = iCCI - 16;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Internet Questionnaire" + strBuildString;			
							}	
							
							if (iCCI >= 8)
							{
								iCCI = iCCI - 8;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Hearing Loops" + strBuildString;			
							}	
							if (iCCI >= 4)
							{
								iCCI = iCCI - 4;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Interpreters and Signers" + strBuildString;		
							}	
							if (iCCI >= 2)
							{
								iCCI = iCCI - 2;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Childcare Arrangements" + strBuildString;	
							}	
							if (iCCI >= 1)
							{
								iCCI = iCCI - 1;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Travel to Public Meetings" + strBuildString;		
							}							
							document.getElementById("tdBarriers").innerHTML = strBuildString;							
							
						}
						catch(ex)
						{
							document.getElementById("tdBarriers").innerHTML = "";
						}	
						
						
						try
						{	
							xx = x[i].getElementsByTagName("REASON");
							strBuildString = "";
							var iCCI = xx[0].firstChild.data;
						
								
							if (iCCI >= 64)
							{
								iCCI = iCCI - 64;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Other" + strBuildString;	
								try
								{						
									xx = x[i].getElementsByTagName("REASONOTHER");
									strBuildString = strBuildString + "(" + xx[0].firstChild.data + ")";
								}
								catch(ex)
								{}									
							}

							if (iCCI >= 32)
							{
								iCCI = iCCI - 32;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Community Plan" + strBuildString;			
							}
							
							if (iCCI >= 16)
							{
								iCCI = iCCI - 16;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Service Plan" + strBuildString;			
							}	
							
							if (iCCI >= 8)
							{
								iCCI = iCCI - 8;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Area Plan" + strBuildString;			
							}	
							if (iCCI >= 4)
							{
								iCCI = iCCI - 4;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Inform Service Improvement" + strBuildString;		
							}	
							if (iCCI >= 2)
							{
								iCCI = iCCI - 2;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Development of a Policy/Strategy" + strBuildString;	
							}	
							if (iCCI >= 1)
							{
								iCCI = iCCI - 1;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Best Value Review" + strBuildString;		
							}							
							document.getElementById("tdReason").innerHTML = strBuildString;							
							
						}
						catch(ex)
						{
							document.getElementById("tdReason").innerHTML = "";
						}							
						
						try
						{						
							xx = x[i].getElementsByTagName("PREVIOUS");							
							document.getElementById("tdPrevious").innerHTML = xx[0].firstChild.data;
						}
						catch(ex)
						{
							document.getElementById("tdPrevious").innerHTML = "";						
						}						
						
						////////////////////////////////////////////////	
						try
						{	
							xx = x[i].getElementsByTagName("CCI_GROUP");
							strBuildString = "";
							var iCCI = xx[0].firstChild.data;

							if (iCCI >= 33554432)
							{
								iCCI = iCCI - 33554432;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}
								strBuildString = "Religious and other belief groups";																
							}	
							
							if (iCCI >= 16777216)
							{
								iCCI = iCCI - 16777216;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}
								strBuildString = "Transgender People";																
							}																	
									
							if (iCCI >= 8388608)
							{
								iCCI = iCCI - 8388608;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}
								strBuildString = "Disabled People";																
							}								
											
							if (iCCI >= 4194304)
							{
								iCCI = iCCI - 4194304;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}
								strBuildString = "Other";																
							}
							
							if (iCCI >= 2097152)
							{
								iCCI = iCCI - 2097152;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Businesses" + strBuildString;
							}		
							
							if (iCCI >= 1048476)
							{
								iCCI = iCCI - 1048476;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Community Planning" + strBuildString;
							}	
							if (iCCI >= 524288)
							{
								iCCI = iCCI - 524288;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "PCT" + strBuildString;		
							}	
							if (iCCI >= 262144)
							{
								iCCI = iCCI - 262144;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Parish Councils" + strBuildString;		
							}	
							if (iCCI >= 131072)
							{
								iCCI = iCCI - 131072;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Area Assemblies" + strBuildString;	
							}
							if (iCCI >= 65536)
							{
								iCCI = iCCI - 65536;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Members" + strBuildString;	
							}
							if (iCCI >= 32768)
							{
								iCCI = iCCI - 32768;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Scrutiny Panel" + strBuildString;
							}
							if (iCCI >= 16384)
							{
								iCCI = iCCI - 16384;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Council Staff" + strBuildString;		
							}
							if (iCCI >= 8192)
							{
								iCCI = iCCI - 8192;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Citizens Panel" + strBuildString;			
							}	
							if (iCCI >= 4096)
							{
								iCCI = iCCI - 4096;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Gypsy and Travellers" + strBuildString;			
							}
							
							if (iCCI >= 2048)
							{
								iCCI = iCCI - 2048;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Socially Excluded" + strBuildString;	
							}
							
							if (iCCI >= 1024)
							{
								iCCI = iCCI - 1024;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Lesbian, Gay and Bisexual" + strBuildString;		
							}
							
							if (iCCI >= 512)
							{
								iCCI = iCCI - 512;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Asylum Seekers" + strBuildString;		
							}			
							if (iCCI >= 256)
							{
								iCCI = iCCI - 256;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "People with family and caring responsibilities" + strBuildString;		
							}

							if (iCCI >= 128)
							{
								iCCI = iCCI - 128;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Service Users" + strBuildString;		
							}
								
							if (iCCI >= 64)
							{
								iCCI = iCCI - 64;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "BME Groups" + strBuildString;		
							}

							if (iCCI >= 32)
							{
								iCCI = iCCI - 32;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Men" + strBuildString;			
							}
							
							if (iCCI >= 16)
							{
								iCCI = iCCI - 16;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Women" + strBuildString;			
							}	
							
							if (iCCI >= 8)
							{
								iCCI = iCCI - 8;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Learning Disabled People" + strBuildString;			
							}	
							if (iCCI >= 4)
							{
								iCCI = iCCI - 4;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Older People" + strBuildString;		
							}	
							if (iCCI >= 2)
							{
								iCCI = iCCI - 2;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Children and Young People" + strBuildString;	
							}	
							if (iCCI >= 1)
							{
								iCCI = iCCI - 1;
								if (strBuildString != "")
								{
									strBuildString = ", " + strBuildString;
								}								
								strBuildString = "Voluntary/Community Groups" + strBuildString;		
							}							
							document.getElementById("tdGroups").innerHTML = strBuildString;							
							
						}
						catch(ex)
						{
							document.getElementById("tdGroups").innerHTML = "";
						}												
						
						

						try
						{
							xx = x[i].getElementsByTagName("OTHER_GROUP");
							document.getElementById("tdOther").innerHTML = xx[0].firstChild.data;
							
						}
						catch(ex)
						{
							document.getElementById("tdOther").innerHTML = "";
						}
						
						try
						{
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_AREA");
							
							if (xx[0].firstChild.data == "1")
							{
								document.getElementById("tdArea").innerHTML = "Location Specific";							
							}
							else
							{
								document.getElementById("tdArea").innerHTML = "Boroughwide";
							}
						}
						catch(ex)
						{
							document.getElementById("tdArea").innerHTML = "False";
						}
							
						var iType1 = "0";	
						var iRef1 = "0";						
						var iType2 = "0";
						var iRef2 = "0";
						var iType3 = "0";
						var iRef3 = "0";
						var iType4 = "0";
						var iRef4 = "0";
						try
						{
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_TYPE_1");
							iType1 = xx[0].firstChild.data;
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_ID_1");
							iRef1 = xx[0].firstChild.data 							
						}
						catch(ex)
						{
							
							document.getElementById("tdLoc1").innerHTML = "";
						}	
						
						try
						{
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_TYPE_2");
							iType2 = xx[0].firstChild.data;
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_ID_2");
							iRef2 = xx[0].firstChild.data 	
						}
						catch(ex)
						{
							document.getElementById("tdLoc2").innerHTML = "";
						}	
													
						try
						{
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_TYPE_3");
							iType3 = xx[0].firstChild.data;
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_ID_3");
							iRef3 = xx[0].firstChild.data 
						}
						catch(ex)
						{
							document.getElementById("tdLoc3").innerHTML = "";
						}	
						
						try
						{
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_TYPE_4");
							iType4 = xx[0].firstChild.data;
							xx = x[i].getElementsByTagName("GEOGRAPHICAL_ID_4");
							iRef4 = xx[0].firstChild.data 
						}
						catch(ex)
						{
							document.getElementById("tdLoc4").innerHTML = "";
						}	

						if ((iType1 != "0") && (iRef1 != "0"))
						{
							GeoControl(iType1, iRef1,1);	
						}
						if ((iType2 != "0") && (iRef2 != "0"))
						{
							GeoControl(iType2, iRef2,2);
						}
						if ((iType3 != "0") && (iRef3 != "0"))
						{
							GeoControl(iType3, iRef3,3);
						}
						if ((iType4 != "0") && (iRef4 != "0"))
						{
							GeoControl(iType4, iRef4,4);
						}		
						
						try
						{
							xx = x[i].getElementsByTagName("FEEDBACK");											
							document.getElementById("Link3").innerHTML = "<INPUT type=\"button\" class=\"btnRight\" value=\"Feedback\" onclick=\"Feedback('" + strFeedbackTitle + "')\">"
							document.getElementById("txtSendToAddress").value = decrypt(xx[0].firstChild.data);
						}
						catch(ex)
						{
							document.getElementById("Link3").innerHTML = "";
							
						}	
																						
						break;					
					}
				}
				catch(ex)
				{}
			}
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp2.statusText);
		}		
	}
}


function GeoControl(Type,Reference,Variable)
{	
	iGeoMatch = Reference;
	var url;
	switch(Type)
	{
		case "1":
			url = LocalityURL + "?x=" + Math.floor(Math.random() * 100000);
			break;
		case "2":
			url = WardURL + "?x=" + Math.floor(Math.random() * 100000);
			break;
		case "3":
			url = AreaURL + "?x=" + Math.floor(Math.random() * 100000);
			break;			
	}
	
	
	switch (Variable)
	{
		case 1: //Geo Location 1
			xmlhttp8=null
			// code for Mozilla, etc.
			if (window.XMLHttpRequest)
			{
				xmlhttp8=new XMLHttpRequest()
			}
			// code for IE
			else if (window.ActiveXObject)
			{
				xmlhttp8=new ActiveXObject("Microsoft.XMLHTTP")
			}
			if (xmlhttp8!=null)
			{
				xmlhttp8.onreadystatechange= geo_loc_Change1
				xmlhttp8.open("GET",url,false)
				xmlhttp8.send(null)
			}
			else
			{
				alert("Your browser does not support XMLHTTP.")
			}	
			break;
		case 2: //Geo Location 2
			xmlhttp9=null
			// code for Mozilla, etc.
			if (window.XMLHttpRequest)
			{
				xmlhttp9=new XMLHttpRequest()
			}
			// code for IE
			else if (window.ActiveXObject)
			{
				xmlhttp9=new ActiveXObject("Microsoft.XMLHTTP")
			}
			if (xmlhttp9!=null)
			{
				xmlhttp9.onreadystatechange= geo_loc_Change2
				xmlhttp9.open("GET",url,false)
				xmlhttp9.send(null)
			}
			else
			{
				alert("Your browser does not support XMLHTTP.")
			}	
			break;			
		case 3: //Geo Location 3
			xmlhttp10=null
			// code for Mozilla, etc.
			if (window.XMLHttpRequest)
			{
				xmlhttp10=new XMLHttpRequest()
			}
			// code for IE
			else if (window.ActiveXObject)
			{
				xmlhttp10=new ActiveXObject("Microsoft.XMLHTTP")
			}
			if (xmlhttp10!=null)
			{
				xmlhttp10.onreadystatechange= geo_loc_Change3
				xmlhttp10.open("GET",url,false)
				xmlhttp10.send(null)
			}
			else
			{
				alert("Your browser does not support XMLHTTP.")
			}	
			break;	
		case 4: //Geo Location 4
			xmlhttp11=null
			// code for Mozilla, etc.
			if (window.XMLHttpRequest)
			{
				xmlhttp11=new XMLHttpRequest()
			}
			// code for IE
			else if (window.ActiveXObject)
			{
				xmlhttp11=new ActiveXObject("Microsoft.XMLHTTP")
			}
			if (xmlhttp11!=null)
			{
				xmlhttp11.onreadystatechange= geo_loc_Change4
				xmlhttp11.open("GET",url,false)
				xmlhttp11.send(null)
			}
			else
			{
				alert("Your browser does not support XMLHTTP.")
			}	
			break;								
	}
}



function geo_loc_Change1()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp8.readyState==4)
	{
		// if "OK"
		if (xmlhttp8.status==200)
		{
			var response = xmlhttp8.responseXML.documentElement;
			var x=response.getElementsByTagName("ENTRY");			
			document.getElementById("tdLoc1").innerHTML = "";
			for(i=0;i<x.length;i++)
			{				
				try
				{
					xx=x[i].getElementsByTagName("ID")
					if (xx[0].firstChild.data == iGeoMatch)
					{					
						xx=x[i].getElementsByTagName("NAME")
						document.getElementById("tdLoc1").innerHTML = xx[0].firstChild.data;
					}
				}
				catch(ex)
				{}
			}					
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp8.statusText)
		}
	}
}

function geo_loc_Change2()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp9.readyState==4)
	{
		// if "OK"
		if (xmlhttp9.status==200)
		{
			var response = xmlhttp9.responseXML.documentElement;
			var x=response.getElementsByTagName("ENTRY");			
			document.getElementById("tdLoc2").innerHTML = "";
			for(i=0;i<x.length;i++)
			{				
				try
				{
					xx=x[i].getElementsByTagName("ID")
					if (xx[0].firstChild.data == iGeoMatch)
					{					
						xx=x[i].getElementsByTagName("NAME")
						document.getElementById("tdLoc2").innerHTML = xx[0].firstChild.data;
					}
				}
				catch(ex)
				{}
			}					
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp9.statusText)
		}
	}
}

function geo_loc_Change3()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp10.readyState==4)
	{
		// if "OK"
		if (xmlhttp10.status==200)
		{
			var response = xmlhttp10.responseXML.documentElement;
			var x=response.getElementsByTagName("ENTRY");			
			document.getElementById("tdLoc3").innerHTML = "";
			for(i=0;i<x.length;i++)
			{				
				try
				{
					xx=x[i].getElementsByTagName("ID")
					if (xx[0].firstChild.data == iGeoMatch)
					{					
						xx=x[i].getElementsByTagName("NAME")
						document.getElementById("tdLoc3").innerHTML = xx[0].firstChild.data;
					}
				}
				catch(ex)
				{}
			}					
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp10.statusText)
		}
	}
}

function geo_loc_Change4()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp11.readyState==4)
	{
		// if "OK"
		if (xmlhttp11.status==200)
		{
			var response = xmlhttp11.responseXML.documentElement;
			var x=response.getElementsByTagName("ENTRY");			
			document.getElementById("tdLoc4").innerHTML = "";
			for(i=0;i<x.length;i++)
			{				
				try
				{
					xx=x[i].getElementsByTagName("ID")
					if (xx[0].firstChild.data == iGeoMatch)
					{					
						xx=x[i].getElementsByTagName("NAME")
						document.getElementById("tdLoc4").innerHTML = xx[0].firstChild.data;
					}
				}
				catch(ex)
				{}
			}					
		}
		else
		{
			alert("Problem retrieving XML data:" + xmlhttp11.statusText)
		}
	}
}
