$(document).ready(function() {

$("#second_nav ul li:first").addClass("first");

$(".top_nav ul li:last-child, .top_nav ul ul li:last-child, #second_nav ul li:last-child, .tab_wrapper ul.nav_button li:last-child, .other_cat ul li:last-child, .other_cat ul li:nth-child(6), .widget .large_widget .widget_area .flickr div:nth-child(5), .widget .large_widget .widget_area .flickr div:nth-child(9), .widget .large_widget .widget_area .flickr div:nth-child(13), .widget .large_widget .widget_area .flickr div:nth-child(17), .footer_menu ul li:last-child, .bottom_widget .flickr div:nth-child(6), .bottom_widget .flickr div:nth-child(11), .bottom_widget .flickr div:nth-child(16)").addClass("last")

//Hover effect recent post

$('.image_wrap').mouseenter(function(e) {

$(this).children('a').children('img').animate({ height: '130', left: '0', top: '0', width: '280'}, 300);

$(this).children('a').children('span').fadeIn(200);

}).mouseleave(function(e) {

$(this).children('a').children('img').animate({ height: '140', left: '-10', top: '-10', width: '290'}, 300);

$(this).children('a').children('span').fadeOut(200);

})

//Hover effect small post

$('.image_wrapper').mouseenter(function(e) {

$(this).children('a').children('img').animate({ height: '90', left: '0', top: '0', width: '280'}, 300);

$(this).children('a').children('span').fadeIn(200);

}).mouseleave(function(e) {

$(this).children('a').children('img').animate({ height: '100', left: '-10', top: '-10', width: '290'}, 300);

$(this).children('a').children('span').fadeOut(200);

})

// Sidebar Tab

$(".tab_sidebar").tabs({ 

	fx: { opacity: "toggle" } 

})

// Scroll to top

$('li.scrollToTop').click(function(){ 

	$('html, body').animate({scrollTop:0}, 'slow'); 
	
	return false; 
	
})
 

//Superfish menu

$("ul.sf-menu").superfish({

	delay: 500,

	animation: {opacity:"show"},

	speed: 200,

	autoArrows: false,

	dropShadows: false

})


// Pretty Photo

$("a[rel^='prettyPhoto']").prettyPhoto();

// Tabber

$( ".tabs" ).tabs();

$( ".tab_sidebar" ).tabs();


// Show/hide Toggle

if($('div.trigger').length > 0) {
	$('div.trigger').click(function() {
		if ($(this).hasClass('open')) {
			$(this).removeClass('open');
			$(this).addClass('close');
			$(this).next().slideDown(300);
			return false;
		} else {
			$(this).removeClass('close');
			$(this).addClass('open');
			$(this).next().slideUp(300);
			return false;
		}			
	});
}

// Show/hide Toggle

if($('div.show').length > 0) {
	$('div.show').click(function() {
		if ($(this).hasClass('open')) {
			$(this).removeClass('open');
			$(this).addClass('closed');
			$(this).next().slideDown(300);
			return false;
		} else {
			$(this).removeClass('closed');
			$(this).addClass('open');
			$(this).next().slideUp(300);
			return false;
		}			
	});
}

// other cat tooltip

$("a.link").easyTooltip();


});
