// JavaScript Document  
$(document).ready(function() {

  //  nav tab animation  
  var navDuration = 150; //time in miliseconds
  var navJumpHeight = "5px";

/*   $('#nav1 li').hover(function() {
      $(this).animate({ top : "-="+navJumpHeight }, navDuration);            
  }, function() {
      $(this).animate({ top : "25px" }, navDuration);
  });
  
  
    //nav animation2  
  $('#nav_move').css({ 
    width: $('#nav2 li:first a').width()+20, 
    height: $('#nav2 li:first a').height()+20 
  });
  $('#nav2 li:first a').addClass('cur');
  
  $('#nav2 a').click(function() {
    var offset = $(this).offset();
    var offsetBody = $('#center_wrapper').offset(); //find the offset of the wrapping div    
    $('#nav_move').animate(
      { 
        width: $(this).width()+20, 
        height: $(this).height()+20, 
        left: (offset.left - offsetBody.left - 143) 
      }, 
      { duration: 350, easing: 'easeInOutCirc' }
    );
    $('.cur').removeClass('cur');
    $(this).addClass('cur');
    return false;
  });  */       
  
  
  //  list animation  
  var fadeDuration = 150; //time in milliseconds
  
  $('#list1 li a').hover(function() {
    $(this).animate({ paddingLeft: '32px' }, fadeDuration);
    $(this).children('span').show().animate({ left: -5 }, fadeDuration);
  }, function() {
    $(this).animate({ paddingLeft: '22px' }, fadeDuration);
    $(this).children('span').animate({ left: -35 }, fadeDuration).fadeOut(fadeDuration);          
  });
  
  
  $('.see_code').click(function() {
    if($(this).parent().next().is(':visible')) {
      $(this).html('+ Show Code');
      $(this).parent().next().toggle();
    } else {
      $(this).html('- Hide Code');
      $(this).parent().next().toggle();            
    }
    return false;
  });

	$('div.submenu.headoffice a').click(function() {
		var roles = ($(this).attr('href').substr(1));
		// alert(roles);
		$('a[name='+roles+']').click();
		return false;
	});
  
});