
var msgTag =   "<!-- msg -->"+
                        "<div id=msg style='position:absolute; top:36; left:551; display:none;'>"+
                        "<!--div id=msg style='position:absolute; display:none;'-->"+
                        "<table border=0 cellpadding=0 cellspacing=0 width=157>"+
                        "<tr>"+
                        "<td><img src=/img/i_msg_01.gif align=absmiddle></td>"+
                        "</tr>"+
                        "</table>"+
                        "<table border=0 cellpadding=0 cellspacing=0 width=159 background=/img/i_msg_02.gif>"+
                        "<tbody id=msgbox>"+
                        "<tr valign=top>"+
                        "<td style='padding:3' class='txt_nr txt_msg' fname=message />"+
                        "<img src=/img/i_msg_close.gif align=absmiddle vspace=3 style='margin:0 0 2 3;cursor:hand;' onClick=document.all.msg.style.display='none';>"+
                        "</tr>"+
                        "</tbody>"+
                        "<tr>"+
                        "<td colspan=2><img src=/img/i_msg_03.gif align=absmiddle></td>"+
                        "</tr>"+
                        "</table>"+
                        "</div>"+
                        "<!-- // msg -->";

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

function showMsgWindowPosition() {
        var org = document.images('msgbtn');
	// org : basis element
	// layer : showable layer element ( style.position == absolute ;)
	if ( ! org ) org = event.srcElement;
	var offsetTop = getAbsoluteOffsetValue(org, "offsetTop");
	var offsetLeft = getAbsoluteOffsetValue(org, "offsetLeft");
	var posTop;
	var posLeft;

	msg.style.display = "block";

	posTop = offsetTop+18;
	posLeft = offsetLeft - msg.offsetWidth +30;

	msg.style.top = posTop + 1;
	msg.style.left= posLeft + 1;
}

// 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;
}

