//  -----------------------------------------------------------------------------
//   ÆÄÀÏ¸í   : lotte.js
//   ¼³¸í     : Lotte Portal °øÅë ÀÚ¹Ù½ºÅ©¸³Æ®
//              Ãß°¡ =>  <SCRIPT LANGUAGE='JavaScript' SRC='../js/lotte.js'></SCRIPT>
//   ÃÖÃÊÀÛ¼º : 2003.06.10
//   ÀÛ¼ºÀÚ   : Á¤Áö¿î
//   ¼öÁ¤»çÇ× :
//----------------------------------------------------------------------------

var winArr = new Array();  // ChildÃ¢À» ¸ðµÎ ´ã±âÀ§ÇÑ ¹è¿­
var workingCheck = false;  //

//----------------------------------------------------------------------------
// CheckBox Object¸¦ ³Ñ±â¸é ÀüºÎÃ¼Å©ÇÑ´Ù.
//   ¹Ýµå½Ã checkYnÀÌ¶õ ÀÌ¸§À» °¡Áø checkBox°¡ ÀÖ¾î¾ß ÇÏ¸ç, ÀÌ CheckBoxÀÇ
//   onClick event¿¡ ÀÌ functionÀ» Àû¿ëÇÑ´Ù.
//   ARGUMENTS
//      formName = CheckBox°¡ ÀÖ´Â formÀÇ name
//      obj = CheckBoxÀÇ name(form nameÀ» ºÙ¿©¼­ ³Ñ±ä´Ù. ¿¹:formName.chboxName
//   RETURN
//---------------------------------------------------------------------------*/
function checkAll(formName, obj){
    if (obj) {
        if (obj.length) {
            for (var i=0 ; i<obj.length ; i++)
                obj[i].checked = formName.checkYn.checked;
        }
        else
            obj.checked = formName.checkYn.checked;
    }
}

//----------------------------------------------------------------------------
// CheckBox°¡ ¹Ýµå½Ã ÇÑ °Ç¸¸ ¼±ÅÃµÇµµ·Ï Ã¼Å©
//   ARGUMENTS
//      obj = CheckBoxÀÇ name(form nameÀ» ºÙ¿©¼­ ³Ñ±ä´Ù. ¿¹:formName.chboxName
//   RETURN
//      boolean
//---------------------------------------------------------------------------*/
function checkValid(obj) {
    var checkedCount = 0;
    if (obj) {
        if (obj.length) {
            for(var i=0 ; i<obj.length ; i++)
                if (obj[i].checked) checkedCount++;
            if (checkedCount == 0) {
                alert('¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.      ');
                return false;
            } else if (checkedCount > 1){
                alert('ÇÑ Ç×¸ñ¸¸ ¼±ÅÃÇÏ½Ê½Ã¿À.      ');
                return false;
            } else
                return true;
        } else {
            if (!obj.checked) {
                alert('¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.      ');
                return false;
            } else
                return true;
        }
    } else {
        alert('Ç×¸ñÀÌ ¾ø½À´Ï´Ù.      ');
        return false;
    }
}

//----------------------------------------------------------------------------
// CheckBox°¡ ¹Ýµå½Ã ÇÑ °Ç ÀÌ»óÀº ¼±ÅÃµÇµµ·Ï Ã¼Å©
//   ARGUMENTS
//      obj = CheckBoxÀÇ name(form nameÀ» ºÙ¿©¼­ ³Ñ±ä´Ù. ¿¹:formName.chboxName
//   RETURN
//      checkedCount = checkµÈ ¼ö
//---------------------------------------------------------------------------*/
function checkValid2(obj) {
    var checkedCount = 0;
    if (obj) {
        if (obj.length) {
            for (var i=0 ; i<obj.length ; i++)
                if (obj[i].checked) checkedCount++;
            if (checkedCount == 0) {
                alert('¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.      ');
                return checkedCount;
            } else
                return checkedCount;
        } else {
            if (!obj.checked) {
                alert('¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.      ');
                return checkedCount;
            } else {
                checkedCount++;
                return checkedCount;
            }
        }
    } else {
        alert('Ç×¸ñÀÌ ¾ø½À´Ï´Ù.');
        return false;
    }
}

