var active;// class "active" indicates the page you are currently on
var imageID;
var sectionName;
var index;
var imagesContainerName = "menu";// the id of DIV containing menu images
//var imageSourceBaseName = "../images/menu"; // the first part of the image source :: images/nav_company_on.gif
//var imageBaseName = "topMenuImg"; // the main part of the menu images ID :: topMenuImg_0[1,2,3,..]
//var imageName = ["jobBoard", "employerProfiles", "careerCenter", "eventCalendar", "industryNews", "RFPS"]; //names of images that have rollovers

function rollovers(){
				var elemA, i, elemImg;
				elemA = document.getElementById(imagesContainerName).childNodes;
				for (i = 0; i < elemA.length; i++){
					if(elemA.item(i).nodeType == 1){
						if(elemA.item(i).tagName == "A"){
							elemImg = elemA.item(i).childNodes[0];
							elemImg.onmouseover = swapImage;
							elemImg.onmouseout = swapImage;
						}
					}
					
				}
				
			}
function swapImage(evt){
				var active;// class "active" indicates the page you are currently on
				evt = (evt) ? evt : ((window.event) ? event : null);
				if(evt) {
					var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
					if(elem) {
						imageID = elem.id;
						sectionName = imageID.substring(parseInt(imageID.indexOf("_") + 1));
						
						var elemA = elem.parentNode;
						
						if(elemA.className == "active") {
							active = true;
						}else{
							active = false;
						}
					}
				}
				
				index = getIndex(sectionName);
				var img = document.getElementById(imageID);
					if(img){
						var strDir;
						switch (evt.type){
							case "mouseover":
								strDir = "_on";
								break;
							case "mouseout":
								
								if(active){
									strDir = "";
								}else{
									strDir = "_off";
								}
								
								break;
						}
						
						img.src = imageSourceBaseName + "_" + sectionName + strDir +".gif";
						//window.status = "";
					}
				
				
				return true;
				
			}	
			
function getIndex (strName) {
			var i, result = 100;// 100 is just a big number. It will be returned if there is NO matching menu for the topNav image
			for (i = 0; i < imageName.length; i++){
				if(imageName[i] == strName) {
					result = i;
					break;
				}
			}
			return result;
		}