//image array for main nav menu bar
var dama_coc_tagline = "DAMA COC - Your home for data and information management in Central Ohio";
var nb_menu_items = 8;//was 7 added a noshow item
var nb_submenu_items = 6;
var nb_bullets = 1;
var curArea = "";// a numeric value that is the index of the menuName array
var curSubMenu = "";
var menuName =  new Array( "home", "member", "chapter", "events", "board", "sponsor", "contact", "noshow");
var subMenuName = new Array ( "smhome", "smmember", "smchapter", "smevents", "smboard", "smsponsor" , "smcontact" );
var statusText = new Array( "DAMA COC - Your home for data and information management in Central Ohio",
"DAMA COC Membership - it pays to belong. Find out about DAMA COC membership",
"Information about the Central Ohio Chapter of DAMA",
"Information about the next DAMA COC meeting, meeting presentations and other data management events",
"Meet the DAMA COC Board Members and find out information about the board positions",
"Meet our DAMA COC Sponsors - and see how you or your company or organization can become a sponsor.",
"Contact information for DAMA COC");

var imgOut = new Array();
var imgOver =  new Array();
var imgCur = new Array();
var bulletsOut = new Array();
var bulletsOver = new Array();

//build the arrarys of immages for the main menu
for(i=0; i<nb_menu_items; i++){
	imgOut[i] = new Image();
	imgOver[i] = new Image();
	imgCur[i] = new Image();

	switch(i){
	case 0 :
		imgOut[i].src =	"images/mn/home_out.gif";
		imgOver[i].src = "images/mn/home_over.gif";
		imgCur[i].src = "images/mn/home_cur.gif";
		break;
	case 1 :
		imgOut[i].src = "images/mn/member_out.gif";
		imgOver[i].src = "images/mn/member_over.gif";
		imgCur[i].src = "images/mn/member_cur.gif";
		break;
	case 2 :
		imgOut[i].src = "images/mn/chapter_out.gif";
		imgOver[i].src = "images/mn/chapter_over.gif";
		imgCur[i].src = "images/mn/chapter_cur.gif";
		break;
	case 3 :
		imgOut[i].src = "images/mn/events_out.gif";
		imgOver[i].src = "images/mn/events_over.gif";
		imgCur[i].src = "images/mn/events_cur.gif";
		break;
	case 4 :
		imgOut[i].src = "images/mn/board_out.gif";
		imgOver[i].src = "images/mn/board_over.gif";
		imgCur[i].src = "images/mn/board_cur.gif";
		break;
	case 5 :
		imgOut[i].src = "images/mn/sponsor_out.gif";
		imgOver[i].src = "images/mn/sponsor_over.gif";
		imgCur[i].src = "images/mn/sponsor_cur.gif";
		break;
	case 6:
	    imgOut[i].src = "images/mn/contact_out.gif";
		imgOver[i].src = "images/mn/contact_over.gif";
		imgCur[i].src = "images/mn/contact_cur.gif";
		break;

	default:
		imgOut[i].src = "images/mn/mn_out_c.gif";
		imgOver[i].src = "images/mn/mn_over_c.gif";
		//imgCur[i].src = "image/mn_out.gif";
	}
}//end of loop to create image arrays

//build the arrarys of immages for the bullets
for(i=0; i<nb_bullets; i++){
	bulletsOut[i] = new Image();
	bulletsOver[i] = new Image();

		bulletsOut[i].src = "images/footer/bullet0out.gif";
		bulletsOver[i].src = "images/footer/bullet0over.gif";
}//end of loop to create image arrays for bullets

//////////////////////////////// function to show sub menus /////////////////
function showSubMenu(menu){
if (document.all) {
		//alert('Showing IE stuff for: ' + menu);
		if(document.all[menu]){
			document.all[menu].style.visibility = "visible";
		}
	}
else if(document.layers) {
		//alert('Showing Netscape stuff');
	}
else if(document.getElementById){
		//alert('Newer browser');
		if(document.getElementById(menu)){
			document.getElementById(menu).style.visibility = "visible";
		}
	}
}// end of function

//////////////////////////////// function to hide sub menus /////////////////
function hideSubMenu( ){
//loop through submenus to hide them
for(i=0; i< subMenuName.length; i++){
	curSubMenu = subMenuName[i];
	//alert('Hiding submenu: ' + curSubMenu);

	if(document.getElementById) {
		document.getElementById(curSubMenu).style.visibility = 'hidden';
	}else if (document.all) {
		//alert("IE - Hiding the menu " + curSubMenu);
		if(document.all(curSubMenu)){
			document.all(curSubMenu).style.visibility = "hidden";
		}
		
	}
	else if(document.layers){
		document.layers[curSubMenu].visibility = 'hidden';
	}

}
return true;
}//end of function

