$(function() {
	// featured window effect
	$("#featured .item").hover(function(){
		$(this).find(".boxCaption").stop().animate({
			top:20
		}, 150);
		}, function(){
		$(this).find(".boxCaption").stop().animate({
			top:185
		}, 150);
	});
	
	// tab
	var tabContainers = $('div.tabs').find('div.tabitem');
	var tabnavs = $('div.tabs').find('ul.tabnav li');
	tabContainers.css('display','block').fadeOut(0);
	tabContainers.filter(':first').css('display','block');
	// tabnavs.filter(':first').find('.arrow-down').css('display','block');
  tabnavs.filter(':first').find('.selected').css('color','#FF0000');
  // alert(tabnavs.filter(':first').name);                    
	$('.tabs ul.tabnav a').click(function () {
		if($(this).attr('class') != 'selected') {
			tabContainers.hide();
			tabnavs.find('.arrow-down').hide();
			$(this).parent().find('span').show();
			tabContainers.filter(this.hash).show();
			$('.tabs ul.tabnav a').removeClass('selected');
			$(this).addClass('selected');
		}
		return false;
	});
});
		
$(document).ready(function(){
	$('ul.sf-menu').supersubs({ 
		minWidth:    12,                                // minimum width of sub-menus in em units 
		maxWidth:    27,                                // maximum width of sub-menus in em units 
		extraWidth:  1                                  // extra width can ensure lines don't sometimes turn over 
															// due to slight rounding differences and font-family 
	}).superfish({ 
		delay:       400,                               // delay on mouseout 
		animation:   {opacity:'show',height:'show'},    // fade-in and slide-down animation 
		speed:       'fast',                            // faster animation speed 
		autoArrows:  false,                             // disable generation of arrow mark-up 
		dropShadows: false                              // disable drop shadows 
	}).children().find('li:first').css('border-top','0px').find('a').css('border-top','0px');
	
	$("h2.subscription").hover(function(){
		$(this).stop().animate({
			marginLeft:10
		}, 150);
		}, function(){
		$(this).stop().animate({
			marginLeft:0
		}, 150);
	});
});

function equalHeight() {
	var group = $('#posts').find('.col2');
	tallest = 0;
	extended = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
