document.write("<script language='javascript' src='js/search.js'></script>");

var htmlblock = "<TR><TD class=##CLASS## vAlign=center>" 
		+ "<IMG id=objMenuTreeNav1_imgBegin5 height=8 src='images/spacer.gif'" 
        + "    width=##WIDTH## align=middle border=0><IMG height=24 alt=''"
        + "    src='images/NavArrowMainClosed.gif' width=5 align=absMiddle" 
        + "    border=0><IMG height=8 alt='' src='images/spacer.gif' width=8" 
        + "    border=0><A class=##LINKCLASS## id=objMenuTreeNav1_aLink5" 
        + "    href='##URL##'>##TEXT##</A><br><IMG height=2 alt=''"
        + "    src='images/NavLine.gif' width=232 border=0></TD>"
        + "  </TR>";
        
var htmlblock2 = "<TR><TD class=left-navigation vAlign=center>" 
		+ "<IMG id=objMenuTreeNav1_imgBegin5 height=8 src='images/spacer.gif'" 
        + "    width=20 align=middle border=0><IMG height=24 alt=''"
        + "    src='images/NavArrowMainClosed.gif' width=5 align=absMiddle" 
        + "    border=0><IMG height=8 alt='' src='images/spacer.gif' width=8" 
        + "    border=0><A class=sap-leftnav-links id=objMenuTreeNav1_aLink5" 
        + "    href='##URL##'>##TEXT##</A><br><IMG height=2 alt=''"
        + "    src='images/NavLine.gif' width=232 border=0></TD>"
        + "  </TR>";        
		
//把功能模块代码转换为对应的数组下标，用来取得正确的页面
function ConvertPageCode(iPageCode)
{	alert(iPageCode);
	var iNewPageCode = -1;
    switch(parseInt(iPageCode))
    {
        case 1:
            iNewPageCode = 0;
            break;
        case 2:
            iNewPageCode = 1;
            break;
        case 3:
            iNewPageCode = 2;
            break;        
    }
    return iNewPageCode;
}
        		  
