/*
Menus are created with an array for each.
The first 3 elements are the name+level, the name and the width for the menu
The next 6 are:
The URL
The Link Text
The Prefix that preceeds all menus in the same family
The Level which is how far down the tree a menu is starting with 0 for the parent
Blankwindow which should be an 'x' if you want the link to open in a new window

They are in the following order:
url,text,prefix,childMenu,level,blankWindow
*/

var aboutItems = new Array('aboutItems_0','aboutItems','160'
,baseURL+'/contact.asp','Contact Us','about','','1',''
,baseURL+'/member_benefits.asp','Member Benefits','about','','1',''
,baseURL+'/advertise.asp','Advertise with NCNA','about','','1',''
,baseURL+'/board.asp','Board of Directors','about','','1',''
,baseURL+'/distreg.asp','Regions and Districts','about','aboutDist','1',''
,baseURL+'/offc_docs.asp','Official Documents','about','','1',''
,baseURL+'/position_statements.asp','Position Statements','about','','1',''
)

var aboutDist = new Array('aboutDist_0','aboutDist','160'
,baseURL+'/DistReg/distreg_mountain.asp','Mountain','about','','2',''
,baseURL+'/DistReg/distreg_northeast.asp','Northeast','about','','2',''
,baseURL+'/DistReg/distreg_northwest.asp','Northwest','about','','2',''  
,baseURL+'/DistReg/distreg_southcentral.asp','South Central','about','','2','' 
,baseURL+'/DistReg/distreg_southeast.asp','Southeast','about','','2','' 
,baseURL+'/DistReg/distreg_southwest.asp','Southwest','about','','2','' 
,baseURL+'/DistReg/distreg_triad.asp','Triad','about','','2',''
,baseURL+'/DistReg/distreg_triangle.asp','Triangle','about','','2',''
)

var membershipItems = new Array('membershipItems_0','membershipItems','195'
,baseURL+'/member_benefits.asp','Member Benefits','membership','','1',''
,baseURL+'/docs/NCNA_Membership_Application.pdf','Membership Application (pdf)','membership','','1','x'
,baseURL+'/membership_cost.asp','Member Cost','membership','','1',''
,baseURL+'/members_information.asp','Member Resources','membership','','1',''
)

/*
	The condition showJoin below is used for adding the extra link for Join or Renew online and this
	variable showJoin is basically being assigned the value in includes/header1.asp
	update by Nadeem on 04-06-09
*/

if(showJoin){
	membershipItems.push(baseURL+'/mem_enrol.asp?org=0&rdrtpg=memh')
	membershipItems.push('Join or Renew Online')
	membershipItems.push('membership')
	membershipItems.push('')
	membershipItems.push('1')
	membershipItems.push('')
}

/*  End Nadeem condition*/

var legislativeItems = new Array('legislativeItems_0','legislativeItems','180'
,baseURL+'/ncna_programs.asp','Government Affairs','legislative','','1',''
,baseURL+'/login.asp?rdrtpg=update.asp','Legislative Update','legislative','','1',''
,baseURL+'/pac.asp','Political Action Committee','legislative','','1',''
)

var practiceItems = new Array('practiceItems_0','practiceItems','235'
,baseURL+'/APRN_Information.asp','APRN Information','practice','','1',''
,baseURL+'/gero.asp','Gerontological Nursing','practice','','1',''
,baseURL+'/Practice_CoNI/practice_CoNI_home.asp','Nursing Informatics','practice','','1',''
,baseURL+'/NPCouncil/practice_NP_home.asp','Nurse Practitioners','practice','','1',''
,baseURL+'/Practice_Psych/practice_psych_home.asp','Psychiatric Nursing','practice','','1',''
,baseURL+'/simulation.asp','Simulation','practice','','1',''
,baseURL+'/comm_spp.asp','Standards/Prof. Practice Commission','practice','','1',''
)

var workforceItems = new Array('workforceItems_0','workforceItems','220'
,baseURL+'/WF_Main.asp','Workforce Advocacy Information','workforce','','1',''
,'http://hallmarks.ncnurses.org','Hallmarks','workforce','','1','x'
,baseURL+'/WF_ppacliai.asp','Nurse Liaison','workforce','','1',''
)

var educationItems = new Array('educationItems_0','educationItems','160'
,baseURL+'/ce_approval_process.asp','CE Approval Process','education','','1',''
,baseURL+'/ce_nc_approved_providers.asp','NC Approved Providers','education','','1',''
,baseURL+'/ce_ncna_provided_ce.asp','NCNA Provided CE','education','','1',''
,baseURL+'/ce_comm_education.asp','Education Commission','education','','1',''
,baseURL+'/ce_becoming_RN.asp','Becoming a RN','education','','1',''
,baseURL+'/studentlinks.asp','Student Links','education','','1',''
)

//list of the above menu arrays. A menu array must be in this list in order to be written to the page
var menuList = new Array(
aboutItems
,aboutDist
,membershipItems
,legislativeItems
,practiceItems
,workforceItems
,educationItems
);

//temporary storage space for each menu item
var menuListHolder = new Array();
var linkClicked = false;

function findURL(cell){
	if(!linkClicked){
		URL = cell.childNodes[0].href
		URLTarget = cell.childNodes[0].target
		if(URLTarget==""){
			location.href = URL;
		}else{
			window.open(URL);
		}
	}
	linkClicked = false;
}

//Writes the menus to the page
for(i=0;i<menuList.length;i++){
	menusArray.push(menuList[i].shift());
	divWriter = "<div id=\"" + menuList[i].shift() + "\" class=\"addItemItems\" style=\"width:"+ menuList[i].shift() +"px;\">";
	tempLength = menuList[i].length/6;
	for(n=0;n<tempLength;n++){
		menuListHolder = menuList[i].splice(0,6);
			divWriter = divWriter + "<div id=\"itemMenuItem\" onMouseOver=\"showMenu(this,'";
			if(menuListHolder[3] != ""){
				divWriter = divWriter + "show";
			}else{
				divWriter = divWriter + "hold";
			}
			divWriter = divWriter + "','";
			if(menuListHolder[3] != ""){
				divWriter = divWriter + menuListHolder[3]
			}
				divWriter = divWriter + "','" + menuListHolder[4];
				divWriter = divWriter + "','" + menuListHolder[2] + "'"; 
			
			divWriter = divWriter + ")\" onMouseOut=\"showMenu(this,'hide')\"><div id=\"itemSpace\">";
			divWriter = divWriter + "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=left nowrap onClick=\"findURL(this)\">";		
			divWriter = divWriter + "<a onClick=\"linkClicked=true;\" href=\""+menuListHolder[0]+"\"";
			if(menuListHolder[5] != ""){
				divWriter = divWriter + " target=\"_blank\"";
			}
			divWriter = divWriter + ">"+menuListHolder[1]+"</a></td><td align=right>";
			if(menuListHolder[3] != ""){
				divWriter = divWriter + "<img src=\"/images/menu_arrow.gif\" width=\"7\" height=\"15\" border=\"0\">";
			}
			divWriter = divWriter + "</td></tr></table></div></div>";
	}
	divWriter = divWriter + "</div>";
	document.write(divWriter);
}