$(document).ready(function() {
	
	$('.go_to_top').click(function()
		{
		$.scrollTo('.body_bg', {duration: 900});
		});  

	$('.open_hidden1').click(function()
		{
		if (!$('.hidden2').is(':hidden')) $('.hidden2').slideToggle('600');
		if (!$('.hidden3').is(':hidden')) $('.hidden3').slideToggle('600');
		var addCurrent = $('.hidden1').is(':hidden');
		$('.hidden1').slideToggle('600');
		$('.open_hidden1').removeClass('current');
		$('.open_hidden2').removeClass('current');
		$('.open_hidden3').removeClass('current');
		if (addCurrent) $('.open_hidden1').addClass('current');
		});
	
	$('.open_hidden2').click(function()
		{
		if (!$('.hidden1').is(':hidden')) $('.hidden1').slideToggle('600');
		if (!$('.hidden3').is(':hidden')) $('.hidden3').slideToggle('600');
		var addCurrent = $('.hidden2').is(':hidden');
		$('.hidden2').slideToggle('600');
		$('.open_hidden1').removeClass('current');
		$('.open_hidden2').removeClass('current');
		$('.open_hidden3').removeClass('current');
		if (addCurrent) $('.open_hidden2').addClass('current');
		});
	
	$('.open_hidden3').click(function()
		{
		if (!$('.hidden1').is(':hidden')) $('.hidden1').slideToggle('600');
		if (!$('.hidden2').is(':hidden')) $('.hidden2').slideToggle('600');
		var addCurrent = $('.hidden3').is(':hidden');
		$('.hidden3').slideToggle('600');
		$('.open_hidden1').removeClass('current');
		$('.open_hidden2').removeClass('current');
		$('.open_hidden3').removeClass('current');
		if (addCurrent) $('.open_hidden3').addClass('current');
		});
	
	

		
	
	$('a[rel*=lightbox]').lightbox({
		fileLoadingImage:'/assets/templates/jivaldi2009/images/loading.gif',
		fileBottomNavCloseImage: '/assets/templates/jivaldi2009/images/close.gif',
		imageBtnPrev: '/assets/templates/jivaldi2009/images/prev.gif'
	});
	
	// New Icon Tooltips on mouse-over
	
	$(".msn_link a, .yahoo_link a, .aim_link a").removeAttr("title").click(function(){return false;});

	$(".msn_link a").mouseover(function()
		{
		$(".msn_tooltip").fadeIn();
		}).mouseout(function()
		{
		$(".msn_tooltip").fadeOut();
		});
	
	$(".yahoo_link a").mouseover(function()
		{
		$(".yahoo_tooltip").fadeIn();
		}).mouseout(function()
		{
		$(".yahoo_tooltip").fadeOut();
		});
	
	$(".aim_link a").mouseover(function()
		{
		$(".aim_tooltip").fadeIn();
		}).mouseout(function()
		{
		$(".aim_tooltip").fadeOut();
	});
});