/***********************************************************************************
*	(c) Ger Versluis 2000 version 5.411 24 December 2001 (updated Jan 31st, 2003 by Dynamic Drive for Opera7)
*	For info write to menus@burmees.nl		          *
*	You may remove all comments for faster loading	          *		
***********************************************************************************/

//Last Changed: July17/2004 steen added demographics button

if (typeof(hmssa) == "undefined") {
	document.write("<scr"+"ipt src='/ismpcmenu.js'></scr"+"ipt>");			// Do not show hmmsa menu since not signed in yet
} else {
	var menuWidth=138;
	
	var LowBgColor='#eaf2ff';			
	var LowSubBgColor='#eaf2ff';			
	var HighBgColor='#b22222';	
	var HighSubBgColor='#b22222';
	var FontLowColor='#000099';	
	var FontSubLowColor='#000099';	
	var FontHighColor='white';	
	var FontSubHighColor='white';
	var BorderColor='#000099';	
	var BorderSubColor='#000099';	
	
	var BorderWidth=1;		
	var BorderBtwnElmnts=1;	
	var FontFamily="verdana,arial,helvetica,sans-serif"
	var FontSize=8;			
	var FontBold=0;			
	var FontItalic=0;		
	var MenuTextCentered='left';
	var MenuCentered='left';			
	var MenuVerticalCentered='static';	
	var ChildOverlap=.2;				
	var ChildVerticalOverlap=.2;	
	var StartTop=150;	
	var StartLeft=8;	
	var VerCorrect=0;
	var HorCorrect=0;	
	var LeftPaddng=3;
	var TopPaddng=2;	
	var FirstLineHorizontal=0;	
	var MenuFramesVertical=1;			
	var DissapearDelay=600;	
	var TakeOverBgColor=1;	
	var FirstLineFrame='navig';
	var SecLineFrame='space';
	var DocTargetFrame='space';	
	var TargetLoc='';			
	var HideTop=1;	
	var MenuWrap=0;		
	var RightToLeft=0;	
	var UnfoldsOnClick=0;	
	var WebMasterCheck=0;
	var ShowArrow=1;		
	var KeepHilite=1;			
	var Arrws=['../images/tri.gif',5,10,'../images/tridown.gif',10,5,'../images/trileft.gif',5,10];	

function menuPdfPrn(prnPage){
  menuLevel++;
  menuCode ="var Menu" + menuLevel + "=new Array('Print Graph', "+'"';
  menuCode+="javascript:newWin=window.open('" + prnPage + "', 'newWin',";
  menuCode+="'scrollbars=yes, resizable=yes, width=780, height=400'); try {newWin.focus();} " 
  menuCode+=" catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0, 18, 148);';
  return menuCode;	
}
	
function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}

	var menuLevel = 1;	
	var popUpMess= ' error - Program possibly stopped by a pop-up blocker';
	
