$("document").ready(function() {
	
	// DROPDOWN MENU
	
	$("ul.nav li").hover(function(){
	
	    $(this).addClass("hover");
	    $('ul:first',this).css('visibility', 'visible');
	
	}, function(){
	
	    $(this).removeClass("hover");
	    $('ul:first',this).css('visibility', 'hidden');
	
	});

	// HOMEPAGE SLIDESHOW
	$('.featured').cycle({
    fx:     'scrollVert',
    prev:   '.prev2',
    next:   '.next2',
    timeout: 0
	});
	
	$(".featured1").cycle({ 
		fx:      'scrollHorz',
		speedIn:  200, 
		speedOut: 100, 
		timeout: 100100,
		auto: false,
		next:	 '.featured-nav1 a.next',
		prev: 	 '.featured-nav1 a.prev'
		

	});
	
	// PROJECT SLIDESHOW
	
	$(function() {
		var contentWrapper = $('.project-wrap > .project');
		// only show the first item, hide the rest
		contentWrapper.hide().filter(':first').show();
		
		$('.project-nav li a').click(function () {
		
		    // check if this item doesn't have class "current"
		    // if it has class "current" it must not execute the script again
		    if (this.className.indexOf('current') == -1){
		    	contentWrapper.hide();
		    	contentWrapper.filter(this.hash).fadeIn(500);
		    	$('.project-nav li').removeClass('current');
		    	$('.project-nav li a').removeClass('current');
		    	$(this).addClass('current');
		    	$(this).parent().addClass('current');
		    }
		    return false;
		});
		
	});
	

	marqueeInit({
		uniqueid: 'mycrawler2',
		style: {
		'padding': '2px',
		'width': '100%',
		'height': '92px'
		},
		inc: 5, //speed - pixel increment for each iteration of this marquee's movement
		mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
		moveatleast: 2,
		neutral: 150,
		savedirection: true
	});
	
	$(window).load(function() {
		$('#slider').nivoSlider({
			effect:'random', //Specify sets like: 'sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft, fold, fade, random
			directionNav:false 
			});
	});
	
var sagscroller2=new sagscroller({
	id:'mysagscroller2',
	mode: 'auto',
	pause: 2500,
	animatespeed: 400 //<--no comma following last option
})
var sagscroller3=new sagscroller({
	id:'mysagscroller3',
	mode: 'auto',
	pause: 3000,
	animatespeed: 400 //<--no comma following last option
})
	
		//$(function() {
		//$('#tabsnav').tabs({ fix: { opacity: 'toggle' } });
		//$('a.popup').lightBox({fixedNavigation:true});
	//});
	
});