function menu()
{
	//一级菜单
	var menu1text = new Array();
	var menu1link = new Array();
	menu1text[0]="首页";
	menu1link[0]="default.htm";
	menu1text[1]="关于Unitsoft";
	menu1link[1]="profile.htm";
	menu1text[2]="Unitsoft电子商务ERP套件";
	menu1link[2]="product.htm";	
	menu1text[3]="技术咨询与服务";
	menu1link[3]="consultation.htm";
	menu1text[4]="成功案例";
	menu1link[4]="case.htm";
	menu1text[5]="合作伙伴";
	menu1link[5]="friend.htm";	
	menu1text[6]="招贤纳仕";
	menu1link[6]="hr.htm";	
	menu1text[7]="联系我们";
	menu1link[7]="contactus.htm";
		
	
	//二级菜单
	var menu2text = new Array();
	var menu2link = new Array();
	
	menu2text[1] = new Array();
	menu2text[1][0]="企业文化";
	menu2text[1][1]="组织结构";
	menu2text[1][2]="友耐优势";	
	menu2text[1][3]="关于我们";
	menu2link[1] = new Array();
	menu2link[1][0]="culture.htm";
	menu2link[1][1]="organize.htm";
	menu2link[1][2]="advantage.htm";
	menu2link[1][3]="scm.htm";
	
	menu2text[2] = new Array();
	menu2text[2][0]="Unitsoft CRM";
	menu2text[2][1]="Unitsoft电子商务ERP";
	menu2text[2][2]="Unitsoft商务中间件";
	menu2text[2][3]="网上协同供应平台";
	menu2text[2][4]="集团预算控制系统";
	menu2text[2][5]="国际贸易行业";
	menu2text[2][6]="化工行业";
	menu2text[2][7]="机电行业";
	menu2text[2][8]="医药行业";
	menu2text[2][9]="纺织服装行业";
	menu2text[2][10]="五金行业";
	menu2text[2][11]="机械行业";

		
	menu2link[2] = new Array();
	menu2link[2][0]="crm.htm";
	menu2link[2][1]="erp.htm";
	menu2link[2][2]="unitware.htm";
	menu2link[2][3]="interCooperate.htm";
	menu2link[2][4]="groupBudgetReimbursement.htm";
	menu2link[2][5]="inter-trade.htm";
	menu2link[2][6]="chemical.htm";	
	menu2link[2][7]="machine-electron.htm";
	menu2link[2][8]="medicine.htm";
	menu2link[2][9]="weave.htm";	
	menu2link[2][10]="hardware.htm";	
	menu2link[2][11]="manufacture.htm";	
	
	
	var htmltext = "";
	var menu1no = pagecode.substring(0,1);	
	var menu2no = "";
	var menu3no = "";
	if(pagecode.length > 1)
	{
		menu2no =  (pagecode+"").substr(1,1);
	}
	if(pagecode.length > 2)
	{
		menu3no =  pagecode.substr(2,1);
	}
	for(var i=0; i<= menu1no && i<menu1text.length; i++)
	{
	    var tempblock = htmlblock.replace("##TEXT##", menu1text[i]).replace("##URL##",menu1link[i]).replace("##WIDTH##",10);
	    if(menu2no == "" && i == parseInt(menu1no))
	        tempblock = tempblock.replace("##CLASS##","leftnav-active").replace("##LINKCLASS##","sap-leftnav2-links");
	    else
	        tempblock = tempblock.replace("##CLASS##","left-navigation").replace("##LINKCLASS##","sap-leftnav-links");
	        
		htmltext += tempblock;
	}
	
	//显示子菜单
		
	if(typeof(menu2text[menu1no]) == "object")
	{
	    for(var i=0; i<menu2text[menu1no].length; i++)
	    {
		    var tempblock = htmlblock.replace("##TEXT##", menu2text[menu1no][i]).replace("##URL##",menu2link[menu1no][i]).replace("##WIDTH##",20);
		    if(menu3no == "" && i == parseInt(menu2no))
	            tempblock = tempblock.replace("##CLASS##","leftnav-active").replace("##LINKCLASS##","sap-leftnav2-links");
	        else
	            tempblock = tempblock.replace("##CLASS##","left-navigation").replace("##LINKCLASS##","sap-leftnav-links");
	        
		    htmltext += tempblock;
	    }
	}
	
	    
	//把主菜单显示完    
	for(var i=parseInt(menu1no)+1; i<menu1text.length; i++)
	{
	    var tempblock = htmlblock.replace("##TEXT##", menu1text[i]).replace("##URL##",menu1link[i]).replace("##WIDTH##",10);
	    tempblock = tempblock.replace("##CLASS##","left-navigation").replace("##LINKCLASS##","sap-leftnav-links");
	    
		htmltext += tempblock;
	}
	document.write(htmltext);
	
}