function setMessage(msg, sec, errCode) {
    showMsgWindowPosition();
    var msgFormat = msg+"<img src=/img/i_msg_close.gif align=absmiddle vspace=3 style='margin:0 0 2 3;cursor:hand;' onClick=document.all.msg.style.display='none';>";
    msg = msg.trim();
    if ( typeof(errCode) == "undefined" ) {                                   // ¿¡·¯ÄÚµå ¾ø´Â °æ¿ì msg °ª¸¸ º¸¿©ÁØ´Ù
        msgbox.rows[0].cells[0].innerHTML = msgFormat;
    }
    else {
        msgbox.rows[0].cells[0].innerHTML = msgFormat;
    }

    if(msg == "" || msg == "&nbsp;") {                                                                     //¸Þ½ÃÁö°¡ ¾ø´Â °æ¿ì ¾Æ¿¹ ¸Þ½ÃÁö Ã¢À» º¸ÀÌÁö ¾Ê´Â´Ù.
        document.all.msg.style.display = "none";
        return;
    } else if(sec == 0)  {                                                          //0ÃÊ·Î ÀÔ·ÂµÈ °æ¿ì ¸Þ½ÃÁö Ã¢À» °è¼Ó º¸¿©ÁØ´Ù
        document.all.msg.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.msg.style.display = "none";
    else {
        document.all.msg.style.display = "";
        window.setTimeout("Timer(closeTime)", sec*1000)
    }
}
//  msg <!-- end -->

// µðÀÚÀÎ °ü·Ã ÇÔ¼öµé

// rollover
var changedImg;

function EImgChg(flag)
{
	source=event.srcElement;
	if (source.name == "")
	{ return false;  }

	if(changedImg == source.name)
	return;


	else if (document.images && source.tagName=="IMG") {
		imgElement = source.name;  // ÀÌ¹ÌÁö name
		imgPath = source.src;   // ÀÌ¹ÌÁö src ¼Ó¼º°ª

		imgPathLen = imgPath.length;
		imgPathFlag = imgPath.lastIndexOf("/");
		imgName = imgPath.substring(0,imgPathFlag+1);

		document.images[imgElement].src =  imgName + imgElement + "_" + flag + ".gif";

	}
}

// µ¥ÀÌÅ¸½ºÅ©·Ñ ÇÔ¼ö->Å×ÀÌºí µÎ°³
function datos_onscroll01() {
    if (datos.scrollLeft != text2.value) {
        text2.value = datos.scrollLeft;
        tituloscolumnas.scrollLeft = datos.scrollLeft;
        return;
    }

    if (datos.scrollHeight != text2.value) {
        text2.value = datos.scrollTop;
        tituloscolumnas.scrollTop = datos.scrollTop;
        return;
    }
}

// µ¥ÀÌÅ¸½ºÅ©·Ñ ÇÔ¼ö->Å×ÀÌºí ³×°³
function datos_onscroll02() {
    if (datos.scrollLeft != text1.value) {
        text1.value = datos.scrollLeft;
        tituloscolumnas.scrollLeft = datos.scrollLeft;
        return;
    }


    if (datos.scrollHeight != text2.value) {
        text2.value = datos.scrollTop;
        titulosfilas.scrollTop = datos.scrollTop;
        return;
    }
}

function tabSetting(objId,mode) {
    var nowtabImg = document.getElementById(objId+"Img");
    if (nowtabImg) nowtabImg.src = "/stk/img/tab_" + objId + "_" + mode + ".gif";
}

function tabOnOff(thisId,mode) {
    if ( prevId != thisId ) tabSetting(thisId,mode);
}

function tabClick(thisId) {
    if ( prevId != thisId ) tabSetting(prevId,'off');
    prevId = thisId;
}

function searchKP200(){
    openPop2('http://www.goodi.com/code/KP.htm', 'KPWin', 273, 398, 0, 0, 'no' );
}

function BBS(){
    openPop2( 'http://www.goodi.com/rsh/brd/rsh_pop_05.htm', 'notice', 400, 295, 200, 355, 'no' );
}

function BBSYahoo(){
    openPop2( 'http://www.goodi.com/rsh/brd/rsh_pop_07.htm', 'notice', 400, 345, 200, 355, 'no' );
}

function QABBS(){
    openPop2( 'http://www.goodi.com/cst/qna_pop.htm', 'notice', 340, 190, 200, 355, 'no' );
}

function searchKP(){
    openPop2('http://www.goodi.com/code/code_bbs.htm', 'codeWin', 273, 398, 0, 0, 'no' );
}

// calendar °ü·Ã ÇÔ¼ö
function calendar(iObject){
    openPop2( 'http://www.goodi.com/util/calendar.htm?'+iObject, 'calWin', 201,203, 200, 355, 'no' );
}

function openPop2(url, name, width, height, left, top, sbar, noOption) {
	if ( ! noOption ) {
		var pop = window.open(url, name, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+ sbar  +",resizable=1,top=0,left=0,width="+ width +",height="+ height + " left="+ left +",top="+ top);
	} else {
		var pop = window.open(url, name);
	}
	try { pop.focus(); } catch(e) {}
}


/**
 * @type   : function
 * @access : public
 * @desc   : ÇØ´ç Å×ÀÌºí ³»ÀÇ ¸ðµç <td>ÀÇ °ªÀ» ÃÊ±âÈ­ÇÑ´Ù.
 * <pre>»ç¿ë¿¹ :
 *
 * init("tab1");
 *
 * ÁÖÀÇ : multiRowÀÏ°æ¿ì ¹ØÀÇ ÀÌ¹ÌÁö·Î tdÀÇ °£°ÝÀ» ¸ÂÃáºÎºÐÀ» °Çµå¸®Áö ¾Ê±â À§ÇØ¼­
 * if ( row.cells(c).innerHTML.substr(1, 3) != "IMG" ) ==> ÀÌÁ¶°ÇÀ» ÁÜ..
 * </pre>
 * @sig    :
 * @param :
 * @author : ¾î¿µ¼ö
 * @date : 2004/07/05
 */
function initailizeTable(obj) {
	if ( document.all[obj] != null ) {
	    var rlen = document.all[obj].rows.length;
	    for ( var r = 0; r < rlen; r++ ) {
	        var row = document.all[obj].rows[r];
	        for ( var c = 0, clen = row.cells.length; c < clen; c++ ) {
	            if ( row.cells(c).innerHTML.substr(1, 3) != "IMG" ) row.cells(c).innerHTML = "";
	        }
	    }
	}
}

// Ã»¾à °ü·Ã ÆË¾÷

function chungPopup( url, width, height, scroll, name ){
	if ( scroll == '' || scroll == null ) scroll = '0';
	if ( name == '' || name == null ) name = 'chungWin';
    openPop3( url, name, width, height, 150, 150, scroll );
}

function openPop3(url, name, width, height, left, top, sbar, noOption) {
	if ( ! noOption ) {
		var pop3 = window.open(url, name, "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars="+ sbar  +",resizable=1,top=0,left=0,width="+ width +",height="+ height + " left="+ left +",top="+ top);
	} else {
		var pop3 = window.open(url, name);
	}
	try { pop3.focus(); } catch(e) {}
}


// ÀÏ¹Ý ÆË¾÷ ¶ç¿ì±â
/*
function openPop(url, name, width, height, noOption) {
	if ( ! noOption ) {
		if ( pop != null )
			pop.location= url;
		else
			pop = window.open(url, name, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,top=0,left=0,width="+ width +",height="+ height + " left=400, top=250");
    }
    else {
        pop = window.open(url, name);
    }

    try { pop.focus(); } catch(e) {}
}
*/



// ÀÏ¹Ý ÆË¾÷ ¶ç¿ì±â
function openPop(url, name, width, height, noOption) {
	if ( ! noOption ) {
		var pop = window.open(url, name, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,top=0,left=0,width="+ width +",height="+ height);
	} else {
		var pop = window.open(url, name);
	}
	try { pop.focus(); } catch(e) {}
}





// openwindow
function openwindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

// focus
function allblur() {
  for (i = 0; i < document.links.length; i++)
    document.links[i].onfocus = document.links[i].blur;
}

/////////////////////////////////////////////////////////////////////////
function isCtrlKeyCode(keyCode) {
    //alert( keyCode );
    switch ( keyCode ) {
		case 8:// back space
		case 9:// alt + tab
		case 13:// enter
		case 16:// shift
		case 17:// ctrl
		case 18:// left alt
		case 19:// pause
		case 20:// tab
		case 21:// right alt
		case 25:// right ctrl
		case 27:// esc
		case 33:// page up
		case 34:// page down
		case 35:// end
		case 36:// home
		case 37:// ÁÂ
		case 38:// À§
		case 39:// ¿ì
		case 40:// ¾Æ·¡
		case 45:// insert
		case 46:// delete
		case 91:// left window key
		case 92:// right window key
		case 93:
		case 112:// f1
		case 113:
		case 114:
		case 115:
		case 116:
		case 117:
		case 118:
		case 119:
		case 120:
		case 121:
		case 122:
		case 123:// f12
		case 144:// num lock
		case 145:// scroll lock
		case 229:// ÇÑÀÚÅ°, ÇÑ±ÛÅ°
			return true;
		default:
			return false;
	}
}


// focus
function allblur() {
  for (i = 0; i < document.links.length; i++)
    document.links[i].onfocus = document.links[i].blur;
}

//flash link
function flashLink(a,b){
    parent.gmsh_top.navi_01.SetVariable("/:nindex",a);
    parent.gmsh_top.navi_01.SetVariable("/:mindex",b);
}

// layer
function LayerSH(LayerName,Status)
{
	LayerN = document.all[LayerName].style;
	if (Status == 'show') LayerN.display = '';
	if (Status == 'hide') LayerN.display = 'none';
}

function gothere()
{
    document.location.href = document.f1.dest.value;
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
        thefield.value = ""
} 

function go2006More(goUrl){
	top.main.location = goUrl;
}

var msg_NotInstallModule = 'º¸¾È ¸ðµâÀÌ Á¦´ë·Î ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n' +
          				   'ÀÎÅÍ³Ý »óÅÂ¿¡ µû¶ó ¼öºÐÀÌ»ó ¼Ò¿äµÉ ¼öµµ ÀÖ½À´Ï´Ù!\n' +
				           '´Ù½Ã È­¸éÀÌ Ç¥½ÃµÇ¸é ºê¶ó¿ìÀú ÁÂÃøÇÏ´Ü¿¡ ¿Ï·á ¸Þ½ÃÁö°¡ ³ª¿Ã ¶§±îÁö ±â´Ù·Á ÁÖ½ÅÈÄ\n' +
					       '´Ù½Ã ÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù! \n' + 
             			   '±×·¡µµ ¾ÈµÇ½Ã¸é ´Ù¿î·Îµå>Áö¿øÇÁ·Î±×·¥>º¸¾ÈÇÁ·Î±×·¥ ¿¡¼­ ´Ù½Ã ¼³Ä¡ ÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù!';
             			   
function alertINIpluginNotInstall(){
	alert(msg_NotInstallModule);
	document.location.reload();
}

//rollover2
function imgOver(imgName) {
	imgName.src = imgName.src.replace("off.gif", "on.gif");
	imgName.src = imgName.src.replace("off.jpg", "on.jpg");
}
function imgOut(imgName) {
	imgName.src = imgName.src.replace("on.gif", "off.gif");
	imgName.src = imgName.src.replace("on.jpg", "off.jpg");
}

function isVistaWindow(){
	if( navigator.appVersion.indexOf('Windows NT 6.0') != -1 ) 	return true;
	else false;			
}

function isIE7(){
	if( navigator.appVersion.indexOf('MSIE 7.0') != -1 ) 	return true;
	else false;			
}

// otpÄ«µå ÀÌ¿ë¾È³» ÆË¾÷
function otp_guide() { 
  window.open("http://www.goodi.com/pop/otp_guide.htm","","width=372,height=500,left=0,top=0,screenX=10,screenY=10,resizable=1,scrollbars=yes"); 
}
