
var image_path = "img/";

//選單相關css定義:
document.write("<style>\n");
document.write(".leftmenu_item{border-bottom:1px dashed #6ea9c7;text-align:left}");
document.write("</style>\n");

/*----主選單設定----*/
//類別內容
var lmenu=new Array(
Array(
	"left_button_A001.jpg",
	"index.eng.html",
	Array(
	   Array("Bluetooth USB Dongle","bluetooth_product1.html","_self"),
           Array("Bluetooth Mono Headset","bluetooth_product2.html","_self"),
           Array("Bluetooth Stereo Headset","bluetooth_product3.html","_self")   
	)
),
Array(
	"left_button_A002.jpg",
	"",
	Array(
	   Array("802.11n Micro Dongle","wifi_product1.html","_self"),
           Array("802.11n Mobile 3G Router","wifi_product2.html","_self")
	)
),
Array(
	"left_button_A003.jpg",
	"",
	Array(
		Array("GPS Bike","gps_product1.html","_self"),
		Array("Travel Recorder","gps_product2.html","_self"),
		Array("Tracker","gps_product3.html","_self")
	  )
),
Array(
	"left_button_A004.jpg",
	"contact_us.eng.html",
	Array(
        Array("BT+WiFi Modules","Module_product1.html","_self"),
        Array("Bluetooth Modules","Module_product2.html","_self"),
	Array("GPS Modules","Module_product3.html","_self")
	)
)

);


//印出主選單
for(a=0;a<lmenu.length;a++)
{
document.write("<div class='leftmenu_item'>");
  document.write("<font onclick='pro_menu_show("+a+")' style='cursor:hand'><img border=0 src='"+image_path+"/"+lmenu[a][0]+"'></font><br>");
  //印出副選單
  if(lmenu[a][2].length)document.write("<div id='s"+a+"' style='padding-bottom:10px;background-color:white;padding-left:10px;display:none;font-family:tahoma;font-size:10px;width:100%'>");
  for(b=0;b<lmenu[a][2].length;b++)document.write("<a style='color:gray' href='"+lmenu[a][2][b][1]+"' target='"+lmenu[a][2][b][2]+"'><b>"+lmenu[a][2][b][0]+"</b></a><br>");  
  if(lmenu[a][2].length)document.write("</div>");
document.write("</div>");
}



function pro_menu_show(num)
{
  for(a=0;a<lmenu.length;a++)
  {
    if(lmenu[a][2].length)document.getElementById('s'+a).style.display=(a==num)?"block":"none";
  }
}



