<!--
//<![CDATA[

//-------This page and code copyright Don Pickerel 2006 ---------------

			
    var point;
    var geocoder;

		// Creates a marker at the given point with the given number label
	function createGMarker(spoint, place,tab2) 
		{
			// Our info window content
			var infoTabs = 
			[
				new GInfoWindowTab("Golf Clubs",place),
				new GInfoWindowTab("Weather","Coming Soon"),
			];
			// Create our "tiny" marker icon
			var icon = new GIcon();
			icon.image = "http://www.northcarolinatourist.com/assets/graphics/golf1.png";
			icon.shadow = "http://www.northcarolinatourist.com/assets/graphics/golf1s.png";
			icon.iconSize = new GSize(25,24);
			icon.shadowSize = new GSize(30,21);
			icon.iconAnchor = new GPoint(6, 20);
			icon.infoWindowAnchor = new GPoint(5, 1);   
			var htmls=[place, tab2,"Coming Soon"];
			var labels = ["Golf Clubs","Visit","Weather"];
		  var marker = new GMarker(spoint,icon);
		  GEvent.addListener(marker, "click", function() 
			{
          		// adjust the width so that the info window is large enough for this many tabs
          		if (htmls.length > 2) 
		  		{
            		htmls[0] = '<div style="width:'+htmls.length*88+'px">' + htmls[0] + '</div>';
          		}
          		var tabs = [];
          		for (var i=0; i<htmls.length; i++) 
		  		{
            		tabs.push(new GInfoWindowTab(labels[i],htmls[i]));
          		}
          		marker.openInfoWindowTabsHtml(tabs);
        	});
		  return marker;
		}


// ---------------- Golf Clubs --------------------------
	function golfclub_markers(mwhich)
	{
		var i,j;

		switch (mwhich)
		{
			case 1:
			i="<a href=\"/Guides/golf.php\">Beechwood Country Club </a>";
			j="Rt 3, Ahoskie, NC<br />(252) 332-2905<br />18 holes - par 72 - 6,511 yards";
point = new GLatLng(36.361957,-77.012513);
			map.addOverlay(createGMarker(point, i,j));		
			break;
			case 2:
			i="<a href=\"http://www.minnesottcountryclub.com/\">Minnesott Country Club</a>";
			j="806 Country Club Dr. Arapahoe, NC<br />(252) 249-0813<br />18 holes - par 72 - 4325 yards";
point = new GLatLng(34.971030,-76.816085);
			map.addOverlay(createGMarker(point, i,j));		
			break;
			case 3:
			i="<a href=\"http://www.aydengolf.com/\">Ayden Golf and Country Club</a>";
			j="4343 Ayden Golf Rd, Ayden, NC<br />(252) 746-3389<br />18 holes - par 72 - 6,597 yards";
point = new GLatLng(35.464741,-77.389305);
			map.addOverlay(createGMarker(point, i,j));		
			break;

		}
		return point;		
		
	}
   function add_golfclubmarker() 
   	{

			var y;

			for (y=1;y<=3;y++)
			{
			golfclub_markers(y);
			}
	}
   	
    function load_golfclub() 
	{
		
        map.setCenter(new GLatLng(35.460669951495305, -79.5849609375), 7);
		map.openInfoWindowHtml(map.getCenter(),"<a href=\"http://www.northcarolinatourist.com/Guides/golf.php\" target=\"_blank\">North Carolina Golf Clubs</a><br />Each green represents a golfcourse.<br /> Click on the green to get more information.  <br />Click anywhere and drag to move map. <br />Click the X top right to close this window.<br />");
		add_golfclubmarker();

    }

    function load_allgolfclub() 
	{

		add_golfclubmarker();
	}

	function pointo_to_golfclub()
	{
		var string_wine,ipoint, npoint,winenum,which_wine;
		var wdone=0;
		box = document.wineryf.whichwine;
		string_wine = box.options[box.selectedIndex].value;
		which_wine = parseInt(string_wine);

		if(which_wine == 0 ) {
        map.setCenter(new GLatLng(35.460669951495305, -79.5849609375), 7);
		return;
		}

		if(which_wine <99 ) {
		npoint = coastal_markers(which_wine);}

		if(which_wine > 300) {
		which_wine = which_wine - 300; 
		npoint = mountain_markers(which_wine);}
		
		if(which_wine > 200) {
		which_wine = which_wine - 200; 
		npoint = yadkin_markers(which_wine);}

		if(which_wine > 100) {
		which_wine = which_wine - 100; 
		npoint = piedmont_markers(which_wine);}

		map.setZoom(7);
		
		window.setTimeout(function() {
		map.panTo(npoint);
			}, 1000);


		window.setTimeout(function() {
		map.setZoom(11);
		map.panTo(npoint);
			}, 3000);


		window.setTimeout(function() {
		map.setZoom(15);
		map.panTo(npoint);
			}, 5000);


	}
	
 