var menus    = new Array();
var isShow   = new Boolean(); 
isShow=false;
var isdown   = new Boolean();
isdown=false;
var srcel; 
var fromel;  
var toel; 
var usestatus=false;
var thestatus="";
var popTimer = 0;
menucolor='#6487DC';fontcolor='#FFFFFF';menuoutcolor='#98B3FA';menuincolor='#9595F7';menuoutbordercolor='#6487DC';menuinbordercolor='#000000';midoutcolor='#6387DB';midincolor='#425A92';menuovercolor='#FFFF00';menuunitwidth=70;menuitemwidth=110;menuheight=22;menuwidth='100%';menuadjust=0;menuadjustV=0;fonts='font-family: 宋体; font-size: 9pt; color: #FFFFFF; ';cursor='default';

function popOut() 
{
	popTimer = setTimeout('allhide()', 500);
}
function getReal(el, type, value) 
{
	temp = el;
	while ((temp != null) && (temp.tagName != "BODY")) 
	{
		if (eval("temp." + type) == value) {
			el = temp;
			return el;
		}
		temp = temp.parentElement;
	}
	return el;
}

function MenuRegister(menu) 
{
  menus[menus.length] = menu;
  return (menus.length - 1);
}
function MenuItem(caption,command,target,isline,statustxt,img,sizex,sizey,pos)
{
	this.caption=caption;
	this.command=command;
	this.target=target;
	this.isline=isline;
	this.statustxt=statustxt;
	this.img=img;
	this.sizex=sizex;
	this.sizey=sizey;
	this.pos=pos;
}
function Menu(caption,command,target,img,sizex,sizey,pos)
{
	this.items = new Array();
	this.caption=caption;
	this.command=command;
	this.target=target;
	this.img=img;
	this.sizex=sizex;
	this.sizey=sizey;
	this.pos=pos;
	this.id=MenuRegister(this);
}
function MenuAddItem(item)
{
  this.items[this.items.length] = item;
  item.parent = this.id;
  this.children=true;
}

Menu.prototype.addItem = MenuAddItem;
function toout(src)
{
	src.style.borderLeftColor=menuoutbordercolor;
	src.style.borderRightColor=menuinbordercolor;
	src.style.borderTopColor=menuoutbordercolor;
	src.style.borderBottomColor=menuinbordercolor;
	src.style.backgroundColor=menuoutcolor;
	src.style.color=menuovercolor;
}
function toin(src){
src.style.borderLeftColor=menuinbordercolor;
src.style.borderRightColor=menuoutbordercolor;
src.style.borderTopColor=menuinbordercolor;
src.style.borderBottomColor=menuoutbordercolor;
src.style.backgroundColor=menuincolor;
src.style.color=menuovercolor;
}
function nochange(src){
src.style.borderLeftColor=menucolor;
src.style.borderRightColor=menucolor;
src.style.borderTopColor=menucolor;
src.style.borderBottomColor=menucolor;
src.style.backgroundColor='';
src.style.color=fontcolor;
}
function allhide()
{
	for(var nummenu=0;nummenu<menus.length;nummenu++)
	{
		var themenu=document.all['menu'+nummenu];
		var themenudiv=document.all['menudiv'+nummenu];
		nochange(themenu);
		menuhide(themenudiv);
	}
}

function menuhide(menuid)
{
	menuid.style.visibility='hidden';
	isShow=false;
}

function menushow(menuid,pid)
{
	menuid.style.left=posflag.offsetLeft+pid.offsetLeft+menuadjust;menuid.style.top=posflag.offsetTop+menutable.offsetHeight+menuadjustV;
	menuid.style.visibility='visible';
	if(menuitemwidth+parseInt(menuid.style.left)>document.body.clientWidth)
	menuid.style.left=document.body.clientWidth-menuitemwidth;
	isShow=true;
}

function menu_over(menuid,x)
{
	toEl = getReal(window.event.toElement, "className", "coolButton");
	fromEl = getReal(window.event.fromElement, "className", "coolButton");
	if (toEl == fromEl) return;
	srcel = window.event.srcElement;
	//Updated 20040719 for erasing an item - tradecidy
	//if(x==5)
	//{
	//	isShow = false;
	//	allhide();
	//	toout(srcel);
	//}
	//else
	//{
		allhide();
		toin(srcel);
		menushow(menuid,eval("menu"+x));
	//}
	clearTimeout(popTimer);
}

