/**
 * Onlinepowers Common Javascript
 * 
 * @author		¾Æµ§Ä¸½¶
 * @date			2010-02-27
 * @copyright	Onlinepowers Development Team
 */

var regNumber =/^[0-9]+$/; 
var regPhone =/^[0-9]{2,3}-[0-9]{3,4}-[0-9]{4}$/; 
var regEmail =/^[_a-zA-Z0-9-]+@[._a-zA-Z0-9-]+.[a-zA-Z]+$/; 
var regDomain =/^[.a-zA-Z0-9-]+.[a-zA-Z]+$/; 
var regAlpha =/^[a-zA-Z]+$/; 
var regHost =/^[a-zA-Z-]+$/; 
var regKor	=/[°¡-ÆR]/; 
var regKorEng  =/[°¡-ÆRa-zA-Z]/; 

var regKorEngOnly =/^[°¡-ÆRa-zA-Z]*$/;
var regKorOnly =/^[°¡-ÆR]*$/;
var regEngOnly =/^[a-zA-Z]*$/; 

var regId = /^[a-zA-Z]{1}[a-zA-Z0-9_-]{3,12}$/; 

Number.prototype.toReadString = function() {
  return (this == 0) ? "¿µ" : unitRead(String(this));
  function unitRead(str, uidx) {
    var units = ["","¸¸","¾ï","Á¶",
      "°æ","ÇØ","½Ã","¾ç","±¸","°£","Á¤","Àç","±Ø","Ç×ÇÏ»ç","¾Æ½ÂÁö","³ªÀ¯Å¸","ºÒ°¡»çÀÇ","¹«·®´ë¼ö"];
    if (uidx == undefined) uidx = 0;
    var re = /^(\d+)(\d{4})$/;
    if (!re.test(str))
      return tinyRead(str) + units[uidx];
    else
      return str.replace(re,
        function(str,p1,p2) { return unitRead(p1, uidx+1) + tinyRead(p2); }
      ) + units[uidx];
    function tinyRead(str) {
      var digits1000 = ["","Ãµ","ÀÌÃµ","»ïÃµ","»çÃµ","¿ÀÃµ","À°Ãµ","Ä¥Ãµ","ÆÈÃµ","±¸Ãµ"];
      var digits100 = ["","¹é","ÀÌ¹é","»ï¹é","»ç¹é","¿À¹é","À°¹é","Ä¥¹é","ÆÈ¹é","±¸¹é"];
      var digits10 = ["","½Ê","ÀÌ½Ê","»ï½Ê","»ç½Ê","¿À½Ê","À°½Ê","Ä¥½Ê","ÆÈ½Ê","±¸½Ê"];
      var digits = ["","ÀÏ","ÀÌ","»ï","»ç","¿À","À°","Ä¥","ÆÈ","±¸"];
      var re = /^(((\d){0,1}(\d)){0,1}(\d)){0,1}(\d)$/;
      return str.replace(re,
        function (str,_p1,_p2,p1,p2,p3,p4) {
          return [
            (p1 != undefined) ? digits1000[parseInt(p1)] : "",
            (p2 != undefined) ? digits100[parseInt(p2)] : "",
            (p3 != undefined) ? digits10[parseInt(p3)] : "",
            digits[parseInt(p4)]
          ].join("");
        }
      );
    }
  }
};



var  Browser={
    IE:     !!(window.attachEvent && !window.opera),
    Opera:  !!window.opera,
    WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
    Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1
}

String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/gi, "");
}

String.prototype.replaceAll = function(str1, str2) {
    var temp_str = this.trim();
    temp_str = temp_str.replace(eval("/" + str1 + "/gi"), str2);
    return temp_str;
}

// Äü¹è³Ê IE6 Ã³¸®
//var bVer = parseInt($.browser.version, 10);
//ie6¿¡¼­¸¸ ½ºÅ©·Ñ½Ã
/*

$(window).scroll( function () {
	if(bVer == '6') {
		try {
			var scrollTop = $(document).scrollTop();
			/*if (parseInt(scrollTop) > 250) {
				$('.quick-banner').css({'top':parseInt(scrollTop + 10) + "px"});
			} else {
				$('.quick-banner').css({'top':'250px'});
			}*/
/*			$('.quick-banner').css({'top':parseInt(scrollTop + 476) + "px"});
		} catch (e) {}
	}
});*/

/**
 * ±Ý¾× ÄÞ¸¶ ºÙÀÌ±â, ex)number_format
 */ 
function comma(n) {
	var reg = /(^[+-]?\d+)(\d{3})/;   // Á¤±Ô½Ä
	n += '';                          // ¼ýÀÚ¸¦ ¹®ÀÚ¿­·Î º¯È¯

	while (reg.test(n))
	n = n.replace(reg, '$1' + ',' + '$2');
	return n;
}

function setCookieLayer(no) {
    var expire = new Date();
    expire.setDate(expire.getDate() + 1);
    document.cookie = "popupLayer_" + no + "=1; expires=" + expire.toGMTString() + "; path=/";

    popupLayerClose(no);
}


function popupLayerClose(n) {
    $g('popup' + n).style.display = 'none';
}

// ReadCookie
function ReadCookie(name) {
    var label = name + "=";
    var labelLen = label.length;
    var cLen = document.cookie.length
    var i = 0
    while (i < cLen) {
        var j = i + labelLen
        if (document.cookie.substring(i, j) == label) {
            var cEnd = document.cookie.indexOf(";", j)
            if (cEnd == -1) {
                cEnd = document.cookie.length
            }
            return unescape(document.cookie.substring(j, cEnd))
        }
        i++
    }
    return ""
}

// index.ÆË¾÷
function OpMainPopup(no, width, height, xposition, yposition, scroll_bar) {
    var popupCookie = ReadCookie('POPUP_CHECK_' + no);
    if (popupCookie == 1) return;
    fn_Popup(op_path+"/Popup/Popup.php?num=" + no, 'openPopup' + no, width, height, scroll_bar, xposition, yposition);
}


//ÀÌ¹ÌÁö ¸®»çÀÌÁî '080316 Ãß°¡
function getImageSize(id) {

    var img = document.body.appendChild(document.createElement('img'));
    img.src = id.src;
    var w = img.offsetWidth;
    var h = img.offsetHeight;

    document.body.removeChild(img);
    return { width: w, height: h };
}


