var thermos = '';
var thermos_changeable = true;

function reset_thermos_choose_thermos() {
	thermos = '';
	
	$('.thermos').css('opacity', 1.0);
	
	$('#choose_thermos_next').css('opacity', 0.3);
}

$('document').ready(
	function() {
		$('.thermos').hover(
			function() {
				$(this).css('border', '3px solid #EE1D23');
			}, function() {
				$(this).css('border', '3px solid black');
			}
		);
		
		$('.thermos').click(
			function() {
				if(thermos_changeable && thermos != $(this).attr('id')){
					thermos_changeable = false;
					
					thermos = $(this).attr('id');
					
					$('.thermos').stop().not(this).animate({'opacity': 0.3}, 400);
					$(this).stop().animate({'opacity': 1.0}, 400);
					
					$('#choose_thermos_next').animate({'opacity': 1.0}, 400);
					
					setTimeout('thermos_changeable = true', 400);
				}
			}
		);
		
		$('#thermos1').tooltip(
			{
				delay: 0,
				showURL: false,
				fade: 250,
				bodyHandler: function() {
					return $('#thermos1_tooltip').html();
				},
				fixPNG: true,
				track: true,
				left: -100
			}
		);
		
		$('#thermos2').tooltip(
			{
				delay: 0,
				showURL: false,
				fade: 250,
				bodyHandler: function() {
					return $('#thermos2_tooltip').html();
				},
				fixPNG: true,
				track: true,
				left: -100
			}
		);
		
		$('#thermos3').tooltip(
			{
				delay: 0,
				showURL: false,
				fade: 250,
				bodyHandler: function() {
					return $('#thermos3_tooltip').html();
				},
				fixPNG: true,
				track: true,
				left: -100
			}
		);
		
		$('#thermos4').tooltip(
			{
				delay: 0,
				showURL: false,
				fade: 250,
				bodyHandler: function() {
					return $('#thermos4_tooltip').html();
				},
				fixPNG: true,
				track: true,
				left: -100
			}
		);
		
		$('#thermos5').tooltip(
			{
				delay: 0,
				showURL: false,
				fade: 250,
				bodyHandler: function() {
					return $('#thermos5_tooltip').html();
				},
				fixPNG: true,
				track: true,
				left: -100
			}
		);
		
		$('#choose_thermos_next').click(
			function() {
				if($(this).css('opacity') == 1){
					show_next();
				}
			}
		);
		
		$('.step_header_back', $('#step_thermos_choose_thermos')).click(
			function() {
				reset_steps('step_thermos_choose_thermos');
			}
		);
	}
);

