
//array of main picts
var arrPics = new Array;
arrPics[0] = "shim.gif";
arrPics[1] = "photo1.png";
arrPics[2] = "photo2.png";
arrPics[3] = "photo3.png";
arrPics[4] = "photo4.png";
arrPics[5] = "photo5.png";
arrPics[6] = "photo6.png";
arrPics[7] = "photo7.png";
arrPics[8] = "photo-appleseed.png";


//figure out what page we are on and set the main image and navBarHighlight accordingly
strURL = document.location.href
strFileName = strURL.substring(strURL.lastIndexOf("/")+1,strURL.length)
// Create an array of all of the folders in the path so we can know exactly which file we are on. 
// There may be more than one index.html in different directories
aryPath = strURL.split("/")
intFileNameIdx = aryPath.length
strFileName = aryPath[intFileNameIdx-1]//array starts at 0 so subtract 1 from the length
strFolderName = aryPath[intFileNameIdx-2]//subtract 2 -1 gives the file name -2 gives the last folder

//set the pictNum to display and the topNavBarHighlight
switch(strFileName){
	case 'index.shtml': 
		pictNum=1//home
		topBarHighlight=1
		break	
	case 'people.shtml': case 'people_testimony.shtml': case 'people_lori.shtml': case 'people_msgbt.shtml': case 'people_christmas.shtml': case 'people_about.shtml': case 'people_meetbetty.shtml': case 'people_ministryalliance.shtml': case 'people_testimony1.shtml': case 'people_testimony2.shtml': case 'people_testimony3.shtml':
		pictNum=2//people
		topBarHighlight=2
		break	
	case 'register.shtml':case 'conference_200701.shtml': case 'conference_200701_FBCdirections.shtml':case 'conference_200701_register.shtml': case 'conference_200701_directions.shtml': case 'conference_main.shtml': case 'newsletter.shtml': case 'newsletter1.shtml': case 'newsletter2.shtml': case 'newsletter3.shtml': case 'register_form.shtml': case 'register_mediakit.shtml': case 'register_aboutclasses.shtml': case 'logos.shtml':
		pictNum=6//classes
		topBarHighlight=3
		break		
	case 'shop.shtml': case 'ragtimequilt.shtml':
		pictNum=4//products
		topBarHighlight=4
		break	
	case 'shopbooks.shtml': case 'ragtimequilt.shtml':
		pictNum=4//products
		topBarHighlight=4
		break
case 'shopaccessories.shtml': case 'ragtimequilt.shtml':
		pictNum=4//products
		topBarHighlight=4
		break
	case 'contactus.shtml': case 'thank_you.shtml':
		pictNum=5//contact us
		topBarHighlight=5
		break
 	case 'register_appleseeds.shtml':
		pictNum=8//appleseeds
		topBarHighlight=3
		break										
	default: 
	//if they come to the url without specifying a file Ex:home page
		pictNum=1//home
		topBarHighlight=1
}


function showPic (){
	//set the main picture
	//picNum is a globalvar set in the switch above
	var pic = arrPics[pictNum]
	objImg = document.getElementById("mainImg")	
	objImg.src='common/'+pic
}

function highlightTopNavBar(){
	//set the top bar highlight
	//topBarHighlight is a globalvar set in the switch above	
	if(topBarHighlight > 0){
		objLI = document.getElementById('topBar'+topBarHighlight)
		objLI.className="navHighlight"
	}
}

