/*
 * Top Nav
 */
$(function() {
	$('#sdt_menu > li').bind('mouseenter',function(){
		var $elem = $(this);
		
		$elem.find('img')
		.stop(true)
		.animate({
			'width':'166px',
			'height':'145px',
			'left':'0px'
		 	},400,'easeOutBack')
		.andSelf()
		
		.find('.sdt_wrap')
		.stop(true)
		.animate({'top':'0px'},500,'easeOutBack')
		.andSelf()
		
		.find('.sdt_active')
		.stop(true)
		.animate({'height':'0px'},300,function(){
		
  		var $sub_menu = $elem.find('.sdt_box');
  		if($sub_menu.length){
  			var top = '65px';
  			if($elem.parent().children().length == $elem.index()+0)
  				top = '-215px';
  		    $sub_menu.show().animate({'top':top},200);
  		}
			
	});
}).bind('mouseleave',function(){
	var $elem = $(this);
	var $sub_menu = $elem.find('.sdt_box');
	if($sub_menu.length)
		$sub_menu.hide().css('left','0px');
	
	$elem.find('.sdt_active')
		 .stop(true)
		 .animate({'height':'0px'},300)
		 .andSelf().find('img')
		 .stop(true)
		 .animate({
			'width':'0px',
			'height':'0px',
			'left':'85px'},400)
		 .andSelf()
		 .find('.sdt_wrap')
		 .stop(true)
		 .animate({'top':'0px'},500);
});
})

/*
 * jquery=
 * College Accord
*/
	$(document).ready(function(){

		//Set default open/close settings
		$('.acc_container').hide(); //Hide/close all containers
		$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
		
		//On Click
		$('.acc_trigger').click(function(){
			if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
				$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
				$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
			}
			return false; //Prevent the browser jump to the link anchor
		});
	});
