// JavaScript Document
$(document).ready(function () {
	var move = -15;
	var zoom = 1.2;
	//Featured post one (Home Page)
	$('.featCaption').hover(function() {
		width = $('.featCaption').width() * zoom;
		height = $('.featCaption').height() * zoom;
		
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
		
		$(this).find('.featOneBorder').stop(false,true).fadeOut(150);
		
		$(this).find('.caption').stop(false,true).fadeIn(200);
			
	}, function() {
		
		$(this).find('img').stop(false,true).animate({'width':$('.featCaption').width(), 'height':$('.featCaption').height(), 'top':'0', 'left':'0'}, {duration:100});
		$(this).find('.featOneBorder').stop(false,true).fadeIn(250);
		
		$(this).find('.caption').stop(false,true).fadeOut(200);
	});
	//Featured post two(Home Page)
	$('.featCaption2').hover(function() {
		width = $('.featCaption2').width() * zoom;
		height = $('.featCaption2').height() * zoom;
		
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
		
		$(this).find('.featTwoBorder').stop(false,true).fadeOut(150);
		
		$(this).find('.caption2').stop(false,true).fadeIn(200);
			
	}, function() {
		$(this).find('img').stop(false,true).animate({'width':$('.featCaption2').width(), 'height':$('.featCaption2').height(), 'top':'0', 'left':'0'}, {duration:100});
		$(this).find('.featTwoBorder').stop(false,true).fadeIn(250);
		
		$(this).find('.caption2').stop(false,true).fadeOut(200);
	});
	
	//Main Menu = Dropdown
	
	$('ul#menu-menu-principal li a').hover( function(){		
		$(this).parent().find('ul.sub-menu').slideDown('fast').show();
		$(this).parent().hover( function(){},function(){
			$(this).parent().find('ul.sub-menu').slideUp('slow');
		}).hover( function(){
			$(this).addClass("subHover");
		},function (){
			$(this).removeClass("subHover");
		});
	
	});
	// Dropped menu links animation
	$('ul.sub-menu li a').hover( function(){
				$(this).stop(true).animate({'paddingLeft': '30'},{speed:70});},
			function(){
				$(this).stop(true).animate({'paddingLeft': '12'},{speed:70});
			});
	
	//Post Samples effect 
	$('.postSampleIMG').mouseenter(function(){
		$(this).find('a img').stop(false,true).fadeTo(300,0.5);
	}).mouseleave(function() {
		$(this).find('a img').stop(false,true).fadeTo(300,1);	
	});
	$('#lastTattoos .ngg-gallery-thumbnail a, .ngg-widget.entry-content a, .postPage .postContent .ngg-galleryoverview .ngg-gallery-thumbnail-box a').hover( function(){
		$(this).find('img').stop(false,true).fadeTo(300,0.6);},
		function(){
		$(this).find('img').stop(false,true).fadeTo(300,1);
	});
	
	//Sidebar animation effects
	$('.widget h4').click(function(){
		if($(this).next().is(":visible")){
		$(this).next().slideUp(300);
		$(this).addClass("showWidget");
		}else{
		$(this).next().slideDown(300);
		$(this).removeClass("showWidget");
		}
	});
	$('.widget ul li a').hover(function(){
			$(this).stop(false,true).animate({'paddingLeft': '30'},{speed:50});},
		function(){
			$(this).stop(false,true).animate({'paddingLeft': '15'},{speed:50});
	});
	//Gallery navigation formating
	$('.ngg-navigation').addClass('gd16col04');
	$('.ngg-gallery-thumbnail-box, .ngg-widget.entry-content a').addClass('gd16col02 gd16line02 masonry');
	$('.postPage .postContent .ngg-galleryoverview .ngg-gallery-thumbnail-box.gd16col02.gd16line02.masonry').removeClass('masonry');
	
});