//----------------------------------------------------------------------------
// ¼±ÅÃµÈ CheckBox ¶Ç´Â RadioButton ÀÇ Value¸¦ ReturnÇÑ´Ù.
//   ARGUMENTS
//      obj = CheckBoxÀÇ name(form nameÀ» ºÙ¿©¼­ ³Ñ±ä´Ù. ¿¹:formName.chboxName
//   RETURN
//---------------------------------------------------------------------------*/
function getCheckedValue(obj) {
    var checkedValue='';

    if (obj.length) {
        for (var i=0 ; i<obj.length ; i++) {
            if (obj[i].checked) {
                checkedValue = obj[i].value;
                return checkedValue;
            }
        }
    } else {
        if(obj.checked) {
            checkedValue = obj.value;
            return checkedValue;
        }
    }

    return checkedValue;
}

//------------------------------------------------------------------------------
// window popup & move to center
//------------------------------------------------------------------------------
function com_openBrWindowCenter(theURL, winName, width, height, features) {
    var leftX = screen.width / 2 - width / 2;
    var topY = -75 + screen.height / 2 - height / 2;

    var featuresValue = 'width=' + width + ',height=' + height;
    featuresValue += ',left=' + leftX + ',top=' + topY;
    if (features.length > 0)
        featuresValue += ',' + features;

    winArr[winArr.length] = window.open(theURL,winName,featuresValue);
}

//------------------------------------------------------------------------------
// window popup & just open
//------------------------------------------------------------------------------
function com_openBrWindow(theURL, winName, features) {
    winArr[winArr.length] = window.open(theURL,winName,features);
}

//------------------------------------------------------------------------------
// clientÃ¢ ¸ðµÎ ´Ý±â
//------------------------------------------------------------------------------
function winCloseAll() {
    for (i=0 ; i<winArr.length ; i++)
        winArr[i].close();
}

//------------------------------------------------------------------------------
// ´Þ·ÂÀ» »ç¿ëÇÏ±â À§ÇÑ ÀÚ¹Ù ½ºÅ©¸³Æ®.
// openerÀÇ form name°ú ³¯Â¥¸¦ ¹Þ´Â objectÀÇ ÀÌ¸§À»(´ëºÎºÐ textboxÀÇ ÀÌ¸§ÀÌ ¾Æ´Ò±î....)
// ½ºÆ®¸µÀ¸·Î ÁÖ°í, ±âÁØÀÏÀº 'yyyy/mm/dd' ÇüÅÂÀÇ ½ºÆ®¸µÀ¸·Î ÁØ´Ù.
// LÀº ±âÁØÀÏ ÀÌÀü ³¯Â¥, H´Â ±âÁØÀÏ ÀÌÈÄ ³¯Â¥¸¦ ¼±ÅÃ
// ¿¹)  onClick=calendar('insert', 'validDate', '2001/07/24','L')
//------------------------------------------------------------------------------
function calendar(formName, object, basisDay, condition) {
    var url = '/cmn/calendar.jsp?formName=' + formName + '&object=' + object +
              '&basisDay=' + basisDay + '&condition=' + condition;
    com_openBrWindowCenter(url, 'popup_calendar', 180, 195, 'scrollbars=no');
}
// add hyangrang  2003.09.22 
function calendar2(formName, object, basisDay, condition,syncObject) {
    var url = '/cmn/calendar.jsp?formName=' + formName + '&object=' + object +
              '&basisDay=' + basisDay + '&condition=' + condition + '&syncObject=' + syncObject;
    com_openBrWindowCenter(url, 'popup_calendar', 180, 195, 'scrollbars=no');
}

function calendar3(formName, object, basisDay) {
    var url = '/cmn/calendar.jsp?formName=' + formName + '&object=' + object +
              '&basisDay=' + basisDay;
    com_openBrWindowCenter(url, 'popup_calendar', 180, 195, 'scrollbars=no');
}


//------------------------------------------------------------------------------
// ÁöÁ¡ÄÚµå ¼±ÅÃÈ­¸éÀ» »ç¿ëÇÏ±â À§ÇÑ ÀÚ¹Ù ½ºÅ©¸³Æ®.(À¥ µð·ºÅä¸®¿¡¼­¸¸ »ç¿ë)
//   ARGUMENTS
//
//------------------------------------------------------------------------------
function comOpenBrandCode() {
    var url = '/brand/brand_code.jsp';
    com_openBrWindowCenter(url, 'popup_brand', 350, 500, 'scrollbars=auto');
}

