    //<![CDATA[
          var lon = -86;
          var lat = 45;
          var zoom = 5;
        var map, mmlayer, layer;

    function checkForm() {
  
     emailFormat = /^.+@.+\..{2,3}$/;  // email pattern         
         
     if(document.getElementById("f_name").value == "") {
      document.getElementById("f_name2").style.visibility = "visible";
      return false;
     }
     else if (document.getElementById("l_name").value == "") {
      document.getElementById("f_name2").style.visibility = "hidden";      
      document.getElementById("l_name2").style.visibility = "visible";
      return false;
     }
     else if(document.getElementById("email").value == "" || !emailFormat.test(document.getElementById("email").value))
      {
      document.getElementById("f_name2").style.visibility = "hidden";      
      document.getElementById("l_name2").style.visibility = "hidden";            
      document.getElementById("email2").style.visibility = "visible";  
      return false;
      }
     else {
      return true;
     }
    
    
    }

	  function popupPage(item,width,height)
		{

		WindowName="bwgeo_info_window";
		window.name = "main";
                size = "width="+width+",height="+height;      
                pos = (width/2)-(((height/601)*364)/2);
                //alert(width + " " + pos);
                
                image = "<img src='wave.png' height='92%' style='position:absolute;left:" + pos + "px;' />";
                

		settings=
		"toolbar=no,location=no,directories=no,"+
		"status=no,menubar=no,scrollbars=yes,"+
		"resizable=yes," +
		 size;
		 
		MyNewWindow=window.open(item,WindowName,settings);

		}

	  function reloader() {
	   alert("hi");
	   //parent.location.reload();
	  }



	  function popupInfoWindow(item,width,height)
		{

		WindowName="bwgeo_info_window";

                size = "width="+width+",height="+height;      
                pos = (width/2)-(((height/601)*364)/2);
                //alert(width + " " + pos);
                
                image = "<img src='wave.png' height='92%' style='position:absolute;left:" + pos + "px;' />";
                

		settings=
		"toolbar=no,location=no,directories=no,"+
		"status=no,menubar=no,scrollbars=yes,"+
		"resizable=yes," +
		 size;
		 
		MyNewWindow=window.open('',WindowName,settings);

		MyNewWindow.document.writeln("<html>");
		MyNewWindow.document.writeln("<head><title>Bluewater Geospatial Info Window</title>");
		MyNewWindow.document.writeln("<script>function reloader() {parent.location.reload();}</script><style>body{overflow:hidden;font-family: arial,trebuchet ms, tahoma, verdana, arial, sans-serif;font-size:10pt;}\nstrong{font-size:12pt;color:#4d6885;}</style></head>");
		MyNewWindow.document.writeln("<body>");		
		MyNewWindow.document.writeln(image);		
		MyNewWindow.document.writeln(item);
		MyNewWindow.document.writeln("</body>");
		MyNewWindow.document.writeln("</html>");
		MyNewWindow.document.close();

		}


    function test() {

    document.getElementById("title").style.backgroundImage = "url(water7.jpg)";
    }

        function getElements(className) {
          var all = document.all ? document.all :
      document.getElementsByTagName('*');
      var elements = new Array();
      for (var e = 0; e < all.length; e++)
       if (all[e].className == className)
        elements[elements.length] = all[e];
                for ( keyVar in elements ) {
                   pos_x = Math.round(100*Math.random()) + "%";
                   pos_y = Math.round(100*Math.random()) + "%";
                   elements[keyVar].style.backgroundPosition = pos_x + ' ' + pos_y;
                }
     }


   function loadAjax(uri,id)
	{
		if (document.getElementById) {
			var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			}
			if (x)
				{
			x.onreadystatechange = function()
					{
				if (x.readyState == 4 && x.status == 200)
						{
						el = document.getElementById(id);
						el.innerHTML = x.responseText;
					}
					}
				x.open("GET", uri, true);
				x.send(null);
				}
	 }


    function fadeIn(obj) {
     window.document.getElementById(obj).style.opacity = x;
    }

    function showLogin(domObj1,domObj2) {
     if(document.getElementById(domObj1).style.display == "none") {
       document.getElementById(domObj1).style.display = "block";
       document.getElementById(domObj1).style.opacity = "0"
      for(x=0;x<100;x++) {
       document.getElementById("navIcon").src = "triangle_up2.gif";
       window.setTimeout("fadeIn('"+domObj1+"',"+x+")", 300);
      }
     }
     else {
      document.getElementById(domObj1).style.display = "none";
      document.getElementById("navIcon").src = "triangle_down2.gif";
     }
    }


    function loadMap() {
      var map = new OpenLayers.Map('map');
      var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
          "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
      map.addLayer(wms);
      map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
      map.addControl( new OpenLayers.Control.LayerSwitcher() );
      map.addControl( new OpenLayers.Control.PanZoomBar() );
     }
     //]]>