function imageResize(id, resizeType, resize) {
    var imgId = document.getElementById(id);
    var size = getImageSize(document.getElementById(id));

    var width;
    var height;

    //  alert(size.width + " = " + size.height);
    if (resizeType == 1) { //°¡·Î°íÁ¤
        if (size.width > resize) {
            width = resize;
            height = (resize * size.height) / size.width;
        } else {
            width = size.width;
            height = size.height;
        }
    } else if (resizeType == 2) { //¼¼·Î°íÁ¤
        if (size.height > resize) {
            height = resize;
            width = (resize * size.width) / size.height;
        } else {
            width = size.width;
            height = size.height;
        }
    } else if (resizeType == 0) { //°¡·Î¼¼·Î ¸ðµÎ size¿µ¿ª ÀÌ³»¿¡...

        if (size.width > resize) {
            width = resize;
            height = (resize * size.height) / size.width;
        } else {
            width = size.width;
            height = size.height;
        }

        if (height > resize) {
            height = resize;
            width = (resize * width) / height;
        } else {
            width = width;
            height = height;
        }
    }

    //  alert(width + " = " + height);
    document.getElementById(id).style.width = width + 'px';
    document.getElementById(id).style.height = height + 'px';

    //  window.resizeTo(width+10, height+49);
}



//¾ÆÀÌÇÁ·¹ÀÓ »çÀÌÁî
var IE = false;
if (window.navigator.appName.indexOf("Explorer") != -1) {
    IE = true;
}

function resizeIfr(obj, minHeight) {
    minHeight = minHeight || 10;


    try {
        var getHeightByElement = function(body) {
            var last = body.lastChild;
            try {
                while (last && last.nodeType != 1 || !last.offsetTop) last = last.previousSibling;
                return last.offsetTop + last.offsetHeight;
            } catch (e) {
                return 0;
            }

        }

        var doc = obj.contentDocument || obj.contentWindow.document;
        if (doc.location.href == 'about:blank') {
            obj.style.height = minHeight + 'px';
            return;
        }


        if (/MSIE/.test(navigator.userAgent)) {
            var h = doc.body.scrollHeight;
        } else {
            var s = doc.body.appendChild(document.createElement('DIV'))
            s.style.clear = 'both';

            var h = s.offsetTop;
            s.parentNode.removeChild(s);
        }

        if (h < minHeight) h = minHeight;

        obj.style.height = h + 'px';
        if (typeof resizeIfr.check == 'undefined') resizeIfr.check = 0;
        if (typeof obj._check == 'undefined') obj._check = 0;


        setTimeout(function() { resizeIfr(obj, minHeight) }, 200); // check 5 times for IE bug

    } catch (e) {
        //alert(e);
    }

}


//¿ìÆí¹øÈ£ Ã£±â(ÁÖ¼ÒÃ£±â ÆÄÀÏ °æ·Î ÀÔ·Â)
function findPost(form, url) {
    form.address.focus();
    var postwindow = window.open(url, 'ÁÖ¼ÒÃ£±â', 'width=410,height=424');
    postwindow.focus();
}

//¾ÆÀÌµð Ã£±â
function findId(form, url) {
    var idwindow = window.open(url, '¾ÆÀÌµðÃ£±â', 'width=410,height=310');
    idwindow.focus();
}


// È®ÀÎ Ãë¼Ò È®ÀÎÈÄ ÀÔ·Â °æ·Î·Î ÀÌµ¿
function goUrl(msg, url) {
    if (confirm(msg)) {
        location.replace(url);
    }
}