//------------------------------------------------------------------------------
// ¿ìº¯¹øÈ£ ¼±ÅÃÈ­¸éÀ» »ç¿ëÇÏ±â À§ÇÑ ÀÚ¹Ù ½ºÅ©¸³Æ®.(À¥ µð·ºÅä¸®¿¡¼­¸¸ »ç¿ë)
//   ARGUMENTS
//
//------------------------------------------------------------------------------
function comOpenZipCode() {
    var url = '/shopping/post/zip_finder.jsp';
    com_openBrWindowCenter(url, 'popup_zipcode', 487, 300, 'scrollbars=yes');
}

//------------------------------------------------------------------------------
// ¿ìº¯¹øÈ£ ¼±ÅÃÈ­¸éÀ» »ç¿ëÇÏ±â À§ÇÑ ÀÚ¹Ù ½ºÅ©¸³Æ®.(À¥ µð·ºÅä¸®¿¡¼­¸¸ »ç¿ë)
//   ARGUMENTS
//
//------------------------------------------------------------------------------
function comOpenNewZipCode(argIndex) {
    var url = '/shopping/post/zip_finder.jsp?argIndex='+argIndex;
    com_openBrWindowCenter(url, 'popup_zipcode', 487, 300, 'scrollbars=yes');
}

//------------------------------------------------------------------------------
// Ã£°íÀÚ ÇÏ´Â formÀÇ elementÀÇ °¹¼ö¸¦ return
//   ARGUMENTS
//      formName = formÀÇ name
//      eleName  = °¹ ¼ö¸¦ ¾Ë°íÀÚ ÇÏ´Â elementÀÇ Name
//   RETURN
//      elementÀÇ °¹ ¼ö
//---------------------------------------------------------------------------*/
function getEleNum(formName,elementName) {
    var elementNum = 0;
    for (i=0 ; i<formName.elements.length ; i++) {
        if (formName.elements[i].name == elementName)
            elementNum++;
    }
    return elementNum;
}

//------------------------------------------------------------------------------
// Ã£°íÀÚ ÇÏ´Â formÀÇ elementÁß ¼±ÅÃµÈ elementÀÇ °¹¼ö¸¦ return
//   ARGUMENTS
//      formName = formÀÇ name
//      eleName  = °¹ ¼ö¸¦ ¾Ë°íÀÚ ÇÏ´Â elementÀÇ Name
//   RETURN
//      elementÀÇ °¹ ¼ö
//---------------------------------------------------------------------------*/
function getCheckedEleNum(formName,elementName) {
    var elementNum = 0;
    for (i=0 ; i<formName.elements.length ; i++) {
        if (formName.elements[i].name == elementName) {
            if (formName.elements[i].checked)
                elementNum++;
        }
    }
    return elementNum;
}

//------------------------------------------------------------------------------
// Ã£°íÀÚ ÇÏ´Â formÀÇ elementÁß ¼±ÅÃµÈ elementÀÇ index¸¦ return
//   ARGUMENTS
//      formName      = formÀÇ name
//      checkBoxName  = Ã¼Å© µÈ index¸¦ ¾Ë°íÀÚ ÇÏ´Â Ã¼Å©¹Ú½º ÀÌ¸§
//   RETURN
//      checked IndexÀÇ Array
//---------------------------------------------------------------------------*/
function getCheckedEleIndex(formName,checkBoxName) {
    var checkedEleIndex = new Array();
    var elementNum = 0;
    var j = 0;
    for (i=0 ; i<formName.elements.length ; i++) {
        if (formName.elements[i].name == checkBoxName) {
            if (formName.elements[i].checked) {
                checkedEleIndex[elementNum] = j;
                elementNum++;
            }
            j++;
        }
    }
    return checkedEleIndex;
}

