/**************************************************************
//適用瀏覽器:Mozilla,IE
****************************************************************/



//選單相關css定義:
document.write("<style>\n");
document.write("A:link{text-decoration:none}");
document.write("A:visited{text-decoration:none}");
document.write("</style>\n");


var menu_top=-15;			//選單X座標
var menu_left=400;			//選單Y座標
var menu_but="img/";		//選單按鈕底圖


/*----主選單設定----*/
//類別內容
var mmenu=new Array(
Array(
	"PRODUCTS",
	"bluetooth_product.html",
	Array(
	)
),					
					
Array(
	"HOME",
	"index.eng.html",
	Array(
	)
),

Array(
	"MAVIN",
	"",
	Array(
		Array("The Mavin","mavin_mavin.eng.html","_self"),
		Array("Vision","mavin_vision.eng.html","_self"),
		//Array("Equipment","about_equipment.eng.html","_self"),
		Array("EVENTS","mavin_sig.eng.html","_self")
		//Array("What is Bluetooth？","about_bluetooth.eng.html","_self"),
		//Array("News","news.eng.html","_self")
	)
),
/*Array(
	"PRODUCTS",
	"",
	Array(
		Array("Bluetooth","product_bluetooth.eng.html","_self")
	)
),
Array(
	"APPLICATIONS",
	"",
	Array(
		Array("Bluetooth Applications","application_bt_applications.eng.html","_self"),
		Array("Bluetooth Profiles","application_profiles.eng.html","_self"),
		Array("Application Note","app_note.eng.html","_self")
	)
),*/
Array(
	"SUPPORT",
	"",
	Array(
		Array("FAQ","support_faq.eng.html","_self")
		//Array("Downloads","support_download.eng.html","_self")
	)
),
Array(
	"CONTACT US",
	"contact_us.eng.html",
	Array(
	)
)

);
//印出主選單

var text=String("")
var HREF=String("");
text+="<table style='position:absolute;z-index:100;left:380px;top:0px;border:0px gray dashed' height=20 border=0 cellspacing=1 cellpadding=0><tr background="+menu_but+">";

for(i=0;i<=mmenu.length-1;i++)
{

	HREF=(mmenu[i][1]!="")?mmenu[i][1]:"javascript:doing_nothing()";
	CURSOR=(mmenu[i][1]!="")?"hand":"default";
	text+="<td id='menu_"+i+"' background="+menu_but+" valign=top>"+
	"<a href="+HREF+" style='width:100%;cursor:"+CURSOR+"'"+
	" onclick=location='"+HREF+"'"+
	" onmouseover=\"if(mmenu["+i+"][2].length!=0){show('smenu"+i+"');}window.status='"+mmenu[i][0]+"';return true;\""+
	" onmouseout=\"if(mmenu["+i+"][2].length!=0){hide('smenu"+i+"');}\" "+
	" style=font-family:Tahoma;font-size:9pt;color:black>"+
	"<table  height=100% border=0 cellspacing=0 cellpadding=0>"+
	"<tr><td width=80 valign=top align=center style=font-family:tahoma;font-size:8pt>"+
	"<b style=color:black><u>"+mmenu[i][0]+"</u></div></b>"+
	"</td></tr></table></a></td>";
}

text+="</tr></table>";

document.write(text);


//印副選單副程式...

function c_div(num,smenu,div_top,div_left)
{
	var text=String();
	var d_id="smenu"+num;

	text+="<div style=position:absolute;top:"+div_top+"px;left:"+div_left+
	"px;visibility:hidden;z-index:100 id="+d_id+" onmouseover=show('"+d_id+
	"') onmouseout=hide('"+d_id+"')>";


	text+="<table border=0 bgcolor=white width=111 cellspacing=1 cellpadding=0 style='border-left:1px gray dashed;border-right:1px gray dashed;border-bottom:1px gray dashed'>";
	for(a=0;a<smenu.length;a++)
	{
  		item_content=smenu[a][0];
  		item_url=smenu[a][1];
  		item_target=smenu[a][2];
  		item_cursor=(item_url!="")?"hand":"default";
	 	var sm="sm_"+item_content;
	 	item_url=(item_url=="")?"javascript:cons()":item_url;
 		var sm="sm_"+item_content;
 	
 		text+="<tr><td bgcolor=black align=left nowrap>";
		text+="<a href='"+item_url+"'><div onclick=location='"+item_url+"'>"+
		"<table border=0 id=\""+sm+"\" style=color:black width=100% "+
 		"border=0 cellspacing=0 cellpadding=2><tr><td bgcolor=white "+
 		"style=font-size:9pt;text-decoration:none;cursor:"+item_cursor+" nowrap "+
  		"onmouseover=\"this.bgColor='#66a2e3';document.getElementById('"+sm+
		"').style.color='white';status='"+item_content+"';return true;\" "+
		"onmouseout=\"this.bgColor='white';document.getElementById('"+sm+
		"').style.color='black';status=''\"><font face=Tahoma><b>&nbsp;"+
		item_content+"</b></font></td></tr></table></div></a></td><td></td></tr>"; 		
 	}

	text+="</table></div>";
	
	
	if(smenu.length!=0){
		document.write(text);
	}

}

//印出副選單

var tmp_top=menu_top+29;
var tmp_left=menu_left;
for(i=0;i<=mmenu.length-1;i++){
	c_div(i,mmenu[i][2],tmp_top,tmp_left);
	tmp_left+=75;
}


function show(id_name)//顯示layer
{
	//alert(document.getElementById(id_name).style.visibility);
	document.getElementById(id_name).style.visibility="visible";
}

function hide(id_name)//隱藏layer
{
	document.getElementById(id_name).style.visibility="hidden";
}

function doing_nothing()//為了怕按到分類按鈕所做的function
{
}
function cons()
{
	alert("under construction...");
}

