$(function()
{
	$(".dropdown").hover(
		function(){ $("ul", this).show(); }, 
		function() { } 
	);
	
	$(".submit").click(function()
	{
		$(this).parents("form:first").trigger("submit");
		return false;
	});
	
	$('.optional').focus(function() {
		$(this).attr('value','');
	});
	
	$("#blog_archive ul:first > li > a").click(function()
	{
		if($(this).parent().hasClass('closed'))
		{
			$(this).parent().removeClass('closed');
			$(this).parent().addClass('opened');
		}
		else if($(this).parent().hasClass('opened'))
		{
			$(this).parent().removeClass('opened');
			$(this).parent().addClass('closed');
		}
		
		return false;
	});
	
	
	$('#scroll_items').mousewheel(function(event, delta)
	{
		this.scrollLeft -= (delta * 30);
		event.preventDefault();
   });
	
	if(window.location.hash == '#right')
	{
		$('#scroll_items').scrollLeft(800);
	}
	
	$('#websites td').mouseenter(function()
	{
		$(this).find('p').fadeOut();
	}).mouseleave(function()
	{
		$(this).find('p').fadeIn();
	});

	$('#videos td').mouseenter(function()
	{
		$(this).find('.caption').fadeOut();
	}).mouseleave(function()
	{
		$(this).find('.caption').fadeIn();
	});
	
	$(document).bind("dragstart", function()
	{
		return false;
	});
});