//------------------------------------------------------------------------------
//  Ã£°íÀÚ ÇÏ´Â formÀÇ elementÁß ¼±ÅÃµÈ checkBox¿Í °°Àº row¿¡ ÀÖ´Â Ç×¸ñÀÇ
// elementÀÇ value¸¦ return
//
//   ARGUMENTS
//      formName      = formÀÇ name
//      checkBoxName  = Ã¼Å© µÈ index¸¦ ¾Ë°íÀÚ ÇÏ´Â Ã¼Å©¹Ú½º ÀÌ¸§
//      elementName   = value¸¦ ¾Ë°í ½ÍÀº elementÀÇ ÀÌ¸§
//   RETURN
//      elementÀÇ value Array
//---------------------------------------------------------------------------*/
function getCheckedEleValues(formName,checkBoxName,elementName) {
    var checkedEleIndex  = getCheckedEleIndex(formName,checkBoxName);
    if (checkedEleIndex.length == 0) {
        alert('¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.');
        return;
    }
    var checkedEleValues = new Array();
    var elementNum = 0;
    var j = 0;
    for (i=0 ; i<formName.elements.length ; i++) {
        if (formName.elements[i].name == elementName) {
            if (j == checkedEleIndex[elementNum]) {
                checkedEleValues[elementNum] = formName.elements[i].value;
                elementNum++;
            }
            j++;
        }
    }
    return checkedEleValues;
}
//------------------------------------------------------------------------------
// select¿¡ optionÀ» Ãß°¡ÇÑ´Ù.
//   ARGUMENTS
//      selectName = selectÀÇ name(form name±îÁö ºÙ¿©ÁØ´Ù)
//      tmpValue   = optionÀÇ value °ª
//      tmpText    = optionÀÇ text °ª
//   RETURN
//---------------------------------------------------------------------------*/
function addSelectOption(selectName,tmpValue,tmpText) {
    if (tmpValue != '') {
        if (!selectName.length) i = 0;
        else i = selectName.length;
        var tmpOption = new Option();
        tmpOption.text = tmpText;
        tmpOption.value = tmpValue;
        selectName.options[i] = tmpOption;
    }
}

//------------------------------------------------------------------------------
// select¿¡¼­ selectµÈ optionÀ» »èÁ¦ÇÑ´Ù.
//   ARGUMENTS
//      selectName = selectÀÇ name(form name±îÁö ºÙ¿©ÁØ´Ù)
//   RETURN
//---------------------------------------------------------------------------*/
function delSelectOption(selectName) {
    if (selectName.length) {
        var selectedCnt = 0;
        for(i=0 ; i<selectName.length ; i++) {
            if(selectName.options[i].selected) {
                selectName.options[i] = null;
                selectedCnt++;
                i--;
            }
        }
        if (selectedCnt == 0) return;
    } else
        return;
}

//------------------------------------------------------------------------------
// select¸¦ ÀüÃ¼¼±ÅÃÇÑ´Ù.
//   ARGUMENTS
//      selectName = selectÀÇ name(form name±îÁö ºÙ¿©ÁØ´Ù)
//   RETURN
//---------------------------------------------------------------------------*/
function selectAll(selectName) {
    if (selectName.length) {
        for (i=0 ; i<selectName.length ; i++)
            selectName.options[i].selected = true;
    }
}

//------------------------------------------------------------------------------
// subStringÇÑ´Ù.
//   ARGUMENTS
//      str = ´ë»ó String
//      inx = subStringÇÒ ±æÀÌ
//   RETURN
//---------------------------------------------------------------------------*/
function getSubString(str,inx) {
    var result = '';
    if (str.length < inx)
        result = str;
    else
        result = str.substring(0,inx);
}

//------------------------------------------------------------------------
// keyUpCharNumChk : TextAreaÀÇ ±ÛÀÚ¼ö Á¦ÇÑ Ã¼Å©
//   ARGUMENTS
//      num = Á¦ÇÑÇÏ·Á´Â ±ÛÀÚ ¼ö
//   RETURN
//------------------------------------------------------------------------
function keyUpCharNumChk(num) {
	if ((event.srcElement.value.length >= num) && (event.keyCode > 65))
		  event.returnValue = false;
}

//------------------------------------------------------------------------
// reWorkChk : Áßº¹ÀÛ¾÷ÀÌ ÀÌ·ç¾îÁú °æ¿ì ¸ðµç link¸¦ workingNow()·Î º¯°æÇÑ´Ù.
//------------------------------------------------------------------------
function reWorkChk() {
    for(i=0 ; i<document.links.length ; i++) {
        if (document.links[i].href.indexOf('close') == -1)
            document.links[i].href = 'javascript:workingNow();';
    }
}

