ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	} else {
		ie5 = false; }
} else { ie5 = false; }

var width = 150; // Ã¢ÀÇ ³Êºñ
var border = "0"; //Å×µÎ¸® µÎ²²
var offsetx = 4; //¿ÞÂÊÀ¸·Î ºÎÅÍÀÇ À§Ä¡
var offsety = 4; //À§ÂÊÀ¸·Î ºÎÅÍÀÇ À§Ä¡
var fcolor = "#FFFFFF"; // º»¹®ÀÇ ¹è°æ»ö»ó
var backcolor = "#F1F1F1"; // Á¦¸ñÀÇ ¹è°æ»ö»ó
var textcolor = "#747475"; // º»¹®¿¡¼­ ±ÛÀÚ»ö
var capcolor = "#747475"; // Á¦¸ñÅ¸ÀÌÆ²ÀÇ »ö»ó
var fontstyle = "font-size:12px;"; //ÆùÆ®ÀÇ Å©±â

var x = 0;
var y = 0;
var snow = 0;
var tmpX, tmpY;
var newWin = null;
var doc_width=800, doc_height=600

if ( (ns4) || (ie4) )
{
	if (ns4) over = document.overDiv
	if (ie4) over = overDiv.style

	document.onmousemove = mouseMove;
	
	if (ns4) document.captureEvents(Event.MOUSEMOVE)
}


function nd() {
	if ( (ns4) || (ie4) )
	{
		snow = 0;
		hideObject(over);
	}
}

function drc(title,text)
{
	//alert("¾È³ç");
	txtee = "<TABLE id=popup border=0 WIDTH=145 STYLE='filter:alpha(opacity=100); border:1 #818888 solid' CELLPADDING=0 CELLSPACING=0><TR><TD BGCOLOR='#F1F1F1'><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0><TR height=18><TD align=center><SPAN ID='PTT'>&nbsp;<FONT style='font-size:12px;' COLOR='#747475'><B>"+title+"</B> &nbsp;</FONT></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0 BGCOLOR='#FFFFFF'><TR><TD align=left><SPAN ID='PST'><FONT COLOR='#747475' style='font-size:11px;'>"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"; 
	//txtee1 = "gfsadf";
	layerWrite(txtee);

	if(ns4)
	{
		doc_width=self.innerWidth;
		doc_height=self.innerHeight;
	}
	else
	{
		if(ie4)
		{
			doc_width=document.body.clientWidth;
			doc_height=document.body.clientHeight;
		}
	}

	disp();
	
}

function disp()
{
	if ( (ns4) || (ie4) )
	{
		if (snow == 0)
		{
			moveTo(over,tmpX,y+offsety);
			showObject(over);
			snow = 1;
		}
	}
}

function mouseMove(e)
{
	if (ns4) {x=e.pageX; y=e.pageY}
	if (ie5) {x=event.x; y=event.y}
	if (ie4) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}

	tmpX = (doc_width-x-offsetx-width < 0) ? (doc_width-width):(x+offsetx);
	
	if (snow)
	{
		moveTo(over,tmpX,y+offsety);
	}
}

function layerWrite(txtee) {
	
	if (ns4)
	{
		var lyr = document.overDiv.document
		lyr.write(txtee)
		lyr.close()
	}
	else if (ie4) document.all["overDiv"].innerHTML = txtee
	
}

function showObject(obj) {
	if (ns4) obj.visibility = "show"
	else if (ie4) obj.visibility = "visible"
}

function hideObject(obj) {
	if (ns4) obj.visibility = "hide"
	else if (ie4) obj.visibility = "hidden"
}

function moveTo(obj,xL,yL) {
	obj.left = xL;
	obj.top = yL;
}

var popupWin;

function toHex(dec) {
	// create list of hex characters
  	var hexCharacters = "0123456789ABCDEF"
  	
  	// if number is out of range return limit
	if (dec < 0) return "00"
	if (dec > 255) return "FF"
	
	// decimal equivalent of first hex character in converted number
	var i = Math.floor(dec / 16)
	
	// decimal equivalent of second hex character in converted number
	var j = dec % 16
	
	// return hexadecimal equivalent
	return hexCharacters.charAt(i) + hexCharacters.charAt(j)
}
	
// set background color to specified descriptors
function setbgColor(red, green, blue) {
   	document.bgColor = "#" + toHex(red) + toHex(green) + toHex(blue)
}
	
// fade from start to end descriptors (increase step to increase transition speed)
function fade(sred, sgreen, sblue, ered, egreen, eblue, step) {
	// loop to create fade effect
    for(var i = 0; i <= step; ++i) {
    // set current red descriptor
    var red = Math.floor(sred * ((step - i) / step) + ered * (i / step))
    // set current green descriptor
    var green = Math.floor(sgreen * ((step - i) / step) + egreen * (i / step))
    // set current green descriptor
    var blue = Math.floor(sblue * ((step - i) / step) + eblue * (i / step))
    // set background color according to descriptors
    setbgColor(red, green, blue)
    }
}


function high(which2)
{ 
	if (window.lowlighting) clearInterval(lowlighting);
	if (window.highlighting) clearInterval(highlighting);

	theobject=which2;
	highlighting=setInterval("highlightit(theobject )",50);
} 

function low(which2)
{ 
	if (window.lowlighting) clearInterval(lowlighting);
	if (window.highlighting) clearInterval(highlighting);

	theobject=which2;
	lowlighting=setInterval("lowlightit(theobject )",50)
} 
 
function highlightit(cur2)
{ 
	if (cur2.filters.alpha.opacity<75) cur2.filters.alpha.opacity+=25;
} 

function lowlightit(cur2)
{ 
	try
	{
		if (cur2.filters.alpha.opacity>=40) cur2.filters.alpha.opacity-=40;

		if (cur2.filters.alpha.opacity<45)
		{
			if (lowlighting) clearInterval(highlighting);
			if (highlighting) clearInterval(highlighting);
			nd();
		}
	} catch (e) {
		nd();
	}
}
