var m1menus    = new Array();
var m1isShow   = new Boolean(); 
m1isShow=false;
var m1isdown   = new Boolean();
m1isdown=false;
var m1usestatus=false;
var m1popTimer = 0;
m1menucolor='#F1F1F1';m1fontcolor='#000000';m1menuoutcolor='#CCCCCC';m1menuincolor='#F1F1F1';m1menuoutbordercolor='#999999';m1menuinbordercolor='#999999';m1midoutcolor='#D3D3D3';m1midincolor='#D3D3D3';m1menuovercolor='#000000';m1itemedge='1';m1subedge='0';m1menuunitwidth=80;m1menuitemwidth=130;m1menuheight=25;m1menuwidth='100%';m1menuadjust=0;m1menuadjustV=0;m1fonts='font-family: 宋体; font-size: 9pt; color: #000000; ';m1cursor='hand';
var fadeSteps = 5;
var fademsec = 20;
var fadeArray = new Array();
function fade(el, fadeIn, steps, msec) {
if (steps == null) steps = fadeSteps;
if (msec == null) msec = fademsec;
if (el.fadeIndex == null)
el.fadeIndex = fadeArray.length;
fadeArray[el.fadeIndex] = el;
if (el.fadeStepNumber == null) {
if (el.style.visibility == "hidden")
el.fadeStepNumber = 0;
else
el.fadeStepNumber = steps;
if (fadeIn)
el.style.filter = "Alpha(Opacity=0)";
else
el.style.filter = "Alpha(Opacity=100)";
}
window.setTimeout("repeatFade(" + fadeIn + "," + el.fadeIndex + "," + steps + "," + msec + ")", msec);
}
function repeatFade(fadeIn, index, steps, msec) {
el = fadeArray[index];

c = el.fadeStepNumber;
if (el.fadeTimer != null)
window.clearTimeout(el.fadeTimer);
if ((c == 0) && (!fadeIn)) {
el.style.visibility = "hidden";
return;
}
else if ((c==steps) && (fadeIn)) {
el.style.filter = "";
el.style.visibility = "visible";
return;
}
else {
(fadeIn) ? c++ : c--;
el.style.visibility = "visible";
el.style.filter = "Alpha(Opacity=" + 100*c/steps + ")";
el.fadeStepNumber = c;
el.fadeTimer = window.setTimeout("repeatFade(" + fadeIn + "," + index + "," + steps + "," + msec + ")", msec);
}
}

