/*
set scripts
*/

$(document).ready(function(){
	
	//superfish
	$("ul.sf-menu").superfish({ 
            //pathClass:  'current',			// the class you have applied to list items that lead to the current page
			autoArrows:  false,				// disable generation of arrow mark-up 
            dropShadows: true,				// disable drop shadows 
			animation: {height:'show'},		// slide-down effect without fade-in 
            delay:     900					// second delay on mouseout 
        });
	
	//Examples of how to assign the ColorBox event to elements
	$('a#colorBox').colorbox();
	$("a#colorBox.excerptLink").colorbox({width:"50%", inline:true, href:"#excerpt1"});
	$('a#colorBoxVid').colorbox({iframe:true, innerWidth:640, innerHeight:385, href:function(){ return this.href.replace('watch?v=', 'v/'); }});
	
	//Hide the tooglebox when page load
	$("#featuresToggle").hide(); 
	//slide up and down when hover over item
	$("#featuresBox #feature h1.featuresHeader").hoverIntent(function(){
		$(this).find("img#featureArrow").attr("src","imgs/img-feature-arrow-2.png");
		//$("#featuresToggle", this).slideDown("slow");
		$(this).next("#featuresToggle").slideDown("slow");
			}, function() {
			//$("#featuresToggle", this).slideUp("slow");
			$(this).next("#featuresToggle").slideUp("slow");
			$(this).find("img#featureArrow").attr("src","imgs/img-feature-arrow.png");
		return false; //prevent link anchor
	});
	
	//set cycle scroller
	$("ul#newsScroller").cycle({
		fx: 'scrollDown'
	});
	
	//autocolumn
	$('.3cols').columnize({columns: 3});
	$('#newsText').columnize({columns: 3});
	
	//sets localScroll for anchors
	$.localScroll({ duration: 888 });

});



