// Copyrghts @ DeccaInfo
// Author M.B.Sathik
// Website www.deccainfo.com

$(document).ready(function(){
  	lastBlock = $("#js_ul #a1");
    maxWidth = 210;
	minWidth = 75;	
    
    $("#js_ul ul li a").hover(	
		function(){			
			$(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
			$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
			currentBlock = this;				
			lastBlock = this;			
	    }
	);
  });

function initMenu() {
//  window.alert($('#menu ul:first'));
  //$('#menu ul').hide();
$('#menu > li > ul:lt(0)').hide();  
$('#menu > li > ul:gt(0)').hide();
  //$('#javithmenu ul').hide();
  //$('#menu ul:first').show();
  $('#menu li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#menu ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }
$(document).ready(function() {
	initMenu();
});


// JavaScript Document

$(function(){
		 
		   $('#navigation li a').append('<sspan class="hover"></span>')
		   
		   $('#navigation li a').hover(function() {
	        
		// Stuff that happens when you hover on + the stop()
		$('.hover', this).stop().animate({
			'opacity': 1
			}, 700,'easeOutSine')
	
	},function() {
	
		// Stuff that happens when you unhover + the stop()
		$('.hover', this).stop().animate({
			'opacity': 0
			}, 700, 'easeOutQuad')
	
	})
		   });


//JAVA CAP
$(window).load(function(){
	//for each description div...
	$('div.description').each(function(){
		//...set the opacity to 0...
		$(this).css('opacity', 0);
		//..set width same as the image...
		$(this).css('width', $(this).siblings('a').width());
		//...get the parent (the wrapper) and set it's width same as the image width... '
		$(this).parent().css('width', $(this).siblings('a').width());
		//...set the display to block
		$(this).css('display', 'block');
	});
	
	$('div.wrapper').hover(function(){
		//when mouse hover over the wrapper div
		//get it's children elements with class descriptio
		//and show it using fadeTo
		$(this).children('.description').stop().fadeTo(500, 0.7);
	},function(){
		//when mouse out of the wrapper div
		//use fadeTo to hide the div
		$(this).children('.description').stop().fadeTo(500, 0);
	});
	
});

//NEW FADE MENU
$(window).ready(function(){
	$(".a").hover(
	function() {
		$(this).stop().animate({"opacity": "0"}, "slow");
	},
	function() {
		$(this).stop().animate({"opacity": "1"}, "slow");
	});
	
});

