$("ul#menu li").hover(
	function() {
		$(".button", this).stop().animate({height: "42px"});
		$("a", this).stop().css({color:"white"});
	}, 
	function() {
		$(".button", this).stop().animate({height: "0px"}, 200);
		if($(this).attr("class") != 'active') {
			$("a", this).stop().css({color: "#13007D"});
		}
	}
);

//set some variables
var elHeight = $("#subnav ul li").height();
var origHeight = 0;

//set arrow to active item
function setActive() 
{
	$('#subnav ul li').each(function(i) 
	{
		if($(this).attr("class") == "active") 
		{
			$("#arrow").animate({top: ((elHeight+2)*i) }, 600);
			
			//Set a variable for the original position
			origHeight = ((elHeight+2)*i)
		}
	});
}

$(document).ready(function(){
	setActive();
});

//hover actions
$('#subnav ul li').each(function(i) 
{
	$(this).hover(function() {
		$("#arrow").stop().animate({top: ((elHeight+2)*i) }, 600);
	}
	,function() {
		$("#arrow").stop().animate({top: origHeight }, 600);
	});
});	

var favUrl = "http://www.sea-tow.co.nz"; 
var desc = "PB Sea-Tow"; 
function addFav()
{ 
	if (window.external) 
	{
		window.external.AddFavorite(favUrl,desc)
	}
	else {
		alert("We're sorry but your browser doesn't support bookmarking"); 
	}
}