var $j = jQuery.noConflict();
var cCont 	= ".sidebarTabContLatest";
var cTab	= "#sidebarTabLatest";

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

$j('document').ready(function() {	
	$j("#sidebarTabEco").click(function()			{	webistShowTab(".sidebarTabContEco", "#sidebarTabEco");				});
	$j("#sidebarTabLatest").click(function()		{	webistShowTab(".sidebarTabContLatest", "#sidebarTabLatest");		});
	$j("#sidebarTabRoundups").click(function()		{	webistShowTab(".sidebarTabContRoundups", "#sidebarTabRoundups");	});
	$j("#sidebarTabFav").click(function()			{	webistShowTab(".sidebarTabContClassics", "#sidebarTabFav");			});
	
	// three media buttons
	$j("#smTwitter").mouseover(function()			{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/smTwitterHover.png");	});
	$j("#smTwitter").mouseout(function()			{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/smTwitter.png");			});
	$j("#smFacebook").mouseover(function()			{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/smFacebookHover.png");	});
	$j("#smFacebook").mouseout(function()			{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/smFacebook.png");		});
	$j("#smRss").mouseover(function()				{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/smRssHover.png");		});
	$j("#smRss").mouseout(function()				{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/smRss.png");				});
//	$j("#smMail").mouseover(function()				{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/mailiconhover.png");		});
//	$j("#smMail").mouseout(function()				{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/mailicon.png");				});
		
	$j("#featuredClickHere").mouseover(function()	{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/clickHereHover.png");	});
	$j("#featuredClickHere").mouseout(function()	{	$j(this).attr("src", "http://webecoist.com/wp-content/themes/webecoist-webist/images/clickHere.png");			});	
	
	$j("#showComments").click(function(){
		var c = $j(".commentSpan").html();
		var s = $j("#commentListing").attr("class");
		if(s == "hidden"){
			

			
			$j(".commentSpan").slideUp(1);
			$j("#commentListing").attr("class", "shown");
			$j("#commentListing").slideDown(1);
		}else{
			

			$j("#commentListing").attr("class", "hidden");
			$j("#commentListing").slideUp(1);
		}
	});
	

	// broken image code - hoodmonkey may 9 2011
	$j('#recentContent img').each(function(){if(typeof this.naturalWidth=="undefined"||this.naturalWidth==0){$j(this).attr('src','http://webecoist.com/images/ecodefault.png');}});
	
});

