//////////////////////////////////////////////
/////   Opens Jquery
//////////////////////////////////////////////
$(document).ready(function(){
	
//////////////////////////////////////////////
/////   The sliding search container at the top of the page
//////////////////////////////////////////////
	$('div#slideContainer').hide();
		
	$('a#slideSearch').toggle(function(){
		$this = $(this)
		$('div#slideContainer').slideDown(800, function() { $this.html('Close')})
		//$this.html('Close');
	},function(){
		$this = $(this);
		$('div#slideContainer').slideUp(800, function() { $this.html('Search For a Home')});
		//$(this).html('Search For a Home');
	});
	
//////////////////////////////////////////////
/////   adds a class of odd (.odd) to every other list item in the News Block (.newsBlock)
//////////////////////////////////////////////
	$('.rightSideBarBlock li').filter(':odd').addClass('odd');
	
//////////////////////////////////////////////
/////   adds a class of odd (.odd) to every other table row in the mortgage table (#mortgageTable)
/////   adds the class tableHover (.tableHover) to a table row with the class of sub (.sub) when hovered
//////////////////////////////////////////////
	$('#mortgageTable tr').filter(':odd').addClass('odd');
	
	$('tr.sub').hover(function(){
		$(this).addClass('tableHover');
	},function(){
		$(this).removeClass('tableHover');
	});
	
//////////////////////////////////////////////
/////   adds support for IE6 so that the background image in the Main Nav shows up when hovered
//////////////////////////////////////////////
	$('#mainNav ul').click(function(){
		var href = $(this).find('a').eq(0).attr('href');
		window.location = href;
	});
	
	$('#mainNav ul').hover(function(){
		$(this).addClass('navBackground');
	},function(){
		$(this).removeClass('navBackground');
	});
//////////////////////////////////////////////
/////   Closes Jquery
//////////////////////////////////////////////
});
