var vPage = location.pathname;
//get the number just before the ".htm"
var vPage_numb = vPage.substr((vPage.lastIndexOf(".")-1),1)
var vMenu_image = "pic"+vPage_numb;
var vAnchor = eval(vPage_numb-1);
var oMenu_image, oTertiary_menu;

//don't exist yet
function initializeTertiary(){
	oMenu_image = document.getElementById(vMenu_image);
	oTertiary_menu = document.getElementById("tertiary_menu");
	var vCase
	switch(vPage_numb){ //0, 1, 2, 3, where 0 there is no tertiary nav selected.
		case "1":
			vCase = "eat";
			break;
		case "2":
			vCase = "drink";
			break;
		case "3":
			vCase = "dip";
			break;
		default:
			break;
	}
	var vSrc = "../images/menu_3_" + vCase + "_on.jpg"
	oMenu_image.src = vSrc;
	oTertiary_menu.getElementsByTagName("a")[vAnchor].onmouseover = function () {tertiaryOn('pic1',1);}
	oTertiary_menu.getElementsByTagName("a")[vAnchor].onmouseout = function () {tertiaryOff('pic1',1);}
}

if (document.images)
   {
     pic1on= new Image(100,25);
     pic1on.src="../images/menu_3_eat_on.jpg";  
     pic2on= new Image(100,25);
     pic2on.src="../images/menu_3_drink_on.jpg"; 
     pic3on= new Image(100,25);
     pic3on.src="../images/menu_3_dip_on.jpg"; 

     pic1off= new Image(100,25);
     pic1off.src="../images/menu_3_eat_off.jpg";
     pic2off= new Image(100,25);
     pic2off.src="../images/menu_3_drink_off.jpg"; 
     pic3off= new Image(100,25);
     pic3off.src="../images/menu_3_dip_off.jpg"; 
   }
   
function tertiaryOn(imgName,status)
 {
   if (status==0)
    {
      imgOn=eval(imgName + "on.src");
      document.getElementById(imgName).src= imgOn;
//      document.getElementById(imgName).getElementsByTagName("a")[0].src= imgOn;
    }
 }

function tertiaryOff(imgName,status)
 {
   if (status==0)
    {
      imgOff=eval(imgName + "off.src");
       document.getElementById(imgName).src= imgOff;
    }
 }
	function pulseTertiaryMenu(){
		setTimeout("tertiaryOn('pic1',0)", 100); // 100 Milliseconds
		setTimeout("tertiaryOff('pic1',0)", 500); 
	
		setTimeout("tertiaryOn('pic2',0)", 700); 
		setTimeout("tertiaryOff('pic2',0)", 1000); 
	
		setTimeout("tertiaryOn('pic3',0)", 1400); 
		setTimeout("tertiaryOff('pic3',0)", 1750); 
	}
