var $j = jQuery.noConflict();
var cCont 	= ".sidebarTabContUrb";
var cTab	= "#sidebarTabUrb";

function webistShowTab(c, t){
	
	$j(cTab).css("background-color", "#e5ecf3");
	$j(t).css("background-color", "#84a2b5");
	
	$j(cCont).fadeOut("fast", function(){
		$j(c).fadeIn("fast");		
	});
	cCont = c;
	cTab = t;
}

$j('document').ready(function() {	
	$j("#sidebarTabLatest").click(function()		{	webistShowTab(".sidebarTabContLatest", "#sidebarTabLatest");	});
	$j("#sidebarTabUrb").click(function()			{	webistShowTab(".sidebarTabContUrb", "#sidebarTabUrb");			});
	$j("#sidebarTabEco").click(function()			{	webistShowTab(".sidebarTabContEco", "#sidebarTabEco");			});
	$j("#sidebarTabFav").click(function()			{	webistShowTab(".sidebarTabContFav", "#sidebarTabFav");			});
	
	// three media buttons
	$j("#smTwitter").mouseover(function()			{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/smTwitterHover.png");	});
	$j("#smTwitter").mouseout(function()			{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/smTwitter.png");			});
	$j("#smFacebook").mouseover(function()			{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/smFacebookHover.png");	});
	$j("#smFacebook").mouseout(function()			{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/smFacebook.png");		});
	$j("#smRss").mouseover(function()				{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/smRssHover.png");		});
	$j("#smRss").mouseout(function()				{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/smRss.png");				});
	$j("#smMail").mouseover(function()				{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/mailiconhover.png");		});
	$j("#smMail").mouseout(function()				{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/mailicon.png");				});
		
	$j("#featuredClickHere").mouseover(function()	{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/clickHereHover.png");	});
	$j("#featuredClickHere").mouseout(function()	{	$j(this).attr("src", "http://weburbanist.com/wp-content/themes/weburbanist-webist/images/clickHere.png");			});	
	
	$j("#showComments").click(function(){
		var c = $j(".commentSpan").html();
		var s = $j("#commentListing").attr("class");
		if(s == "hidden"){
			
			$j("#showComments").next("b").html("doing something");
			
			$j(".commentSpan").slideUp(1);
			$j("#commentListing").attr("class", "shown");
			$j("#commentListing").slideDown(1);
		}else{
			
			$j("#showComments").next("b").html("doing more stuffs");
			
			$j("#commentListing").attr("class", "hidden");
			$j("#commentListing").slideUp(1);
		}
	});
	
});

