$( function( )
{
	generic.loadCSS( 'css/fancybox.css' );
	generic.loadModule( '/lib/jquery/fancybox/jquery.fancybox-1.3.1.pack.js', function( )
	{
		$( "#splash_click" ).fancybox(
		{
			"titlePosition"		: "inside",
			"showNavArrows"		: false,
			"overlayOpacity"	: "0.8",
			"overlayColor"		: "#000",
			"hideOnContentClick": true,
			"overlayShow"		: true,
			"autoDimensions"	: true
		} ).trigger( 'click' );
	} );

	generic.loadModule( "/lib/jquery/cycle/jquery.cycle.lite.min.js", function( )
	{
		$( '#rotateBanner' ).cycle( { timeout:5000 } );
	} );
	
	// google maps module form input ui
	$( '.googleInput' ).bind( 'focusin', function( ) 
	{
		if( $( this ).val( ) == $( this ).attr( 'title' ) ){ $( this ).val( '' ); }
	} )
	.bind( 'focusout', function( )
	{ 
		if( $( this ).val( ).length == 0 ){ $( this ).val( $( this ).attr( 'title' ) ); } 
	} ); // end form input UI

	$( '#getDirections' ).click( function( ){ $( this ).parentsUntil( 'form' ).parent( ).submit( ); } );
	
	generic.loadModule( "/lib/application/googleApi.js", function( )
	{
		var maps = new googleApi;
		
		while( !maps.readyState( ) ){ console.log( "waiting" ); }
		
		maps.createMap( { "lat":34.0444, "long":-118.2650, "zoom":16, "controls":false, "mapDisp":"smallGoogleMaps", "marker":"/media/images/ico_google_marker.png" } );
	} );
} );

