
         var vemap = null;
         var mappingref;
         var slDrawing;
		 var timerID = 0;
		 var popupID = 0;
         var pinPoint = null;
         var pinPixel = null;
         var ignoreEvents = 0;
         var pinID = 1;
         var mapcursor;
         var pin1;
         var addpushpin;
         var ajaxsuccess = false;
         var ajaxID = 0;
      	 var ajaxTimerLat = null; 
		 var ajaxTimerLong = null;
		 var ajaxMiniMap = null;
		 var openwindow = 0;
   		 var minzoomlevel = 8;
   		 var newWindowURL ="";
  		 var oldval="1";
		 var isBack;
		 var pinMouseOver = null;
		 var oldpinIcon = "";
		 var panelOldPin = "";
		 var panelImageId = "";
	   
	     var myLocationLatitude = null; 
		 var myLocationLongitude = null;
		 
		 var pinIds;
		 
		 function handleBackButton() 
		 {
		 	try {
		 
		   		isBack = (oldval != $('mapForm')._a1.value);
		   		$('mapForm')._a1.value=2;
		   		$('mapForm')._a1.defaultValue=2;
		   	}catch (error) {
			}
		   			
		 }
      
	     function GetMap(mappingRef, latitude, longitude, zoom, mylatitude, mylongitude, newwindow, minresultzoom, cursor, json)
	     {		mappingref = mappingRef;
	     		openwindow = newwindow;
	     		minzoomlevel = minresultzoom; 
	     		if (mylatitude != -1) {	
	     			myLocationLatitude = mylatitude;
					myLocationLongitude = mylongitude;				     		
	     		}
	     		handleBackButton();
	     		vemapOptions =  new VEMapOptions();
	     		vemapOptions.EnableBirdseye = false;
	            vemap = new VEMap('myMap');
	            slDrawing = new VEShapeLayer();
	            var LA = new VELatLong(latitude , longitude);
	           
	            vemap.LoadMap(LA, 
	            	zoom, 
	            	VEMapStyle.Road, false, 
	            	VEMapMode.Mode2D, true, 0, vemapOptions);
	 			
	 			vemap.AddShapeLayer(slDrawing);
	 			slDrawing.DeleteAllShapes();
				//vemap.ShowMiniMap(0, 0);            
	 			//RealignMiniMap();
	 			 			
	 			 			
	 			 			
	 			 			
	 			vemap.AttachEvent("onstartpan", mapStartPan);
	 			vemap.AttachEvent("onendpan", mapEndPan);
	 			vemap.AttachEvent("onstartzoom", mapStartZoom);
	 			vemap.AttachEvent("onendzoom", mapEndZoom);
	 			vemap.AttachEvent("onclick", mapOnClick);
	 			vemap.AttachEvent("onmouseover", mapOnMouseOver);
	 			vemap.AttachEvent("onmouseout", mapOnMouseOut);

	 			
	 			vemap.Hide3DNavigationControl();
	 			VEMapOptions.EnableBirdseye = false;
	 			addpushpin = false;
	 		 	pinMouseOver = null
				oldpinIcon = "";
	 
	 		 	var z = vemap.GetZoomLevel(); 
	 		 	if (cursor !== null && cursor !== "") {
	 		 		 
	 		 		mapcursor ="url('_images/"+cursor+"'),pointer";
	 		 	}
	 		 	else {
	 		 		mapcursor = "";
	 		 	}

				if (z < minzoomlevel) {

					document.getElementById("myMap").childNodes[0].style.cursor = "";
	 			}
 	 			else {
					document.getElementById("myMap").childNodes[0].style.cursor = mapcursor;
 				}	      
	 
	 			
	 			var pp = json; 
	 			if (pp != null && pp.length > 0) {
					var json = pp.evalJSON(true); 
					var i = pp.indexOf('zoomLevel');

					if (i == -1) {
						addPins(json, 0, 1);
					}
					else {
						var mzoom = json.results[0]['zoomLevel'];
						var z = vemap.GetZoomLevel();    
						if (mzoom < z) {
							ignoreEvents = true;
							vemap.SetZoomLevel(mzoom);
						}
						
						addPins(json, 1, 1);
						
					}								

					if (newWindowURL != null && newWindowURL.length > 0) {
						var policingwin = window.open(newWindowURL,'mywindow');
						if (policingwin && policingwin.top) {
							// popup has opened
						} else {
							
							if (isBack == false) {
								document.location.href = newWindowURL;
								return;
							}
						} 
					}
					
					
					document.location.href='#mapanchor';
				}
 	 			
	      }
	      
	      
	     function GetMapDetails(latitude, longitude, zoom, newwindow, minresultzoom, cursor, json)
	     {
	     		openwindow = newwindow;
	     		minzoomlevel = minresultzoom; 
	     		handleBackButton();
	     		vemapOptions =  new VEMapOptions();
	     		vemapOptions.EnableBirdseye = false;
	            vemap = new VEMap('myMap');
	            slDrawing = new VEShapeLayer();
	            var LA = new VELatLong(latitude , longitude);
	           
	            vemap.LoadMap(LA, 
	            	zoom, 
	            	VEMapStyle.Road, false, 
	            	VEMapMode.Mode2D, true, 0, vemapOptions);
	 			
	 			vemap.AddShapeLayer(slDrawing);
	 			slDrawing.DeleteAllShapes();
	 			vemap.DeleteAllShapes();
				//vemap.ShowMiniMap(0, 0);            
	 			//RealignMiniMap();
	 			 			
				vemap.AttachEvent("onendzoom", mapEndZoomDisplay);
	 			
	 			vemap.Hide3DNavigationControl();
	 			VEMapOptions.EnableBirdseye = false;
	 			addpushpin = false;
	 
	 		 	var z = vemap.GetZoomLevel();    
	 
	 			
	 			var pp = json; 
	 			if (pp != null && pp.length > 0) {
					var json = pp.evalJSON(true); 
					addPins(json, 0, 0);
	
					
					document.location.href='#mapanchor';
				}
 	 			
	      }	      
	      
	      function popupTimer() {
 			if(popupID) {
			    clearTimeout(popupID);
			    popupID  = 0;
			}
			if (pin1 != null) {
				vemap.ShowInfoBox(pin1);		
			}		
	      }
	      	      
	      function ajaxTimer(command) {
 			if(ajaxID) {
			    clearTimeout(ajaxID);
			    ajaxID  = 0;
			}
		    if 	(ajaxsuccess == false) {
				
				$('mapZoom').value=	vemap.GetZoomLevel().toString(); 
		    	
		    	if (ajaxTimerLat != null) {
					$('mapLatitude').value = ajaxTimerLat;
					$('mapLongitude').value = ajaxTimerLong;
					$('myLocationLatitude').value = myLocationLatitude;
					$('myLocationLongitude').value = myLocationLongitude;				
		    	}
		    	else if (ajaxMiniMap != null) {
		    		$('map').value = ajaxMiniMap;
		    	}
		    	else {
		    		var center = vemap.GetCenter();
					$('mapLatitude').value = center.Latitude.toString();
					$('mapLongitude').value = center.Longitude.toString();
					$('myLocationLatitude').value = myLocationLatitude;
					$('myLocationLongitude').value = myLocationLongitude;				
		        }
		  		
		  		$('ref').value = mappingref;  	
		    	$('mapCommand').value=command;
		    	$('mapForm').submit();
		    	
		    }
	    	ajaxTimerLat = null;
			ajaxTimerLong = null;
			ajaxMiniMap = null; 
	      }
	     
	     
	      function MoreResults(layer, resultsArray, places, hasMore, veErrorMessage)
          {
           		if (places != null && places.length > 0) {
           			updateTimer();
		        }
	      }
         
      	  function mapStartZoom()
		  {
	     	if(timerID) {
	     		clearTimeout(timerID);
	     		timerID = 0;
	 		}	      
	 	  }
	 	   
	      function mapEndZoom()
		  {
		  	var z = vemap.GetZoomLevel() ;
		  	if (z < 5) {
   				vemap.SetZoomLevel(5)
   			} 	 		
 			
	      	timerID  = setTimeout('updateTimer()', 1000);
	      }
	      
	      function mapEndZoomDisplay()
		  {
		  	var z = vemap.GetZoomLevel() ;
		  	if (z < 5) {
   				vemap.SetZoomLevel(5)
   			} 	 		
 	
	      }
		
		
		  function mapStartPan()
		  {
	     	if(timerID) {
	     		clearTimeout(timerID);
	     		timerID = 0;
	 		}	      
	 	  }
	
	      function mapEndPan()
		  {	
	      	timerID  = setTimeout('updateTimer()', 1000);	 

	      }
	      
	      function listOnMouseOver(id) 
	      {
	          	var replace = "_images/pinyellow" + id + ".gif";
	
	            panelImageId = "panelpin" + id;
	            panelOldPin = document[panelImageId].src;
	            document[panelImageId].src=replace;
	            var pinMouseOver2 = vemap.GetShapeByID(pinIds[id]);
	            if (pinMouseOver2 != null) {
	           		pinMouseOver2.SetCustomIcon(replace);
	            }
           }
          
          function listOnMouseOut(id) 
          {
	          	panelImageId = "panelpin" + id;
	            document[panelImageId].src=panelOldPin;
	            var pinMouseOver2 = vemap.GetShapeByID(pinIds[id]);
	            if (pinMouseOver2 != null) {
	           	 	pinMouseOver2.SetCustomIcon(panelOldPin);
	            }
	                   
          }
	      
	       
	      
	      function mapOnMouseOver(e) 
	      {
	      	if(e.elementID != null && pinMouseOver == null)
        	{
        		if (slDrawing.GetShapeCount() > 1) {
	        		pinMouseOver = vemap.GetShapeByID(e.elementID);
	        		
	        	
	        		var icon = pinMouseOver.GetCustomIcon();
	        		var image = icon.Image;
	        		
	        		var i = image.lastIndexOf('/');
	        		var i2 = image.indexOf('.gif');
	        		
	        		if(image.charAt(i2-1) >= '0' && image.charAt(i2-1) <= '9') {
	        		
		        		oldpinIcon = "";
		        		var derivedId = "";
		        		
		        		
		        		if(image.charAt(i2-2) >= '0' && image.charAt(i2-2) <= '9') {
		        			oldpinIcon = image.substring(i+1, i2-2);
		        			derivedId = image.substring(i2-2, i2);
		        		}
		        		else {
		        			oldpinIcon = image.substring(i+1, i2-1);
		        			derivedId = image.substring(i2-1, i2);
		        		}
	
		        		
		        		var myNewString = image.replace(oldpinIcon, "pinyellow");
		        		//var myNewString = image.replace("burgandy", "yellow");
		         		pinMouseOver.SetCustomIcon(myNewString);
		         		
		         		 // replace panel image too                
	                    //var derivedId = parseInt(e.elementID.charAt(e.elementID.length-1)) + 1;
	                  	
	                  	var replace = "_images/pinyellow" + derivedId + ".gif";
						
	                  	panelImageId = "panelpin" + derivedId;
	                  	panelOldPin = document[panelImageId].src;
	                  	document[panelImageId].src=replace;
	                }
 	         	}
        	 }
	      }
	      
	      function mapOnMouseOut(e) 
	      {
	      	
	      	if(e.elementID != null && pinMouseOver != null)
        	{
        		if (slDrawing.GetShapeCount() > 1) {
	        		var icon = pinMouseOver.GetCustomIcon();
	        		var image = icon.Image;
	         		var myNewString = image.replace("pinyellow", oldpinIcon);
	         		pinMouseOver.SetCustomIcon(myNewString);
	       			pinMouseOver = null;
	       			//Replace panel pin image
                    document[panelImageId].src=panelOldPin;
	       			
	       		}
        		
         	}
	      } 
		
		  function mapOnClick(e) 
	      {
	      	if(e.elementID != null)
        	{

 	      		var clickedPin = vemap.GetShapeByID(e.elementID);
	      		var desc = clickedPin.GetDescription();
	      		
	      		var i = desc.indexOf('datatype'); 
	      		var detail = desc.substring(i,desc.length);
	      		var i3 = detail.indexOf(">"); 
				var detail2 = detail.substring(0,i3-1);
       			var mySplitResult = detail2.split("&");

				for (var i = 0; i < mySplitResult.length; i++) {
					var splitz = mySplitResult[i];
					var mySplitResultx = splitz.split("=");
					$(mySplitResultx[0]).value = mySplitResultx[1];
				}
			

	      		$('mapDetailForm').submit();  
	      		
	      	}
	      	else {
		      	if (mapcursor !== "" && vemap.GetZoomLevel() >= minzoomlevel && timerID == 0) {
	
			      	if (addpushpin == true) {
			      		return;
			      	}
	
			      	addpushpin = true;
			      	
			      	slDrawing.DeleteAllShapes();
			      	vemap.DeleteAllShapes();
			      	
					document.getElementById("myMap").childNodes[0].style.cursor = "wait";
	 	      	
				  	var x = e.mapX;
					var y = e.mapY;
					var pixel = new VEPixel(x, y);
					var latlong = vemap.PixelToLatLong(pixel);;			
			
				    myLocationLatitude = latlong.Latitude.toString(); 
		 			myLocationLongitude = latlong.Longitude.toString();				
				
			 		var serviceUrl = "/LDGRedirect/mapajax.do?date="+new Date();
					ajaxsuccess = false;
					pin1 = null;

					var aj = new Ajax.Request(serviceUrl, 
					{   method: 'post',   
						parameters: {mapCommand: 'addPushPin', 	
							mappingRef: mappingref,		
							myLocationLatitude : myLocationLatitude,
							myLocationLongitude : myLocationLongitude,				
							mapZoom: vemap.GetZoomLevel().toString(), 
							mapLatitude: latlong.Latitude.toString(),
							mapLongitude:  latlong.Longitude.toString()},
						onLoading: function(transport){		
							ajaxsuccess = true;
						},	
	
						onSuccess: function(transport){
								var response = transport.responseText || "no response text";
								try {
													
									var i = response.indexOf('{results:');
									var jsonStr;
									if (i == 0) {
										jsonStr = response;							
									}									
									else {										
										if (i==-1) {
											$('minimap').update(response);
										} else {
											var sub = response.substring(0,i-1);
											$('minimap').update(sub);	
											jsonStr = response.substring(i);
										}					
									}

									if (jsonStr != null) {								
										var json = jsonStr.evalJSON(true); 																		
										var i = response.indexOf('zoomLevel');
										var setCenter = 1;
										if (i == -1) {
											addPins(json, 0, 1);
										}
										else {
											var mzoom = json.results[0]['zoomLevel'];
																
											addPins(json, 1, 0);
											setCenter = 0;
											var z = vemap.GetZoomLevel();    
											
											// have to do something special here as SetCenterAndZoom sometimes loses the current zoom level
					   						var diff = mzoom - z;

			           						//if (mzoom < z) {
											//	ignoreEvents = true;
											//	vemap.SetZoomLevel(mzoom);
											//}

											ignoreEvents = true;
											vemap.SetCenterAndZoom(latlong,z+diff);
											addpushpin = false;	
										}								
										addpushpin = false;								
										if (pin1 != null) {
											popupID  = setTimeout('popupTimer()', 1000);	
											if (setCenter == 1) {
												vemap.SetCenterAndZoom(latlong, vemap.GetZoomLevel());
											}
										}
									}
									else {
										addpushpin = false;	
									}
								}
								catch(error) {
									addpushpin = false;	
								}						
								document.getElementById("myMap").childNodes[0].style.cursor = mapcursor;
							},
	
	 						onFailure: function () {
	 								addpushpin = false;
	 								document.getElementById("myMap").childNodes[0].style.cursor = mapcursor;
	 							} 
							}
						); 	

						ajaxTimerLat = latlong.Latitude.toString(); 
						ajaxTimerLong = latlong.Longitude.toString();
	
						ajaxID  = setTimeout("ajaxTimer('addPushPin')", 1000);	
				}
			 }
	      }
	     
	     	  
     	  function updateTimer() 
     	  {
      	 	pinMouseOver = null
			oldpinIcon = "";
	
     	  	if (ignoreEvents == 1) {
     	  		ignoreEvents = 0;
     	  		return;
     	  	}
  			if(timerID) {
			    clearTimeout(timerID);
			    timerID  = 0;
			}
	  	 	var center = vemap.GetCenter();

	 		var serviceUrl = "/LDGRedirect/mapajax.do?date="+new Date();			
			ajaxsuccess = false;		
		

			var aj = new Ajax.Request(serviceUrl, 
			{   method: 'post',   
				parameters: {mapCommand: 'updateMiniMap',
					mappingRef: mappingref,	
					pinCount: slDrawing.GetShapeCount(),
					myLocationLatitude : myLocationLatitude,
					myLocationLongitude : myLocationLongitude,				
					mapZoom: vemap.GetZoomLevel().toString(), 
					mapLatitude: center.Latitude.toString(),
					mapLongitude:  center.Longitude.toString()},
				onLoading: function(transport){		
					ajaxsuccess = true;
				},	
				onSuccess: function(transport){
					var response = transport.responseText || "no response text"; 
					var i = response.indexOf('{results:');

					if (i == -1) {
						$('minimap').update(response);						
					}
					else {
						slDrawing.DeleteAllShapes();
						vemap.DeleteAllShapes();
						var sub = response.substring(0,i-1);
						
						var jsonStr = response.substring(i);
						var json = jsonStr.evalJSON(true); 
						$('minimap').update(sub);	
						
						var i2 = response.indexOf('zoomLevel');
						if (i2 == -1) {
							addPins(json, 0, 0);	
						}
						else {
							var mzoom = json.results[0]['zoomLevel'];						
							addPins(json, 1, 0);
						}
					}				
					
				} 
			}
			); 	

			
			var z = vemap.GetZoomLevel();
			if (z < minzoomlevel) {

				document.getElementById("myMap").childNodes[0].style.cursor = "";
	 		}
 	 		else {
				document.getElementById("myMap").childNodes[0].style.cursor = mapcursor;
 			}	      
				
			ajaxID  = setTimeout("ajaxTimer('updateMiniMap')", 1000);	 
		 }
		 
   	 	 function miniMap()
    	 {
    	 
 			var serviceUrl = "/LDGRedirect/mapajax.do";
			
			var aj = new Ajax.Request(serviceUrl, 
			{   method: 'post',   
				parameters: {map: '${requestScope.map}'},	
				onLoading: function(transport){		
					ajaxsuccess = true;
				},	
				onSuccess: function(transport){
					var response = transport.responseText || "no response text";       	
					$('minimap').update(response);					
				}, 
				onFailure: function () {
 					
 				}			
			}
			); 	
 
		}
		

		function minimapClick(id) {
		 	var serviceUrl = "/LDGRedirect/mapajax.do?date="+new Date();
			ajaxsuccess = false;

			var aj = new Ajax.Request(serviceUrl, 
			{   method: 'post',   
				parameters: {mapCommand: 'selectMiniMap',
					mappingRef: mappingref,	
					map: id,
					mapZoom: vemap.GetZoomLevel().toString()},				
				onLoading: function(transport){		
						ajaxsuccess = true;
					},	
				onSuccess: function(transport){
					var response = transport.responseText || "no response text";       	
					ignoreEvents = 1;
					
					slDrawing.DeleteAllShapes();
		  			vemap.DeleteAllShapes();
			
					var i = response.indexOf('{results:');
					if (i == -1) {
						ignoreEvents = 1;
						$('minimap').update(response);	
						vemap.SetZoomLevel(5);
						document.getElementById("myMap").childNodes[0].style.cursor = "";
					}
					else {
						var sub = response.substring(0,i-1);
						
						var jsonStr = response.substring(i);
						var json = jsonStr.evalJSON(true); 
						$('minimap').update(sub);	

						var mlat = json.results[0]['latitude'];
						var mlong = json.results[0]['longitude'];
						var mzoom = json.results[0]['zoomLevel'];
						
					
						addPins(json, 1, 0);
						
					   	ignoreEvents = 1;
					   	// have to do something special here as SetCenterAndZoom sometimes loses the current zoom level
					   	var diff = mzoom - vemap.GetZoomLevel();

			            var LA2 = new VELatLong(mlat, mlong);
				   		var  zl = vemap.GetZoomLevel();
				   		vemap.SetCenterAndZoom(LA2, zl+diff);
					 
						if (zl+diff < minzoomlevel) {				
							document.getElementById("myMap").childNodes[0].style.cursor = "";
				 		}
			 	 		else {
							document.getElementById("myMap").childNodes[0].style.cursor = mapcursor;
			 			}	
			 		}      
				} 
			}
			); 	

			ajaxMiniMap = id; 
			ajaxID  = setTimeout("ajaxTimer('selectMiniMap')", 1000);	 
		}
		
		
		function gotoLocation(street, town, county, postcode)
		{

			$('refineLocation').value='Go';
			$('refineStreet').value=street;
			$('refineTown').value=town;
			$('refineCounty').value=county;
			$('refinePostcode').value=postcode;
			
		    $('mapForm').submit();
		}	
		
		function addPins(json, startindex, showinfobox) {
		
			pinIds = new Array ();
			var index = 1;
			var infoBoxShape;
			
			for (var i = startindex; i < json.results.length; i++) {
				var lat1 = parseFloat(json.results[i]['latitude']);
				var long1 = parseFloat(json.results[i]['longitude']);
				
				var title = json.results[i]['title'];
				var htmlU = json.results[i]['html'];
				
				//var html = htmlU.replace(/!/, 'XX');
				
				out1 = "^"; // replace this
				add1 = "\""; // with this			
				html1 = "" + htmlU; // temporary holder				
				while (html1.indexOf(out1)>-1) {
					pos1= html1.indexOf(out1);
					if (pos1 != -1) {
						html1 = "" + (html1.substring(0, pos1) + add1 + 
						html1.substring((pos1 + out1.length), html1.length));
					}
				}
	
				out2 = "~"; // replace this
				add2 = "'"; // with this		
				html = "" + html1; // temporary holder				
				while (html.indexOf(out2)>-1) {
					pos2= html.indexOf(out2);
					if (pos2 != -1) {
						html = "" + (html.substring(0, pos2) + add2 + 
						html.substring((pos2 + out2.length), html.length));
					}
				}
	

				var icon = json.results[i]['icon'];
				var image = json.results[i]['image']; 
				var detailsPageU = json.results[i]['detailsPage'];  
				
				detailsPage1 = "" + detailsPageU; // temporary holder
				
				while (detailsPage1.indexOf(out1)>-1) {
					pos1= detailsPage1.indexOf(out1);
					detailsPage1 = "" + (detailsPage1.substring(0, pos1) + add1 + 
					detailsPage1.substring((pos1 + out1.length), detailsPage1.length));
				}
		
				detailsPage = "" + detailsPage1; // temporary holder
		
				while (detailsPage.indexOf(out2)>-1) {
					pos2= detailsPage.indexOf(out2);
					detailsPage = "" + (detailsPage.substring(0, pos2) + add2 + 
					detailsPage.substring((pos2 + out2.length), detailsPage.length));
				}
				
				var url = json.results[i]['url'];
				
				var latlongPin = new VELatLong(lat1, long1);
	            var shape = new VEShape(
               	VEShapeType.Pushpin, latlongPin);
                shape.SetTitle(title);
               
                var desc = html;
                if (detailsPage != null && detailsPage != "null") {
               		desc += "<br/>"+detailsPage;
               	}
               	
            	
          		shape.SetDescription(desc);
          		if (icon != null) {
          			shape.SetCustomIcon(icon);
          		}
          		if (image != null) {
           			shape.SetPhotoURL(image);
           		}
				shape.SetMinZoomLevel(minzoomlevel);
	
          		slDrawing.AddShape(shape);
          		
          		pinIds[index] = shape.GetID();
          		
				newWindowURL = "";
				if (i == startindex) {
					infoBoxShape = shape;
				} else {
					if (title != 'My Location') {
						infoBoxShape = null;
					}
					
				}         	
	          	index++;	          	
			}
			
  			if (infoBoxShape != null) {
  				if (showinfobox == 1 && openwindow == 0) {
  					vemap.ShowInfoBox(infoBoxShape);
  				}					           		
		   		else if (openwindow == 1){
		   			newWindowURL = url;
	   				pin1 = infoBoxShape;
	   			}
	        } 
 		}
		
		function getDirections(postcode) 
		{
			with('TransportDirectPlanningForm')
			{
				$('d').value = postcode;
				$('TransportDirectPlanningForm').submit();
			}
		}
		
		function MapResize(e)
		{
		    // When the map is resized, Realign the position of the Mini Map
		    RealignMiniMap();
		} 
		
		function RealignMiniMap()
		{
			
		    // Realign the position of the Mini Map so it appears
		    // where we want it - The Upper Right Corner
		    var minimap2 = document.getElementById("MSVE_minimap");
		    var xoffset = (GetMapWidth() - minimap2.offsetWidth);
		  
		    vemap.ShowMiniMap(xoffset, 0);
		    
		    /// Hide the Mini Map resizer so the Mini Map cannot be resized
		    document.getElementById("MSVE_minimap_resize").style.display = "none";
		} 
		
		function GetMapWidth()
		{   
		    // Get the Width of the Map as an integer
		    return document.getElementById("myMap").offsetWidth;
		}
		function GetMapHeight()
		{
		    // Get the Height of the Map as an integer
		    return document.getElementById("myMap").offsetHeight;
		}

  		// temp code
		function getInfo2()
        {
			var results = vemap.Find('',
                                  document.forms.mapForm.la.value+ ', uk',
                                  null,
                                  null,
                                  0,
                                  1,
                                  true,
                                  true,
                                  false,
                                  true,
                                  GetInfoMoreResults);
         }
         
         function getInfo()
         {
	
            var center = vemap.GetCenter();
	 		var serviceUrl = "/LDGRedirect/ajax.do?date="+new Date();
			var aj = new Ajax.Request(serviceUrl, 
			{   method: 'post',   
				parameters: {mapCommand: 'saveInfo',
						la: document.forms.mapForm.la.value,
						mapZoom: vemap.GetZoomLevel().toString(), 
						mapLatitude: center.Latitude.toString(),
						mapLongitude:  center.Longitude.toString()}

			}
			); 	

         }
         
         function GetInfoMoreResults(layer, resultsArray, places, hasMore, veErrorMessage)
         {
         	var center = vemap.GetCenter();
	 		var serviceUrl = "/LDGRedirect/ajax.do?date="+new Date();
		
			var aj = new Ajax.Request(serviceUrl, 
			{   method: 'post',   
				parameters: {mapCommand: 'saveInfo2',
					la: document.forms.mapForm.la.value,
					mapZoom: vemap.GetZoomLevel().toString(), 
					mapLatitude: center.Latitude.toString(),
					mapLongitude:  center.Longitude.toString()}

			}
			); 	
         }