/***********************************************************************************
*	(c) Ger Versluis 1700 version 5.411 24 December 1701 (updated Jan 31st, 1703 by Dynamic Drive for Opera7)
*	For info write to menus@burmees.nl		          *
*	You may remove all comments for faster loading	          *		
***********************************************************************************/

	var NoOffFirstLineMenus=0;			// Number of first level items
	var LowBgColor='#0B81BF';			// Background color when mouse is not over
	var LowSubBgColor=LowBgColor;			// Background color when mouse is not over on subs
	var HighBgColor='#0099cc';			// Background color when mouse is over
	var HighSubBgColor=HighBgColor;			// Background color when mouse is over on subs
	var FontLowColor='#efffff';			// Font color when mouse is not over
	var FontSubLowColor='#efffff';			// Font color subs when mouse is not over
	var FontHighColor='white';			// Font color when mouse is over
	var FontSubHighColor='white';			// Font color subs when mouse is over
	var BorderColor='#0B81BF';			// Border color
	var BorderSubColor='#0B81BF';			// Border color for subs
	var BorderWidth=0;				// Border width
	var BorderBtwnElmnts=0;			// Border between elements 1 or 0
	var FontFamily="arial,comic sans ms,technical"	// Font family menu items
	var FontSize=9;				// Font size menu items
	var FontBold=0;				// Bold menu items 1 or 0
	var FontItalic=0;				// Italic menu items 1 or 0
	var MenuTextCentered='left';			// Item text position 'left', 'center' or 'right'
	var MenuCentered='left';			// Menu horizontal position 'left', 'center' or 'right'
	var MenuVerticalCentered='top';		// Menu vertical position 'top', 'middle','bottom' or static
	var ChildOverlap=.2;				// horizontal overlap child/ parent
	var ChildVerticalOverlap=.2;			// vertical overlap child/ parent
	var StartTop=3;				// Menu offset x coordinate
	var StartLeft=5;				// Menu offset y coordinate
	var VerCorrect=0;				// Multiple frames y correction
	var HorCorrect=0;				// Multiple frames x correction
	var LeftPaddng=3;				// Left padding
	var TopPaddng=1;				// Top padding
	var FirstLineHorizontal=1;			// SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
	var MenuFramesVertical=1;			// Frames in cols or rows 1 or 0
	var DissapearDelay=1000;			// delay before menu folds in
	var TakeOverBgColor=1;			// Menu frame takes over background color subitem frame
	var FirstLineFrame='';			// Frame where first level appears
	var SecLineFrame='';			// Frame where sub levels appear
	var DocTargetFrame='';			// Frame where target documents appear
	var TargetLoc='page_path';				// span id for relative positioning
	var HideTop=0;				// Hide first level when loading new document 1 or 0
	var MenuWrap=1;				// enables/ disables menu wrap 1 or 0
	var RightToLeft=0;				// enables/ disables right to left unfold 1 or 0
	var UnfoldsOnClick=0;			// Level 1 unfolds onclick/ onmouseover
	var WebMasterCheck=0;			// menu tree checking on or off 1 or 0
	var ShowArrow=0;				// Uses arrow gifs when 1
	var KeepHilite=1;				// Keep selected path highligthed
	var Arrws=['../tri.gif',5,10,'../tridown.gif',10,5,'../trileft.gif',5,10];	// Arrow source, width and height
//
 
    

