$(document).ready(function(){
	
	//
	// Form hover and focus style backups
	//
	
	// Form hovers
	$('input[type=text]').hover(function(){
		$(this).addClass('form_hover');
	},function(){
		$(this).removeClass('form_hover');
	});
	$('textarea').hover(function(){
		$(this).addClass('form_hover');
	},function(){
		$(this).removeClass('form_hover');
	});
	
	// Form focus
	$('input[type=text]').focus(function(){
		$(this).addClass('form_focus');
	});
	$('input[type=text]').blur(function(){
		$(this).removeClass('form_focus');
	});
	$('textarea').focus(function(){
		$(this).addClass('form_focus');
	});
	$('textarea').blur(function(){
		$(this).removeClass('form_focus');
	});
	
	// Google Maps
	if($('#gmap').length != 0){
		gmap_init();
		$(document).unload(function(){GUnload();});
	}
	
	// Tabs
	if($('#tabs').length != 0){
		$('#tabs').tabs();
	}


	
});


function gmap_init(){
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("gmap"));
		map.setCenter(new GLatLng(41.903232, -87.673554), 14);
		
		// Icon
        var lakeviewIcon = new GIcon(G_DEFAULT_ICON);
        //lakeviewIcon.image = "http://localhost:8888/moonshine/wp-content/themes/moonshine/images/gmarker.png";
        lakeviewIcon.image = "http://shauncrittenden.com/preview/moonshine/wp-content/themes/moonshine/images/gmarker.png";
		markerOptions = {icon: lakeviewIcon};
		lakeviewIcon.iconSize = new GSize(89,66);
		lakeviewIcon.iconAnchor = new GPoint(22, 67);

		// Location
		var point = new GLatLng('41.903232', '-87.673554');
		
		map.addOverlay(new GMarker(point, markerOptions));
		//map.addOverlay(new GMarker(point));
		
		// Controls
		map.addControl(new GSmallMapControl());
		//map.addControl(new GMapTypeControl());
	}
}

