﻿//首先定义两个数组，一个是菜单文字，一个是链接
var MenuText = new Array(19);
    var MenuEven = new Array(19);
    MenuText[1] = ["全日制英语系列班","周末英语系列班","剑桥少儿英语系列班","夜校英语系列班","寒暑假英语系列班","英语ENGLISH特色课程","商务英语","雅思英语"];

    MenuEven[1] = ["http://www.678876.org/ENGLISH/index.html#a1","http://www.678876.org/ENGLISH/index.html#a2","http://www.678876.org/ENGLISH/index.html#a3","http://www.678876.org/ENGLISH/index.html#a4","http://www.678876.org/ENGLISH/index.html#a5","http://www.678876.org/ENGLISH/index.html#a6","http://www.678876.org/ENGLISH/index.html#a7","http://www.678876.org/ENGLISH/index.html#a8"];
    
    
   MenuText[2] = ["全日制法语班","周末法语班","夜校法语班","寒暑假法语班","半日制法语班"];

    MenuEven[2] = ["http://www.678876.org/FRENCH/index.html#a1","http://www.678876.org/FRENCH/index.html#a2","http://www.678876.org/FRENCH/index.html#a3","http://www.678876.org/FRENCH/index.html#a4","http://www.678876.org/FRENCH/index.html#a5"];
    
    MenuText[3] = ["全日制日语班","周末日语班","夜校日语班","寒暑假日语班"];

    MenuEven[3] = ["http://www.678876.org/JAPANESE/index.html#a1","http://www.678876.org/JAPANESE/index.html#a2","http://www.678876.org/JAPANESE/index.html#a3","http://www.678876.org/JAPANESE/index.html#a4"];
    
    
    MenuText[4] = ["全日制韩语班","周末韩语班","夜校韩语班","寒暑假韩语班"];

    MenuEven[4] = ["http://www.678876.org/KOREAN/index.html#a1","http://www.678876.org/KOREAN/index.html#a2","http://www.678876.org/KOREAN/index.html#a3","http://www.678876.org/KOREAN/index.html#a4"];
    
    MenuText[5] = ["周末泰语班"];

    MenuEven[5] = ["http://www.678876.org/THAI/index.html#a1"];
    
    MenuText[6] = ["周六汉语班","夜校汉语班"];

    MenuEven[6] = ["http://www.678876.org/Mandarin/index.html#a1","http://www.678876.org/Mandarin/index.html#a2"];
    
   MenuText[7] = ["周末俄语班","夜校俄语班","全日制俄语班","寒暑假俄语班"];

    MenuEven[7] = ["http://www.678876.org/RUSSIAN/index.html#a1","http://www.678876.org/RUSSIAN/index.html#a2","http://www.678876.org/RUSSIAN/index.html#a3","http://www.678876.org/RUSSIAN/index.html#a4"];
    
   MenuText[8] = ["全日制德语班","周末德语班","夜校德语班","寒暑假德语班"];

   MenuEven[8] = ["http://www.678876.org/GERMAN/index.html#a1","http://www.678876.org/GERMAN/index.html#a2","http://www.678876.org/GERMAN/index.html#a3","http://www.678876.org/GERMAN/index.html#a4"];
    
    
   MenuText[9] = ["周末意大利语系列班","夜校意大利语系列班"];

   MenuEven[9] = ["http://www.678876.org/ITALIAN/index.html#a1","http://www.678876.org/ITALIAN/index.html#a2"];
    
    
   MenuText[10] = ["全日制西班牙语班","周末西班牙语班","夜校西班牙语班","寒暑假西班牙语班"];

   MenuEven[10] = ["http://www.678876.org/SPANISH/index.html#a1","http://www.678876.org/SPANISH/index.html#a2","http://www.678876.org/SPANISH/index.html#a3","http://www.678876.org/SPANISH/index.html#a4"];
    
   MenuText[11] = ["周末葡萄牙语初级班"];

   MenuEven[11] = ["http://www.678876.org/PORTUGUESE/index.html#a1"];
   
   MenuText[12] = ["阿拉伯语周末班","阿拉伯语夜校班","阿拉伯语全日制班"];

   MenuEven[12] = ["http://www.678876.org/ARABIC/index.html#a1","http://www.678876.org/ARABIC/index.html#a2","http://www.678876.org/ARABIC/index.html#a3"];
   
   MenuText[13] = ["寒暑假小语种系列班","寒暑假英语系列班"];

   MenuEven[13] = ["http://www.678876.org/SUMMERSCHOOL/index.html#a1","http://www.678876.org/SUMMERSCHOOL/index.html#a2"];
   
   MenuText[14] = ["寒暑假少儿英语全日制系列班","剑桥少儿英语周六系列班"];

   MenuEven[14] = ["http://www.678876.org/KIDENGLISH/index.html#a1","http://www.678876.org/KIDENGLISH/index.html#a2"];
   
   MenuText[15] = ["周末印度语班"];

   MenuEven[15] = ["http://www.678876.org/HINDI/index.html#a1"];
    
   MenuText[16] = ["周末波斯语班","夜校波斯语班"];

   MenuEven[16] = ["http://www.678876.org/PERSIAN/index.html#a1","http://www.678876.org/PERSIAN/index.html#a2"];
   
   MenuText[17] = ["越南语周末班","夜校越南语班"];

   MenuEven[17] = ["http://www.678876.org/VIETNAMESE/index.html#a1","http://www.678876.org/VIETNAMESE/index.html#a2"];
  
   MenuText[18] = ["荷兰语初级周末班"];

   MenuEven[18] = ["http://www.678876.org/Dutch/index.html#a1"];
   
   MenuText[19] = ["希伯来语初级周末班"];

   MenuEven[19] = ["http://www.678876.org/Hebrew/index.html#a1"];
