//blank line

function locationFunction () {
	//get the URL of the current page, convert it to a string and make the string lowercase	
	var location = window.location
	location = location.toString()
	location = location.toLowerCase()
	// alert(location)
	
	// define a new array to contain the pairs necessary to identify the current directory and corresponding div
	currentLocation = new Array();
	
	// directory is a string containing the name of the directory each section of the site is contained in, framed by slashes
	// menuLink is a string containing the unique id of the <a> tag that the menuCurrentLoc class  needs to be applied to
	
	
	currentLocation[0] = new Object();
			currentLocation[0].directory = "/programming/"; 
			currentLocation[0].menuLink = "menuProgramming";
			
	currentLocation[1] = new Object();
			currentLocation[1].directory = "/sales/"; 
			currentLocation[1].menuLink = "menuSales";
	
	currentLocation[2] = new Object();
			currentLocation[2].directory = "/personality/"; 
			currentLocation[2].menuLink = "menuPersonality";
			
	currentLocation[3] = new Object();
			currentLocation[3].directory = "/productionlibrary/"; 
			currentLocation[3].menuLink = "menuProductionLibrary";
			
	currentLocation[4] = new Object();
			currentLocation[4].directory = "/resources/"; 
			currentLocation[4].menuLink = "menuResources";
			
	currentLocation[5] = new Object();
			currentLocation[5].directory = "/tipsheets/"; 
			currentLocation[5].menuLink = "menuTipSheets";	
			
	currentLocation[6] = new Object();
			currentLocation[6].directory = ".jacobsmedia.com/default.asp"; 
			currentLocation[6].menuLink = "menuHome";
currentLocation[7] = new Object();
			currentLocation[7].directory = "/wtda/"; 
			currentLocation[7].menuLink = "menuWTDA";
	
    

    
    
	// initiate a for loop to cycle through the array of site directories
	for (var i=0; i < currentLocation.length; i++) {
	
	// move through the array, checking if the .directory element string is present in the URl of the current page  
	
	if 	(location.match(currentLocation[i].directory))  { 
		// change the class of the corresponding menu item if it matches the current directory
	    
	    if (document.getElementById) { document.getElementById(currentLocation[i].menuLink).className="menuCurrentLoc";
		return;
		}	
		 
	}
	
	else if (location == "http://dev.jacobsmedia.com" || location == "http://dev.jacobsmedia.com/") {

    document.getElementById("menuHome").className="menuCurrentLoc";
	
	}
	
	}
	
}
