var prevHash = null;

function pageload(hash) {

	if( hash ) {
		$('#tech_info div').hide();
		$('#tech_info, #tech_info div#'+hash).show();	
		
		$(".tech_links a").removeClass('current');
		$('.tech_links a[href=#'+hash+']').addClass('current');
		prevHash = hash;
		
	} else {
		$('#tech_info, #tech_info div').hide();
		$('.tech_links a[href=#tech_overview]').addClass('current');
		$('#tech_info, #tech_info div#tech_overview').show();	
	}
	return false;
}

$(document).ready(function(){

	// $('#tech_info, #tech_info div').hide();

	$.historyInit(pageload);
	
	$("area").tooltip({
		track: true,
		delay: 0,
		showURL: false,
		fixPNG: true,
		opacity: 0.85,
		top: -30,
		left: -30
	});

	$(".tech_links a, #turbinemap area").click(function(){

		var hash = this.href;
		hash = hash.replace(/^.*#/, '');
	
		if (hash == prevHash ) return false;

		$.historyLoad(hash);
		
		return false;
	});
	
});

// if ( ! ($.browser.msie && $.browser.version < 7) )
// {
	Cufon.replace('h2');
	Cufon.replace('h3');	
// }