//初始化一个oPopup对象

var  oPopup = window.createPopup();

//这两个是获得表格绝对位置的方法，很有用的说
function getLeftIE(x,m) {
  var dx=0;
  if (x.tagName=="TD"){
    dx=x.offsetLeft;
  }
  else if (x.tagName=="TABLE") {
    dx=x.offsetLeft;
    if (m) { dx+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
  }
  return dx+(x.parentElement.tagName=="BODY"?0:getLeftIE(x.parentElement,m));
}
function getTopIE(x,m) {
  var dy=0;
  if (x.tagName=="TR"){
    dy=x.offsetTop;
  }
  else if (x.tagName=="TABLE") {
    dy=x.offsetTop;
    if (m) { dy+=(x.cellPadding!=""?parseInt(x.cellPadding):2); m=false; }
  }
  return dy+(x.parentElement.tagName=="BODY"?0:getTopIE(x.parentElement,m));
}

//显示菜单
function ButtonClick(node,t)
{   
   //首先得到鼠标所在的表格的位置
    var left = getLeftIE(node,true)-30;  
    var top = getTopIE(node,true)+20;
//定义打开的oPopup的宽度，高度
    var width = 180;
    var height = MenuText[t].length*23;    
//清空oPopup的内容，否则每次调用都只会在后面接着写
    oPopup.document.body.innerHTML = "";
    var oPopBody = oPopup.document.body;
    oPopup.show(left,top, width, height, document.body);      
        oPopup.document.open;
//让oPopup在鼠标离开时自动隐藏。
        oPopup.document.write("<body leftmargin=0 topmargin=0 scroll=no style='border : 0 px;' onmouseover=clearTimeout(parent.popt); onmouseout=parent.popt=setTimeout('parent.oPopup.hide()',10);>");

//用document.write()写菜单内容
        oPopup.document.write("<table width=100% height=100% style='border-collapse : collapse;'>");
    for(var i=0;i<MenuText[t].length;i++)
        {
        oPopup.document.write("<tr><td bgcolor=#FFFFFF style='border-top : #CCCCCC 1px solid;border-bottom : #CCCCCC 1px solid;border-left : #CCCCCC 1px solid;border-right : #CCCCCC 1px solid;mouse : hand; font-size : 12px; color:#333333;text-align :center;vertical-align : center;CURSOR: hand' onmouseover=this.bgColor='#CCCCCC'; onmouseout=this.bgColor='#FFFFFF'; height='20' onclick='parent.location.href=\""+MenuEven[t][i]+"\"';><b>"+MenuText[t][i]+"</b></td></tr>");
        }
        oPopup.document.write("</table></td></tr></table>");
        oPopup.document.write("</body>")
}