//------------------------------------------------------------------------
// workingNow : Áßº¹ÀÛ¾÷ Ã¼Å© ÈÄ ¸ðµç ¸µÅ©¿¡ °É¸± ¸Þ¼¼Áö
//------------------------------------------------------------------------
function workingNow() {
    alert('ÇöÀç ÀÛ¾÷ÀÌ ÁøÇàÁß¿¡ ´Ù¸¥ ÀÛ¾÷À» ¼öÇàÇÏ¼Ì½À´Ï´Ù.\nÁøÇàÁßÀÎ ÀÛ¾÷ÀÌ ¿Ï·áµÇ¾ú°Å³ª ÀÛ¾÷ÀÌ Áö¿¬ÁßÀÌ´Ï \nÀÌÀü ¸Þ´º·Î µ¹¾Æ°¡¼­ È®ÀÎÇÏ½Ê½Ã¿À.');
}

//------------------------------------------------------------------------
// newName : ÇöÀç Ã¢¿¡ »õ·Î¿î ÀÌ¸§À» ºÙÀÎ´Ù.
//------------------------------------------------------------------------
function newName() {
    this.name = this.name+'_new';
}

//------------------------------------------------------------------------
// checkNumberInput() : ¼ýÀÚ ÀÔ·ÂÀ» Ã¼Å©ÇÑ´Ù.
//------------------------------------------------------------------------
function checkNumberInput(checkInput, updateValue) {
    var checkString = checkInput.value;
    for (var i=0 ; i<checkString.length ; i++) {
        if ((checkString.charAt(i)!='.') &&
            (checkString.charAt(i)>'9' || checkString.charAt(i)<'0')) {
            alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.      ');
            checkInput.value = updateValue;
            checkInput.focus();
            break;
        }
    }
}
//------------------------------------------------------------------------
// checkNumberInput_01() : ¼ýÀÚ ÀÔ·ÂÀ» Ã¼Å©ÇÑ´Ù.(ÀÔ·Â ÈÄ È®ÀÎÇÒ ¶§ »ç¿ëÇÔ...)
//                         targetÀº form ÀÌ¸§À» ºÙ¿©¼­ ÇÔ²² ³Ñ±ä´Ù.
//                         message´Â ¿øÇÏ´Â ´ë·Î...default ³ÖÀ¸¸é ±âº» ¸Þ½ÃÁö°¡ ¶á´Ù.
//------------------------------------------------------------------------
function checkNumberInput_01(target, message) {
    if (message == 'default')
        message = '¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.      ';
    var checkString = valueTrim(target.value);
    target.value = checkString;
    var pointNum = 0;
    if (checkString == '') return true;

    for (var i=0 ; i<checkString.length ; i++) {
        if (checkString.charAt(i)=='.') {
            pointNum++;
            if (pointNum > 1) {
                alert(message);
                return false;
            }
        }
        if ((checkString.charAt(i)!='.') &&
            (checkString.charAt(i)>'9' || checkString.charAt(i)<'0')) {
            alert(message);
            return false;
        }
    }

    return true;
}

//------------------------------------------------------------------------
// valueTrim() : ÀÔ·ÂµÈ value¿¡¼­ ¾ÕºÎºÐÀÇ °ø¹é°ú ¿£ÅÍ¸¦ Á¦°ÅÇÑ ¹®ÀÚ¿­À» ¸®ÅÏÇÑ´Ù.
//------------------------------------------------------------------------
function valueTrim(stringValue) {
    var realStringIndex = 0
    for (var i=0 ; i<stringValue.length ; i++) {
        if (stringValue.charCodeAt(i) == 32 ||
            stringValue.charCodeAt(i) == 13 ||
            stringValue.charCodeAt(i) == 10) {
            realStringIndex++;
        } else break;
    }

    return stringValue.substring(realStringIndex, stringValue.length);
}

//------------------------------------------------------------------------
// moveToCenter() : ÇöÀçÃ¢À» °¡¿îµ¥·Î ÀÌµ¿½ÃÅ²´Ù.
//------------------------------------------------------------------------
function moveToCenter() {
    if (document.layers) {
        var x = screen.width / 2 - outerWidth / 2;
        var y = screen.height / 2 - outerHeight / 2;
    } else {
        var x = screen.width / 2 - document.body.offsetWidth / 2;
        var y = -75 + screen.height / 2 - document.body.offsetHeight / 2;
    }

    window.moveTo(x, y);
}

//------------------------------------------------------------------------
// resizeCenter() : Ã¢ Å©±â¸¦ ¹Ù²Ù°í °¡¿îµ¥·Î ÀÌµ¿½ÃÅ²´Ù.
//------------------------------------------------------------------------
function resizeCenter(width, height) {
    var leftX = screen.width / 2 - width / 2;
    var topY = -75 + screen.height / 2 - height / 2;

    window.resizeTo(width, height);
    window.moveTo(leftX, topY);
}