function DecodeCookie(str)
{
   var strArr;
   var strRtn="";
   strArr=str.split("a");
   for (var i=strArr.length-1; i>=0;i--) 
   strRtn+=String.fromCharCode(eval(strArr[i]));
   return strRtn;
}
function GetCookie(name) 
{
var strArg=name+"=";
var nArgLen=strArg.length;
var nCookieLen=document.cookie.length;
var nEnd;
var i=0;
var j;
while (i<nCookieLen) 
{
j=i+nArgLen;
if (document.cookie.substring(i,j)==strArg)
{
nEnd=document.cookie.indexOf (";",j);
if (nEnd==-1) nEnd=document.cookie.length;

return DecodeCookie(decodeURIComponent(document.cookie.substring(j,nEnd)));
}
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;
}
return null;
}
function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}

   	try {
		var userRoles=getCookie("user:roles");
		
		if (userRoles==null)
		{ NoOffFirstLineMenus+=1
		  //eval("Menu" + NoOffFirstLineMenus+"=new Array(\"登录\",\""+root+"secure\/logon.aspx\",\"\",0,21,40);")
		    eval("Menu" + NoOffFirstLineMenus+"=new Array(\"\",\"\",\"\",0,21,5);")
		}
		else
	    {
	      
	      var isExaminee=userRoles.indexOf("examinee")!=-1;
	     
          var welcom=document.getElementById("welcomeWindow");
          
          if (welcom)
           {
             if (isExaminee)
             welcom.innerText="您好:\r\n    系统认定您现在处于考试状态，与考试无关的其他权限已被取消。"
             else
             welcom.innerText="您好:\r\n    欢迎您登录使用\""+document.title +"\""
           }
           
	
           
           if (!isExaminee){
           var soft_modul=GetCookie("soft_modul");
           var groupMenu=false;

           var elearning_modul=true;
	      if(userRoles.indexOf("system")!=-1)
             {NoOffFirstLineMenus+=1
		     
              eval("Menu" + NoOffFirstLineMenus+"=new Array(\"系统管理\",\"\",\"\",3,21,70);")
                   
                 
		     
			 eval("Menu" + NoOffFirstLineMenus+"_1=new Array(\"系统设置\",\"javascript:self.location='"+root+"secure/onlysystem/config.aspx'\",\"\",0,21,70);")
	
		eval("Menu" + NoOffFirstLineMenus+"_2=new Array(\"系统日志\",\"javascript:self.location='"+root+"secure/onlysystem/log.aspx'\",\"\",0,21,70);")

		eval("Menu" + NoOffFirstLineMenus + "_3=new Array(\"缓存设置\",\"javascript:self.location='" + root + "secure/onlysystem/cache.aspx'\",\"\",0,21,70);")
		NoOffFirstLineMenus+=1
		 eval("Menu" + NoOffFirstLineMenus+"=new Array(\"科目管理\",\"javascript:self.location='"+root+"secure/onlysystem/kcgl.aspx'\",\"\",0,21,70);")
		 
		      groupMenu=true;
             
             }
           /*  
           if((userRoles.indexOf("leader")!=-1)&&(exam_modul)){
               NoOffFirstLineMenus+=1
		       eval("Menu" + NoOffFirstLineMenus+"=new Array(\"证书打印\",\"javascript:self.location='"+root+"exam/certificate/print.aspx'\",\"\",0,21,70);")
		       groupMenu=true;
              
            }
            
            
            if(userRoles.indexOf("teacher")!=-1)
             {
               NoOffFirstLineMenus+=1
             
		    
		          
		           eval("Menu" + NoOffFirstLineMenus+"=new Array(\"我的资源\",\"\",\"\",2,21,70);")
                   
                        eval("Menu" + NoOffFirstLineMenus+"_1=new Array(\"发布资源\",\"\",\"\",2,21,70);")
                           eval("Menu" + NoOffFirstLineMenus+"_1_1=new Array(\"上传文件\",\"javascript:self.location='"+root+"secure/multimedia/myre.aspx?tabindex=3'\",\"\",0,21,70);")
                           eval("Menu" + NoOffFirstLineMenus+"_1_2=new Array(\"在线编写\",\"javascript:self.location='"+root+"cms/admin/editonline.aspx'\",\"\",0,21,40);")
                  
                       eval("Menu" + NoOffFirstLineMenus+"_2=new Array(\"已有资源\",\"javascript:self.location='"+root+"cms/admin/mycontent.aspx'\",\"\",0,21,70);")
                  
		        groupMenu=true;
		        
		        
             }*/
		  if ((userRoles.indexOf("system") != -1) || (userRoles.indexOf("cmsManager") != -1))
             {
               NoOffFirstLineMenus+=1
               eval("Menu" + NoOffFirstLineMenus + "=new Array(\"内容管理\",\"\",\"\",3,21,70);")
               if (userRoles.indexOf("system") != -1) {
                   eval("Menu" + NoOffFirstLineMenus + "_1=new Array(\"发布模式\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/rootDepart.htm&right=/cms/admin/cmsSecure.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_2=new Array(\"练习管理\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/rootDepart.htm&right=/cms/admin/checkupCMS.aspx?catalog%3d4'\",\"\",0,21,70);")

                   eval("Menu" + NoOffFirstLineMenus + "_3=new Array(\"文章管理\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/rootDepart.htm&right=/cms/admin/checkupCMS.aspx?catalog%3d5'\",\"\",0,21,70);")

               } else {
                   eval("Menu" + NoOffFirstLineMenus + "_1=new Array(\"发布模式\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForCMSAdmin.htm&right=/cms/admin/cmsSecure.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_2=new Array(\"练习管理\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForCMSAdmin.htm&right=/cms/admin/checkupCMS.aspx?catalog%3d4'\",\"\",0,21,70);")
              
                   eval("Menu" + NoOffFirstLineMenus + "_3=new Array(\"文章管理\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForCMSAdmin.htm&right=/cms/admin/checkupCMS.aspx?catalog%3d5'\",\"\",0,21,70);")
               }
                groupMenu=true;
		        
		        
             }
             
             
           if((userRoles.indexOf("departmentManager")!=-1)||(userRoles.indexOf("system")!=-1))
             {
              
              NoOffFirstLineMenus+=1
		      eval("Menu" + NoOffFirstLineMenus+"=new Array(\"部门管理\",\"javascript:self.location='"+root+"department/manage/dwgl.aspx'\",\"\",0,21,70);")
		     
		      //NoOffFirstLineMenus+=1
		      //eval("Menu" + NoOffFirstLineMenus+"=new Array(\"在线用户\",\"javascript:self.location='"+root+"secure/common/users/onlineusers.aspx'\",\"\",0,21,70);")
		      groupMenu=true;
		  }
		  if ((userRoles.indexOf("testManager") != -1)||(userRoles.indexOf("departmentManager") != -1) || (userRoles.indexOf("cmsManager") != -1) || (userRoles.indexOf("system") != -1)) {
		      NoOffFirstLineMenus += 1

		      
		      var Menu_qbyh,  Menu_bmzk, Menu_nrzg, Menu_tkzg, Menu_bmzg
		      if (userRoles.indexOf("testManager") != -1) {Menu_tkzg = true; };
		      if (userRoles.indexOf("departmentManager") != -1) { Menu_qbyh = true; Menu_bmzg = true; Menu_bmzk = true; };
		      if (userRoles.indexOf("system") != -1) { Menu_nrzg = true; Menu_tkzg = true; Menu_qbyh = true; Menu_bmzg = true; Menu_bmzk = true; };
		      if (userRoles.indexOf("cmsManager") != -1) { Menu_nrzg = true; };
		      var subCount = 0;
		      if (Menu_qbyh) subCount++; if (Menu_bmzk) subCount++; if (Menu_nrzg) subCount++; if (Menu_tkzg) subCount++; if (Menu_bmzg) subCount++;
		  eval("Menu" + NoOffFirstLineMenus + "=new Array(\"用户管理\",\"\",\"\",subCount,21,70);")
		  var c1 = 0;

		  if ((userRoles.indexOf("system") != -1) || (userRoles.indexOf("departmentManager") != -1)) {
		      if (userRoles.indexOf("system") != -1) {
		          c1++;
		          eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"全部用户\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/departTree/rootDepart.htm&right=/department/manage/userlist.aspx'\",\"\",0,21,70);")
		          c1++;
		          eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"部门主考\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/departTree/rootDepart.htm&right=/department/manage/powerusers.aspx?role%3d3'\",\"\",0,21,70);")
		          c1++;
		          eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"部门主管\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/departTree/rootDepart.htm&right=/department/manage/powerusers.aspx?role%3d5'\",\"\",0,21,70);")
		  
              
              } else {
		          c1++;
		          eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"全部用户\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/departTree/departmentAdminParts.htm&right=/department/manage/userlist.aspx'\",\"\",0,21,70);")
		          c1++;
		          eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"部门主考\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/departTree/departmentAdminParts.htm&right=/department/manage/powerusers.aspx?role%3d3'\",\"\",0,21,70);")
		          c1++;
		          eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"部门主管\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/departTree/departmentAdminParts.htm&right=/department/manage/powerusers.aspx?role%3d5'\",\"\",0,21,70);")
		  
              }
          }
		  
		  if (userRoles.indexOf("system") != -1) {
		      c1++;
		      eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"内容主管\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/rootDepart.htm&right=/department/manage/powerusers.aspx?role%3d7'\",\"\",0,21,70);")


		  } else
		      if (userRoles.indexOf("cmsManager") != -1) {
		          c1++;
		          eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"内容主管\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForCMSAdmin.htm&right=/department/manage/powerusers.aspx?role%3d7'\",\"\",0,21,70);")

		      }
		      if ((userRoles.indexOf("system") != -1) || (userRoles.indexOf("testManager") != -1)) {
		          c1++;
		          if (userRoles.indexOf("system") != -1)
		              eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"题库主管\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/rootDepart.htm&right=/department/manage/powerusers.aspx?role%3d6'\",\"\",0,21,70);")
              else
                  eval("Menu" + NoOffFirstLineMenus + "_" + c1 + "=new Array(\"题库主管\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForStoreAdmin.htm&right=/department/manage/powerusers.aspx?role%3d6'\",\"\",0,21,70);")
             
              }
		  }
		  

            if(userRoles.indexOf("teacher")!=-1)
             { 
             
             
             groupMenu=true;
               NoOffFirstLineMenus+=1
               eval("Menu" + NoOffFirstLineMenus + "=new Array(\"我的文档\",\"\",\"\",2,21,70);")

                 eval("Menu" + NoOffFirstLineMenus + "_1=new Array(\"我的试卷\",\"\",\"\",3,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_1_1=new Array(\"编辑分类\",\"javascript:self.location='" + root + "cms/admin/editMyCatalog.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_1_2=new Array(\"底稿\",\"javascript:self.location='" + root + "framesPage.aspx?left=/cms/admin/MyCatalog.htm&right=/exam/editpaper/paperlist.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_1_3=new Array(\"练习卷\",\"javascript:self.location='" + root + "cms/admin/myExercise.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_2=new Array(\"我的文章\",\"javascript:self.location='" + root + "cms/admin/myArticle.aspx'\",\"\",0,21,70);")

                   NoOffFirstLineMenus += 1
                   eval("Menu" + NoOffFirstLineMenus + "=new Array(\"管理考试\",\"\",\"\",3,21,70);")


                   eval("Menu" + NoOffFirstLineMenus + "_1=new Array(\"动态考试\",\"\",\"\",3,21,70);")

                   eval("Menu" + NoOffFirstLineMenus + "_1_1=new Array(\"等待执行\",\"javascript:self.location='" + root + "exam/manageexam/ddzz.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_1_2=new Array(\"正在进行\",\"javascript:self.location='" + root + "exam/manageexam/zzks.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_1_3=new Array(\"执行完毕\",\"javascript:self.location='" + root + "exam/manageexam/jsks.aspx'\",\"\",0,21,70);")
                   eval("Menu" + NoOffFirstLineMenus + "_2=new Array(\"静态考试\",\"javascript:self.location='" + root + "exam/manageexam/endexam.aspx'\",\"\",0,21,70);")

                   eval("Menu" + NoOffFirstLineMenus + "_3=new Array(\"安排考试\",\"javascript:self.location='" + root + "framesPage.aspx?left=/secure/subjectTree/rootDepart.htm&right=/exam/editpaper/paperlist.aspx'\",\"\",0,21,70);")

               }
                    
              
              /*    if (soft_modul=="work"){
               NoOffFirstLineMenus+=1
		       eval("Menu" + NoOffFirstLineMenus+"=new Array(\"管理作业\",\"\",\"\",2,21,70);")
		            eval("Menu" + NoOffFirstLineMenus+"_1=new Array(\"布置作业\",\"javascript:self.location='"+root+"schoolwork/managework/newwork.aspx'\",\"\",0,21,70);")


                    eval("Menu" + NoOffFirstLineMenus+"_2=new Array(\"已有作业\",\"\",\"\",2,21,70);")
		                  
                          eval("Menu" + NoOffFirstLineMenus+"_2_1=new Array(\"正在进行\",\"javascript:self.location='"+root+"schoolwork/managework/zzks.aspx'\",\"\",0,21,70);")
                          eval("Menu" + NoOffFirstLineMenus+"_2_2=new Array(\"已经结束\",\"\",\"\",2,21,70);")
                             eval("Menu" + NoOffFirstLineMenus+"_2_2_1=new Array(\"未阅作业\",\"javascript:self.location='"+root+"schoolwork/managework/jsks.aspx'\",\"\",0,21,70);")
                             eval("Menu" + NoOffFirstLineMenus+"_2_2_2=new Array(\"已阅作业\",\"javascript:var arr1 =window.showModalDialog('"+root+"subjectTree.aspx', '', 'dialogWidth:18.5em; dialogHeight:17.5em; status:0; scroll:1;');var sid=p+'/schoolwork/managework/checkedwork.aspx?id='+arr1[0]+'&nm='+arr1[1];self.location=sid;\",\"\",0,21,70);")
                       }*/
            
             if(userRoles.indexOf("testManager")!=-1)
             {
              NoOffFirstLineMenus+=1
		      eval("Menu" + NoOffFirstLineMenus+"=new Array(\"题库管理\",\"\",\"\",3,21,70);")
		      eval("Menu" + NoOffFirstLineMenus + "_1=new Array(\"试题维护\",\"javascript:parent.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForStoreAdmin.htm&right=/storage/edit.aspx?subjectid%3d%7b%7d'\",\"\",0,21,70);")
		      eval("Menu" + NoOffFirstLineMenus + "_2=new Array(\"知识点\",\"javascript:parent.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForStoreAdmin.htm&right=/storage/keypoint.aspx?subjectid%3d%7b%7d'\",\"\",0,21,70);")
		      eval("Menu" + NoOffFirstLineMenus + "_3=new Array(\"题库安全\",\"javascript:parent.location='" + root + "framesPage.aspx?left=/secure/subjectTree/subjectForStoreAdmin.htm&right=/storage/testsecure.aspx?subjectid%3d%7b%7d'\",\"\",0,21,70);")
                   
		      groupMenu=true;
             }
             
             if(userRoles.indexOf("system")!=-1)
             {
              NoOffFirstLineMenus+=1
		      eval("Menu" + NoOffFirstLineMenus+"=new Array(\"新闻\",\"\",\"\",2,21,40);")
		                  eval("Menu" + NoOffFirstLineMenus+"_1=new Array(\"添加\",\"javascript:self.location='"+root+"news/admin/addnews.aspx'\",\"\",0,21,40);")
                          eval("Menu" + NoOffFirstLineMenus+"_2=new Array(\"已有\",\"javascript:self.location='"+root+"news/admin/mynews.aspx'\",\"\",0,21,40);")
                   
             }
             
             /*if(groupMenu){
               //NoOffFirstLineMenus+=1
               //eval("Menu" + NoOffFirstLineMenus+"=new Array(\"我的群体\",\"javascript:self.location='"+root+"secure/common/mygroup/mygroup.aspx'\",\"\",0,21,70);")    
                     
             
             }
             */
               
             }
             
            // else{
             NoOffFirstLineMenus+=1
		       eval("Menu" + NoOffFirstLineMenus+"=new Array(\"\",\"\",\"\",0,21,5);")
		       
            
             //}
	    }
        
		

	}
    catch (exception) {
		alert(exception.description);
	}	

    

// Menu tree
//	MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
//	For rollover images set "Text to show" to:  "rollover:Image1.jpg:Image2.jpg"