//	eval("var Menu" + menuLevel + "=new Array('CEC Home', 'mssalogout.php?home=yes', '', 0, 18, 148);");		// home
	eval("var Menu" + menuLevel + "=new Array('" + HOME_MENU_TEXT + "', 'mssalogout.php?home=yes', '', 0, 18, " + menuWidth + ");");		// home
	menuLevel++;
	demographics="var Menu" + menuLevel + "=new Array('" + VIEW_DEMO_TEXT +"', '"+DEMO_PAGE+"','',0);";
	eval(demographics);
	if (typeof(NEW_SURVEY_TEXT)!="undefined"){			//no fly-outs with 'New Survey'
		menuLevel++
		newSurvey="var Menu" + menuLevel + "=new Array('" + NEW_SURVEY_TEXT +"', " +'"';
		newSurvey+="javascript: newWin=window.open('questions.php?pgStart=1', 'newWin',";
		newSurvey+="'scrollbars=yes, resizable=yes, width=780, height=400'); location.reload(); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0);';
		eval(newSurvey);
	}

	var updateCount=0;
	while (++updateCount<=UPDATE_SURVEY_COUNT){				//no fly-outs with 'Update Survey'
		updateLabel=eval("UPDATE_SURVEY_TEXT"+updateCount);
		updateAsses=eval("UPDATE_SURVEY_ASSESS"+updateCount);
		updateVersion=eval("UPDATE_SURVEY_VERSION"+updateCount);
//		updateDate=eval("UPDATE_SURVEY_DATE"+updateCount);
		menuLevel++;
		updateSurvey="var Menu" + menuLevel + "=new Array('" + updateLabel +"', " +'"';
		updateSurvey+="javascript:newWin=window.open('questions.php?pgUpdate=1&pgAsses=" + updateAsses + "&pgVersion=" + updateVersion +"', 'newWin',";
		updateSurvey+="'scrollbars=yes, resizable=yes, width=780, height=400'); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0);';
		eval(updateSurvey);
	}
	var printCount=0;
	if (0<DONE_SURVEY_COUNT){
		menuLevel++;
		eval("var Menu" + menuLevel + "=new Array('" + PRINT_SURVEY_TEXT + "', '', '', " + DONE_SURVEY_COUNT+");");
	}
	while (++printCount<=DONE_SURVEY_COUNT){			//menu flyouts with 'Print Survey'
		printAsses=eval("DONE_SURVEY_ASSESS"+printCount);
		printVersion=eval("DONE_SURVEY_VERSION"+printCount);
		printDate=eval("DONE_SURVEY_DATE"+printCount);
		printSurvey="var Menu" + menuLevel + "_" + printCount + "=new Array('" + printDate + "', " +'"';
		printSurvey+="javascript:newWin=window.open('assesprn.php?pgAsses=" + printAsses + "&pgVersion=" + printVersion +"', 'newWin',";
		printSurvey+="'scrollbars=yes, resizable=yes, width=780, height=400');  try {newWin.focus();} catch(e){alert(e.description + '" + popUpMess + "');}" + '", "", 0, 18, 148);';
		eval(printSurvey);
	}

	var viewCount=0;
	if (0<VIEW_SURVEY_COUNT){
		menuLevel++;
		eval("var Menu" + menuLevel + "=new Array('" + VIEW_SURVEY_TEXT + "', '', '', " + VIEW_SURVEY_COUNT+");");
	}
	while (++viewCount<=VIEW_SURVEY_COUNT){
		viewAsses=eval("VIEW_SURVEY_ASSESS"+viewCount);				//menu flyouts with 'View Survey'
		viewVersion=eval("VIEW_SURVEY_VERSION"+viewCount);				//menu flyouts with 'View Survey'
		viewDate=eval("VIEW_SURVEY_DATE"+viewCount);
		viewSurvey="var Menu" + menuLevel + "_" + viewCount + "=new Array('" + viewDate + "', " +'"';
		viewSurvey+="javascript:newWin=window.open('questions.php?pgView&pgAsses=" + viewAsses + "&pgVersion=" + viewVersion +"', 'newWin',";
		viewSurvey+="'scrollbars=yes, resizable=yes, width=780, height=400'); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0, 18, 148);';
		eval(viewSurvey);
	}

	var aggCount=0; 
	if (0<DONE_SURVEY_COUNT){
		menuLevel++;
		eval("var Menu" + menuLevel + "=new Array('" + AGGR_SURVEY_TEXT + "', '', '', " + DONE_SURVEY_COUNT+");");
	}
	while (++aggCount<=DONE_SURVEY_COUNT){
		aggAsses=eval("DONE_SURVEY_ASSESS"+aggCount);
		aggVersion=eval("DONE_SURVEY_VERSION"+aggCount);
		aggDate=eval("DONE_SURVEY_DATE"+aggCount);
		aggSurvey="var Menu" + menuLevel + "_" + aggCount + "=new Array('" + aggDate + "', '";
		aggSurvey += GRAPH_AGGREGATE + "?pgAsses=" + aggAsses + "&pgVersion=" + aggVersion +  "&pgDate=" + aggDate + "','', 0, 18, 148)";
		eval(aggSurvey);		
	}

	if (typeof(SELF_SURVEY_TEXT)!="undefined"){
		menuLevel++
		selfCompare="var Menu" + menuLevel + "=new Array('" + SELF_SURVEY_TEXT +"', '"+GRAPH_SELF+"','',0);";
		eval(selfCompare);
	}
	if (typeof(REGION_TEXT)!="undefined"){	
		menuLevel++
		region="var Menu" + menuLevel + "=new Array('" + REGION_TEXT +"', '"+GRAPH_REGION+"','',0);";
		eval(region);
	}
	if (typeof(curprog)!="undefined") {
		if (curprog =="mssacomp") {
			menuLevel++
			prnopt="var Menu" + menuLevel + "=new Array('Print Graph', "+'"';
			prnopt+="javascript:newWin=window.open('compareprn.php', 'newWin',";
			prnopt+="'scrollbars=yes, resizable=yes, width=780, height=400'); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0, 18, 148);';
			eval(prnopt);		
		}
		else if (curprog =="mssacompself") {
			menuLevel++
			prnopt="var Menu" + menuLevel + "=new Array('Print Graph', "+'"';
			prnopt+="javascript:newWin=window.open('compareselfprn.php', 'newWin',";
			prnopt+="'scrollbars=yes, resizable=yes, width=780, height=400'); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0, 18, 148);';
			eval(prnopt);		
	    }
		else if (curprog =="mssacompreg") {
			menuLevel++
			prnopt="var Menu" + menuLevel + "=new Array('Print Graph', "+'"';
			prnopt+="javascript:newWin=window.open('compregprn.php', 'newWin',";
			prnopt+="'scrollbars=yes, resizable=yes, width=780, height=400'); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0, 18, 148);';
			eval(prnopt);		
	    }
		else if (curprog =="demo") {
			menuLevel++
			prnopt="var Menu" + menuLevel + "=new Array('Print Graph', "+'"';
			prnopt+="javascript:newWin=window.open('demoprn.php', 'newWin',";
			prnopt+="'scrollbars=yes, resizable=yes, width=780, height=400'); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');}" + '", "", 0, 18, 148);';
			eval(prnopt);		
	    }
		else if ("compBc1"==curprog) 
		  eval( menuPdfPrn('compBc1prn.php') );
	    else if ("compBc2"==curprog) 
		  eval( menuPdfPrn('compBc2prn.php') );
	    else if ("compBc3"==curprog) 
		  eval( menuPdfPrn('compBc3prn.php') );
	    else if ("compBc4"==curprog) 
		  eval( menuPdfPrn('compBc4prn.php') );
	    else if ("compBc5"==curprog) 
		  eval( menuPdfPrn('compBc5prn.php') );
	    else if ("compBc6"==curprog) 
		  eval( menuPdfPrn('compBc6prn.php') );
	    else if ("compBc7"==curprog) 
		  eval( menuPdfPrn('compBc7prn.php') );
	    else if ("compBc8"==curprog) 
		  eval( menuPdfPrn('compBc8prn.php') );
	}
	if (typeof(COORD_PAGE)!="undefined"){
		if (COORD_PAGE == "aggmenu.php") {
			
			menuLevel++
			coord="var Menu" + menuLevel + "=new Array('Aggregate Data Only', 'aggregate/aggmenu.php','',0);";
			eval(coord);
		} else {

			menuLevel++
			coord="var Menu" + menuLevel + "=new Array('High Level Compare', '"+COORD_PAGE+"','',0);";
			eval(coord);
		}
	}

	menuLevel++;
	exit="var Menu" + menuLevel + "=new Array('Log Out', "+'"';
	exit+="javascript:newWin=window.open('close.php', 'newWin'); try {newWin.focus();} catch(e){alert(e.description +'" + popUpMess + "');} location='index.htm'; " + '", "", 0, 18, 148);';
	eval(exit);		

	var NoOffFirstLineMenus=menuLevel;		//make sure the number of menu items is consistant with menu program
} // end else

