$(document).ready(function() {
    var $block1   = 'div#results';
    var $block2   = 'div#news';
    var $block3   = 'div#blogs';
    var $link1    = 'ul#navSub li a[@href=#results]';
    var $link2    = 'ul#navSub li a[@href=#news]';
	var $link3    = 'ul#navSub li a[@href=#blogs]';
	
	$($block3).hide();
	$($block2).hide();
	$($link1).addClass("active");
	
	$($link1).click(function() {
		if ($($block1 + ':not:visible')) {
		  $($block1).show();
		  $($block2).hide();
		  $($block3).hide();
		  $($link1).addClass("active");
		  $($link2).removeClass("active");
		  $($link3).removeClass("active");
		
		} else {
		  $($block3).hide();
		  $($block2).hide();
		  $($block1).show();
		}
		return false;//return true so our links jump to the section
	});
	//toggle the summary using our associated summary link
	$($link2).click(function() {
		//if the description is hidden
		if ($($block2 + ':not:visible')) {
		  $($block2).show();//show the description
		  $($block1).hide();//hide the summary
		  $($block3).hide();//hide the summary
		  $($link2).addClass("active");
		  $($link1).removeClass("active");
		  $($link3).removeClass("active");
		//otherwise, if the description is hidden
		} else {
		  $($block1).hide();//show the summary
		  $($block3).hide();//show the summary
		  $($block2).show();//hide the description
		}
		return false;//return true so our links jump to the section
	});
	//toggle the summary using our associated summary link
	$($link3).click(function() {
		//if the description is hidden
		if ($($block3 + ':not:visible')) {
		  $($block3).show();//show the description
		  $($block1).hide();//hide the summary
		  $($block2).hide();//hide the summary
		  $($link3).addClass("active");
		  $($link1).removeClass("active");
		  $($link2).removeClass("active");
		//otherwise, if the description is hidden
		} else {
		  $($block1).hide();//show the summary
		  $($block3).show();//show the summary
		  $($block2).hide();//hide the description
		}
		return false;//return true so our links jump to the section
	});
	
	
	
});