function displayTopHtml()
{
	var htmltop = "	<TABLE width='964' border=0 cellPadding=0 cellSpacing=0>	 ";
	htmltop +="   	<TBODY>	 ";
	htmltop +="           <TR>	 ";
	htmltop +="                     <TD width='448' align=left vAlign=center noWrap bgcolor='#FFFFFF'><IMG 	 ";
	htmltop +="               src='images/logo.gif' alt=Unitsoft width='340' height='72' border=0></TD>	 ";
	htmltop +="                     <TD width=303 align=left vAlign=center background='images/logo1.jpg'>&nbsp; </TD>	 ";
	htmltop +="             <TD vAlign=center align=left width=213>	 ";
	
	htmltop +="               <TABLE height=66 cellSpacing=0 cellPadding=0 	 ";
	htmltop +="                 border=0><TBODY>	 ";
	htmltop +="                 <TR bgcolor='#999999'>	 ";
	htmltop +="                   <TD height=22 colSpan=3 align=right vAlign=bottom>	 ";
	htmltop +="                     <P class=mastHead><A class=navigation 	 ";
	
	htmltop +="                     id=_ctl0_GlobalToolbar1_aCountry 	 ";
	htmltop +="                     href='default.htm'>首页</A>&nbsp;&nbsp;|&nbsp;&nbsp;";
	htmltop +="						注册会员&nbsp;&nbsp;|&nbsp;&nbsp;<a class=navigation href='bbs/index.asp' target='_blank'>友耐论坛</a><br>";
	htmltop +="						<img src='images/spacer.gif'width='1' height='7'><br>";
	htmltop +="						<table cellSpacing=0 cellPadding=0 width=100%>";
	htmltop +="							<tr><td align='right' style='color:white;'>用户名&nbsp;<INPUT class=search_text id=_ctl0_QuickSearch1_textfield size=15 name=_ctl0:QuickSearch1:textfield></td>";
	htmltop +="								<td rowspan=2 align='right' width='48'>&nbsp;<A><img src='images/GO.gif' border='0'></A></td></tr>";
	htmltop +="						<tr><td align='right' style='color:white;'>密码&nbsp;<INPUT class=search_text id=_ctl0_QuickSearch1_textfield size=15 name=_ctl0:QuickSearch1:textfield></td></tr></table>";
	htmltop +="                     </P></TD></TR>	 ";
	htmltop +="                 <TR bgcolor='#999999'>	 ";
	htmltop +="                   <TD height=10 colSpan=3><IMG height=10 	 ";
	htmltop +="                     src='images/spacer.gif' width=1></TD></TR>	 ";
	
	htmltop +="                 <TR bgcolor='#999999'>	 ";
	htmltop +="                   <TD height=34 align=right vAlign=top><INPUT 	 ";
	htmltop +="                     class=search                   	 ";
	htmltop +="                     id=_ctl0_QuickSearch1_textfieldtxt size=15 	 ";
	htmltop +="                     name=_ctl0:QuickSearch1:textfield></TD>	 ";
	htmltop +="                   <TD height=34 align=right vAlign=top><IMG height=1 	 ";
	htmltop +="                     src='images/spacer.gif' width=6></TD>	 ";
	htmltop +="                   <TD height=34 align=right vAlign=top>	 ";
	htmltop +="                     <TABLE cellSpacing=0 cellPadding=0 width=70 align=right 	 ";
	htmltop +="                     border=0>	 ";
	htmltop +="                       <TBODY>	 ";
	htmltop +="                       <TR>	 ";
	
	htmltop +="                         <TD vAlign=top align=left width=11 height=23><IMG 	 ";
	htmltop +="                           height=23 alt='' src='images/BttnL_336699.gif' 	 ";
	htmltop +="                           width=11 align=top border=0></TD>	 ";
	htmltop +="                         <TD vAlign=center noWrap align=middle width=48 	 ";
	htmltop +="                         background='images/BttnM_336699.jpg' bgColor='#336699' 	 ";
	htmltop +="                         height=23><A class=form-button-336699 	 ";

	htmltop +="                           href='javascript:go_onclick(_ctl0_QuickSearch1_textfieldtxt.value)'>搜索</A></TD>	 ";
	htmltop +="                         <TD vAlign=top align=left width=11 height=23><IMG 	 ";
	htmltop +="                           height=23 alt='' src='images/BttnR_336699.gif' 	 ";
	htmltop +="                           width=11 align=top 	 ";
	htmltop +="                 border=0></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY>	 ";
	htmltop +="   </TABLE>	 ";
	/*
	htmltop +="<script src='http://www.google-analytics.com/urchin.js' type='text/javascript'>";
	htmltop +="</script>";
	htmltop +="<script type='text/javascript'>";
	htmltop +="_uacct = 'UA-361614-2';";
	htmltop +="urchinTracker();";
	htmltop +="</script>";
	*/

	document.write(htmltop);
}

function displayBottomHtml()
{
	var htmlBottom = " <TABLE cellSpacing=0 cellPadding=0 width=964 border=0>";
	htmlBottom += "		<TBODY>";
	htmlBottom += "                 <TR> ";
	htmlBottom += "                   <TD vAlign=top align=left width=694 height=66> <P class=footer><BR>";
	htmlBottom += "                      上海友耐软件技术有限公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;版权所有　　<img src='images/c.gif' border='0' width='10' height='10'>&nbsp;2001-2007 | 隐私声明 <BR>";
	htmlBottom += "                      如有问题或意见,请联系 <A class=navigation id=FooterToolbar1_aEmail ";
	htmlBottom += "            href='mailto:service@unitsoft.com.cn?subject=Questions or Comments About Unitsoft'>mailto:service@unitsoft.com.cn</A>"; 
	htmlBottom += "                    </P></TD>";
	htmlBottom += "                  <TD vAlign=center align=right width=115 height=66>&nbsp;</TD>";
	htmlBottom += "                  <TD vAlign=center align=right width=155 height=66><div align='right'><IMG ";
	htmlBottom += "            alt=Unitsoft src='images/logoen.jpg'></div></TD>";
	htmlBottom += "                </TR>";
	htmlBottom += "              </TBODY>";
	htmlBottom += "</TABLE>";
	document.write(htmlBottom);
}
