function MWS_Services_PageHeader(Div){
	MWS.pageheaderLocation = function (){this.id=""};
	
	MWS.pageheaderDiv = OpenLayers.Util.getElement(Div);
	MWS.pageheaderFunction1 = function (){
		var mav_lonlat = MWS.MWS_MapObj.getCenter();
		MWS.searchExtents = new OpenLayers.Bounds
			( mav_lonlat.lon-1, mav_lonlat.lat-1, 
			mav_lonlat.lon+1, mav_lonlat.lat+1);

		url = MWS.MWS_EBUrlFunction("pageheader_getlocation") + 
			"&minx="+MWS.MWS_MapObj.getExtent().left+
			"&miny="+MWS.MWS_MapObj.getExtent().bottom+
			"&maxx="+MWS.MWS_MapObj.getExtent().right+
			"&maxy="+MWS.MWS_MapObj.getExtent().top; 
	
		OpenLayers.loadURL(url, '', MWS.MWS_MapObj, MWS.pageheaderFunction2);		
	};

	MWS.pageheaderFunction2 = function (resp){
		if (resp.responseXML!=null)
		{
			var theXML=resp.responseXML.documentElement;
			var r = theXML.getElementsByTagName('ResultSet');
			var div = OpenLayers.Util.getElement(MWS.MWS_getServiceDiv("pageheader_getlocation", 1));

			if (div!=null)
				div.innerHTML="";
			var j = 0;
			for (var i = 0; i < r.length; i++)
			{
				if(r[i].firstChild!=null)
				{
					MWS.pageheaderLocation.country_name =  MWS_Utils.getNodeText(r[i], 'COUNTRY', " ");
					MWS.pageheaderLocation.country_code =  MWS_Utils.getNodeText(r[i], 'COUNTRYCODE', " ");
					MWS.pageheaderLocation.region_name =  MWS_Utils.getNodeText(r[i], 'REGION', " ");
					MWS.pageheaderLocation.region_code =  MWS_Utils.getNodeText(r[i], 'REGIONCODE', " ");
					MWS.pageheaderLocation.place_name =  MWS_Utils.getNodeText(r[i], 'PLACENAME', "");

					MWS.pageheaderLocation.country_xmin =  MWS_Utils.getNodeText(r[i], 'COUNTRYXMIN', -180);
					MWS.pageheaderLocation.country_ymin =  MWS_Utils.getNodeText(r[i], 'COUNTRYYMIN', -90);
					MWS.pageheaderLocation.country_xmax =  MWS_Utils.getNodeText(r[i], 'COUNTRYXMAX', 180);
					MWS.pageheaderLocation.country_ymax =  MWS_Utils.getNodeText(r[i], 'COUNTRYYMAX', 90);

					if (MWS.pageheaderDiv!=null)
					{
						var placenametext = MWS.pageheaderLocation.country_name;
						if (MWS.pageheaderLocation.place_name!="")
							 placenametext = MWS.pageheaderLocation.place_name + " in " + placenametext;
						MWS.pageheaderDiv.innerHTML="Viewing Area: <span style='color: #cc6633;'>"+
						placenametext+"</span>";
					}
				}
			}
		}
	};

	MWS.MWS_MapObj.events.register("moveend", MWS.MWS_MapObj, MWS.pageheaderFunction1);
	MWS.pageheaderFunction1();
}