google.load("jquery","1.3.2");
google.load("jqueryui", "1.7.2");
google.load("maps", "2.x");

google.setOnLoadCallback(function(){
	
	$.ajaxSetup({async: false});
	$.getScript("inc/jquery.color.js");
	$.ajaxSetup({async: true});
	
	$.ajaxSetup({async: false});
	$.getScript("inc/curvycorners.js");
	$.ajaxSetup({async: true});
	
	$.ajaxSetup({async: false});
	$.getScript("inc/jquery.dropshadow.js");
	$.ajaxSetup({async: true});	
	
	$.ajaxSetup({async: false});
	$.getScript("inc/jquery.corner.js");
	$.ajaxSetup({async: true});
		
	$("theMap").hide();
	
	$("#topNav a").hover(function(){
								  
		$(this).animate({ 
			color: "#fff"
		}, "slow" )},
		
		function(){
		$(this).animate({ 
			color: "#ebcd59"
		}, "slow" )}
	
	);
		
		curvyCorners({
	  tl: { radius: 20 },
      tr: { radius: 20 },
      bl: { radius: 20 },
      br: { radius: 20 },
      antiAlias: true}, document.getElementById("content"));	
	
	curvyCorners({
      tl: { radius: 20 },
      tr: { radius: 0 },
      bl: { radius: 20 },
      br: { radius: 0 },
      antiAlias: true
    }, document.getElementById("leftSide"));
	
	curvyCorners({
      tl: { radius: 0 },
      tr: { radius: 20 },
      bl: { radius: 0 },
      br: { radius: 20 },
      antiAlias: true
    }, document.getElementById("rightSide"));
	
	$("#subContent h3").dropShadow({left: 1,top:1,blur:0});
	$("#menus em").dropShadow({left: 1,top:1,blur:0});
	
	$("#layout").wrap("<div id='footer1'><div id='footer2'></div></div>");

	$("#menuTabs ol li").corner();
	
	jQuery.each(jQuery.browser, function(i, val) {
		if(i=="mozilla") { $("#menuTabs ol li em").corner(); }
	});
	
	$('#wineLink').click(function(){
								  
		$('#wineList').dialog({
			
			modal: true,
			width: 550,
			height: 500,
			buttons: {
				"Close": function() { $(this).dialog("close"); }
			},
			title: 'Featured Wine List'
			
			
		}).dialog("open");
		
									  });
	
	if($("body").attr("id")=="directionsPage") {
		
		var map = new GMap2(document.getElementById('theMap'));
		var geocoder = new GClientGeocoder();
	    var auntKates = new GLatLng(29.949843,-81.308922);
		map.setCenter(auntKates, 15);		
		map.addControl(new GLargeMapControl());  // "(" + name + ")" + 
		
		var point = new GLatLng(29.949843,-81.308922);
		
		var html = '<div id=\"mapDisplay\"><h3>Aunt Kate\'s!</h3><br>To receive step-by-step directions, please enter your Street Address: <form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<p><input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" style=\"width: 100%;\" /></p>' +
           '<p align=\"right\"><INPUT value="Get Directions" TYPE="SUBMIT"></p>' +
           '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + '"/></div>'
		
		var marker = createMarker(point,html)
		map.addOverlay(marker);
		
		$("theMap").fadeIn("slow");
                
	
	}
	
});

function createMarker(point,html) {
        var marker = new GMarker(point);
         marker.openInfoWindowHtml(html);
        return marker;
      }
	  
function tohere(i) {
        marker.openInfoWindowHtml(to_htmls[i]);
      }
      function fromhere(i) {
        marker.openInfoWindowHtml(from_htmls[i]);
      }


