var nextPage = new String();
var pagePlayer = new Object();
var rsvp = new Object();

var fconfig = {
		canvas: {
			backgroundColor: 'transparent'
		},
		plugins: {
			controls: {
				backgroundGradient: 'none',
				backgroundColor: '#ffffff'
			}
		}
};

function imageShow( mainID, thumbClass ){
	var nextImage = new String();

	$( mainID ).fadeIn( 200 );
	$( thumbClass ).css( 'cursor', 'pointer' );
	$( thumbClass ).click( function(){ 
		nextImage = $( this ).attr( 'src' );
		$( mainID ).fadeOut( 500, function(){
			$( mainID ).attr( 'src', nextImage );
			$( mainID ).fadeIn( 500 );
		});
	});
}

function showRSVP(){
	$( 'div#rsvp' ).overlay().load();
}

function fadeInMain(){
	$( 'div#main' ).fadeIn( 'slow' );
	$( 'div#address' ).fadeIn( 'slow' );
	$( 'div#footer-links' ).fadeIn( 'slow' );
}

$( document ).ready( function(){
	$( 'div#main' ).css( 'display', 'none' );
	$( 'div#address' ).css( 'display', 'none' );
	$( 'div#footer-links' ).css( 'display', 'none' );
	
	$( 'div#main' ).css( 'opacity', '1' );
	$( 'div#address' ).css( 'opacity', '1' );
	$( 'div#footer-links' ).css( 'opacity', '1' );
	
	$( 'div.menu-item' ).each( function( itemID ){
		var div = $( this );
		div.html( '<img src="bin/images/menu.jpg" border="0" style="margin-top:' + div.attr( 'ypos' ) + '"/>' );
	});
	
	$( 'div.menu-item' ).hover( 
		function(){ $( this ).find( 'img' ).css( 'margin-left', '0px' ); },
		function(){ $( this ).find( 'img' ).css( 'margin-left', '-166px' ); }
	);
	
	$( 'div.menu-item' ).click( function(){ 
		//window.location = $( this ).attr( 'rel' );
		nextPage = $( this ).attr( 'rel' ); 
		$( 'div#footer-links' ).fadeOut( 300 );
		$( 'div#address' ).fadeOut( 300 );
		$( 'div#main' ).fadeOut( 500, function(){ window.location = nextPage; } ); 
	});
	
	rsvp = $( 'div#rsvp' ).overlay({
		api: true,
		closeOnClick: false,
		expose: { 
			opacity: .9,
			color: '#e8e8f4'
		},
		onLoad: function(){
			$( 'input#rsvpName' ).focus();
		}
	});
	
	setTimeout( fadeInMain, 500 );
	
	if( typeof _pageInit == 'function' ){ _pageInit(); }
});