function menu_out(menuid)
{
	toEl = getReal(window.event.toElement, "className", "coolButton");
	fromEl = getReal(window.event.fromElement, "className", "coolButton");
	if (toEl == fromEl) return;	
	srcel = window.event.srcElement;
	if (isShow)
	{
		toin(srcel);
	}
	else
	{
		nochange(srcel);
	}
	popOut();
}

function menu_down(menuid,x)
{
	srcel = getReal(window.event.srcElement, "className", "coolButton");
	if(isShow)
	{
		menuhide(menuid);
		toout(srcel);
	}
	else
	{
		toin(srcel);
		menushow(menuid,eval("menu"+x));
		isdown=true;
	}
}
function menu_up(){
  isdown=false;
}
function menuitem_over(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
if(isdown){
	toin(srcel);
}
else{
toout(srcel);
}
if(thestatus!=""){
	usestatus=true;
	window.status=thestatus;
}
clearTimeout(popTimer);
}
function menuitem_out(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
nochange(srcel);
if(usestatus)window.status="";
popOut()
}
function menuitem_down(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
toin(srcel)
isdown=true;
}
function menuitem_up(menuid){
srcel = getReal(window.event.srcElement, "className", "coolButton");
toout(srcel)
isdown=false;
}
function exec2(x){
var cmd;
if(menus[x].target=="blank"){
  cmd = "window.open('"+menus[x].command+"')";
}else{
  cmd = menus[x].target+".location='"+menus[x].command+"'";
}
eval(cmd);
}
function exec(x,i){
var cmd;
if(menus[x].items[i].target=="blank"){
  cmd = "window.open('"+menus[x].items[i].command+"')";
}else{
  cmd = menus[x].items[i].target+".location='"+menus[x].items[i].command+"'";
}
eval(cmd);
}
function body_click(){
if (isShow){
	srcel = getReal(window.event.srcElement, "className", "coolButton");
	for(var x=0;x<=menus.length;x++){
		if(srcel.id=="menu"+x)
		return;
	}
	allhide();
}
}
document.onclick=body_click;
var MenuBodyRef;
function writetodocument()
{
      var wb=1;
      for(var i in document.all){
              if (document.all[i].tagName == 'BODY'){
                     MenuBodyRef = document.all[i]
                     var stringx='<div id="posflag" style="position:absolute;"></div><table  id=menutable border=0 cellpadding=0 cellspacing=2 width='+menuwidth+' height='+menuheight+' bgcolor='+menucolor+
                     ' onselectstart="event.returnValue=false"'+
                     ' style="cursor:'+cursor+';'+fonts+
                     ' border-left: '+wb+'px solid '+menuoutbordercolor+';'+
                     ' border-right: '+wb+'px solid '+menuinbordercolor+'; '+
                     'border-top: '+wb+'px solid '+menuoutbordercolor+'; '+
                     'border-bottom: '+wb+'px solid '+menuinbordercolor+'; padding:0px"><tr>'
                     for(var x=0;x<menus.length;x++){
                     	var thismenu=menus[x];
                     	var imgsize;
                     	      if(thismenu.sizex=="0"&&thismenu.sizey=="0"){
                     	        imgsize="";
                     	      }else{
                     	        imgsize=" width="+thismenu.sizex+" height="+thismenu.sizey;
                     	      }
                     	var ifspace;
                     	      if(thismenu.caption==""){
                     	        ifspace="";
                     	      }else{
                     	        ifspace="&nbsp;";
                     	      }
                     	stringx += "<td class=coolButton id=menu"+x+" style='border: 1px solid "+menucolor+
                     	"' width="+menuunitwidth+"px onmouseover=menu_over(menudiv"+x+
                     	","+x+") onmouseout=menu_out(menudiv"+x+
                     	") onmousedown=menu_down(menudiv"+x+","+x+")";
                     	      if(thismenu.command!=""){
                     	          stringx += " onmouseup=exec2("+x+");menu_up();";
                     	      }else{
                     	      	  stringx += " onmouseup=menu_up()";
                     	      }
                     	      if(thismenu.pos=="0"){
                     	          stringx += " align=center><img src="+thismenu.img+imgsize+">"+ifspace+thismenu.caption+"</td>";	
                     	      }else if(thismenu.pos=="1"){
                     	          stringx += " align=center>"+thismenu.caption+ifspace+"<img src="+thismenu.img+imgsize+"></td>";	
                     	      }else if(thismenu.pos=="2"){
                     	          stringx += " align=center background="+thismenu.img+">"+thismenu.caption+"</td>";
                     	      }else{
                     	          stringx += " align=center>"+thismenu.caption+"</td>";
                     	      }
                     	stringx += "";
                     }
                     stringx+="<td width=*>&nbsp;</td></tr></table>";
                     
                     for(var x=0;x<menus.length;x++){
                     	thismenu=menus[x];
			//Updated 20040719 for erasing an item - tradecidy
                        //if(x==5){
	                //        stringx+='<div id=menudiv'+x+' style="visiable:none"></div>';
                        //}else{
    	                    stringx+='<div id=menudiv'+x+
                        ' style="cursor:'+cursor+';position:absolute;'+
                        'width:'+menuitemwidth+'px; z-index:'+(x+100)+
                        ';border-left: 1px solid '+midoutcolor+'; '+
                        'border-right: 1px solid '+menuinbordercolor+';'+
                        ' border-top: 1px solid '+midoutcolor+'; '+
                        'border-bottom: 1px solid '+menuinbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+
                     	'<table  width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="2" '+
                     	'style="'+fonts+' border-left: 1px solid '+menuoutbordercolor+';'+
                     	' border-right: 1px solid '+midincolor+';'+
                     	' border-top: 1px solid '+menuoutbordercolor+'; '+
                     	'border-bottom: 1px solid '+midincolor+'; padding: 4px" bgcolor='+menucolor+'>\n'
                     	for(var i=0;i<thismenu.items.length;i++){
                     		var thismenuitem=thismenu.items[i];
                     		var imgsize;
                     	          if(thismenuitem.sizex=="0"&&thismenuitem.sizey=="0"){
                     	             imgsize=""
                     	          }else{
                     	             imgsize=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey
                     	          }
                     	        var ifspace;
                     	          if(thismenu.caption==""){
                     	            ifspace="";
                     	          }else{
                     	            ifspace="&nbsp;";
                     	          }
                     		if(!thismenuitem.isline){
                     		stringx += "<tr><td class=coolButton style='border: 1px solid "+menucolor+
                     		"' width=100% height=15px onmouseover=\"thestatus='"+thismenuitem.statustxt+"';menuitem_over(menudiv"+x+
                     		");\" onmouseout=menuitem_out(menudiv"+x+
                     		") onmousedown=menuitem_down(menudiv"+x+") onmouseup=";
 				stringx += "exec("+x+","+i+");menuitem_up(menudiv"+x+") ";
 				if(thismenuitem.pos=="0"){
                     	            stringx += "><img src="+thismenuitem.img+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";	
                     	          }else if(thismenuitem.pos=="1"){
                     	            stringx += ">"+thismenuitem.caption+ifspace+"<img src="+thismenuitem.img+imgsize+"></td></tr>";	
                     	          }else if(thismenuitem.pos=="2"){
                     	            stringx += "background="+thismenuitem.img+">"+thismenuitem.caption+"</td></tr>";	
                     	          }else{
                     	            stringx += ">"+thismenuitem.caption+"</td></tr>";
                     	          }
 				}else{
                     		stringx+='<tr><td height="1" background="hr.gif"><img border="0" src="none.gif" width="1" height="1"></td></tr>\n';
                     		}
                     	}stringx+='</table>\n</div>'
                     	//}
                     	
                }
                
                     document.write("<div align='center'>"+stringx+"</div>");
      break
    }
  }
}