//------------------------------------------------------------------------
// ±ÛÀÚ¼öcheck
//------------------------------------------------------------------------
function checkBytes(s)
{
    var len = 0;
    if ( s == null ) return len;
    for(var i=0;i<s.length;i++)
    {
        var c = escape(s.charAt(i));
        if ( c.length == 1 ) len ++;
        else if ( c.indexOf("%u") != -1 ) len += 2;
        else if ( c.indexOf("%") != -1 ) len += c.length/3;
    }
    return len;
}

//------------------------------------------------------------------------
// ¹®ÀÚ¿­ TRIM()
// »ç¿ë¹ý : ¹®ÀÚ¿­.trim()
//------------------------------------------------------------------------
// ¹®ÀÚ¿­ °ø¹éÀ» Á¦°Å
String.prototype.trim = function()
{
	return this.replace(/(^\s*) | (\s*$)/g, "");
}

//------------------------------------------------------------------------
// ´Þ·Â ÀÔ·Â³»¿ë »èÁ¦
// »ç¿ë¹ý : resetCal(object)
//------------------------------------------------------------------------
function resetCal(obj)
{
	obj.value = "";
}

//-----------------------------------------------------------------------
// ÁÂÃø ¸Þ´º ÀÌµ¿À» À§ÇÑ ÇÔ¼ö
// menu_location(index, depth)
// 2003/07/27
//-----------------------------------------------------------------------
function menu_location(index, depth)
{
	if (self != top) {
		top.menu.menu_index = index;
		top.menu.menu_gubun = depth;
	}
	//init(index, depth);

}

//-----------------------------------------------------------------------
// ¸Þ´ºÀÌµ¿½Ã °ªÀ» ¹Þ´Â´Ù.
// init(index, depth)
// 2003/07/27
//-----------------------------------------------------------------------
function init(mm, ms){
	if(typeof(document.Fmovie) != "undefined")
	{
	    IEx = navigator.appName.indexOf("Microsoft") != -1;
   		flashObj = IEx ? Fmovie : document.Fmovie;
	    flashObj.TGotoFrame("_root/mc",mm);
   		flashObj.TGotoFrame("_root/sub"+mm+"/mSub"+ms,2);
   	}
	//else {
	//	alert("¹Ì¹ß°ß");
	//}
}



//-----------------------------------------------------------------------
// ¸Þ´ºÀÌµ¿ ÇÔ¼ö
// ¸Þ´ºÀÌµ¿½Ã ¼±ÅÃµÉ °ªÀ» ¼öµ¿ÀÔ·ÂÇÑ´Ù.
//-----------------------------------------------------------------------
function move_menu(idx, dpt, locate)
{
	menu_location(idx, dpt)
	location.href = locate;
}

//mouseon/over°ü·Ã ÇÔ¼ö //hyangrang 2003.08.07
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
  newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}
//hyangrang 2003.08.14 add window.openÈ¿°ú
function openwin(url)
{
	window_attitude = "top=0, left=0";
	id=window.open("","", window_attitude);
	id.resizeTo(screen.availwidth,screen.availheight);
	id.location.href=url;

}



//hyangrang  2003.08.18 add zzamÀ» À§ÇÑ script
function zzam_popup(URL,W,H)
{	
 var width = W;
 var height = H;
 var loc_x = screen.width / 2 - width / 2;
 var loc_y = screen.height / 2 - height / 2;          
 shape  = "width=" + width + ",height=" + height ;
 shape += "toolbar=no,location=no,directories=no,status=no,";
 shape += "menubar=no,scrollbars=yes,resizable=no,left=" + loc_x + ",top=" + loc_y + ",screenX=" + loc_x + ",screenY=" + loc_y ;
 path   = URL;
 open(path, "pop", shape);
}

//¾ÆÀÌÇÇ±×·ì¿¡¼­ ¿äÃ»ÇØ¼­ ³ÖÀº function 2003.09.30
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// E-Mail Ã¼Å©
function isEmail(str) {
	// regular expression Áö¿ø ¿©ºÎ Á¡°Ë
	var supported = 0;
	if (window.RegExp) {
		var tempStr = "a";
		var tempReg = new RegExp(tempStr);
		if (tempReg.test(tempStr))  supported = 1;
	}
	if (!supported) { 
		return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); 
	}
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(str) && r2.test(str));
}