


jQuery(document).ready(
	function()
	{
	
		// Hide Option Divs
		jQuery('#option').hide();
		jQuery('#option div.optiongroup').hide();
		
		// Handle thumbnail clicks
		jQuery('#models a').click(
			function()
			{
			
				jQuery('#models a img').css('border', '1px solid #FFFFFF')
				jQuery(this).children('img').css('border', '1px solid #999999')
				
				// Show Options
				jQuery('#option').show(); // Show title
				jQuery('#option div.optiongroup').hide(); // Hide all options
				jQuery('#option div.optiongroup input.OPTI').removeAttr('checked'); // Uncheck all checkboxes
				jQuery('#' + jQuery(this).attr('alt')).show(); // Show related options
				
				// Change hero image, text and enlarge link
				jQuery('#swapper').attr('src', jQuery(this).attr('href'));
				jQuery('#modelshown p').text(jQuery(this).attr('title'));
				jQuery('#enlargeswapper').attr('alt', jQuery(this).attr('alt'));
				
				// Set hidden VARI form value
				jQuery('#VARI').val(jQuery(this).attr('alt'));
				
				return false;
			}
		);
		
		// Handle enlarge image clicks
		jQuery('#enlargeswapper').click(
			function()
			{
				
				// Grouptree new window function (using alt tag pointer id)
				NewWindow(this.href,'name','630','700','no', jQuery(this).attr('alt'));
				return false;
				
			}
		);
		
	}
);

