﻿$(document).ready(function ()
{

	/*--------------------------------------------------------------------------------*/
	/*-----------------------jimgMenu-------------------------------------------------*/
	/*--------------------------------------------------------------------------------*/
	
	// find the elements to be eased and hook the hover event
	$('div.jimgMenu ul li a').hover(
	function()
	{
	
		// if the element is currently being animated (to a easeOut)...
		if ( $(this).attr('id') == 'last' )
			$(this).stop('animated:').animate({width: "380px"}, {duration: 450, easing:"easeInOutQuad"});
		else
			if ($(this).is(':animated'))
			{
				$(this).stop().animate({width: "310px"}, {duration: 450, easing:"easeOutQuad"});
			}
			else
			{
				// ease in quickly
				$(this).stop().animate({width: "310px"}, {duration: 400, easing:"easeOutQuad"});
			}
	},
	function ()
	{
		// on hovering out, ease the element out
		if ($(this).is(':animated'))
		{
			//alert( $(this).attr('id') );	
			if ( $(this).attr('id') == 'last' )
				$(this).stop().animate({width: "380px"}, {duration: 400, easing:"easeInOutQuad"})
			else
				$(this).stop().animate({width: "110px"}, {duration: 400, easing:"easeInOutQuad"})
		}
		else
		{
			//alert( $(this).attr('id') );	
			if ( $(this).attr('id') == 'last' )
				$(this).stop('animated:').animate({width: "380px"}, {duration: 450, easing:"easeInOutQuad"});
			else
				$(this).stop('animated:').animate({width: "110px"}, {duration: 450, easing:"easeInOutQuad"});	
			// ease out slowly
		}
	}
	);
	

	/*--------------------------------------------------------------------------------*/
	/*-----------------------jimgMenu_sinodos-------------------------------------------------*/
	/*--------------------------------------------------------------------------------*/
	
	// find the elements to be eased and hook the hover event
	$('div.jimgMenu_sinodos ul li a').hover(
	function()
	{
	
		// if the element is currently being animated (to a easeOut)...
		if ( $(this).attr('id') == 'last' )
			$(this).stop('animated:').animate({width: "380px"}, {duration: 450, easing:"easeInOutQuad"});
		else
			if ($(this).is(':animated'))
			{
				$(this).stop().animate({width: "310px"}, {duration: 450, easing:"easeOutQuad"});
			}
			else
			{
				// ease in quickly
				$(this).stop().animate({width: "310px"}, {duration: 400, easing:"easeOutQuad"});
			}
	},
	function ()
	{
		// on hovering out, ease the element out
		if ($(this).is(':animated'))
		{
			//alert( $(this).attr('id') );	
			if ( $(this).attr('id') == 'last' )
				$(this).stop().animate({width: "380px"}, {duration: 400, easing:"easeInOutQuad"})
			else
				$(this).stop().animate({width: "32px"}, {duration: 400, easing:"easeInOutQuad"})
		}
		else
		{
			//alert( $(this).attr('id') );	
			if ( $(this).attr('id') == 'last' )
				$(this).stop('animated:').animate({width: "380px"}, {duration: 450, easing:"easeInOutQuad"});
			else
				$(this).stop('animated:').animate({width: "32px"}, {duration: 450, easing:"easeInOutQuad"});	
			// ease out slowly
		}
	}
	);
	
	/*--------------------------------------------------------------------------------*/
	/*-----------------------jimgMenu_leukoma-----------------------------------------*/
	/*--------------------------------------------------------------------------------*/
	
	// find the elements to be eased and hook the hover event
	$('div.jimgMenu_leukoma ul li a').hover(function()
	{
	
		// if the element is currently being animated (to a easeOut)...
		if ( $(this).attr('id') == 'last' )
			$(this).stop('animated:').animate({width: "380px"}, {duration: 450, easing:"easeInOutQuad"});
		else
			if ($(this).is(':animated'))
			{
				$(this).stop().animate({width: "310px"}, {duration: 450, easing:"easeOutQuad"});
			}
			else
			{
				// ease in quickly
				$(this).stop().animate({width: "310px"}, {duration: 400, easing:"easeOutQuad"});
			}
	},
	function ()
	{
		// on hovering out, ease the element out
		if ($(this).is(':animated'))
		{
			//alert( $(this).attr('id') );	
			if ( $(this).attr('id') == 'last' )
				$(this).stop().animate({width: "380px"}, {duration: 400, easing:"easeInOutQuad"})
			else
				$(this).stop().animate({width: "110px"}, {duration: 400, easing:"easeInOutQuad"})
		}
		else
		{
			//alert( $(this).attr('id') );	
			if ( $(this).attr('id') == 'last' )
				$(this).stop('animated:').animate({width: "380px"}, {duration: 450, easing:"easeInOutQuad"});
			else
				$(this).stop('animated:').animate({width: "110px"}, {duration: 450, easing:"easeInOutQuad"});	
			// ease out slowly
		}
	}
	);
	
});

