var isDOM = document.getElementById ? true : false
var isIE = (document.all && !isDOM) ? true : false
var isNS = document.layers ? true : false
function getRef(id) {
if (isDOM) return document.getElementById(id)
if (isIE) return document.all[id]
if (isNS) return document.layers[id]
}
function showMenu(tg, id){
x = 0
y = 0
x += tg.offsetLeft
y += tg.offsetHeight
obj = tg;
while(obj = obj.offsetParent)
{
x += obj.offsetLeft;
y += obj.offsetTop;
}
tgMenu = getRef(id);
tgMenu.style.left = x + "px";
tgMenu.style.top = y + "px";
tgMenu.style.visibility = 'inherit'
}
function hideMenu(id){
obj = getRef(id)
obj.style.visibility = "hidden"
}
function mainItem(str)
{
this.title = str.split("|")[0]
this.img = str.split("|")[1]
this.imgSwap = str.split("|")[2]
this.url = str.split("|")[3]
this.sub = new Array()
}
function item(str)
{
this.title = str.split("|")[0]
this.url = str.split("|")[1]
this.sub = new Array()
}
function makeMenu()
{
var str = '';
str += "
\n";
str += "\n"
str += "\n";
str += "\n";
str += "\n";
for (i=0; i\n";
str += "";
str += " \n";
str += "\n";
str += " \n";
str += ""
str += "\n";
if (Menu[i].sub.length){
str += "\n";
str += "\n";
str += " | \n";
str += " \n";
str += " \n";
}
for (j=0; j | \n";
}
str += "\n";
str += " \n";
str += " \n";
str += "\n"
str += " | \n";
if (i < Menu.length-1)
str += " | \n";
}
str += "
\n";
str += "
\n";
str += "\n";
str += "\n";
str += "\n";
document.write(str);
}
//絕對路徑(記得最後+ "/");
var absoluteUrl = "";
/*
mainItem的格式:名稱|圖檔|連結
名稱-無作用,僅供確認
圖檔-位於images
連結-接在絕對路徑後的路徑
item的格式:名稱|路徑(接在絕對路徑後)
*/
var Menu = new Array();
Menu[0] = new mainItem("aboutus|ne01.gif|ne01_o.gif|../about/about.php")
Menu[0].sub[0] = new item("耕昇品牌介绍|../about/about.php?about_id=1");
Menu[0].sub[1] = new item("发展历程|../about/about.php?about_id=2");
Menu[0].sub[2] = new item("合作伙伴|../about/about.php?about_id=3");
Menu[1] = new mainItem("product|ne02.gif|ne02_o.gif|../product/productvga.php?act=category");
//Menu[1].sub[] = new item("|../product/product.php?pc1_id=");
Menu[1].sub[0] = new item("显卡|../product/productvga.php?act=category")
Menu[2] = new mainItem("news|ne03.gif|ne03_o.gif|../news/news1.php");
Menu[2].sub[0] = new item("耕昇新闻|../news/news1.php");
Menu[2].sub[1] = new item("产品评测|../news/news2.php");
Menu[2].sub[2] = new item("耕昇荣誉|../news/news3.php");
Menu[3] = new mainItem("support|ne04.gif|ne04_o.gif|../support/support.php");
Menu[3].sub[0] = new item("下载服务|../support/download.php");
Menu[3].sub[1] = new item("售后服务条款|../support/rule.php");
Menu[3].sub[2] =new item("常见问题解答|../support/qa.php");