

	function Product( Id, ImageUrl, Alt, Description )
	{
		this.Id = Id;
		this.ImageUrl = ImageUrl;
		this.Alt = Alt
		this.Description = Description;
	}
	
	// Global
		var AllProducts = new Array( );


$( document ).ready( function( )
{
	InitProducts( );
	$( 'div.Gallery' ).each( // Correctly position mouse overs and hide.
		function( )
		{
			var P;
			var Anchor = $( this ).children( 'a' );
			var MouseOver = $( this ).children( 'div.MouseOver' );

			P = $( Anchor ).css( 'margin-top' );
			$( MouseOver ).css( 'margin-top', P );
			P = $( Anchor ).css( 'margin-bottom' );
			$( MouseOver ).css( 'margin-bottom', P );
			P = $( Anchor ).css( 'margin-left' );
			$( MouseOver ).css( 'margin-left', P );
			P = $( Anchor ).css( 'margin-right' );
			$( MouseOver ).css( 'margin-right', P );
			$( MouseOver ).hide( );
		}
	).hover( // Make mouse overs pop up
		function( )
		{
			$( this ).children( 'div.MouseOver' ).css( 'height', 0 ).show( ).animate(
			{
				height: 100
			}, 250, function( )
			{
				// Animation complete.
			} )
		},
		function( )
		{
			$( this ).children( 'div.MouseOver' ).animate(
			{
				height: 0
			}, 250, function( )
			{
				$( this ).hide( ); // Animation complete.
			} )
		}
	).click( // Show the big pictures
		function( )
		{
			var Id = $( this ).attr( 'id' );
			var Parts = Id.split( '_' );
			if( Parts.length == 2 )
			{
				if( Parts[ 0 ] == 'ApProduct' )
				{
					Id = Parts[ 1 ];
					var ProdDetails = null;
					{
						for( P in AllProducts )
						{
							if( AllProducts[ P ].Id == Id )
							{
								$( '#GalleryBigPic' ).attr( 'src', AllProducts[ P ].ImageUrl ).attr( 'alt', AllProducts[ P ].Alt );
								$( '#DescriptionDiv' ).html( AllProducts[ P ].Description );
								break;
							}
						}
					}
				}
			}


			return false;
		}
	);
} );


