<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/enrgise-html.tld" prefix="enrgise" %>
<%@ page import="java.util.*" %>
<%@ page import="wenrgise.common.bean.DynamicMenuBean" %>
<%@ page import="wenrgise.common.utility.UserInfo" %>
<%@ page import="org.apache.struts.util.RequestUtils" %>
<%@ page import="wenrgise.ejb.common.utility.ParamUtil" %>
<table cellSpacing=0 bgColor=#ffffff>
  <TR> 
  <td class = "userText">
    <img src="../includes/images/Brand_Final.gif">
    <div  id="divLogin" style="position:absolute; left:250px; top:80px; height:2px; z-index:2"> 
    
    
    <!-- For User And Site -->
    
    <% 
        String empLoyeeNumber = new String();
        String empLoyeeName = new String();
        String siteCode = new String();
        String siteName = new String();
        
        try
        {
            String sessionBeanName = ParamUtil.getSessionBeanName();
            UserInfo oUserInfo = (UserInfo)RequestUtils.lookup(pageContext, sessionBeanName, "userInfo", "session");
            
            if(null != oUserInfo)
            {
                empLoyeeNumber = oUserInfo.getUserId();
                empLoyeeName = oUserInfo.getUserName();
                siteCode = oUserInfo.getSiteCode();
                siteName =  oUserInfo.getSiteName();     
            }
        }
        catch(Exception oEx)
        {
            oEx.printStackTrace();
        }
        
    %>
    
    
      <%="User: "+empLoyeeName+"["+empLoyeeNumber+"]"%>
      <%="Location: "+siteName+"["+siteCode+"]"%>
   <!-- For User And Site -->
    
    </div>
  </td>
</TR>
</TABLE>
<script>

//Menu object creation
MyMenu=new makeCM("MyMenu") //Making the menu object. Argument: menuname

MyMenu.frames = 0

//Menu properties   
MyMenu.pxBetween=10 //10
MyMenu.fromLeft=0 
MyMenu.fromTop=102 //0   
MyMenu.rows=1 
MyMenu.menuPlacement="center"
                                                             
MyMenu.offlineRoot="" 
MyMenu.onlineRoot="" 
MyMenu.resizeCheck=1 
MyMenu.wait=1000 
MyMenu.fillImg="cm_fill.gif"
MyMenu.zIndex=1

//Background bar properties
MyMenu.useBar=1
MyMenu.barWidth="100%"
MyMenu.barHeight="menu" 
MyMenu.barClass="clBar"
MyMenu.barX=0 //10 
MyMenu.barY=102 //0
MyMenu.barBorderX=0
MyMenu.barBorderY=0
MyMenu.barBorderClass=""

MyMenu.onresize="makeCM('MyMenu'); MyMenu.construct(1);"

//Level properties - ALL properties have to be spesified in level 0
MyMenu.level[0]=new cm_makeLevel() //Add this for each new level
MyMenu.level[0].width=74 //130
MyMenu.level[0].height=25 
MyMenu.level[0].regClass="clLevel0"
MyMenu.level[0].overClass="clLevel0over"
MyMenu.level[0].borderX=0
MyMenu.level[0].borderY=1
MyMenu.level[0].borderClass="clLevel0border"
MyMenu.level[0].offsetX=0
MyMenu.level[0].offsetY=0
MyMenu.level[0].rows=0
MyMenu.level[0].arrow=0
MyMenu.level[0].arrowWidth=0
MyMenu.level[0].arrowHeight=0
MyMenu.level[0].align="bottom"

//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
MyMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
MyMenu.level[1].width=180 //200
MyMenu.level[1].height=22
MyMenu.level[1].regClass="clLevel1"
MyMenu.level[1].overClass="clLevel1over"
MyMenu.level[1].borderX=1
MyMenu.level[1].borderY=1
MyMenu.level[1].align="right" 
MyMenu.level[1].offsetX=0//-(MyMenu.level[0].width-2)/2+20
MyMenu.level[1].offsetY=0
MyMenu.level[1].borderClass="clLevel1border"


//EXAMPLE SUB LEVEL[2] PROPERTIES - You have to spesify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this
MyMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number)
MyMenu.level[2].width=180 //200
MyMenu.level[2].height=20
MyMenu.level[2].offsetX=0
MyMenu.level[2].offsetY=0
MyMenu.level[2].regClass="clLevel2"
MyMenu.level[2].overClass="clLevel2over"
MyMenu.level[2].borderClass="clLevel2border"


/******************************************
Menu item creation:

*************************************/

<% ArrayList menuList=new ArrayList();
menuList=(ArrayList)session.getAttribute("menuList"); 
int i=0;
DynamicMenuBean oBean=new DynamicMenuBean();
if(menuList!=null)
{
i=menuList.size()-1;
while(i>=0)
{
  
  oBean = (DynamicMenuBean)menuList.get(i);
  out.println(oBean.getDynamicMenu());
  i--;
}
}
%>
 


//Leave this line - it constructs the menu
MyMenu.construct()		

//MyMenu.showsub("top3")
MyMenu.hidesub()
</script>
