// JavaScript Document

var selected = 1;
var path='images/featured_projects/';

var titles = Array();
titles[1] = 'Taum Sauk Upper Reservoir Rebuild <br/><span class="gold italic">Lesterville, Missouri</span>'
titles[2] = 'Bear Creek Dam Rehabilitation Project <br/><span class="gold italic">Hodges, Alabama</span>'
titles[3] = 'Sallisaw Watershed Spillway <br/><span class="gold italic">Stillwell, Oklahoma</span>'
titles[4] = 'Hackberry Draw Watershed Project <br/><span class="gold italic">Carlsbad, New Mexico</span>'
titles[5] = 'Saluda Dam Remediation Project <br/><span class="gold italic">Columbia, South Carolina</span>'


function hidediv(thediv) {
	$('#'+thediv).fadeOut(300);		
}
function showdiv(thediv) {
	$('#'+thediv).fadeIn(600);
} 


function swapActive(num){
	hidediv('featured_image');
	hidediv('featured_name');
	selected = num;
	setTimeout('secondPart()',300);
}

function swapGalleryActive(img){
	hidediv('gallery_image');
	setTimeout('secondGalleryPart("'+img+'")',300);
}



function swapImage(img){
	document.getElementById("featured_image").src = img;
	document.getElementById("featured_name").innerHTML = titles[selected];
}

function swapGalleryImage(img){
	document.getElementById("gallery_image").src = img;
}

function secondPart(){
	swapImage(path+"featured"+selected+".jpg");
	setTimeout('thirdPart()',200);
}

function secondGalleryPart(img){
	swapGalleryImage(path+img);
	setTimeout('thirdGalleryPart()',200);
}

function thirdPart(){		
	showdiv('featured_image');
	showdiv('featured_name');
}

function thirdGalleryPart(){		
	showdiv('gallery_image');
}
