/**
 * gardner client scripts
 * copyright (c) 2009 Gardner Plumbing and Heating Inc.
 * @author Michael Murray
 */

function switchToTab(id){
	id = id.replace("tab-btn-","");
	$('.tab-current-page').fadeOut('fast',function(){
		$('.tab-current-page').removeClass('tab-current-page');
		$('#tab-content-'+id).fadeIn('fast',function(){
			$('#tab-content-'+id).addClass('tab-current-page');
		});
	});
}

$(document).ready(function(){
	$('#tab-btn-companyinfo').click(function(e){
		e.preventDefault();
		$("#tab-list").stop().animate(
			{backgroundPosition:"(27px 13px)"}, 
			{duration:500}
		);
		switchToTab(this.id);
	});
	$('#tab-btn-plumbingserv').click(function(e){
		e.preventDefault();
		$("#tab-list").stop().animate(
			{backgroundPosition:"(27px 71px)"}, 
			{duration:500}
		);
		switchToTab(this.id);
	});
	$('#tab-btn-acserv').click(function(e){
		e.preventDefault();
		$("#tab-list").stop().animate(
			{backgroundPosition:"(27px 129px)"}, 
			{duration:500}
		);
		switchToTab(this.id);
	});
	$('#tab-btn-heatingserv').click(function(e){
		e.preventDefault();
		$("#tab-list").stop().animate(
			{backgroundPosition:"(27px 187px)"}, 
			{duration:500}
		);
		switchToTab(this.id);
	});
});

