/* Site specific JS */


$(document).ready(function()
{	
	
	// Open external links in a new window
	//$("a[href^='http:']").not("[href*='mydomain.com']").attr('target','_blank');

	// Instantiate the accordian for the Equipment section
	$('#equipmentAccordion').accordion({autoHeight: false});
	
	$('.equipmentSectionHeader').hover(
	function () {
		$(this).css("background-color","#cacaca");
	},
	function () {
		$(this).css("background-color","#d8d8d8");
	});	
	
	
	// More Projects List
	if ($('#moreProjectsList').length != "")
	{
		// Initially hide the list and place the More Projects text
		$('#moreProjectsList').css("display","none");
		$('#moreProjects').text('More projects');
		
		// Show the list when the More Projects text is clicked
		$("#moreProjects").click(function()
		{
			$("#moreProjects").fadeOut('normal');
			$('#moreProjectsList').slideDown('slow');
		});
	}
	
	
	// About content switcher 
	
	// When a link is clicked  
	$("ul.aboutTabs a").click(function () 
	{  
	
		// switch all tabs off  
		$("a.tabActive").removeClass("tabActive"); 
		$("a.tab").removeClass("tab"); 
		$("ul.aboutTabs a").addClass("tab");
		
		// switch this tab on  
		$(this).removeClass("tab");
		$(this).addClass("tabActive");  
		
		// slide all elements with the class 'content' up  
		$(".aboutContentSection").slideUp();  
		
		// Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.  
		var content_show = $(this).attr("title");  
		$("#"+content_show).slideDown();  
	
	});
	
	
	
}); // End document.ready




// Nivo Image Sliders
$(window).load(function() {

	$('#homeSlider').nivoSlider({
		effect:'random', //Specify sets like: 'fold,fade,sliceDown'
		slices:12,
		animSpeed:500, //Slide transition speed
		pauseTime:5000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
      	controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
	
	$('#equipmentSlider').nivoSlider({
		effect:'random', //Specify sets like: 'fold,fade,sliceDown'
		slices:12,
		animSpeed:500, //Slide transition speed
		pauseTime:4500,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
      	controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
	
});






