﻿
_menuCloseDelay=500           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150            // The time delay before menus open on mouse over
_subOffsetTop=10              // Sub menu top offset
_subOffsetLeft=-10            // Sub menu left offset


with(menuStyle=new mm_style()){
onbgcolor="#334455";
oncolor="#ffffff";
offbgcolor="#223344";
offcolor="#ffffff";
bordercolor="#000000";
borderstyle="raised";
borderwidth=1;
separatorcolor="#334455";
separatorsize="0";
padding=5;
fontsize="8pt";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
pagecolor="white";
pagebgcolor="#223344";
headercolor="#000000";
headerbgcolor="#ffffff";
onborder = "1px outset #334455"
high3dcolor="#223344";
low3dcolor="#000000";
swap3d="1";

overfilter="Alpha(opacity=100);Shadow(color='#000000', Direction=135, Strength=2)";

}


M_ToolTipDelay=700    // Milliseconds after menu has been displayed before showing tooltip
M_maxWidth=0          // Sets the maximum width, set to 0 for 100%

// The above 2 parameters are the only user definable parameters for this module.
// In order to use this module you will also need the Milonic DHTML Menu code files
// The syntax for tooltips is: showtip("This is your text <b><i>With HTML </i></b> too!")

with(M_toolTipStyle=new mm_style()){
    offbgcolor = "#ffffa1";
      offcolor = "#000000";
   bordercolor = "#999999";
   borderstyle = "solid";
       padding = 1
   borderwidth = 1
      fontsize = "11px";
     fontstyle = "normal";
    fontfamily = "tahoma, verdana";
    overfilter = "Fade(duration=0.1);Shadow(color='#001122', Direction=135, Strength=3)"
}
with(new menuname("M_toolTips"))
{
	top="offset=10"
	left="offset=10"
	style=M_toolTipStyle;
	aI("text=;type=ToolTip;");
}


with(topStyle=new mm_style()){
onbgcolor="#223344";
oncolor="#ffffff";
offbgcolor="#223344";
offcolor="#ffffff";
bordercolor="#223344";
borderstyle="solid";
borderwidth=0;
separatorcolor="#223344";
separatorsize="30";
padding=5;
fontsize="8pt";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
pagecolor="white";
pagebgcolor="#223344";
headercolor="#000000";
headerbgcolor="#ffffff";
}


with(milonic=new menuname("Main Menu")){
style=topStyle;
top=0;
left=screen.width/2-245;
alwaysvisible=1;
orientation="horizontal";
aI("text=Home;url=/;status=Back to my homepage;");
aI("text=Teaching;showmenu=Teaching;status=Một số tài nguyên dành cho sinh viên;");
aI("text=Research;showmenu=Research;status=Các bài báo và đề tài khoa học;");
aI("text=Projects;showmenu=Projects;status=Một số dự án tôi từng tham gia;");
aI("text=Scripts;showmenu=Scripts;status=Một số script tiện ích;");
aI("text=Resources;showmenu=Resources;status=Các tài nguyên khác;");
}

with(milonic=new menuname("Teaching")){
style=menuStyle;
overflow="scroll";
aI("text=Kiến trúc máy tính;url=/ca.asp;onfunction=showtip('Computer Architecture')");
aI("text=Kỹ thuật Vi xử lý;url=/ktmt;onfunction=showtip('Microprocessors')");
aI("text=Lập trình Web;url=/web.asp;onfunction=showtip('Web Programming')");
aI("text=Tin học đại cương;url=/it.asp;onfunction=showtip('Introduction to Informatics')");
aI("text=Thiết kế nhờ máy tính;url=/vhdl.asp;onfunction=showtip('Computer Aided Design')");
aI("text=Các môn học khác;url=/subjects.asp;onfunction=showtip('Other modules')");
}

with(milonic=new menuname("Research")){
style=menuStyle;
overflow="scroll";
aI("text=Publications;url=/pubs.asp;onfunction=showtip('Các bài báo khoa học')");
}

