var $j = jQuery.noConflict();

$j(document).ready(function() {
	// Animate navigation
	// set opacity to nill on page load
	$j("#navMain ul li a span").css( {opacity : "0", height : "100%", width : "100%"} );
	$j(function() {
		// on mouse over
		$j("body #navMain ul li a span").hover(function () {
			// animate opacity to full
			$j(this).stop().animate({
				opacity: 1
			}, "slow");
		},
		// on mouse out
		function () {
			// animate opacity to nill
			$j(this).stop().animate({
				opacity: 0
			}, "slow");
		});
	});
	
	// Animate footer hire me box
	$j('a#footerHire').hover(function(){
		$j(this).stop().animate({"height": "186px"}, "slow");
	}, function(){
		$j(this).stop().animate({"height": "75px"}, "slow");
	});
	
	// Clear specific boxes on focus if they have the default value in them
	var inputVal=$j('input[name].clearMeFocus').val();  
	
	$j('.clearMeFocus').focus(function(){
		if ($j(this).val()==inputVal) {
			this.select();
		}
	}).blur(function(){
		if ($j(this).val()==""||$j(this).val()==null) {
			$j(this).val(inputVal);
		}
	});
	
	// Animate sidebar, based upon Chris Coyier's navigation at digwp.com, thank God for him! Find the full article here http://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/
	$j(".popular-posts a, .widget_categories a, #friendWidget a").hover(function () {
		$j(this).stop().animate({ paddingLeft: "20px" }, "slow"); }, function () {
		$j(this).stop().animate({ paddingLeft: "3px" }, "slow");
	});
	
	// Search form configuration
	// Change form CSS on click
	$j("input#s").focus(function(){
	    $j(this).css('background', 'white');
	});
	$j(".emailSubscribe").focus(function(){
	    $j(this).css('background', 'white');
	});
			   
	// Reset form on reload
	$j("input#s").val("");
	$j(".emailSubscribe").val("");
	
	// Google Analytics ID
	/* Currently crashing page
	_gaq.push(['_setAccount', 'UA-12535501-1']);
	_gaq.push(['_trackPageview']); */

}); 