function stoperror(){
return true;
}
window.onerror=stoperror;
function m1popOut() {
m1popTimer = setTimeout('m1allhide()', 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 m1MenuRegister(menu) 
{
  m1menus[m1menus.length] = menu
  return (m1menus.length - 1)
}
function m1MenuItem(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 m1Menu(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=m1MenuRegister(this);
}
function m1MenuAddItem(item)
{
  this.items[this.items.length] = item
  item.parent = this.id;
  this.children=true;
}

m1Menu.prototype.addItem = m1MenuAddItem;
function m1toout(src){

src.style.borderLeftColor=m1menuoutbordercolor;
src.style.borderRightColor=m1menuinbordercolor;
src.style.borderTopColor=m1menuoutbordercolor;
src.style.borderBottomColor=m1menuinbordercolor;
src.style.backgroundColor=m1menuoutcolor;
src.style.color=m1menuovercolor;
}
function m1toin(src){

src.style.borderLeftColor=m1menuinbordercolor;
src.style.borderRightColor=m1menuoutbordercolor;
src.style.borderTopColor=m1menuinbordercolor;
src.style.borderBottomColor=m1menuoutbordercolor;
src.style.backgroundColor=m1menuincolor;
src.style.color=m1menuovercolor;
}
function m1nochange(src){
src.style.borderLeftColor=m1menucolor;
src.style.borderRightColor=m1menucolor;
src.style.borderTopColor=m1menucolor;
src.style.borderBottomColor=m1menucolor;
src.style.backgroundColor='';
src.style.color=m1fontcolor;

}
function m1allhide(){
for(var nummenu=0;nummenu<m1menus.length;nummenu++){
var themenu=document.all['m1Menu'+nummenu]
var themenudiv=document.all['m1menudiv'+nummenu]
                m1nochange(themenu);
                m1menuhide(themenudiv);
                }
}
function m1menuhide(menuid){

fade(menuid,false,5);
m1isShow=false;
}
function m1menushow(menuid,pid){

menuid.style.left=m1posflag.offsetLeft+pid.offsetLeft+m1menuadjust;menuid.style.top=m1posflag.offsetTop+m1menutable.offsetHeight+m1menuadjustV;
if(m1menuitemwidth+parseInt(menuid.style.left)>document.body.clientWidth+document.body.scrollLeft)
menuid.style.left=document.body.clientWidth+document.body.scrollLeft-m1menuitemwidth;
fade(menuid,true,5);
m1isShow=true;
}
function m1menu_over(menuid,x){
toel = getReal(window.event.toElement, "className", "coolButton");
fromel = getReal(window.event.fromElement, "className", "coolButton");
if (toel == fromel) return;
if(x==0||x==1||x==2||x==3||x==4||x==5||x==6){
  m1isShow = false;
  m1allhide();
  m1toout(eval("m1Menu"+x));
}else{

  m1allhide();
  m1toin(eval("m1Menu"+x));
  m1menushow(menuid,eval("m1Menu"+x));

}

}
function m1menu_out(x){
toel = getReal(window.event.toElement, "className", "coolButton");
fromel = getReal(window.event.fromElement, "className", "coolButton");
if (toel == fromel) return;
if (m1isShow){
m1toin(eval("m1Menu"+x));
}else{
m1nochange(eval("m1Menu"+x));
}

}
function m1menu_down(menuid,x){
  if(m1isShow){
  m1menuhide(menuid);
  m1toout(eval("m1Menu"+x));
  }
  else{
  m1toin(eval("m1Menu"+x));
  m1menushow(menuid,eval("m1Menu"+x));
  m1isdown=true;
  }
}
function m1menu_up(){
  m1isdown=false;
}
function m1menuitem_over(x,i){
srcel = getReal(window.event.srcElement, "className", "coolButton");
if(m1isdown){
m1toin(srcel);
}
else{
m1toout(srcel);
}
m1thestatus = m1menus[x].items[i].statustxt;
if(m1thestatus!=""){
m1usestatus=true;
window.status=m1thestatus;
}

}
function m1menuitem_out(){
srcel = getReal(window.event.srcElement, "className", "coolButton");
m1nochange(srcel);
if(m1usestatus)window.status="";

}
function m1menuitem_down(){
srcel = getReal(window.event.srcElement, "className", "coolButton");
m1toin(srcel)
m1isdown=true;
}
function m1menuitem_up(){
srcel = getReal(window.event.srcElement, "className", "coolButton");
m1toout(srcel)
m1isdown=false;
}
function m1exec2(x){
var cmd;
if(m1menus[x].target=="blank"){
  cmd = "window.open('"+m1menus[x].command+"')";
}else{
  cmd = m1menus[x].target+".location=\""+m1menus[x].command+"\"";
}
eval(cmd);
}
function m1exec(x,i){
var cmd;
if(m1menus[x].items[i].target=="blank"){
  cmd = "window.open('"+m1menus[x].items[i].command+"')";
}else{
  cmd = m1menus[x].items[i].target+".location=\""+m1menus[x].items[i].command+"\"";
}
eval(cmd);
}
function m1body_click(){
mbody_click();
if (m1isShow){
srcel = getReal(window.event.srcElement, "className", "coolButton");
for(var x=0;x<=m1menus.length;x++){
if(srcel.id=="m1Menu"+x)
return;
}
m1allhide();
}
}
document.onclick=m1body_click;
function m1writetodocument(){
      var m1wb=0;
                     var stringx='<div id="m1posflag" style="position:absolute;"></div><table  id=m1menutable border=0 cellpadding=0 cellspacing=1 width='+m1menuwidth+' height='+m1menuheight+' bgcolor='+m1menucolor+
                     ' onselectstart="event.returnValue=false"'+
                     ' style="cursor:'+m1cursor+';'+m1fonts+
                     ' border-left: '+m1wb+'px solid '+m1menuoutbordercolor+';'+
                     ' border-right: '+m1wb+'px solid '+m1menuinbordercolor+'; '+
                     'border-top: '+m1wb+'px solid '+m1menuoutbordercolor+'; '+
                     'border-bottom: '+m1wb+'px solid '+m1menuinbordercolor+'; padding:0px"><tr>'
                     for(var x=0;x<m1menus.length;x++){
                     var thismenu=m1menus[x];
                     var imgsize="";
                     if(thismenu.sizex!="0"||thismenu.sizey!="0")imgsize=" width="+thismenu.sizex+" height="+thismenu.sizey;
                     var ifspace="";
                     if(thismenu.caption!="")ifspace="&nbsp;";
                     stringx += "<td nowrap class=coolButton id=m1Menu"+x+" style='border: "+m1itemedge+"px solid "+m1menucolor+
                     "' width="+m1menuunitwidth+"px onmouseover=m1menu_over(m1menudiv"+x+
                     ","+x+") onmouseout=m1menu_out("+x+
                     ") onmousedown=m1menu_down(m1menudiv"+x+","+x+")";
                           if(thismenu.command!=""){
                               stringx += " onmouseup=m1menu_up();m1exec2("+x+");";
                           }else{
                             stringx += " onmouseup=m1menu_up()";
                           }
                           if(thismenu.pos=="0"){
                               stringx += " align=center><img align=absmiddle src='"+thismenu.img+"'"+imgsize+">"+ifspace+thismenu.caption+"</td>";
                           }else if(thismenu.pos=="1"){
                               stringx += " align=center>"+thismenu.caption+ifspace+"<img align=absmiddle src='"+thismenu.img+"'"+imgsize+"></td>";
                           }else if(thismenu.pos=="2"){
                               stringx += " align=center background='"+thismenu.img+"'>&nbsp;"+thismenu.caption+"&nbsp;</td>";
                           }else{
                               stringx += " align=center>&nbsp;"+thismenu.caption+"&nbsp;</td>";
                           }
                     stringx += "";
                     }
                     stringx+="<td width=*>&nbsp;</td></tr></table>";
                     
                     
                     for(var x=0;x<m1menus.length;x++){
                     thismenu=m1menus[x];
                        if(x==0||x==1||x==2||x==3||x==4||x==5||x==6){
                        stringx+='<div id=m1menudiv'+x+' style="visiable:none"></div>';
                        }else{
                        stringx+='<div id=m1menudiv'+x+
                        ' style="cursor:'+m1cursor+';position:absolute;'+
                        'width:'+m1menuitemwidth+'px; z-index:'+(x+100);
                        if(m1menuinbordercolor!=m1menuoutbordercolor&&m1subedge=="0"){
                        stringx+=';border-left: 1px solid '+m1midoutcolor+
                        ';border-top: 1px solid '+m1midoutcolor;}
                        stringx+=';border-right: 1px solid '+m1menuinbordercolor+
                        ';border-bottom: 1px solid '+m1menuinbordercolor+';visibility:hidden" onselectstart="event.returnValue=false">\n'+
                     '<table  width="100%" border="0" height="100%" align="center" cellpadding="0" cellspacing="2" '+
                     'style="'+m1fonts+' border-left: 1px solid '+m1menuoutbordercolor;
                        if(m1menuinbordercolor!=m1menuoutbordercolor&&m1subedge=="0"){
                     stringx+=';border-right: 1px solid '+m1midincolor+
                     ';border-bottom: 1px solid '+m1midincolor;}
                     stringx+=';border-top: 1px solid '+m1menuoutbordercolor+
                     ';padding: 4px" bgcolor='+m1menucolor+'>\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=" width="+thismenuitem.sizex+" height="+thismenuitem.sizey;
                             var ifspace="";
                             if(thismenu.caption!="")ifspace="&nbsp;";
                     if(!thismenuitem.isline){
                     stringx += "<tr><td class=coolButton style='border: "+m1itemedge+"px solid "+m1menucolor+
                     "' width=100% height=15px onmouseover=\"m1menuitem_over("+x+","+i+
                     ");\" onmouseout=m1menuitem_out() onmousedown=m1menuitem_down() onmouseup=";
 stringx += "m1menuitem_up();m1exec("+x+","+i+"); ";
 if(thismenuitem.pos=="0"){
                                 stringx += "><img align=absmiddle src='"+thismenuitem.img+"'"+imgsize+">"+ifspace+thismenuitem.caption+"</td></tr>";
                               }else if(thismenuitem.pos=="1"){
                                 stringx += ">"+thismenuitem.caption+ifspace+"<img align=absmiddle 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" onmousemove="clearTimeout(mpopTimer);"><img height="1" width="1" src="none.gif" border="0"></td></tr>\n';
                     }
                     }stringx+='</table>\n</div>'
                     }
                     
                }
                
                     document.write("<div align='left'>"+stringx+"</div>");
}


m1pmenu1=new m1Menu('交易中心','/aboutus/','self','','','','');
m1pmenu2=new m1Menu('交易公告','/gonggao/','self','','','','');
m1pmenu3=new m1Menu('新闻动态','/news/','self','','','','');
m1pmenu4=new m1Menu('业务指南','/yewu/wendang.htm','self','','','','');
m1pmenu5=new m1Menu('政策法规','/law/','self','','','','');
m1pmenu6=new m1Menu('青年文明号','/wmh/','self','','','','');
m1pmenu7=new m1Menu('留言簿','/guestbook/','self','','','','');
m1writetodocument();