with(milonic=new menuname("Projects")){
style=menuStyle;
overflow="scroll";
aI("text=VIOLET;url=http://www.bachkim.vn/violet.asp;onfunction=showtip('Visual and Online Lecture Editor for Teachers')");
aI("text=DATRIX;url=http://www.datrix.jp;onfunction=showtip('Auto Recovery Technology')");
aI("text=PLATIN Web;url=http://www.bachkim.vn;onfunction=showtip('Platin JSC, Website')");
aI("text=ICPS;url=/icps.htm;onfunction=showtip('Information Collecting and Parsing System')");
}

with(milonic=new menuname("Scripts")){
style=menuStyle;
overflow="scroll";
aI("text=Download MP4 from YouTube;url=/fetchmp4.asp;onfunction=showtip('Download file MP4 từ YouTube')");
aI("text=Download music from NhacSo.Net;url=/nhacso.asp;onfunction=showtip('Download nhạc từ NhacSo.Net')");
aI("text=Display geographical location of an IP address;url=/ipinfo.asp;onfunction=showtip('Hiện thông tin địa lý của địa chỉ IP')");
}

with(milonic=new menuname("Resources")){
style=menuStyle;
overflow="scroll";
aI("text=My programs;url=/programs.asp;onfunction=showtip('Một số chương trình do tôi thực hiện')");
aI("text=Chip's photos;url=http://www.flickr.com/photos/anhchip02/page5/;onfunction=showtip('Album ảnh của Chip')");
aI("text=Utilities;url=/utils.asp;onfunction=showtip('Một số phần mềm tiện ích')");
aI("text=e-Books;url=/ebooks.asp;onfunction=showtip('Bộ sưu tập sách điện tử về lập trình')");
aI("text=Links;url=;onfunction=showtip('Liên kết tới các website khác')");
}

drawMenus();

// drawMenus()

function buildTips(_ttext)                // Function for showing Tooltips
{
	_Tmnu=getMenuByName("M_toolTips")     // Get a reference to the tooltips menu
	_Tgm=gmobj("menu"+_Tmnu)              // Get the object reference to the tooltips menu
	if(!ns4&&(!_m[_Tmnu][23]&&!_startM))  // If the menu hasn't been built yet, build it
	{
		_m[_Tmnu][23]=_Tmnu               // Set the menu built flag
		BDMenu(_Tmnu)                     // Build the menu, this only happens once, or at least should do.
	}

	_el=_m[_Tmnu][0][0]                   // Set the menu element reference for building the menu items
	_mi[_el][1]=_ttext                    // Set the menu items text. This is the text that will be displayed
	if(ns4)
	{
		dte="<table width=1 cellpadding=0 cellspacing=0 border=0>"+drawItem(_el)+"</table>";
		with(_Tgm.document){open();write(dte);close()}
		_brd=gmobj("bord"+_Tmnu)
		_brdwid=(_m[_Tmnu][6].borderwidth*2)
		_brd.clip.width=_Tgm.clip.width+_brdwid
		_brd.clip.height=_Tgm.clip.height+_brdwid
		_brd.bgColor=_m[_Tmnu][6].bordercolor

	}
	else
	{
		_Tgm.innerHTML=_drawMenu(_Tmnu)   // Change the menu item for browsers other than Netscape 4
	}

	_i=_itemRef
	popup("M_toolTips",1);                // Display the menu based on MouseX and MouseY coordinates
	_itemRef=_i
	_gp=gpos(_gm)

	if((_gp[0]+_gp[2])>_bH)
	{
		spos(_gm,MouseY-_gp[2])
	}

	if(ns4)
	{
		_brd.zIndex=_zi+1
		_zi++
		_Tgm.zIndex=_zi+1
	}
	else
	{
		//alert()
		_Tgm.style.zIndex=_zi+100
	}

}

function showtip(_ttext)                  // This function that sets the timer for showing the tooltip
{
	clearTimeout(_Mtip)	                  // Clear the ToolTop timer
	_Mtip=null                            // Need to set the timer to null for Konquerers sake.
	if(!op5&&!op6)                        // Don't bother with Opera 5 or Opera 6, these browsers do not support dynamic change of text
	if(!inDragMode)
	{
		_Mtip=setTimeout("buildTips('"+_ttext+"',1)",_menuOpenDelay+M_ToolTipDelay) // Set the tooltip timer
	}
}
