
function menuBind(){
		$('#menu > li > a').bind ('mouseenter', function(){
			busy = true;
			$(this).parent().find('strong').stop().animate({backgroundPosition:'-80 -30'},400, 'easeInQuad', function(){busy=false;})
		});
		$('#menu > li > a').bind ('mouseleave',function(){
			busy = true;
			$(this).parent().find('strong').stop().animate({backgroundPosition:'-310 -30'},400, 'easeOutQuad', function(){busy=false;})
		});
}
function menuUlBind(){	
		$('ul').bind ('mouseenter', function(){
			busy = true;
			$(this).parent().find('> strong').stop().animate({backgroundPosition:'-80 -30'},400, 'easeInQuad', function(){busy=false;})
		});
		$('ul').bind ('mouseleave',function(){
			busy = true;
			$(this).parent().find('> strong').stop().animate({backgroundPosition:'-310 -30'},400, 'easeOutQuad', function(){busy=false;})
		});
}
function closeBind(){
		$('.close').bind ('mouseenter', function(){
			$(this).stop().animate({right:'73'},400,'easeInBack')	
		});
		$('.close').bind ('mouseleave',function(){
			$(this).stop().animate({right:'92'},400,'easeOutBack')
		});
}


$(document).ready(function() {
	$('#menu, #content').show();
	//logo animate
	$('h1').hover(function(){
			$(this).stop().animate({left:'0'},400,'easeInBack')			 
		}, function(){
			$(this).stop().animate({left:'-69'},400,'easeOutBack')	
		}
	)
	$('#icon li a span').css({height:'0px'})
	$('#icon li a').mouseenter(function(){			   
			$(this).find('span').stop().animate({height:'62'},400)
		}).mouseleave(function(){
			$(this).find('span').stop().animate({height:'0'},400)
		}
	)
	closeBind();
	//menu animate
	menuBind();
	menuUlBind();
	$('ul#menu').superfish({
      delay:       600,
      animation:   {height:'show'},
      speed:       400,
      autoArrows:  false,
      dropShadows: false
    });
	//button animate
	$('.button1').hover(function(){
			$(this).find('span').stop().animate({backgroundPosition:'-80 -45'},400, 'easeInQuad')
		}, function(){
			$(this).find('span').stop().animate({backgroundPosition:'-310 -45'},400, 'easeOutQuad')
		}
	)
	$('.enter_button').hover(function(){
			$(this).find('strong').stop().animate({backgroundPosition:'-80 -33'},400, 'easeInQuad')
		}, function(){
			$(this).find('strong').stop().animate({backgroundPosition:'-410 -33'},400, 'easeOutQuad')
		}
	)
	// tool tip
	$('.normaltip').aToolTip({
    	toolTipClass: 'aToolTip'});
		
	// tabs
	tabs.init();
	//list animate
	$('.list1 li a, .list2 li a').hover(function(){
			$(this).stop().animate({paddingLeft:'23'},400);			
		}, function(){
			$(this).stop().animate({paddingLeft:'13'},400);	
		}
	);
		

	// vertical scroll	
	$('.scroll-pane').jScrollPane({
		showArrows:true,
		scrollbarWidth:24,
		dragMaxHeight:56
	});
	
						   
});
