$(document).ready(function() {
	var imgContainers = $('div#tesol-wrapper > div');
	imgContainers.hide().filter(':first').hide();
	
	$('#tesol-box ul li a').click(function () {
										   
		imgContainers.hide();
		imgContainers.filter(this.hash).fadeIn(800);
		$('#tesol-box ul li a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	});
	if(location.hash){
		$('#tesol-wrapper div' + location.hash).attr("style","display:block");
		  var $target = $(location.hash);
		  $target = $target.length && $target
		  || $('[name=' + this.hash.slice(1) +']');
		  if ($target.length) {
			var targetOffset = $target.offset().top - 30;
			$('html,body')
			.animate({scrollTop: targetOffset}, 1000);
		   return false;
		  }

	}
	
	
	$('#tesol_form_submit').click(function () {
		
		$('form').submit(function() {return false; }); 
		$('#tesol_form_print').css('display','inline');
		$('#tesol_form_back').css('display','inline');
		$('.panel').attr('id', 'panel_wrapper');
		$('#tesol_form_submit').attr('class', 'tesol_form_hide');
		$('body').attr('id', 'tesolprint');
		$( 'html, body' ).animate( { scrollTop: 0 }, 'slow' );
		
	});	
	$('#tesol_form_print').click(function () {
	
		window.print();
	});
	$('#tesol_form_back').click(function () {
		$('form').submit(function() {return false; }); 
		
		$('#tesol_form_print').css('display','none');
		$('#tesol_form_back').css('display','none');

		$('#tesol_form_submit').attr('class', '');
		
		$('body').removeAttr('id');
		$('.panel').removeAttr('id');
		
	});	
	$('button').hover(function() {
		$(this).css('cursor','pointer');								
	});	
	
}); 