
function country_report_navigation(sub_section,main_section,header)
{
	
	jQuery('.sub_sections').hide();
	
	//SORT THE HEADER OUT
	if(header)
	{
		jQuery('#header_box').show();
	}
	else
	{
		jQuery('#header_box').hide();
	}
	
	//SORT MAIN SECTION
	toggleDiv(main_section);
	
	//SORT SUB SECTION
	jQuery('#'+sub_section).show();
	
}

function showGoogle()
{
	jQuery('#map1').hide();	
	jQuery('#map2').show();	
	initialize();
	//showCity('London');
}

    function showHideGoogleMap() {
        var flashmap = document.getElementById("flashmap");
        var zIndexValue = flashmap.style.zIndex.toString()
        if (zIndexValue == '2' || zIndexValue == '')
        {
            flashmap.style.zIndex = 0;
        } else {
            flashmap.style.zIndex = 2;
        }
    }
    var map;
    var geocoder = null;    
    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        //map.hideControls();
        map.setMapType(G_PHYSICAL_MAP);
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.setUIToDefault();
        geocoder = new GClientGeocoder();
      }
    }
    function moveToCountry(lLat, lLong, lZoom) {
      map.panTo(new GLatLng(lLat, lLong));
      map.setZoom(lZoom);
    }
    
    function showAlertsPanel(cAlertTypes, cPage) {
       var http = false;
        if(navigator.appName == "Microsoft Internet Explorer") {
            http = new ActiveXObject("Microsoft.XMLHTTP");
        } else {
            http = new XMLHttpRequest();
        }
        http.open("GET", "ajaxgetalerts.asp?alerttypes=" + cAlertTypes + "&page=" + cPage, true);
        http.onreadystatechange=function() {
        if(http.readyState == 4) {
            document.getElementById('divGlobalAlerts').innerHTML=http.responseText;
            eval(document.getElementById("reloadpoisdiv").innerHTML);
            }
        }
    http.send(null);
  }

    function loadGoogleAlerts(cFile) {
      //alert(cFile)
	  map.clearOverlays();
      setTimeout('',250);
      GDownloadUrl(cFile, function(doc) {
        var xmlDoc = GXml.parse(doc);
        var markers = xmlDoc.documentElement.getElementsByTagName("marker");
       // alert(markers.length)
		for (var i = 0; i < markers.length; i++) {
          var lat = parseFloat(markers[i].getAttribute("lat"));
          var lng = parseFloat(markers[i].getAttribute("lng"));
		  //alert(i)
          var point = new GLatLng(lat,lng);
          var html = markers[i].getAttribute("label");
          var category = markers[i].getAttribute("cat");
          var alertIcon = new GIcon(G_DEFAULT_ICON);
          alertIcon.iconSize = new GSize(22, 22);
          alertIcon.image = "fmASMap/pois/alert-"+category+"-pois.gif";
          alertIcon.shadow = "";
          alertIcon.iconAnchor = new GPoint(0, 0);
          markerOptions = { icon:alertIcon, "clickable": true };
          map.addOverlay(new GMarker(point, markerOptions));
          //var labelpoint = new GLatLng(lat+.35,lng+0.2);
          //var label = new BpLabel(labelpoint,html,'maplabel','center');
          //map.addOverlay(label);
          //label.setCursor('pointer');
        }
        });
       }
    function showCity(city) {
      if (geocoder) {
        geocoder.getLatLng(
          city,
          function(point) {
            if (!point) {
              alert(city + " not found");
            } else {
              map.setCenter(point, 6);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(city);
            }
          }
        );
      }
    }
	
	function validateFormNoSubmit(formName)
	{
		var valid = true;
		
		jQuery("form[name='" + formName + "'] .requiredField").each(function()
		{
			if(this.value == "")
			{
				jQuery(this).css('border-color','red');
				valid = false;
			} 
			else 
			{
				jQuery(this).css('border-color','#666666');
			}
		});
		
		return valid;
	}
	
	function HashString(FullURL)
	{
		QueryStr = FullURL.split("#");	
		VariableArray = QueryStr[1].split("&");
		
		Variables = new Array();
		for (var ArrayObjects in VariableArray)
		{
			Vars = VariableArray[ArrayObjects].split("=");
			Variables.push(Vars);
		}
		return Variables;
		// Returns the format Variables[VarName][VarData]
	}
	
	function getHashVariable(VarName)
	{
		if (location.hash)
		{
			var VarArray = HashString(location.hash);
		
			for (var Count = 0; Count < VarArray.length; Count++)
			{
				if (VarArray[Count][0] == VarName)
				{
					return VarArray[Count][1];	
				}
			}
			
			return false;
		}
		return false;
	}
