﻿/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div style="line-height:17px;" id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/arrow_tooltip.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
document.onmousemove=positiontip

var msg_help_note = '<br><b>Đã biết</b>: Là văn bản đã biết ngày hiệu lực hoặc đã biết tình trạng hiệu lực.<br><b>Liên quan hiệu lực</b>: Là những VB thay thế VB đang xem, hoặc bị VB đang xem thay thế.<br><b>Liên quan nội dung</b>: Là những VB có liên quan về nội dung với VB đang xem.'
var msg_help = new Array();
msg_help[0] = 'Các văn bản vừa mới ban hành.'
msg_help[1] = 'Chức năng tra cứu văn bản mở rộng.'
msg_help[2] = 'Tra cứu theo tình trạng hiệu lực của văn bản: <b>Còn/Hết/Sắp hết</b> hiệu lực.'
msg_help[3] = 'Tra cứu theo thời điểm áp dụng của văn bản: <b>Sắp có/Vừa có/Chưa xác định</b> hiệu lực.'
msg_help[4] = 'Tra cứu văn bản theo <b>lĩnh vực, ngành nghề</b>.'
msg_help[5] = 'Tra cứu văn bản theo năm ban hành.'
msg_help[6] = 'Tra cứu công văn.'
msg_help[7] = 'Tra cứu biểu thuế nhập khẩu WTO.'
msg_help[8] = 'Tra cứu bảng giá đất Tỉnh/Thành.'
msg_help[9]  = ''
msg_help[10] = ''
msg_help[11] = ''
msg_help[12] = '450Đây là nội dung có thu phí. Để xem Bạn cần phải có tài khoản <b>Basic</b>.<br>Bạn <b>Chuyển đổi tài khoản</b> tại ô <b>THÀNH VIÊN</b> phía trên bên trái hoặc<br>Liên hệ <b>(08) 845 6684</b>.' + msg_help_note 
msg_help[13] = '450Đây là nội dung có thu phí. Để xem Bạn cần phải có tài khoản <b>Basic</b>.<br>Hãy <b>Đăng nhập</b> hoặc <b>Đăng ký mới</b> tại ô <b>THÀNH VIÊN</b> phía trên bên trái hoặc<br>Liên hệ <b>(08) 845 6684</b>.' + msg_help_note
msg_help[14] = '450Đây là nội dung có thu phí. Tài khoản của Bạn đã hết hạn sử dụng.<br>Hãy <b>Gia hạn</b> tại ô <b>THÀNH VIÊN</b> phía trên bên trái hoặc<br>Liên hệ <b>(08) 845 6684</b>.' + msg_help_note
msg_help[15] = 'Thông tin cá nhân và thời hạn sử dụng.'
msg_help[16] = 'Chuyển đổi tài khoản <b>Free</b> sang <b>Basic</b>.'
msg_help[17] = 'Chuyển đổi tài khoản <b>Basic</b> sang <b>Pro</b>.'
msg_help[18] = 'Liệt kê các văn bản mà Bạn đã lưu trữ riêng.'
msg_help[19] = 'Đăng ký <b>Gia hạn</b> thời gian sử dụng.'

function LS_Tip(code,w){
	if (w==null) w = 320;
	if (w==0){
		//var s = msg_help[code];
		var s = code;
		ddrivetip(s.substr(3),s.substr(0,3))
	}else{
		ddrivetip(code,w)
	}
}
function LS_Hide(){hideddrivetip();}