//<![CDATA[

//*****************************************************************************
// eorbe.com
//
// 
//*****************************************************************************

	function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
	function hideLayer(layer){
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( layer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[layer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[layer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  vis.display = 'none';
}
	
function GPoint2(x,y) { return new GLatLng(x,y); }
         
      // this variable will collect the html which will eventually be placed in the sidebar
      var sidebar_html = "";
    
      // arrays to hold copies of the markers and html used by the sidebar
      // because the function closure trick doesnt work there
      var gmarkers = [];
      var htmls = [];
      var i = 0;
      var htmls1 = [];
      var htmls2 = [];
      var labels1 = [];
      var labels2 = [];


      // A function to create the marker and set up the event window
function createMarker(point,name,html) {
        var marker = new GMarker(point, icon);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info we need to use later for the sidebar
        gmarkers[i] = marker;
        htmls[i] = html;
        // add a line to the sidebar html
        sidebar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
        i++;
        return marker;
      }

      // A function to create a tabbed marker and set up the event window
function createTabbedMarker(point,html1,html2,label1,label2,name,icon) {
        var marker = new GMarker(point,icon);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowTabsHtml([new GInfoWindowTab(label1,html1), new GInfoWindowTab(label2,html2)]);
        });
        // save the info we need to use later for the sidebar
        gmarkers[i] = marker;
        htmls1[i] = html1;
				htmls2[i] = html2;
				labels1[i] = label1;
				labels2[i] = label2;
        // add a line to the sidebar html
        sidebar_html += '<a href="javascript:mytabbedclick(' + i + ')">' + name + '</a><br>';
        i++;
        return marker;
      }
	
	
	     // This function picks up the click and opens the corresponding info window
function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }

      // This function picks up the click and opens the corresponding tabbed info window
function mytabbedclick(i) {
        gmarkers[i].openInfoWindowTabsHtml([new GInfoWindowTab(labels1[i],htmls1[i]), new GInfoWindowTab(labels2[i],htmls2[i])]);
      }
      













//]]>