function document_load()
{
	writetodocument();
}

pmenu1=new Menu('站点首页',eb_webroot+'/index.jsp','self','','','','');

pmenu2=new Menu('易办事','#','self','','','','');
pmenu2.addItem(new MenuItem('公司介绍',eb_webroot+'/update051110/about.jsp','self',false,'','','','',''));
pmenu2.addItem(new MenuItem('银联卡',eb_webroot+'/index.jsp','self',false,'','','','',''));
pmenu2.addItem(new MenuItem('银联新标识',eb_webroot+'/update051110/page28.jsp','self',false,'','','','',''));


pmenu3=new Menu('业务介绍','#','self','','','','');
pmenu3.addItem(new MenuItem('自助缴费',eb_webroot+'/update051110/opertion.jsp','self',false,'','','','',''));
pmenu3.addItem(new MenuItem('自助转帐',eb_webroot+'/update051110/opertion2.jsp','self',false,'','','','',''));
pmenu3.addItem(new MenuItem('支付服务',eb_webroot+'/update051110/opertion3.jsp','self',false,'','','','',''));
pmenu3.addItem(new MenuItem('信息服务',eb_webroot+'/update051110/opertion4.jsp','self',false,'','','','',''));

pmenu4=new Menu('业务办理','#','self','','','','');
pmenu4.addItem(new MenuItem('自助缴费',eb_webroot+'/financing/FinancingList.jsp','self',false,'','','','',''));
pmenu4.addItem(new MenuItem('跨行转帐',gw_webroot_https+'/gateway/GWTransferRequest.jsp','self',false,'','','','',''));
pmenu4.addItem(new MenuItem('信用卡还款',gw_webroot_https+'/gateway/GWCreditCardPayRequest.jsp','self',false,'','','','',''));
pmenu4.addItem(new MenuItem('投注转帐',eb_webroot+'/financing/Lottery.jsp','self',false,'','','','',''));
pmenu4.addItem(new MenuItem('帐户查询',gw_webroot_https+'/gateway/GWQueryAccountBalanceRequest.jsp','self',false,'','','','',''));
pmenu4.addItem(new MenuItem('交易查询',gw_webroot_https+'/gateway/GWQueryAccountDetailRequest.jsp','self',false,'','','','',''));
//Update 20080124
//pmenu4.addItem(new MenuItem('银信通服务',eb_webroot+'/yinxintong/intro.jsp','self',false,'','','','',''));
//End Update 20080124

