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 = 180; // È­¸éÀÇ °¡·Î±æÀÌ
var border = "0";
var offsetx = 0;
var offsety = 20;
var fcolor = "#666666"; // Á¦¸ñÀÌ µé¾î°¡´Â ºÎºÐÀ» Á¦¿ÜÇÑ ±× ¹ØÀÇ º»¹®ÀÇ ¹è°æ»ö
var backcolor = "#000000"; // Á¦¸ñÀÌ µé¾î°¡´Â ºÎºÐÀÇ ¹è°æ»ö
var textcolor = "#ffffff"; // º»¹®¿¡¼­ ±ÛÀÚ»ö
var capcolor = "#ffffff"; // Á¦¸ñ(Å¸ÀÌÆ²)ÀÇ »ö±ò 
var fontstyle = "font-size:8pt; family:µ¸¿ò;"; // ±âº»ÀûÀÎ ÆùÆ®ÀÇ »çÇ×

var x = 0;
var y = 0;
var snow = 0;
var tmpX, tmpY;
var newWin = null;
var doc_width=179, doc_height=400

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)
{
	txt = "<TABLE id=popup border=0 WIDTH="+width+" STYLE=\"filter:alpha(opacity=40); border:1 #101010 solid\" CELLPADDING="+border+" CELLSPACING=0><TR><TD BGCOLOR=\""+backcolor+"\"><TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0><TR><TD align=left><SPAN ID=\"PTT\"><FONT style="+fontstyle+" COLOR=\""+capcolor+"\">"+title+"</FONT></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD align=left><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\" style="+fontstyle+">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>" 
	layerWrite(txt);

	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 (ie4) {x=event.x; y=event.y}
	if (ie5) {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(txt) {
	
	if (ns4)
	{
		var lyr = document.overDiv.document
		lyr.write(txt)
		lyr.close()
	}
	else if (ie4) document.all["overDiv"].innerHTML = txt
	
}

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) {

  	var hexCharacters = "0123456789ABCDEF"
  	
	if (dec < 0) return "00"
	if (dec > 255) return "FF"
	
	var i = Math.floor(dec / 16)
	
	var j = dec % 16
	
	return hexCharacters.charAt(i) + hexCharacters.charAt(j)
}
	
function setbgColor(red, green, blue) {
   	document.bgColor = "#" + toHex(red) + toHex(green) + toHex(blue)
}
	
function fade(sred, sgreen, sblue, ered, egreen, eblue, step) {
    for(var i = 0; i <= step; ++i) {
    var red = Math.floor(sred * ((step - i) / step) + ered * (i / step))
    var green = Math.floor(sgreen * ((step - i) / step) + egreen * (i / step))
    var blue = Math.floor(sblue * ((step - i) / step) + eblue * (i / step))
    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+=30;
} 

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();
	}
}