

$(document).ready(function () {
	$("li.hasdropdown").hover(function() {
		var dd = this;
		this._ptHovered = true;
		$("li.hasdropdown").each(function(i){
			if(this._ptHovered != true)
				$("ul.dropdown", this).fadeOut("fast");
		});
		clearTimeout(this._ptDropdownTimer);
		$("ul.dropdown", this).fadeIn("fast");
	},
	function() {
		var dd = this;
		this._ptHovered = false;
		this._ptDropdownTimer = setTimeout(function(){
			$("ul.dropdown", dd).fadeOut("fast");
		}, 600);
	});
	
	$("ul.dropdown li a").each(function(i){
		txt = $(this).text();
		if(txt.length > 16) {
			$(this).text(txt.substr(0, 16) + "...");
		}
	});	
	$("#subscribe").click(function() {
		$("#subscribe-form").show("slow");
	});
	
	$("#email-input").focus(function () {
		$("#email-input").val("");
	});
});