pmenu5=new Menu('信息中心','#','self','','','','');
pmenu5.addItem(new MenuItem('银联动态',eb_webroot+'/info/gnete.htm','self',false,'','','','',''));
pmenu5.addItem(new MenuItem('行业动态',eb_webroot+'/info/trade.htm','self',false,'','','','',''));
pmenu5.addItem(new MenuItem('电子公告',eb_webroot+'/info/electron.htm','self',false,'','','','',''));


pmenu6=new Menu('在线注册','#','self','','','','');
pmenu6.addItem(new MenuItem('新用户注册','#','self',false,'','','','',''));
pmenu6.addItem(new MenuItem('支付号用户注册','#','self',false,'','','','',''));
pmenu6.addItem(new MenuItem('在线注销','#','self',false,'','','','',''));
//Update 20080124
//pmenu6.addItem(new MenuItem('银信通注册',gw_webroot_https+'/gateway/YXTRegistRequest.jsp','self',false,'','','','',''));
//End Update 20080124

pmenu7=new Menu('商户服务','#','self','','','','');
pmenu7.addItem(new MenuItem('POS操作指南',eb_webroot+'/merchant/PosManual.htm','self',false,'','','','',''));
pmenu7.addItem(new MenuItem('申请安装刷卡机',eb_webroot+'/merchant/appSetupPOS.htm','self',false,'','','','',''));
pmenu7.addItem(new MenuItem('错误代码对照表',eb_webroot+'/merchant/errorcode.htm','self',false,'','','','',''));
pmenu7.addItem(new MenuItem('下载单笔调帐表',eb_webroot + '/merchant/accountadjusting_s.doc','self',false,'','','','',''));
pmenu7.addItem(new MenuItem('下载多笔调帐表',eb_webroot + '/merchant/accountadjusting_m.doc','self',false,'','','','',''));



pmenu8=new Menu('客户服务','#','self','','','','');
pmenu8.addItem(new MenuItem('理财帮助',eb_webroot+'/customer/help.htm','self',false,'','','','',''));
pmenu8.addItem(new MenuItem('深银联支付说明',eb_webroot+'/customer/szpayexplain.htm','self',false,'','','','',''));
pmenu8.addItem(new MenuItem('CHINAPAY说明',eb_webroot+'/customer/cppayexplain.htm','self',false,'','','','',''));
pmenu8.addItem(new MenuItem('注册及支付图示',eb_webroot+'/customer/szpayexplainwithimage.htm','self',false,'','','','',''));
pmenu8.addItem(new MenuItem('常见问题说明',eb_webroot+'/customer/FAQ.htm','self',false,'','','','',''));
pmenu8.addItem(new MenuItem('投诉受理',eb_webroot+'/customer/accept.htm','self',false,'','','','',''));
pmenu8.addItem(new MenuItem('用户建议',eb_webroot+'/customer/suggest.htm','self',false,'','','','',''));
pmenu8.addItem(new MenuItem('服务热线',eb_webroot+'/customer/hotline.htm','self',false,'','','','',''));

