$(document).ready(function(){
    $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
    $("ul.topnav li span").click(function() { //When trigger is clicked...
        //Following events are applied to the subnav itself (moving subnav up and down)  
        $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
        $(this).parent().hover(function() {  
        }, function(){  
            $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up  
        });
	}).hover(function() { //Following events are applied to the trigger (Hover events for the trigger)
		$(this).addClass("subhover"); //On hover over, add class "subhover"
	}, function(){  //On Hover Out
		$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	$('ul#twitter_update_list li').mouseover(function(){
		$(this).css({'background-color' : '#E5E5E4'});
	});
	$('ul#twitter_update_list li').mouseout(function(){
		$(this).css({'background-color' : '#e0e0e0'});
	});
});

$(function(){ //Document ready shorthand
	var $search = $('#search');//Cache the element for faster DOM searching since we are using it more than once
	original_val = $search.val(); //Get the original value to test against. We use .val() to grab value="Search"
	$search.focus(function(){ //When the user tabs/clicks the search box.
		if($(this).val()===original_val){ //If the value is still the default, in this case, "Search"
			$(this).val('');//If it is, set it to blank
		}
	})
	.blur(function(){//When the user tabs/clicks out of the input
		if($(this).val()===''){//If the value is blank (such as the user clicking in it and clicking out)...
			$(this).val(original_val); //... set back to the original value
		}
	});
});