//////////////////////////////// function to set menus /////////////////
function setMenu(menu, obj, direction, menuobj){
//alert("The current area is: " + curArea + "\nThe current direction is " + direction);
if(menu == "main"){
	resetMenus('main') //hide all layers and reset all images
	//alert('Setting the menu bar to: ' + menuName[menuobj]);

	switch(menuName[menuobj]){ //set the status bar according to the menu
		case "home":
			if(direction == 'out'){
				document.images.home.src = imgCur[0].src;
			}
			else if(curArea != 0){ 
				//alert('Resetting home to HOME OVER');
				document.images.home.src = imgOver[0].src; 
			}
			setStatusText(menuobj);
			hideSubMenu();   //set menu layer visible
			showSubMenu("smhome"); //hide other submenus set this submenu layer visible
			break;

		case "member":
			if(direction == 'out'){
				document.images.member.src = imgCur[1].src;
			}
			else if(curArea != 1){
				//alert('Setting the member image to MEMBER OVER');
				document.images.member.src = imgOver[1].src; 
			}
			setStatusText(menuobj);
			hideSubMenu();
			showSubMenu("smmember"); //hide other submenus set this submenu layer visible
			break;
		
		case "chapter":
			if(direction == 'out'){
				document.images.chapter.src = imgCur[2].src;
			}
			else if(curArea != 2){ 
				//alert('Resetting home to CHAPTER OVER');
				document.images.chapter.src = imgOver[2].src; 
			}
			setStatusText(menuobj);
			hideSubMenu();
			showSubMenu("smchapter"); //hide other submenus set this submenu layer visiblee
			break;

		case "events":
			if(direction == 'out'){
				document.images.events.src = imgCur[3].src;
			}
			else if(curArea != 3){
				document.images.events.src = imgOver[3].src; 
			}
			setStatusText(menuobj);
			hideSubMenu();
			showSubMenu("smevents"); //hide other submenus set this submenu layer visible
			break;

		case "board":
			if(direction == 'out'){
				document.images.board.src = imgCur[4].src;
			}
			else if(curArea != 4){ 
				//alert('Setting to BOARD OVER');
				document.images.board.src = imgOver[4].src; 
			}
			setStatusText(menuobj);
			hideSubMenu();
			showSubMenu("smboard"); //hide other submenus set this submenu layer visible
			break;
			
		case "sponsor":
			if(direction == 'out'){
				document.images.sponsor.src = imgCur[5].src;
			}
			else if(curArea != 5){
				document.images.sponsor.src = imgOver[5].src; 
			}
			setStatusText(menuobj);
			hideSubMenu();  
			showSubMenu("smsponsor"); //hide other submenus set this submenu layer visible
			break;

		case "contact":
			if(direction == 'out'){
				document.images.contact.src = imgCur[6].src;
			}
			else if(curArea != 6){ 
				document.images.contact.src = imgOver[6].src; 
			}
			setStatusText(menuobj);
			hideSubMenu();            //set menu layer visible
			showSubMenu("smcontact"); //hide other submenus set this submenu layer visible
			break;

		default :
			//alert("Setting menu options with the default switch");
			window.status = "DAMA COC - Your home for data and information management in Central Ohio";
			hideSubMenu();
			break;
	} //end of mn image and status bar switch
}else if(menu == "footer"){
	if(direction == 'over'){
		//alert('Changing the footer image ' + obj + ' to another source');
		eval('document.images.' + obj + '.src = bulletsOver[menuobj].src');
		return true;
	}else{
		eval('document.images.' + obj + '.src = bulletsOut[menuobj].src');
		return true;
		}
	}
} //end function

//////////////////////////////// function to reset menus /////////////////
function resetMenus(menu){

if(menu == "main"){
	for(i=0; i<nb_menu_items; i++){
	//alert('Resetting the main menu, the current area is: ' + curArea);
	
		switch(menuName[i]){ //reset all images and the secondary menu bar's visibility
			case "home":
				if(curArea != 0){
					document.images.home.src = imgOut[0].src; 
				}
				break;
			case "member":
				if(curArea != 1){
					document.images.member.src = imgOut[1].src; 
				}
				break;
			case "chapter":
				if(curArea != 2){
					document.images.chapter.src = imgOut[2].src; 
				}
				break;
			case "events":
				if(curArea != 3){
					document.images.events.src = imgOut[3].src;
				}
				break;
			case "board":
				if(curArea != 4){
					document.images.board.src = imgOut[4].src;
				}
				break;
			case "sponsor":
				if(curArea != 5){
					//alert("Getting ready to set Sponsor to image out");
					document.images.sponsor.src = imgOut[5].src;
				}
				break;
			case "contact":
				if(curArea != 6){
					document.images.contact.src = imgOut[6].src;
				}
				break;
			default :
				break;
		} //end of switch
		
	} //end of for loop
}else if(menu == "footer"){
	window.status = dama_coc_tagline;
	return true;
}
}//end of function to reset menus

////////////////////////////////////////////////
function setStatusText(area){
//special if-then or switch code to call fancy status text display function

window.status = statusText[area];
} //end function setStatusText


/////////////////////////////change BG Color////////////
function changeBGColor(ojb, color){
	//alert('Inside the background color changer');
	//if (document.getElementById) {
	//	obj.style.backgroundColor = color;
	//}
	//isssue on some pages there's more than table with rowid1 rowid2 etc
} // end function changeBGColor

////////////////////////////////////////////////
function setCurrentArea(area){
		curArea = area;
		subMenuToShow = subMenuName[area];
		showSubMenu(subMenuToShow);
		setStatusText(area);
return true;
} //end function set CurrentArea

 //// function to show emai list sign in form pop up 08/20/2004
function popEmUp( url, title, type ){
var winDims = '';
var newWin;
var newWinStatus = '';
var loadStatusCntr = 0;
var statusPromo = 'DAMA COC Email List Sign Up';

//alert('Launching pop for  ' + url);
winDims = 'width=840,height=580,directories = no,location = no,menubar = no,resizable = yes,scrollbars = no,status = yes,toolbar = no, top=100,left=100';
newWin =  window.open(url, 'emsul', winDims);
newWin.status = statusPromo;

} //end popEmUp
