
var loginmsgTag = "<div id=loginmsg style='position:absolute; display:none;z-index: 3000;'>"+
                "<table width=650 border=0 cellpadding=0 cellspacing=0 >" +
                "<tr valign=top>"+
                "<td width=357></td>" +
                "<td>" +
                "<table bgcolor=#FFFFFF width=255 border=0 cellpadding=0 cellspacing=0 >" +
                "<tr height=21>"+
                "<td>&nbsp;<img src=/img/t_clock_n.gif width=13 height=13 align=absmiddle> </td>" +
                "<td style='padding:3' class=time11_blue id=loginmsgbox ></td>"+
//                "<td><img src=/img/i_msg_close_n.gif align=absmiddle vspace=1 style='margin:0 0 2 3;cursor:hand;' onClick=document.all.loginmsg.style.display='none';></td>"+
                "</tr>"+
                "</table>"+
                "</td>" +
                "</tr>"+
                "</table>"+
                "</div>";

document.write(loginmsgTag);                                                     //Div·Î º¸¿©Áú Message Ã¢ Å×ÀÌºí
//if(document.images('loginmsgbtn'))   showLoginMsgWindowPosition();


function showLoginMsgWindowPosition() {
    
	var posTop;
	var posLeft;

	loginmsg.style.display = "block";
	
	posTop = 3;
    posLeft = 0;
    
	loginmsg.style.top = posTop + 1;
	loginmsg.style.left= posLeft + 1;
}

function setLoginMessage(msg, sec, errCode) {
    
    showLoginMsgWindowPosition();
    msg = msg.trim();
        
    if ( typeof(errCode) == "undefined" ) {                                   // ¿¡·¯ÄÚµå ¾ø´Â °æ¿ì msg °ª¸¸ º¸¿©ÁØ´Ù
        loginmsgbox.innerHTML = msg;
    }
    else {
        loginmsgbox.innerHTML = msg;
    }

    if(msg == "" || msg == "&nbsp;") {                                                                     //¸Þ½ÃÁö°¡ ¾ø´Â °æ¿ì ¾Æ¿¹ ¸Þ½ÃÁö Ã¢À» º¸ÀÌÁö ¾Ê´Â´Ù.
        document.all.loginmsg.style.display = "none";
        return;
    } else if(sec == 0)  {                                                          //0ÃÊ·Î ÀÔ·ÂµÈ °æ¿ì ¸Þ½ÃÁö Ã¢À» °è¼Ó º¸¿©ÁØ´Ù
        document.all.loginmsg.style.display = "";
        return;
    } else {                                                                            //ÀÔ·ÂµÈ ÃÊ ¸¸Å­ ¸Þ½ÃÁö Ã¢À» ¶ç¿î´Ù.
        var time = new Date();
        closeTime = time.getHours()*3600+time.getMinutes()*60+time.getSeconds();
        closeTime += sec;                                                       // This number is how long the window stays open
        Timer(closeTime, sec);
    }
}

String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }
function Timer(closeTime, sec) {
    var time= new Date();
    curTime = time.getHours()*3600+time.getMinutes()*60+time.getSeconds();
    if (curTime >= closeTime)
        document.all.loginmsg.style.display = "none";
    else {
        document.all.loginmsg.style.display = "";
        window.setTimeout("Timer(closeTime)", sec*1000)
    }
}

// style.position ÀÌ absolute °¡ ¾Æ´Ñ ÅÂ±×¿ÀºêÁ§Æ®ÀÇ Àý´ëÀ§Ä¡ ¾Æ´Â ¹æ¹ý
function getAbsoluteOffsetValue(o, attName) {
	var result = 0;
	result += o[attName];
	var parentTag = o;
	while ( parentTag = parentTag.offsetParent ) {
		result += parentTag[attName];
	}
	return result;
}
