hidetip_flag = 0;
function showtip(current,e,text)
{
        hidetip_flag=0;
	var left_offset;
	if ( showtip.arguments.length >= 4)
		top_offset = showtip.arguments[3];
	else
		top_offset = 0;

	if ( showtip.arguments.length >= 5)
		left_offset = showtip.arguments[4];
	else
		left_offset = 0;

//  winW  = (document.layers) ? window.innerWidth : document.body.offsetWidth ;
//  winH  = (document.layers) ? window.innerHeight  : document.body.offsetHeight;
  if (document.layers) // Netscape 4.0+
  {
    theString="<DIV CLASS='ttip'>"+text+"</DIV>";
    document.tooltip.document.write(theString);
    document.tooltip.document.close();
    document.tooltip.left=e.pageX+14;
	if (left_offset) 
		document.tooltip.left -= ( left_offset + 14 );
    document.tooltip.top=e.pageY+2;
    document.tooltip.visibility="show";
//	alert(document.tooltip.offsetWidth);
  } else {
     if(document.getElementById) // Netscape 6.0+ and Internet Explorer 5.0+
     {
        elm=document.getElementById("tooltip");
        elml=current;
        elm.innerHTML=text;
        elm.style.width=elml.style.width;
        elm.style.height=elml.style.height;
        elm.style.top  = getOffset(elml, "Top")  + elml.offsetHeight;
        elm.style.left = getOffset(elml, "Left"); // + elml.offsetWidth;
		if ( left_offset > 0) {
			elm.style.left = getOffset(elml, "Left") - left_offset; 
			if ( elm.style.left < 0 ) elm.style.left = 0;
		}
		if ( top_offset > 0) {
			elm.style.top = getOffset(elml, "Top") - top_offset; 
			if ( elm.style.top < 0 ) elm.style.top = 0;
		}

        elm.style.visibility = "visible";
     }
  }
}

function hidetip(){
  hidetip_flag=1;
  setTimeout('hidetip1()', 5000);
  return;
}
function hidetip1(){
   if ( !hidetip_flag ) return;
   window.status = "";
   if (document.layers) // Netscape 4.0+
   {
    document.tooltip.visibility="hidden";
   } else {
      if(document.getElementById) // Netscape 6.0+ and Internet Explorer 5.0+
      {
        elm.style.visibility="hidden";
      }
   } 
}

function getOffset(el, which) {
   var amount = 0;
   while (el!=null) {
     amount+=el["offset"+which]
     el = el.offsetParent
   }
   return amount
}

function openWin(text) {
var newwin = window.open('', 'detail_result'
        ,'width=800,height=350,scrollbars=yes,left=380,top=0');

    newwin.document.open();
    newwin.document.write(text);

    str = "<script>"
        + " function closeWin() { "
        + " self.close(); "
        + " } "
        + "<" + "/" + "script>"
        ;

    str += "<br><br> <center> "
        +  " <a href=javascript:closeWin()> Close </a>"
        +  "</center>";

    newwin.document.write(text);
    newwin.document.write(str);
    newwin.document.close();
    newwin.focus();
}
