// Beat Fly JS Core Document
$(document).ready(function() {	
	//img effect
	$('ul.thumb li img').hover(function() {
		$(this).stop().animate({
			opacity : 0.8
		}, 500);
		},
		function(){
		$(this).stop().animate({
			opacity : 1
		}, 500);
	});
	
	//portfolio
	$('div#eventi').addClass('hide');
	$('a#matrimonio').addClass('selected');
	
	$('a#eventi').click(function() {
 		$('div#eventi').removeClass('hide').show();
			$('div#matrimonio').addClass('hide');
				$('a#eventi').addClass('selected');
					$('a#matrimonio').removeClass('selected');
 	return false;
  	});
	
	$('a#matrimonio').click(function() {
 		$('div#matrimonio').removeClass('hide').show();
		$('div#eventi').addClass('hide');
			$('a#matrimonio').addClass('selected');
				$('a#eventi').removeClass('selected');
 	return false;
  	});
	
	//form focus
	$('#name').focus();
	
	//tabs
	$(".tab_content").hide(); //Hide all content
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$("ul.tabs li a:first").addClass("active"); //Activate a first tab
			$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li, ul.tabs li a").removeClass("active"); //Remove any "active" class + Remove a any "active" class
			
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content			
		
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).show(); //show the active content
		
		$("ul.tabs li.active").find("a").addClass("active"); //Find li.active and add active to link		
		return false;
	});
	
	//share it
	$("#share").jsocial({highlight: true,
		buttons: "delicious,facebook,stumbleupon,twitter,digg,", 
		imagedir: "images/", 
		imageextension: "png", 
		blanktarget: true});
					
});//end
