jQuery.noConflict();
var $jp = jQuery;

$jp(function(){	
	
	$jp("div.post").each(function(){
		if($jp(this).siblings("div.tags-right")){
			var postHeight = $jp(this).height();
			var tagHeight = $jp(this).next("div.tags-right").height();
			if(postHeight < tagHeight){
				$jp(this).css("height",(tagHeight+20)+"px");
			}
			var tweetmemeHeight = $jp(".tweetmeme_button").height();
			$jp(".tweetmeme_button").css({top: (tagHeight+10)+"px"});
			$jp(".addthis_container").css({top: (tweetmemeHeight+tagHeight)+"px"});
		}
	});
	
	$jp("a:not([href*='"+window.location.host+"']):not([href*='#'])").attr("target", "_blank");
	
	$jp("div.special-feat-list").cycle({
		fx: 'scrollHorz',
		timeout: 9000,
		speed: 300,
		pauseOnPagerHover: 1
	});
	
	$jp("#sponsor-left").cycle({
		fx: 'scrollHorz',
		timeout: 7000,
		speed: 300,
		pauseOnPagerHover: 1
	});
	
	$jp("#sponsor-right").cycle({
		fx: 'scrollHorz',
		timeout: 7000,
		speed: 450,
		pauseOnPagerHover: 1
	});
	
	$jp("#re-s, #s").blur(function(){
		if($jp(this).val() == ""){
			$jp(this).val(this.defaultValue);
		}
	}).focus(function(){
		if($jp(this).val() == this.defaultValue){
			$jp(this).val("");
		}
	});
	
	$jp("#tabs-nav a.nav").click(function(){
		
		$jp("#tabs-nav li.active").removeClass("active");
		$jp(this).parent("li.tab").addClass("active");
		
		$jp("#tabs-content div.active").each(function(){
			$jp(this).addClass("hide").removeClass("active");
		});
		
		$jp($jp(this).attr("href")+"-content").addClass("active").removeClass("hide");
	});
	
	if(window.location.hash.indexOf("#") != -1){
		var hash = window.location.hash;
		
		$jp("#tabs-nav li.active").removeClass("active");
		$jp("#tabs-nav li.tab a[href="+hash+"]").parent("li.tab").addClass("active");
		
		$jp("#tabs-content div.active").each(function(){
			$jp(this).addClass("hide").removeClass("active");
		});
		$jp(""+hash+"-content").addClass("active").removeClass("hide");
	}
	
});