
		var intZoomLevel  = 17;
   //alert(strLongitude+"--"+strLatitude)
	var __isFireFox = navigator.userAgent.match(/gecko/i); 

	

	function GetElementAbsolutePos(element) {  
	 var res = new Object();  
	 res.x = 0; res.y = 0;  
	 if (element !== null) {  
	     res.x = element.offsetLeft;   
	     res.y = element.offsetTop;   
	       
	     var offsetParent = element.offsetParent;  
	     var parentNode = element.parentNode;  
	
	     while (offsetParent !== null) {  
	         res.x += offsetParent.offsetLeft;  
	         res.y += offsetParent.offsetTop;  
	
	         if (offsetParent != document.body && offsetParent != document.documentElement) {  
	             res.x -= offsetParent.scrollLeft;  
	             res.y -= offsetParent.scrollTop;  
	         }  
	         //next lines are necessary to support FireFox problem with offsetParent  
	         if (__isFireFox) {  
	             while (offsetParent != parentNode && parentNode !== null) {  
	                 res.x -= parentNode.scrollLeft;  
	                 res.y -= parentNode.scrollTop;  
	                   
	                 parentNode = parentNode.parentNode;  
	             }      
	         }  
	         parentNode = offsetParent.parentNode;  
	         offsetParent = offsetParent.offsetParent;  
	     }  
	 }  
	 return res;  
	}
	
	
			

					//<![CDATA[
					var map, timer;
					var chosen = [];
					 
					/* Array of GLayers
					 * The 'name' label is not being used here
					*/
					//var layers = [ { name: "Pano", obj: new GLayer("com.panoramio.all") }, { name: "Wiki", obj: new GLayer("org.wikipedia.en") }];
														
					
					function hideAll()
					{
					 var boxes = document.getElementsByName("mark");
					 
					 for(var i = 0; i < boxes.length; i++)
					 {
					  if(boxes[i].checked)
					  {
					   boxes[i].checked = false;
					   switchLayer(false, layers[i].obj);
					   chosen.push(i);
					  }
					 }
					}
					
					function checkChecked() {
					
					 /* Returns true if a checkbox is still checked
					 *  otherwise false
					 */
					 var boxes = document.getElementsByName("mark");
					 for(var i = 0; i < boxes.length; i++) {
					  if(boxes[i].checked) return true;
					 }
					 return false;
					}
					
					
					function switchLayer(checked, layer) {
					
					 /* Function was originally borrowed from Esa:
					 *  http://esa.ilmari.googlepages.com/dropdownmenu.htm
					 */
					 var layerbox = document.getElementById("box");
					 var boxlink = document.getElementById("boxlink");
					 var button = document.getElementById("more_button");
					
					 if(checked) {
					   map.addOverlay(layer);
					   // Reset chosen array
					   chosen.length = 0;
					   /* Highlight the link and
					   *  make the button font bold.
					   */
					   boxlink.className ="highlight";
					   layerbox.className ="highlight";
					   button.className ="highlight";
					 }
					 else {
					   map.removeOverlay(layer);
					   /*  Reset the link and the button
					    * if all checkboxes were unchecked.
					   */
					   if(!checkChecked()) {
					    boxlink.blur();
					    boxlink.className ="";
					    layerbox.className ="";
					    button.className ="";
					   }
					 }
					}			
					
					function showLayerbox()
					{
					var myElement = document.getElementById("more_button");
					var pos = GetElementAbsolutePos(myElement);  
					//window.alert("Element's left: " + pos.x +" and top: " + pos.y);
					
					 var layerbox = document.getElementById("box");
	
					 // Left size of more control plus mapdiv.style.left
					 var offsetX = pos.x;
					 // Top size of more control plus mapdiv.style.top plus more button height
					 var offsetY = pos.y + 18;
					
					 var lpos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(offsetX, offsetY));
					 lpos.apply(layerbox);
					 if(window.timer) clearTimeout(timer);
					 layerbox.style.display = "block";
					}				
					
					function setClose(e) {
					
					 if(!e) e = window.event;
					 var layerbox = document.getElementById("box");
					
					 if(checkMouseLeave(layerbox, e))
					  timer = setTimeout(function() {
					   layerbox.style.display = "none"; }, 400);
					}
					
					
					function checkMouseLeave(element, evt) {
					
					 /* Avoid firing a mouseout event
					 *  when the mouse moves over a child element.
					 *  Borrowed from:
					 *  http://www.faqts.com/knowledge_base/view.phtml/aid/1606/fid/145
					 */
					 if(element.contains && evt.toElement) {
					   return !element.contains(evt.toElement);
					 }
					 else if(evt.relatedTarget) {
					   return !containsDOM(element, evt.relatedTarget);
					 }
					}
					
					
					function containsDOM(container, containee) {
					
					 var isParent = false;
					 do {
					  if((isParent = container == containee))
					   break;
					   containee = containee.parentNode;
					 }
					 while(containee != null);
					 return isParent;
					}
					
					
					function toggleLayers() {
					
					 if(chosen.length > 0 ) {
					   /* Make an independent copy of chosen array since switchLayer()
					   *  resets the chosen array, which may not be useful here.
					   */
					   var copy = chosen.slice();
					   for(var i = 0; i < copy.length; i++) {
					    var index = parseInt(copy[i]);
					    switchLayer(true, layers[index].obj);
					    document.getElementsByName("mark")[index].checked = true;
					   }
					 }
					 else {
					  hideAll();
					 }
					}
					
					/*
					function MoreControl(){};
					MoreControl.prototype = new GControl();
					MoreControl.prototype.initialize = function(map)
					{
						 var more = document.createElement("div");
						 more.id = "more_button";
						 more.title = "Show/Hide Layers";
						 more.appendChild(document.createTextNode("More..."));
						 more.onmouseover = showLayerbox;
						 more.onmouseout = setClose;
						 more.onclick = toggleLayers;
						 map.getContainer().appendChild(more);
						 return more;
					}
					
					
					MoreControl.prototype.getDefaultPosition = function() {
					 return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(278, 7));
					}
					*/
					
					function showAddress(address) {
					
					 var geocoder = new GClientGeocoder();
					 geocoder.getLatLng(address, function(point) {
					
					  if(!point) {
					   alert(address + " not found.");
					  }
					  else {
					   map.setCenter(point, 14);
					  }
					 });
					}
					
					