//ÇÑ±Û Ã¼Å© (ÇÑ±Û»ç¿ë±ÝÁö)
function checkHan(strObj, msg) {
    var strValue = strObj.value;
    var intCode = 0;
    var msg;

    for (i = 0; i < strValue.length; i++) {
        var intCode = strValue.charCodeAt(i)
        var strChar = strValue.substr(i, 1).toUpperCase()
        intCode = parseInt(intCode)

        if ((strChar < "0" || strChar > "9") && (strChar < "A" || strChar > "Z") && ((intCode > 255) || (intCode < 0))) {
            alert(msg + " ÇÑ±ÛÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
            strObj.focus();
            return false;
        }
    }
    return true;
}


function han_check(aThis) { 
//ÇÑ±ÛÃ¼Å© 
var rtn = true; 

	for(i=0; i<aThis.value.length; i++) { 
		if(!((aThis.value.charCodeAt(i) > 0x3130 && aThis.value.charCodeAt(i) < 0x318F) || (aThis.value.charCodeAt(i) >= 0xAC00 && aThis.value.charCodeAt(i) <= 0xD7A3))) 
		return false; 
	} 
return rtn; 

}
//Æ¯¼ö¹®ÀÚ Ã¼Å©
function checkSpecial(strObj, msg) {
var special_pattern = /[`~!@#$%^&*|\\\'\";:\/?]/gi;
	
	if (strObj.value.length == 0) {
		alert(msg + " ÀÔ·ÂÇÏ¼¼¿ä.");
		strObj.focus();
		return false;
	}

	if( special_pattern.test(strObj.value) == true ){
		alert(msg+' Æ¯¼ö¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
		strObj.focus();
		return false;
	}

}

//ÇÑ±ÛÀÌ¸§ÀÔ·ÂÃ¼Å©
function checkName(strObj, msg) {
    if (strObj.value.length == 0) {
        alert(msg + " ÀÔ·ÂÇÏ¼¼¿ä.");
        strObj.focus();
        return false;
    }

    if (han_check(strObj) == false) {
        alert(msg + " ÇÑ±Û·Î ÀÔ·ÂÇÏ¼¼¿ä.");
        strObj.focus();
        return false;
    }
    return true;
}

//ºñ¹Ð¹øÈ£, ºñ¹Ð¹øÈ£ È®ÀÎ Ã¼Å©
function checkPassword(strObj1, strObj2, eng) {
    var strValue1 = strObj1.value;
    var strValue2 = strObj2.value;
    if (strValue1 != strValue2) {
        if (eng == 1)
        {
            alert("Please verify your password again.");
        }
        else{
            alert("ºñ¹Ð¹øÈ£¶õ°ú ºñ¹Ð¹øÈ£ È®ÀÎ¶õÀÌ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù");
        }
        strObj2.focus();
        return false;
    }
    return true;
}

//°ø¹é Ã¼Å©
function checkSpace(strObj, msg) {
    var strValue = strObj.value;
    var intCode = 0;
    var msg;
    for (i = 0; i < strValue.length; i++) {
        var intCode = strValue.charCodeAt(i)
        var retChar = strValue.substr(i, 1).toUpperCase()
        intCode = parseInt(intCode)
        if (retChar == " ") {
            alert(msg + "½ºÆäÀÌ½º¸¦ ³ÖÀ¸½Ã¸é ¾ÈµË´Ï´Ù.");
            strObj.focus();
            return false;
        }
    }
    return true;
}

// E-Mail Ã¼Å©
function checkEmail(strObj, eng) {
    var strValue = strObj.value;
    var intCode = 0;
    var flag = 0;

    for (i = 0; i < strValue.length; i++) {
        var intCode = strValue.charCodeAt(i)
        var strChar = strValue.substr(i, 1).toUpperCase()
        intCode = parseInt(intCode)
        if (strChar == "@") {
            flag += 1;
        }
        if (strChar == ".") {
            flag += 1;
        }
    }
    if (flag < 2) {
        if(eng==1){
            alert("Incorrect email address. Please try again.");
        }else{
            alert("ÀÌ¸ÞÀÏ Çü½ÄÀ» ÁöÄÑÁÖ¼¼¿ä."); //ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
        }
        strObj.focus();
        return false;
    }
    return true;
}

// E-Mail Ã¼Å©
function checkEmail2(strObj) {
    var strValue = strObj.value;
    var intCode = 0;
    var flag = 0;

    for (i = 0; i < strValue.length; i++) {
        var intCode = strValue.charCodeAt(i)
        var strChar = strValue.substr(i, 1).toUpperCase()
        intCode = parseInt(intCode)
        if (strChar == "@") {
            flag += 1;
        }
        if (strChar == ".") {
            flag += 1;
        }
    }
    if (flag < 2) {
        alert("ÀÌ¸ÞÀÏ Çü½ÄÀ» ÁöÄÑÁÖ¼¼¿ä."); //ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
		
        strObj.focus();
        return false;
    }
    return true;
}

//°ø¹éÁ¦°Å
function trim(str) {
    var arrStr = new Array();
    var lenStr;
    var rtnStr = "";

    if (str == null) return "";
    lenStr = str.length;

    for (var i = 0; i < lenStr; i++) {
        arrStr[i] = str.charAt(i);

        if (arrStr[i] == " ") {
            if (i > 0) {
                if (!arrStr[i - 1])
                    arrStr[i] = "";
            }
            else
                arrStr[i] = "";
        }
    }

    for (i = lenStr - 1; i >= 0; i--) {
        if (arrStr[i] == " ") {
            if (i < lenStr - 1) {
                if (!arrStr[i + 1])
                    arrStr[i] = "";
            }
            else
                arrStr[i] = "";
        }
    }

    for (i = 0; i < lenStr; i++)
        if (arrStr[i])
        rtnStr += arrStr[i];

    return rtnStr;
}

//¼¿·ºÆ® ¹Ú½º ¼±ÅÃ ¿©ºÎ 
function checkSelect(strObj, msg, eng) {
    var msg;
    if (strObj.length > 1) {
        for (var inx = 1; inx < strObj.length; inx++) {
            if (strObj[inx].selected) return true;
        }
    } else {
        if (strObj.selected) return true;
    }

    if(eng==1){
        alert(msg);
    }else{
        alert(msg + " ¼±ÅÃÇÏÁö ¾Ê¾Ò½À´Ï´Ù.");
    }
    return false;
}


// ¶óµð¿À¹öÆ°ÀÇ ¼±ÅÃ¿©ºÎ ¾Ë¾Æ³»±â
function checkRadio(strObj, msg, eng) {
    var msg;
    if (strObj.length > 1) {
        for (var inx = 0; inx < strObj.length; inx++) {
            if (strObj[inx].checked) return true;
        }
    } else {
        if (strObj.checked) return true;
    }

    if(eng==1){
        alert(msg);
    }else{
        alert(msg + " ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
    }

    strObj[0].focus();
    return false;
}

// Ã¼Å©¹Ú½º ¼±ÅÃ¿©ºÎ ¾Ë¾Æ³»±â
function checkCheckbox(strObj, cbObjText, eng) {

    for (i = 0; i < strObj.length; i++) {
        if ((strObj[i].checked == true)) {
            return (true); 	// ¼±ÅÃµÈ °á°ú°¡ ÀÖÀ»¶§
            break;
        }
    }

    if(eng==1){
        alert(cbObjText);
    }else{
        alert("¼±ÅÃµÈ " + cbObjText + "¾ø½À´Ï´Ù.\n\n¸ÕÀú ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À");
    }
    strObj[0].focus();
    return (false); 	// ¼±ÅÃµÈ °á°ú°¡ ¾øÀ»¶§
}

//¿µ¹®¸¸
function onlyEnglish(chkObj, chkObjText) {
    for (i = 0; i < chkObj.value.length; i++) {
        if ((chkObj.value.charAt(i) < "A" || chkObj.value.charAt(i) > "Z") && (chkObj.value.charAt(i) < "a" || chkObj.value.charAt(i) > "z")) {
            alert(chkObjText + " " + "¿µ¹®À¸·Î¸¸ ÀÔ·ÂÇÏ¼¼¿ä.");
            chkObj.focus();
            return (false);
        }
    }
}

//¿µ¹®¸¸2
function checkEnglish2(chkObj) {
    for (i = 0; i < chkObj.value.length; i++) {
        if ((chkObj.value.charAt(i) < "A" || chkObj.value.charAt(i) > "Z") && (chkObj.value.charAt(i) < "a" || chkObj.value.charAt(i) > "z")) {
            return (false);
        }
    }
}


// ¿µ¾î¿Í¼ýÀÚ¸¸ ÀÔ·ÂµÇ¾ú´Â°¡ °Ë»çÇÔ (document.form.username, '°ü¸®ÀÚID')
// ÇÏÀÌÆù(-), ¾ð´õ¹Ù(_) ÀÔ·Â°¡´É
function onlyEngNum(chkObj, chkObjText) {
    for (i = 0; i < chkObj.value.length; i++) {
        if ((chkObj.value.charAt(i) < "A" || chkObj.value.charAt(i) > "Z") && (chkObj.value.charAt(i) < "a" || chkObj.value.charAt(i) > "z") && (chkObj.value.charAt(i) < '0' || chkObj.value.charAt(i) > '9') && (chkObj.value.charAt(i) != '-' && chkObj.value.charAt(i) != '_')) {
            alert(chkObjText + " " + "¿µ¹®¿Í ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇÏ¼¼¿ä.");
            chkObj.focus();
            return (false);
        }
    }
}

/* ex)
bCheck = form_chk_onlyEngNum(form.lid, "Áö¿ªID");
if ( bCheck == false ) return;
*/


// Æû³»ÀÇ Æ¯Á¤ elementÃ£±â
function findElement(form, element) {		// Ã£À» Æû, Ã£À» °´Ã¼ÀÌ¸§(obj.name or 'lc_cd[]')
    for (i = 0; i < form.elements.length; i++) {
        if (form.elements[i].name == element) {
            element = form.elements[i];
            return (element);
        }
    }
}

/* ex)
// ¹è¿­·Î ¼±¾ðµÈ °´Ã¼¸¦ Á¦¾îÇÏ±â
var selectObj = form_findElement(document.form, 'lc_cd[]');		// selectObj => document.form.elements[?]
*/


// ÀÔ·Â¿©ºÎ °Ë»ç (document.form[0].title, Á¦¸ñ)
function checkValue(obj, objName, eng) {
    var result;
    var msg;
    result = trim(obj.value); 	// °ø¹éÁ¦°Å

    if (result == "") {
        if ((obj.type == "text") || (obj.type == "textarea") || (obj.type == "password")) {
            msg = "ÀÔ·Â";
        } else {
            msg = "¼±ÅÃ";
        }

        if(eng==1){
            alert(objName);
        }else{
            alert(objName + " " + msg + "ÇÏ¼¼¿ä.");
        }
        obj.focus();

        if (obj.type == "text") obj.select();
        return (false);
    }
}

/* ex)
bCheck = form_chk_value(form.lid, "Áö¿ªID");
if ( bCheck == false ) return;
*/

// ±æÀÌ °Ë»ç (document.form[0].title, Á¦¸ñ, ÃÖ¼Ò±æÀÌ, ÃÖ´ë±æÀÌ) - ÇÑ±Ûµµ ¿µ¹®°ú µ¿ÀÏÇÏ°Ô Ãë±ÞÇÔ.
function checkLength(obj, objName, minLen, maxLen) {
    var result;
    var msg;

    result = trim(obj.value); 	// [trim.js] °ø¹éÁ¦°Å
    if (result.length < minLen) {
        alert(objName + " " + minLen + "ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.");
        obj.focus();
        obj.select();

        return (false);
    }

    if (result.length > maxLen) {
        alert(objName + " " + maxLen + "ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
        obj.focus();
        obj.select();

        return (false);
    }
}

/* ex)
bCheck = form_chk_value(form.lid, "Áö¿ªID");
if ( bCheck == false ) return;
*/

//»ç¾÷ÀÚµî·Ï¹øÈ£Ã¼Å©
function checkCompany(obj) {
    var sum = 0;
    var li_epno = new Array(10);
    var li_chkvalue = new Array(1, 3, 7, 1, 3, 7, 1, 3, 5);

    for (i = 0; i < 10; i++) {
        li_epno[i] = obj.substr(i, 1);
    }
    for (i = 0; i < 9; i++) {
        sum += li_epno[i] * li_chkvalue[i];
    }

    sum = sum + ((li_epno[8] * 5) / 10);
    var li_y = sum % 10;

    if (li_y == 0) {
        epno_chk = 0;
    } else {
        epno_chk = 10 - li_y;
    }

    if (epno_chk == li_epno[9]) {
        return true;
    } else {
        alert('À¯È¿ÇÏÁö ¾ÊÀº »ç¾÷ÀÚµî·Ï¹øÈ£ ÀÔ´Ï´Ù. È®ÀÎÇØÁÖ¼¼¿ä');
        obj.focus();
        return false;
    }
}


//ÁÖ¹Î¹øÈ£ Ã¼Å©
function checkResNumber(obj1, obj2) {

    var str_f_num = obj1.value;
    var str_l_num = obj2.value;

    if (str_f_num == '' || str_l_num == '') {
        alert('ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
        if (str_f_num == '') obj1.focus();
        else obj2.focus();
    }
    var i3 = 0

    for (var i = 0; i < str_f_num.length; i++) {
        var ch1 = str_f_num.substring(i, i + 1);
        if (ch1 < '0' || ch1 > '9') { i3 = i3 + 1 }
    }
    if ((str_f_num == '') || (i3 != 0)) {
        return false;
    }
    var i4 = 0

    for (var i = 0; i < str_l_num.length; i++) {
        var ch1 = str_l_num.substring(i, i + 1);
        if (ch1 < '0' || ch1 > '9') { i4 = i4 + 1 }
    }
    if ((str_l_num == '') || (i4 != 0)) {
        return false;
    }
    if (str_f_num.substring(0, 1) < 0) {
        return false;
    }
    if (str_l_num.substring(0, 1) > 2) {
        return false;
    }
    if ((str_f_num.length > 7) || (str_l_num.length > 8)) {
        return false;
    }
    if ((str_f_num == '72') || (str_l_num == '18')) {
        return false;
    }

    var f1 = str_f_num.substring(0, 1)
    var f2 = str_f_num.substring(1, 2)
    var f3 = str_f_num.substring(2, 3)
    var f4 = str_f_num.substring(3, 4)
    var f5 = str_f_num.substring(4, 5)
    var f6 = str_f_num.substring(5, 6)
    var hap = f1 * 2 + f2 * 3 + f3 * 4 + f4 * 5 + f5 * 6 + f6 * 7
    var l1 = str_l_num.substring(0, 1)
    var l2 = str_l_num.substring(1, 2)
    var l3 = str_l_num.substring(2, 3)
    var l4 = str_l_num.substring(3, 4)
    var l5 = str_l_num.substring(4, 5)
    var l6 = str_l_num.substring(5, 6)
    var l7 = str_l_num.substring(6, 7)
    hap = hap + l1 * 8 + l2 * 9 + l3 * 2 + l4 * 3 + l5 * 4 + l6 * 5
    hap = hap % 11
    hap = 11 - hap
    hap = hap % 10
    if (hap != l7) {
        alert("ÁÖ¹Î¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇØÁÖ¼¼¿ä");
        obj1.focus();
        return false;
    }
    return true;
}


// ÁÖ¹Î¹øÈ£ Ã¼Å©
function checkSsn(ssn1, ssn2){
	check = false;
	total = 0;
	temp = new Array(13);
	//temp[13] 13¹øÂ° ÀÚ¸®¼ö
	for(i=1; i<=6; i++)
	temp[i] = ssn1.charAt(i-1);
	for(i=7; i<=13; i++)
	temp[i] = ssn2.charAt(i-7);

	for(i=1; i<=12; i++){
	k = i + 1;
	if(k >= 10)
	k = k % 10 + 2;
	total = total + temp[i] * k;
	}
	mm = temp[3] + temp[4];
	dd = temp[5] + temp[6];

	totalmod = total % 11;

	chd = 11 - totalmod;
	if(chd == 11){
	chd = 1;
	} else if(chd == 10){
	chd = 0;
	}
	if(chd == temp[13] && mm < 13 && dd < 32 && (temp[7]==1 || temp[7]==2 || temp[7]==3 || temp[7]==4))
	{
	check=true;
	}
	return check;
}


// ¼ýÀÚ¸¸ ÀÔ·ÂÇÏµµ·Ï °Ë»ç (document.form[0].money, °¡°Ý)
function checkNumber(obj, objName) {
    var result;

    result = trim(obj.value); 	// [trim.js] °ø¹éÁ¦°Å

    if (isNaN(result)) {
        alert(objName + "¼ýÀÚ·Î¸¸ ÀÔ·ÂÇÏ¼¼¿ä.");
        obj.focus();

        if (obj.type == "text") obj.select();
        return (false);
    }
}


// ¼ýÀÚ¸¸ ÀÔ·ÂÇÏµµ·Ï °Ë»ç (document.form[0].money, °¡°Ý)
function onlyNumber(obj, objName) {
    var result;

    result = trim(obj.value); 	// [trim.js] °ø¹éÁ¦°Å

    if (isNaN(result)) {
        alert(objName + "¼ýÀÚ·Î¸¸ ÀÔ·ÂÇÏ¼¼¿ä.");
        obj.focus();

        if (obj.type == "text") obj.select();
        return (false);
    }
}

/* ex)
bCheck = form_chk_number(form.money, "°¡°Ý");
if ( bCheck == false ) return;
*/



// ³¯Â¥¿©ºÎ °Ë»ç (dateObject = document.form[0].date1)(msg = °´Ã¼¸í)
function checkDate(dateObject, msg) {
    var date = dateObject.value;
    var s_date = date.split("-");
    var yyyy = (s_date[0] * 10) / 10; 	// parseInt()ÀÇ °æ¿ì "08", "09"ÀÏ¶§ 0À¸·Î Àß¸ø º¯°æµÇ¹Ç·Î ¿¬»êÀ» ÀÌ¿ëÇÔ.
    var mm = (s_date[1] * 10) / 10;
    var dd = (s_date[2] * 10) / 10;
    var chk_day;
    var result;

    if (date != "") {		// ÀÔ·Â°ªÀÌ Á¸ÀçÇÒ¶§¸¸ °Ë»çÇÔ
        if ((date.length >= 8) && (date.length <= 10)) {		// [±æÀÌ] 2001-1-1 ~ 2001-12-12
            if (s_date.length == 3) {		// [Çü½Ä] xxxx-xx-xx
                if ((yyyy > 1900) && (yyyy < 2100)) {		// [³âµµ] 1900³â ~ 2100³â
                    if ((mm >= 1) && (mm <= 12)) {		// [¿ù] 1¿ù ~ 12¿ù
                        switch (mm) {		// [´Þº°³¯¼ö] 1¿ù - 31, 4¿ù - 30 ...
                            case 2:
                                chk_day = (!(yyyy % 4) && (yyyy % 100) || !(yyyy % 400)) ? 29 : 28; 	// À±³â±¸ºÐ
                                break;
                            case 4: case 6: case 9: case 11:
                                chk_day = 30;
                                break;
                            default:
                                chk_day = 31;
                                break;
                        }

                        //alert(chk_day + " / " + dd + " / " + s_date[2]);
                        if ((dd >= 1) && (dd <= chk_day)) {			// [ÀÏ] 1ÀÏ ~ ´Þº°³¯¼ö
                            result = true;
                        }
                    }
                }
            }
        }

        if (result != true) {
            alert(msg + "ÀÇ ³¯Â¥Çü½ÄÀÌ Àß¸øµÇ¾ú°Å³ª ¿Ã¹Ù¸¥ ³¯Â¥°¡ ¾Æ´Õ´Ï´Ù.\n\n[2001-01-01]Çü½ÄÀ¸·Î ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.");
            dateObject.focus();
            dateObject.select();
            return (false);
        }
    }
}

/* ex
// ³¯Â¥¿©ºÎ °Ë»ç
bCheck = form_chk_date(form.c_buydate, "Â÷·®µî·ÏÀÏ");
if ( bCheck == false ) return;
*/


// ³¯Â¥ ±â°£ °Ë»ç (dateObject1 = document.form[0].date1)(objName = È­¸é»ó¿¡ Ç¥½ÃµÉ °´Ã¼ÀÌ¸§)
function compareDate(dateObject1, dateObject2, objName) {
    function form_getTime(value) {
        var d; // Date Object
        var sd; 	// Split Date
        sd = value.split("-");
        d = new Date(sd[0], sd[1], sd[2]);
        return (d.getTime()); 	// getTime() - returns a numeric value
    }

    var d1; 	// First Compare Date
    var d2; 	// Second Compare Date

    d1 = form_getTime(dateObject1.value);
    d2 = form_getTime(dateObject2.value);
    if (d1 > d2) {
        alert(objName + "ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.\n\nÃ¹¹øÂ° ³¯Â¥´Â µÎ¹øÂ°³¯Â¥º¸´Ù »¡¶ó¾ß ÇÕ´Ï´Ù.");
        dateObject1.focus();
        dateObject1.select();
        return (false);
    }
}

/* ex
// ³¯Â¥ ±â°£ °Ë»ç
bCheck = form_compare_date(form.c_hb_begin, form.c_hb_end, "ÇÒºÎ±â°£");
if ( bCheck == false ) return;
*/

// Change Div display 
function changeDiv(IObject) {
    var ObjStyle;

    if (IObject.style.display != "none") {
        ObjStyle = "none";
    } else {
        ObjStyle = "";
    }

    IObject.style.display = ObjStyle;
}

//onkeypress='Check_Number()' ÀÌº¥Æ® ÇÚµé·¯ ¹ß»ý½Ã ¼ýÀÚ Ã¼Å©
function checkEventNumber() {
    if ((event.keyCode < 48) || (event.keyCode > 57)) {
        alert("¼ýÀÚ¸¸ ÀÔ·ÂÀÌ Çã¿ëµË´Ï´Ù.");
        event.returnValue = false;
    }
}

//±Ý¾×ÀÔ·Â(,»ç¿ë) : onkeyup="this.value=this.value.replace(/[^0-9]/g,'');amount_aden(this);amount_aden2(Form.tg_price);"
function checkPrice(frm) {
    var rtn = "";
    var val = "";
    var j = 0;
    x = frm.value.length;

    for (i = x; i > 0; i--) {
        if (frm.value.substring(i, i - 1) != ",") {
            val = frm.value.substring(i, i - 1) + val;
        }
    }
    x = val.length;
    for (i = x; i > 0; i--) {
        if (j % 3 == 0 && j != 0) {
            rtn = val.substring(i, i - 1) + "," + rtn;
        } else {
            rtn = val.substring(i, i - 1) + rtn;
        }
        j++;
    }
    frm.value = rtn;
    amount = frm.value.replace(/,/g, '')
}

//Æ÷Ä¿½º ÀÌµ¿ÇÏ±â
function moveNext(varControl, varNext) {
    if (varControl.value.length == varControl.maxLength) {
        varNext.focus();
        varNext.select();
    }
}

/*******************************************************
******                                            ******
******              ¼³¸í : ÆË¾÷ ¶ç¿ì±â            ******
******                                            ******
*******************************************************/


function fn_Popup(url, winname, width, height, scrollbars, xposition1, yposition1) {
    xposition = 0; yposition = 0;
    if (parseInt(navigator.appVersion) >= 4) {
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    if (scrollbars == null) {
        scrollbars = '0';
    }

	xposition1 = xposition1 == null ? xposition : xposition1;
	yposition1 = yposition1 == null ? yposition : yposition1;

    args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=0,"
         + "scrollbars=" + scrollbars + "," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition1 + ","     //IE Only
   + "top=" + yposition1;           //IE Only

    newWin = window.open(url, winname, args)
    newWin.focus();
}


//ÆË¾÷
function makeWin(url, winname, width, height, scrolltype) {
    xposition = 0; yposition = 0;
    if (parseInt(navigator.appVersion) >= 4) {
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=0,"
         + "scrollbars=" + scrolltype + "," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0,"
		 + "screenx=" + xposition + ","  //NN Only
		 + "screeny=" + yposition + ","  //NN Only
		 + "left=" + xposition + ","     //IE Only
		 + "top=" + yposition;           //IE Only

    newWin = window.open(url, winname, args)
    newWin.focus();
}

//ÆË¾÷ - À§Ä¡ ÁöÁ¤
function makeWin1(url, winname, width, height, scrollbars, xposition1, yposition1, ck) {
    xposition = 0; yposition = 0;
    if (parseInt(navigator.appVersion) >= 4) {
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    if (scrollbars == null) {
        scrollbars = '0';
    }
    args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=0,"
         + "scrollbars=" + scrollbars + "," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition1 + ","     //IE Only
   + "top=" + yposition1;           //IE Only

    var newWin = window.open(url, winname, args, ck)
    newWin.focus();
}

function newWindow(mypage, myname, w, h, scroll) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ',resizable'
    win = window.open(mypage, myname, winprops)
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

/* ÆË¾÷ */
function popup(pop, width, height) {
    var url = pop;
    var wd = width;
    var he = height;

    window.open(url, "", "left=300;top=300,toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd + ",height=" + he + ";")
}

function formatNumber(s) {
    s = "" + s;
    len = s.length - 3;
    while (len > 0) {
        s = s.substr(0, len) + "," + s.substr(len);
        len -= 3;
    }
    return s;
}


function swf(src, width, height) {
    html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
  ' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"' +
  ' width="' + width + '" height="' + height + '">';
    html += '<param name="movie" value="' + src + '" />';
    html += '<param name="quality" value="high" />';
    html += '<param name="wmode" value="transparent" />';
    html += '<param name="menu" value="false" />';

    html += '<embed src="' + src + '" quality="high"' +
  ' pluginspage="https://www.macromedia.com/go/getflashplayer"' +
  ' type="application/x-shockwave-flash"' +
  ' width="' + width + '" height="' + height + '" wmode="transparent" ></embed>';
    html += '</object>';
    //$('#show').text(html);
    document.write(html);
}

function swf2(src, width, height) {
    html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
  ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"' +
  ' width="' + width + '" height="' + height + '">';
    html += '<param name="movie" value="' + src + '" />';
    html += '<param name="quality" value="high" />';
    html += '<param name="wmode" value="transparent" />';
    html += '<param name="menu" value="false" />';

    html += '<embed  id="flashMenu" src="' + src + '" quality="high"' +
  ' pluginspage="http://www.macromedia.com/go/getflashplayer"' +
  ' type="application/x-shockwave-flash"' +
  ' width="' + width + '" height="' + height + '" wmode="transparent" ></embed>';
    html += '</object>';
    document.write(html);
}
function swf3(src, width, height) {
	html = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' +
	' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"' +
	' width="' + width + '" height="' + height + '" id="main" align="middle">';
	html += '<param name="movie" value="' + src + '" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<param name="menu" value="false" />';
	
	html += '<embed  id="flashMenu" src="' + src + '" quality="high"' +
	' pluginspage="http://www.macromedia.com/go/getflashplayer"' +
	' type="application/x-shockwave-flash"' +
	' width="' + width + '" height="' + height + '" wmode="transparent" id="main" align="middle" pluginspage="https://www.macromedia.com/go/getflashplayer"></embed>';
	html += '</object>';
	document.write(html);
}



/**
 * °ü¸®ÀÚÆäÀÌÁö ½Ã°è
 * @return
 */
function fn_SetClock() {
    try{
        var now = new Date();
        var Hours = now.getHours();
        var Minutes = now.getMinutes();
        var Seconds = now.getSeconds();
        var Value = (Hours >= 12) ? " ¿ÀÈÄ" : " ¿ÀÀü";

        Value += " " + ((Hours > 12) ? Hours - 12 : Hours)
        Value += ((Minutes < 10) ? ":0" : ":") + Minutes
        Value += ((Seconds < 10) ? ":0" : ":") + Seconds
        //Value+= ((Minutes <10) ? "½Ã 0" : "½Ã ") + Minutes 
        //Value+= ((Seconds <10) ? "ºÐ 0" : "ºÐ ") + Seconds 
        //Value+= "ÃÊ"

        if(document.getElementById("clock")){
            $("#clock").text(Value);
            setTimeout("fn_SetClock()", 1000);
        }
    }catch(e){

    }

}




//·Ñ¿À¹ö ÀÌ¹ÌÁö
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&$g(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 FlashSize2(){
    if(_MenuOpen2==false){
        _MenuOpen2 = true;
        $g('flashMenu2').style.height= '245px';
        $g('flashMenu2').style.position= 'absolute';
        $g('blank').style.display='block';
        //$('toggler').style.display='none';
    }else{
        _MenuOpen2 = false;
        $g('flashMenu2').style.height= '80px';
        $g('flashMenu2').style.position= 'relative';
        $g('blank').style.display='none';
        //$('toggler').style.display='block';
    }
}


// ³¯Â¥¸¦ date Çü½ÄÀ¸·Î..

function getNewDate(ymd){
    defDate = ymd.split('-');
    var yyyy = defDate[0];
    var mm   = defDate[1];
    var dd   = defDate[2]*1+1;

    return new Date(yyyy, mm-1, dd);
}



function addDays(defaultDate, add)
{
    //var add  = "-1";
    defDate = defaultDate.split('-');
    var yyyy = defDate[0];
    var mm   = defDate[1];
    var dd   = defDate[2];

    dd = (dd*1) + (add*1);

    cDate = new Date(yyyy, mm-1, dd);
    cYear = cDate.getFullYear();
    cMonth = cDate.getMonth() + 1;
    cDay   = cDate.getDate(); 

//    alert("After: " + cYear + "-" + padZeros(cMonth) + "-" + padZeros(cDay));
    return cYear + "-" + padZeros(cMonth) + "-" + padZeros(cDay);
}


function padZeros(num) {
    var size = 2;
	var str = num.toString();
	var numZeros = size - str.length;
	for (var i=0; i<numZeros; i++) str="0"+str;
	return str;
}



function $g(element){
    return document.getElementById(element);
}

function $n(element){
    return document.getElementsByName(element);
}


// »ó´Ü °Ë»ö
function checkHeaderSearch(f){
    if(checkValue(f.key, "Enter Keyword", 1)==false) return false;
}




/**
 * Captcha °¡Á®¿À±â
 */
function fn_ShowCaptcha(){
	$('#auth_key_area').load(op_path+'/getCaptcha');
}


// ÆÄÀÏ¸íÀ¸·Î È®ÀåÀÚ ¾Ë¾Æ³»±â

// ÆÄÀÏ È®ÀåÀÚ ¾Ë¾Æ³»±â
function fn_GetExtension(filename){
    var fileExt = filename.split('.');
	var extCnt  = fileExt.length;
    return fileExt[extCnt-1].toLowerCase();
}

//ÆÄÀÏ È®ÀåÀÚ ¾Ë¾Æ³»±â
function fn_GetFileSize(filesize){
	if (filesize < 1000000) {
		return parseInt((filesize / 1000) * 100) / 100 + "KB";
	} else {
		return parseInt((filesize / 1000000) * 100) / 100 + "MB";		
	}
}


// ÅëÇÕ°Ë»ö{
function fn_TotalSearch(f){
	try{
		if(!$('#total-search-form .required').validation(op_language)){
			return false;
		}
	}catch(e){
		alert('catch : '+e.message)
		return false;
	}
}



/**
 * È¸¿øÅ»Åð Ã³¸® 
 */
function fn_Secede(userId){
	var msg1 = 'Å»ÅðÇÏ½Ã°Ú½À´Ï±î?';
	var msg2 = 'Å»ÅðÇÏ´Â °æ¿ì ¸ðµç Á¤º¸´Â »èÁ¦µË´Ï´Ù.\n±×·¡µµ Å»ÅðÇÏ½Ã°Ú½À´Ï±î?';

	if(op_language==1){
		msg1 = 'Do you want to unsubscribe?';
		msg2 = 'Do you want to unsubscribe? Really?';
	}
	if(confirm(msg1)){
		if(confirm(msg2)){
			location.href='/user/secede/'+userId;
		}
	}
}



// ÂÊÁöÇÔ
function fn_Note(){
	fn_Popup(op_path+'/Note/Note'+op_ext, 'ÂÊÁöÇÔ', 710, 570);
}


// ÂÊÁöº¸³»±â
function fn_SendNote(id){
	fn_Popup(op_path+'/Note/NoteSend.php?targetId='+id, 'ÂÊÁöº¸³»±â', 420, 465);
}


// º¹»ç
function CopyText(id){

	var obj = document.getElementById(id);
	var iurl = document.getElementById('urlcopy');
	var curl = obj.url;
		iurl.innerText = curl;

	var copyurl = document.body.createTextRange();
		copyurl.moveToElementText(urlcopy);
		copyurl.execCommand("Copy");
		alert ("ÁÖ¼Ò°¡ º¹»ç µÇ¾ú½À´Ï´Ù.");
}


/**
 * ÀÔ·ÂÇÑ ±ÛÀÚ¸¦ ´ë¹®ÀÚ·Î ¹Ù²Û´Ù.
 * @return string
 */
function fn_Upper(obj)
{
	obj.value = obj.value.toUpperCase();	
}


/**
* ÀÔ·ÂÇÑ ±ÛÀÚ¸¦ ¼Ò¹®ÀÚ·Î ¹Ù²Û´Ù.
* @return string
*/
function fn_Lower(obj)
{
	obj.value = obj.value.toLowerCase();	
}


/*	±ÛÀÚÈ®´ëÃà¼Ò */	
var currentFontSize = 1;
function zoomUtil(state, e){
	var idx;
	var arrFontSize = new Array();

	arrFontSize[0] = "65%";
	arrFontSize[1] = "75%";
	arrFontSize[2] = "85%";
	arrFontSize[3] = "100%";
	arrFontSize[4] = "110%";
	arrFontSize[5] = "120%";
	arrFontSize[6] = "130%";
	
	var e = e || window.event;
	if (e) {
		if (state == "plus") {		
			if (currentFontSize < 6 ) {
				idx = currentFontSize + 1;
				currentFontSize = idx;
			}else{
				idx = 6;
				currentFontSize = idx;
			}			
		} else if (state == "default") {
			idx = 1;
			currentFontSize = idx;
		} else if (state == "minus") {			
			if ( currentFontSize >= 1) {
				idx = currentFontSize - 1;
				currentFontSize = idx;
			}else{
				idx = 0;
				currentFontSize = idx;
			}
		}		
	}
	document.body.style.fontSize = arrFontSize[idx];
	return false;
}


/**
 * ¿ìÆí¹øÈ£ °Ë»ö
 */
function fn_Zipcode(params)
{
	if (params == undefined)
	{
		fn_Popup('/zipcode', 'findZipcode', 380, 455);
	}
	else
	{
		fn_Popup('/zipcode?'+params, 'findZipcode', 380, 455);
	}
}


/**
 * thickbox ·¹ÀÌ´õ ´Ý±â
 */
function fn_CloseThickbox(isReload)
{
	parent.tb_remove();
	if(isReload == true){
		setTimeout(function(){
			parent.document.location.reload();
		}, 300);
		
	}
}

/**
 * ÆË¾÷ ´Ý±â
 */
function fn_Close()
{
	self.close();
}




function fn_Bookmark(url, name)
{
	if(confirm('Áñ°ÜÃ£±â¿¡ Ãß°¡ÇÏ½Ã°Ú½À´Ï±î?'))
	{
		window.external.AddFavorite(url, name);
	}
}
	
	
function fn_Zipcode(url, width, height) {
	url = url ? url : '/zipcode/search';
	width = width ? width : 370;
	height = height ? height : 400;
	
	fn_Popup(url, 'zipcode', width, height);
}


/**
 * GrowlUI Message
 */
function fn_SuccessGrowlUI(msg) {
	$.growlUI("Success", msg); 
	$('div.growlUI').addClass('success');
}

function fn_FailureGrowlUI(msg) {
	$.growlUI("Failure", msg); 
	$('div.growlUI').addClass('failure');
}

function fn_InformationGrowlUI(msg) {
	$.growlUI("Infomation", msg); 
	$('div.growlUI').addClass('info');	
}

function fn_GrowlUI(msg) {
	$.blockUI.defaults.growlCSS.right = '10px';
	$.blockUI.defaults.growlCSS.left =  '';
	$.blockUI.defaults.growlCSS.top  =  '10px';
	$.growlUI('Notification', msg);
}

function fn_WaitBlock() {
	$.blockUI({
	    css: {
	    border: 'none',
	    padding: '15px',
	    backgroundColor: '#000',
	    '-webkit-border-radius': '10px',
	    '-moz-border-radius': '10px',
	    opacity: .5,
	    color: '#fff'
		}
	});
}

function fn_MessageInBlock(msg){
	fn_WaitBlock();
		$('.blockUI.blockMsg.blockPage').remove();
		$('#wrapper').block({message:msg, css:{ width: '800px',
			margin:'68px',backgroundColor:'#FFFFFF', padding:'20px',
			border:'5px solid #D6D6D6',cursor:'auto'
		}});
	$('div.blockMsg').css('left','0px');
	$('div.blockMsg').css('top','0px');
	$('#wrapper .blockUI.blockOverlay').remove();
}

function fn_ValidateCaptcha() {
	if ($('input[name=captchaSelection]').val()== '') {
		//$('#captchaArea span.required').text("ÇÊ¼ö¼±ÅÃ");
		return false;
	} else {
		return true;
	}
}



function fn_GetCaptcha() {
	$('#captchaArea').bind('loaded.simpleCaptcha', function(ev) {
		loadedCaptcha();
		ev.stopPropagation();
	  }).simpleCaptcha();
}

//´Ù¸¥ ÆäÀÌÁö ÀÌµ¿ Ã¼Å© ÇØÁ¦
function fn_DisableUnload() {
	beforeUnload = 0;
} 



function fn_AjaxResponse(response) {

	if (response.available) {
		location.reload();
	} else {
		alert(response.message);
	}	
}

function fn_AjaxResponseGrowlUI(response) {
	if (response.available) {
		location.reload();
	} else {
		fn_FailureGrowlUI(response.message);
	}	
}


//0 ºÙÀÌ±â
function fn_AttachZero(v) {
	v = '0' + v;
	v = v.slice(-2);
	return v;
}

function fn_SWF(obj) {
	if (window.ActiveXObject && obj) {
		obj.innerHTML = obj.innerHTML;
	}
}

function fn_ClosePopReloadUrl(url) {
	opener.document.location.reload(url);
	fn_Close();
}


