// ---------------------------------
//  stuff to get the top directory name out of the URL
//----------------------------------

if ( document.images ) {

	var strPath = new String(window.location.pathname);		
	// get rid of the first slash
	strPath = strPath.substring(1,strPath.length);
	// get the index of the next slash
	var intDirEnd = strPath.indexOf("/");
	// get the index of the last slash
	var intLastSlash = strPath.lastIndexOf("/");
	// get the filename as a string
	var strFName = strPath.substring(intLastSlash + 1, strPath.length);
	
	// get the top dir as a string
	strPath = strPath.substring(0,intDirEnd);
	
	var imgChangeName = "";
		
	switch (strPath) 
	{ 
		case "newplayers" : 
			imgChangeName = "menu2";
			break; 
		case "domains" : 
			imgChangeName = "menu3";
			break; 
		case "guilds" : 
			imgChangeName = "menu4";
			break; 
		case "races" : 
			imgChangeName = "menu5";
			break; 
		case "history" : 
			imgChangeName = "menu6";
			break; 
                case "FAQ":
		case "help" : 
			imgChangeName = "menu7";
			break; 
		case "usage" : 
			imgChangeName = "menu7";
			break; 
                case "boards" :
		case "people" : 
			imgChangeName = "menu8";
			break; 
		case "parties" : 
			imgChangeName = "menu8";
			break; 
		case "guestbook" : 
			imgChangeName = "menu9";
			break; 
		case "links" : 
			imgChangeName = "menu10";
			break; 
		case "wiz" : 
			imgChangeName = "menu11";
			break; 
	} 
	
	switch (strFName) {
		case "guestbook.cgi" : 
			imgChangeName = "menu9";
			break; 
		case "links.cgi" : 
			imgChangeName = "menu10";
			break; 
		case "boards.cgi" :
                        imgChangeName = "menu8";
                        break;
	} 
}
		
// ---------------------------------
// activation scripts
//----------------------------------
		
// flip to the "off" image
function img_act2(imgName) {

        if (document.images) {
                imgOn = eval(imgName + "off.src");
                document [imgName].src = imgOn;
        }
}

// flip to the "on" image
function img_inact2(imgName) {        
        if (document.images && imgChangeName != imgName ) {
			imgOff = eval(imgName + "on.src");
			document [imgName].src = imgOff;
	}
}

// for party photos	
function openFinger(strURL) {
	if ( window.opener ) {
		window.opener.document.location.href = strURL;
	} else {
		document.location.href = strURL;
	}
	return;
}
	
//-->
