var tipTimer;

function locateObject(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document); return x;
}


function hideTooltip(object)
{
if (document.all)
{
    locateObject(object).style.visibility="hidden"
    locateObject(object).style.left = 1;
    locateObject(object).style.top = 1;
return false
}
else if (document.layers)
{
    locateObject(object).visibility="hide"
    locateObject(object).left = 1;
    locateObject(object).top = 1;
    return false
}
else
    return true
}

function showTooltip(object,e,style, tipContent1, tipContent2, tipContent3, tipContent4)//, displaytime)
{
    
    if (document.all)
        {
            locateObject(object).style.top=document.body.scrollTop+event.clientY+5
            
//            locateObject(object).innerHTML="<table cellpadding='0' cellspacing='0' border='0' width='10' bgcolor='#FFFFFF'>"
//			locateObject(object).innerHTML="<tr>"
//			locateObject(object).innerHTML="<td></td>"
//			locateObject(object).innerHTML="</tr>"
//			locateObject(object).innerHTML="</table>"

			locateObject(object).innerHTML='<table width="260" cellpadding="3" cellspacing="0" border="0"><tr><td colspan="2" height="5"></td></tr><tr height="20"><td width="70" class="'+style+'"><img src="images/tip_sales_arrow.gif" width="5" height="17" border="0" align="absmiddle"><b>ÇöÀåÀ§Ä¡</b> :</td><td width="190">'+ tipContent1+'</td></tr><tr><td colspan="2" height="1" bgcolor="#EBEBEB"></td></tr><tr height="20"><td class="'+style+'"><img src="images/tip_sales_arrow.gif" width="5" height="17" border="0" align="absmiddle"><b>°ø±ÞÆòÇü</b> :</td><td>'+ tipContent2+'</td></tr><tr><td colspan="2" height="1" bgcolor="#EBEBEB"></td></tr><tr height="20"><td class="'+style+'"><img src="images/tip_sales_arrow.gif" width="5" height="17" border="0" align="absmiddle"><b>°ø±Þ±Ô¸ð</b> :</td><td>'+tipContent3+'</td></tr><tr><td colspan="2" height="1" bgcolor="#EBEBEB"></td></tr><tr height="20"><td class="'+style+'"><img src="images/tip_sales_arrow.gif" width="5" height="17" border="0" align="absmiddle"><b>ºÐ¾ç¹®ÀÇ</b> :</td><td>'+ tipContent4+'</td></tr><tr><td colspan="2" height="1" bgcolor="#EBEBEB"></td></tr></table>'

            if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft))
                {    
                    locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10;
                }
            else
            {
            locateObject(object).style.left=document.body.scrollLeft+event.clientX
            }
        locateObject(object).style.visibility="visible"
        //tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
        //window.setTimeout("hideTooltip('"+object+"')", displaytime);
        }
    else if (document.layers)
        {
        locateObject(object).document.write('<table width="10" border="0" cellspacing="1" cellpadding="1"><tr><td><table width="10" border="0" cellspacing="0" cellpadding="2"><tr><td nowrap>'+unescape(tipContent)+'</td></tr></table><td></tr></table>')
        locateObject(object).document.close()
        locateObject(object).top=e.y+20

        if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth))
            {
                locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10;
            }
        else
            {
            locateObject(object).left=e.x;
            }
        locateObject(object).visibility="show"
        //tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
        window.setTimeout("hideTooltip('"+object+"')", displaytime);
    }
    else
    {
        return true
    }
}
