﻿/***********************************************
* Cool DHTML tooltip script- © 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 offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
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") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
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 ShowToolTip(thetext)
{
	if (ns6||ie)
	{
		//if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
		//if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
			//tipobj.innerHTML=thetext;
		thetext = thetext.replace("`", "'");
		tipobj.innerHTML= thetext;
		/* '<table id="Table_01" width="408" height="316" border="0" cellpadding="0" cellspacing="0">'
			+'<tr>'
				+'<td rowspan="3">'
					+'<img src="images/hinhmay_01.gif" width="52" height="316" alt=""></td>'
				+'<td>'
					+'<img src="images/hinhmay_02.gif" width="300" height="64" alt=""></td>'
				+'<td rowspan="3">'
					+'<img src="images/hinhmay_03.gif" width="56" height="316" alt=""></td>'
			+'</tr>'
			+'<tr>'
				+'<td background="images/a dime a dozen.jpg">'
					+'<img src="images/hinhmay_04.gif" width="300" height="220" alt=""> <br>' + thetext 
				+'</td>'
			+'</tr>'
			+'<tr>'
				+'<td>'
					+'<img src="images/hinhmay_05.gif" width="300" height="32" alt=""></td>'
			+'</tr>'
		+'</table>';*/
		enabletip=true
		return false
	}
}


function positiontip(e){
if (enabletip){
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 rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-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=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
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+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}




document.onmousemove=positiontip

function GetToolTipString(sWords, sDefinePhrase)
{
    sWords = sWords.replace("`", "'");
    sDefinePhrase = sDefinePhrase.replace("`", "'");
    
var str =  "<div class='popup1'>" + 
	            "<div class='popup_top1'></div>" +
                "<div class='popup_cter1'>" +
                    "<div class='img_pencil'><img src='App_Themes/Htan/Images/butchi.gif' /></div>" +
                    "<div class='popup_cter1_inner'>" + 
                        "<span><strong>" + sWords + "</strong></span>" +
                        "<div class='color04'>" + sDefinePhrase + "</div>" +
                    "</div>" +
                "</div>" +
                "<div class='popup_btom1'></div>" +
            "</div>";
    
//    var str =   "<table width='504' style='vertical-align:middle' border='0' cellspacing='0' cellpadding='0'>" +
//              "<tr>" +
//               "<td align='center' valign='top' class='bgtop'></td>" +
//              "</tr>" +
//              "<tr>" +
//               "<td  align='left' valign='top'>" +
//               "<table class='line' bgcolor='#FFFFFF' width='499' border='0' cellpadding='0' cellspacing='0'>" +
//                "<tr>" +
//                 "<td width='15'></td>" +
//                 "<td width='462'>" +
//                  "<span style='color:#000000;font-family:Tahoma;font-size:14px;font-weight:bold'>" + sWords + "</span>" +
//                 "</td>" +
//                 "<td width='10'></td>" +
//                "</tr>" +
//                "<tr>" +
//                 "<td width='15'></td>" +
//                 "<td>" +
//                  "<span style='color:#ff0000;font-family:Tahoma;font-size:12px;font-weight:normal'>" + sDefinePhrase + "</span>" +
//                 "</td>" +
//                 "<td width='10'></td>" +
//                "</tr>" +
//               "</table></td>" +
//              "</tr>" +
//              "<tr>" +
//               "<td align='center' valign='top' class='bgbottom'></td>" +
//              "</tr>" +
//             "</table>";
               
    return str;
}


