//////////////////////////////////// HOVER FIX FOR IE 6 AND BELOW START //////////////////////////////////////////////////////
		startList = function() {
		if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
		node.onmouseover=function() {
		this.className+=" over";
		  }
		  node.onmouseout=function() {
		  this.className=this.className.replace(" over", "");
		   }
		   }
		  }
		 }
		}
//////////////////////////////////// HOVER FIX FOR IE 6 AND BELOW END //////////////////////////////////////////////////////

	
		
//////////////////////////////////// POPUP LINK FOR POINTS STANDINGS - START //////////////////////////////////////////////////////
		// Popup for Standings links
			timeout = false;
			$(document).ready(function() {
				$('#standings, #standings-popup').click(function() {
					$('#standings-popup').show();											  
				});
				$('#standings, #standings-popup').mouseover(function() {
					if(timeout!==false)
						clearTimeout(timeout);
				});
				$('#standings, #standings-popup').mouseout(function() {
					timeout = setTimeout(function() {$('#standings-popup').fadeOut();}, 1000);
				});
			});
//////////////////////////////////// POPUP LINK FOR POINTS STANDINGS - END //////////////////////////////////////////////////////


//////////////////////////////////// LOADS PROPER FUNCTIONS START //////////////////////////////////////////////////////
 	// Loads proper functions
	var nbr_events = 13;
	var aCities = new Array(nbr_events);
 
 	function initialiseDD() {
		yearChange();
		restrictFilename();
		startList();
		
	}
//////////////////////////////////// LOADS PROPER FUNCTIONS END //////////////////////////////////////////////////////



//////////////////////////////////// DRILL DOWN RACE NAV START ////////////////////////////////////////////////////// 
	function yearChange() {
//		var dy = document.getElementById("ddYear");
//		alert(dy.options[dy.selectedIndex].value);
//		switch(dy.options[dy.selectedIndex].value)
 
// move the "_" below to the desired default race:
		aCities = ["Lakeview","Linton","Iuka","Lynnville","Vanleer","Maplesville","Saulsbury","Camden","Bucksnort","Marion","_Salem"," ", " "];
		aCities = ["Red Boiling Springs", "Monterey", "_Horse Cave", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "];
 
		var de = document.getElementById("ddEvent");
		for(i=de.options.length-1;i>=0;i--) {
			de.remove(i);
		}
 
		for(i=(nbr_events-aCities.length);i<nbr_events;i++) {
			var city = document.createElement("OPTION");
			if(aCities[i].match("_")=="_") {
				city.text = aCities[i].replace("_","");
				city.selected = "selected";
			}
			else {
				city.text = aCities[i];
			}
			city.value=String(i+1);
			de.options.add(city);
		}
	}

	function restrictFilename() {
		var dt = document.getElementById("ddType");
		switch(dt.options[dt.selectedIndex].value)
		{ 
			case "MC" :	aFilenames = ["-P2.TXT","_Places","-OVR.TXT","Overall","-LAP.HTM","Laptimes"];break
			case "QD" :	aFilenames = ["-P2.TXT","_Places","-OVR.TXT","Overall","-LAP.HTM","Laptimes"];break
			case "CY" :	aFilenames = ["-P2.TXT","_Places","-LAP.HTM","Laptimes"];break
			case "R"  : aFilenames = ["ACESUM.TXT","Summary"];break
		}
		var df = document.getElementById("ddFilename");
		for(i=df.options.length-1;i>=0;i--) {
			df.remove(i);
		}
		for(i=0;i<aFilenames.length/2;i++) {
			var filename = document.createElement("OPTION");
			if(aFilenames[i*2+1].match("_")=="_") {
				filename.text =aFilenames[i*2+1].replace("_","");
				filename.selected = "selected";
			}
			else {
				filename.text = aFilenames[i*2+1];
			}
			 filename.value=aFilenames[i*2];
			//filename.value=aFilenames[i];
			df.options.add(filename);
		}
	}
	
	function gotofile() {
		var dy = document.getElementById("ddYear");
		var de = document.getElementById("ddEvent");
		var dt = document.getElementById("ddType");
		var df = document.getElementById("ddFilename");
		
 
		// window.location = "http://www.msxc.com/SCOREMACHINE/08ws/" + de.options[de.selectedIndex].value + "/" + dt.options[dt.selectedIndex].value + df.options[df.selectedIndex].value ;
		//window.open("http://www.msxcracing.com/SCOREMACHINE/09ws/" + de.options[de.selectedIndex].value + "/" + dt.options[dt.selectedIndex].value + df.options[df.selectedIndex].value) ;
		window.open("http://www.msxcracing.com/SCOREMACHINE/10ss/" + de.options[de.selectedIndex].value + "/" + dt.options[dt.selectedIndex].value + df.options[df.selectedIndex].value) ;
	
	}
//////////////////////////////////// DRILL DOWN RACE NAV END ////////////////////////////////////////////////////// 
