			var preloadFlag = false;
			function preloadImages() {
				if (document.images) {
					//create image objects for all the images in use
					SFNav_Home = new Image();
					SFNav_ShowAll = new Image();
					SFNav_Author = new Image();
					SFNav_Char = new Image();
					SFNav_World = new Image();
					SFNav_Other = new Image();
					SFNav_Store = new Image();
					SFNav_Links = new Image();
					over_SFNav_Home = new Image();
					over_SFNav_ShowAll = new Image();
					over_SFNav_Author = new Image();
					over_SFNav_Char = new Image();
					over_SFNav_World = new Image();
					over_SFNav_Other = new Image();
					over_SFNav_Store = new Image();
					over_SFNav_Links = new Image();


					//now set the image object source values according to what page you are on. 
					//for whatever page you are on, you want the nav image to always be the rollover image
					var fileName
					//alert(document.location.pathname.substring(document.location.pathname.lastIndexOf("/")+1,document.location.pathname.length));
					if (document.location.pathname.substring(document.location.pathname.lastIndexOf("/")+1,document.location.pathname.length) == "index.html") {
						fileName = "index.html";
					} else {

						fileName=document.location.pathname.substring(document.location.pathname.lastIndexOf("/")+1,document.location.pathname.length - 15);
		
					}
				
					if((fileName == "index.html" || fileName == "" || fileName == "/") && document.location.pathname.substring(document.location.pathname.lastIndexOf("/")+1,document.location.pathname.length) != "links.html") {
						SFNav_Home.src = 'images/SFNav_Home-over.jpg';
						over_SFNav_Home.src = SFNav_Home.src;
						document.images["HomeSpot"].src = SFNav_Home.src;					
					} else {
						SFNav_Home.src = 'images/SFNav_Home.jpg';
						over_SFNav_Home.src = 'images/SFNav_Home-over.jpg';
					} //end if Home page


					if(fileName == "LSFAll") {
						SFNav_ShowAll.src = 'images/SFNav_ShowAll-over.jpg';
						over_SFNav_ShowAll.src = SFNav_ShowAll.src;
						document.images["ShowAllSpot"].src = SFNav_ShowAll.src;
					} else {
						SFNav_ShowAll.src = 'images/SFNav_ShowAll.jpg';
						over_SFNav_ShowAll.src = 'images/SFNav_ShowAll-over.jpg';
					} //end if All page

					if(fileName == "LSFChar") {
						SFNav_Char.src = 'images/SFNav_Char-over.jpg';
						over_SFNav_Char.src = SFNav_Char.src;
						document.images["CharSpot"].src = SFNav_Char.src;
					} else {
						SFNav_Char.src = 'images/SFNav_Char.jpg';
						over_SFNav_Char.src = 'images/SFNav_Char-over.jpg';
					} //end if Char page

					if(fileName == "LSFAuth") {
						SFNav_Author.src = 'images/SFNav_Author-over.jpg';
						over_SFNav_Author.src = SFNav_Author.src ;
						document.images["AuthorSpot"].src = SFNav_Author.src ;
					} else {
						SFNav_Author.src = 'images/SFNav_Author.jpg';
						over_SFNav_Author.src = 'images/SFNav_Author-over.jpg';
					} //end if Author page


					if(fileName == "LSFWorld") {
						SFNav_World.src = 'images/SFNav_World-over.jpg';
						over_SFNav_World.src = SFNav_World.src;
						document.images["WorldSpot"].src = SFNav_World.src;
					} else {
						SFNav_World.src = 'images/SFNav_World.jpg';
						over_SFNav_World.src = 'images/SFNav_World-over.jpg';
					} //end if World page


					if(fileName == "LSFOther") {
						SFNav_Other.src = 'images/SFNav_Other-over.jpg';
						over_SFNav_Other.src = SFNav_Other.src;
						document.images["OtherSpot"].src = SFNav_Other.src;
					} else {
						SFNav_Other.src = 'images/SFNav_Other.jpg';
						over_SFNav_Other.src = 'images/SFNav_Other-over.jpg';
					} //end if Other page
					
					if(document.location.pathname.substring(document.location.pathname.lastIndexOf("/")+1,document.location.pathname.length) == "links.html") {
						SFNav_Links.src = 'images/SFNavBottom-over.jpg';
						over_SFNav_Links.src = SFNav_Links.src;
						document.images["LinkSpot"].src = SFNav_Links.src;
						//SFNav_Home.src = 'images/SFNav_Home.jpg';
					} else {
						SFNav_Links.src = 'images/SFNavBottom.jpg';
						over_SFNav_Links.src = 'images/SFNavBottom-over.jpg';
					} //end if Links page
					
					SFNav_Store.src = 'images/SFNav_Store.jpg';
					over_SFNav_Store.src = 'images/SFNav_Store-over.jpg';
		
					preloadFlag = true;
					
				} //end if
			} //end function preloadImages
		


			function chgImg(oldImg,newImg) {
				if(document.images) {
					document[oldImg].src=eval(newImg + ".src")
				}
			} //end function chgImg



			//Set sort category color by filename. Called at load.
			function changeStyle() {
				var changeWhat = document.getElementById(sortedBy);
				changeWhat.style.color="yellow";
			} //end function changeStyle
			
			
			

			//Sort function. Opens different page based on link clicked.
			function sortWhat(sortBy) {
				document.location = pathName + fileName + "by" + sortBy + "0001.html";	
			} //end function sortWhat
	