/* Author: Jeremey Hustman

*/
	
$(document).ready(function() {  /* begin ready function */

/* testimonials */
$('#test-widget ul').cycle({ fx: 'scrollUp', speed: 750, timeout: 7500, next: '#next_test', prev: '#prev_test', cleartype: true, cleartypeNoBg: true });
	
	$("#tabs").tabs();


	$("#navigation li a").hover(function() { //When trigger is clicked...  

		//Following events are applied to the subnav itself (moving subnav up and down)  
		$(this).parent().find(".subnav").slideDown('fast').show(); //Drop down the subnav on click  

		$(this).parent().hover(function() {  
		}, function(){  
			$(this).parent().find(".subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up  
		});  

		//Following events are applied to the trigger (Hover events for the trigger)  
	}).hover(function() {  
		$(this).addClass("subhover"); //On hover over, add class "subhover"  
	}, function(){  //On Hover Out  
		$(this).removeClass("subhover"); //On hover out, remove class "subhover"  
	});  



/* css dropdown menu */

if($("ul.dropdown").length) {
	$("ul.dropdown li").dropdown();
}



});  /* end ready function */



$.fn.dropdown = function() {

	return this.each(function() {

		$(this).hover(function(){
			$(this).addClass("hover");
			$('> .dir',this).addClass("open");
			$('ul:first',this).css('visibility', 'visible');
		},function(){
			$(this).removeClass("hover");
			$('.open',this).removeClass("open");
			$('ul:first',this).css('visibility', 'hidden');
		});

	});

}

