$(document).ready(function(){

	//Tab Persistance
	var urlhash = location.hash;
	if (urlhash == "") urlhash = "finance";
	tabs(urlhash);

	$("#nav li a").each(function(i){
		$(this).bind("click", function(){
			tabs($(this).attr("href"));
		});
	});

	$("#footer").css("bottom", "-75px")
	.click(function(){
		$(this).stop().animate({"bottom": "0px"},{duration: 400})
	})

	//Footer Slide Up - Sorry IE6
	if(notIE6 == true)
	{
		$("#footer").css("bottom", "-75px")
		.mouseover(function(){
			$(this).stop().animate({"bottom": "0px"},{duration: 400})
		})
		.mouseout(function(){
			$(this).stop().animate({"bottom": "-75px"},{duration: 400})
		});
	}

	//Menu Hovering - Sorry IE
	if(notIE == true)
	{
		//Menu Links
		$("#nav li a").mouseover(function(){
			$(this).stop().animate({color: "#000000"}, {duration: 300})
		}).mouseout(function(){
			$(this).stop().animate({color: "#777777"}, {duration: 300})
		})
	}

	//Clear Input
	$("#zip").click(function(){
		if($(this).val() == "Zip Code") $(this).val("");
	}).blur(function(){
		if($(this).val() == "") $(this).val("Zip Code");
	});
});

function tabs(input)
{
	var hashArr = new Array("finance","tumbler","extractor");
	var input = input.replace(/#/,"");

	for(i=0; i<3; i++)
	{
	   curr = hashArr[i];
	   if(input == curr)
	   {
		  $("#page-"+curr).fadeIn(500);
	   } else {
		  $("#page-"+curr).css("display", "none");
	   }
	}
}