

var U = {

    // ------------------------------------------------------------------------------------
    // ----------------------------------- 로그인 관련 --------------------------------------
    // ------------------------------------------------------------------------------------

    isLogin: false,

    confirmLoginMove: function (url) {

        if (!U.isLogin) {
            if (confirm(Msg.loginConfirm))
                U.goMenu("popLogin", url);

            return;
        }
        else {
            location.href = url;
        }

    },



    // ------------------------------------------------------------------------------------
    // -------------------------------------- 쿠키 ----------------------------------------
    // ------------------------------------------------------------------------------------

    cookie: {

        // ------------------------------------------------------------------------------------
        // 쿠키 설정
        // name        : 이름
        // value       : 값
        // expire_type : 만료시간 구분
        // expire_val  : 만료시간 크기
        // ------------------------------------------------------------------------------------
        setCookie: function (name, value, expire_type, expire_val) {

            var expire_date = new Date();

            switch (expire_type) {
                case "m":
                    expire_date.setMonth(expire_val);
                    break;
                case "d":
                    expire_date.setDate(expire_val);
                    break;
                case "h":
                    expire_date.setHours(expire_val);
                    break;
                case "n":
                    expire_date.setMinutes(expire_val);
                    break;
                case "s":
                    expire_date.setSeconds(expire_val);
                    break;
                default:
                    expire_date.setDate(expire_val);
                    break;
            }

            document.cookie = name + "=" + encodeURIComponent(value) + "; path=/; expires=" + expire_date.toGMTString() + ";";

        },

        // ------------------------------------------------------------------------------------
        // 쿠키값 조회
        // name : 이름
        // ------------------------------------------------------------------------------------
        getCookie: function (name) {

            var prefix = name + "=";
            var cookieStartIndex = document.cookie.indexOf(prefix);

            if (cookieStartIndex == -1)
                return "";

            var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);

            if (cookieEndIndex == -1)
                cookieEndIndex = document.cookie.length;

            return decodeURIComponent(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));

        },

        // ------------------------------------------------------------------------------------
        // 쿠키 삭제
        // name : 이름
        // ------------------------------------------------------------------------------------
        clearCookie: function (name) {

            var today = new Date();
            var expire_date = new Date(today.getDate() - 1);

            document.cookie = name + "=" + "; path=/; expires=" + expire_date.toGMTString();

        }

    },


    // ------------------------------------------------------------------------------------
    // ------------------------------------ 윈도우 ----------------------------------------
    // ------------------------------------------------------------------------------------

    window: {

        // ------------------------------------------------------------------------------------
        // 윈도우 오픈 (위치 지정 안하면 화면 중앙)
        // url        : 주소
        // win_id     : 윈도우 이름
        // win_width  : 윈도우 가로 크기
        // win_height : 윈도우 세로 크기
        // win_x      : 윈도우 x 좌표
        // win_y      : 윈도우 y 좌표
        // ------------------------------------------------------------------------------------
        open: function (url, win_id, win_width, win_height, win_x, win_y) {

            var win_opt, o_win;

            if (win_x == null) win_x = eval((screen.availWidth / 2) - (win_width / 2));
            if (win_y == null) win_y = eval((screen.availHeight / 2) - (win_height / 2));

            win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=no,status=no,scrollbars=no";
            win_opt += ",top=" + win_y + ",left=" + win_x;

            o_win = window.open(url, win_id, win_opt);
            o_win.focus();

        },

        openWScroll: function (url, win_id, win_width, win_height, win_x, win_y) {

            var win_opt, o_win;

            if (win_x == null) win_x = eval((screen.availWidth / 2) - (win_width / 2));
            if (win_y == null) win_y = eval((screen.availHeight / 2) - (win_height / 2));

            win_opt = "width=" + win_width + ",height=" + win_height + ",resizable=no,status=no,scrollbars=yes";
            win_opt += ",top=" + win_y + ",left=" + win_x;

            o_win = window.open(url, win_id, win_opt);
            o_win.focus();

        }
    },


    // ------------------------------------------------------------------------------------
    // ------------------------------------ 검증  -----------------------------------------
    // ------------------------------------------------------------------------------------

    validation: {

        regexp: {
            required: /[^.*]/,
            alpha: /^[a-z ._-]+$/i,
            alphanum: /^[a-z0-9 ._-]+$/i,
            digit: /^[-+]?[0-9]+$/,
            nodigit: /^[^0-9]+$/,
            number: /^[-+]?\d*\.?\d+$/,
            email: /^[a-z0-9._%-]+@[a-z0-9.-]+\.[a-z]{2,4}$/i,
            phone: /^[\d\s ().-]+$/,
            url: /^(http|https|ftp)\:\/\/[a-z0-9\-\.]+\.[a-z]{2,3}(:[a-z0-9]*)?\/?([a-z0-9\-\._\?\,\'\/\\\+&amp;%\$#\=~])*$/i,
            mem_id: /^[a-z][a-z0-9]{4,11}$/i,
            mem_pw: /([a-z]+[0-9]+|[0-9]+[a-z]+)/i,
            tel_num: /^0(?:\d{1,2})-(?:\d{3,4})-\d{4}$/,
            mobile_num: /^01(?:0|1|[6-9])-(?:\d{3,4})-\d{4}$/
        },

        // ------------------------------------------------------------------------------------
        // 정규식으로 검증
        //
        // obj : 컨트롤 개체 또는 문자열
        // exp : 정규식
        // ------------------------------------------------------------------------------------
        regExp: function (obj, exp, msg) {

            if (typeof (obj) == "string") {
                if (obj.search(exp) == -1) {
                    if (msg != null) alert(msg);

                    return false;
                }
                else {
                    return true;
                }
            }
            else {
                if (obj.val().search(exp) == -1) {
                    obj.focus();

                    if (msg != null) alert(msg);

                    return false;
                }
                else {
                    return true;
                }
            }

        },

        // ------------------------------------------------------------------------------------
        // 빈값 허용하지 않는 입력폼 체크
        //
        // ctrl : 컨트롤 개체 (document.all.Email)
        // msg  : 경고창에 보여질 내용
        // ------------------------------------------------------------------------------------
        notNull: function (ctrl, msg) {

            return U.validation.regExp(ctrl, U.validation.regexp.required, msg);

        },

        // ------------------------------------------------------------------------------------
        // 주민등록번호를 정확히 입력했는지 확인
        //
        // aaa : 주민번호 앞 6 자리
        // bbb : 주민번호 뒤 7 자리
        // ------------------------------------------------------------------------------------
        sid: function (sid1, sid2) {

            var tmp = 0;
            var yy = sid1.substring(0, 2);
            var mm = sid1.substring(2, 4);
            var dd = sid1.substring(4, 6);
            var sex = sid2.substring(0, 1);
            var ccc = sid1 + sid2;
            var i;

            if ((ccc.length != 13) || (mm < 1 || mm > 16 || dd < 1) || (sex != 1 && sex != 2 && sex != 3 && sex != 4)) return false;

            for (i = 0; i <= 5; i++)
                tmp = tmp + ((i % 8 + 2) * parseInt(sid1.substring(i, i + 1)));

            for (i = 6; i <= 11; i++)
                tmp = tmp + ((i % 8 + 2) * parseInt(sid2.substring(i - 6, i - 5)));

            tmp = 11 - (tmp % 11);
            tmp = tmp % 10;

            if (tmp != sid2.substring(6, 7)) return false;

            return true;

        },

        socNo: function(socno) {
            var socnoStr = socno.toString();
            a = socnoStr.substring(0, 1);
            b = socnoStr.substring(1, 2);
            c = socnoStr.substring(2, 3);
            d = socnoStr.substring(3, 4);
            e = socnoStr.substring(4, 5);
            f = socnoStr.substring(5, 6);
            g = socnoStr.substring(6, 7);
            h = socnoStr.substring(7, 8);
            i = socnoStr.substring(8, 9);
            j = socnoStr.substring(9, 10);
            k = socnoStr.substring(10, 11);
            l = socnoStr.substring(11, 12);
            m = socnoStr.substring(12, 13);
            month = socnoStr.substring(2, 4);
            day = socnoStr.substring(4, 6);
            socnoStr1 = socnoStr.substring(0, 7);
            socnoStr2 = socnoStr.substring(7, 13);
            // 월,일 Validation Check
            if (month <= 0 || month > 12) { return false; }
            if (day <= 0 || day > 31) { return false; }
            // 주민등록번호에 공백이 들어가도 가입이 되는 경우가 발생하지 않도록 한다.
            if (isNaN(socnoStr1) || isNaN(socnoStr2)) { return false; }
            temp = a * 2 + b * 3 + c * 4 + d * 5 + e * 6 + f * 7 + g * 8 + h * 9 + i * 2 + j * 3 + k * 4 + l * 5;
            temp = temp % 11;
            temp = 11 - temp;
            temp = temp % 10;
            if (temp == m) {
                return true;
            } else {
                return false;
            }
        },

        fgnNo: function(socno) {
            var total = 0;
            var parity = 0;
            var fgnNo = new Array(13);
            for (i = 0; i < 13; i++) fgnNo[i] = parseInt(socno.charAt(i));
            if (fgnNo[11] < 6) return false;
            if ((parity = fgnNo[7] * 10 + fgnNo[8]) & 1) return false;

            var weight = 2;
            for (i = 0, total = 0; i < 12; i++) {
                var sum = fgnNo[i] * weight;
                total += sum;
                if (++weight > 9) weight = 2;
            }
            if ((total = 11 - (total % 11)) >= 10) total -= 10;
            if ((total += 2) >= 10) total -= 10;
            if (total != fgnNo[12]) return false;
            return true;
        },

        // ------------------------------------------------------------------------------------
        // iOS 계열의 기기 검증
        // ------------------------------------------------------------------------------------
        isiOS: function() {
            var pf_lc = navigator.platform.toLowerCase();

            if (pf_lc.indexOf("iphone") >= 0 || pf_lc.indexOf("ipad") >= 0 || pf_lc.indexOf("ipod") >= 0)
                return true;
            else
                return false;
        }

    },


    // ------------------------------------------------------------------------------------
    // --------------------------------- 이벤트 처리 --------------------------------------
    // ------------------------------------------------------------------------------------

    act: {

        // ------------------------------------------------------------------------------------
        // 엔터키를 눌렀을 경우 해당 함수를 호출
        //
        // fn_name : 함수명 ("window.close()")
        // ------------------------------------------------------------------------------------
        execFn: function (fn_name, e) {

            var code;

            if (!e) e = window.event;
            if (e.keyCode) code = e.keyCode;
            else if (e.which) code = e.which;

            if (code == 13)
                setTimeout(fn_name, 0);
        },

        // ------------------------------------------------------------------------------------
        // 숫자만 입력받기
        // ------------------------------------------------------------------------------------
        onlyNumber: function (e) {

            var code;

            if (!e) e = window.event;
            if (e.keyCode) code = e.keyCode;
            else if (e.which) code = e.which;

            if (!((48 <= code && code <= 57 || 96 <= code && code <= 105) || code == 8 || code == 9 || code == 46)) {
                if (!e.preventDefault)
                    e.returnValue = false;
                else
                    e.preventDefault();
            }

        },

        // ------------------------------------------------------------------------------------
        // 영문자와 숫자만 입력받기
        // ------------------------------------------------------------------------------------
        onlyAlphaNumeric: function (e) {

            var code;

            if (!e) e = window.event;
            if (e.keyCode) code = e.keyCode;
            else if (e.which) code = e.which;

            if (!((65 <= code && code <= 90 || 48 <= code && code <= 57 || 96 <= code && code <= 105) || code == 8 || code == 9 || code == 46)) {
                if (!e.preventDefault)
                    e.returnValue = false;
                else
                    e.preventDefault();
            }

        },

        // ------------------------------------------------------------------------------------
        // 숫자 형태만 입력받기
        // ------------------------------------------------------------------------------------
        onlyNumeric: function (e) {

            var code;

            if (!e) e = window.event;
            if (e.keyCode) code = e.keyCode;
            else if (e.which) code = e.which;

            if (!((48 <= code && code <= 57 || 96 <= code && code <= 105) || code == 8 || code == 9 || code == 46 || code == 110 || code == 190 || code == 188)) {
                if (!e.preventDefault)
                    e.returnValue = false;
                else
                    e.preventDefault();
            }

        },

        // ------------------------------------------------------------------------------------
        // 전화번호 형식만 입력받기
        // ------------------------------------------------------------------------------------
        onlyTelNumber: function (e) {

            var code;

            if (!e) e = window.event;
            if (e.keyCode) code = e.keyCode;
            else if (e.which) code = e.which;

            if (!((48 <= code && code <= 57 || 96 <= code && code <= 105) || code == 8 || code == 9 || code == 46 || code == 57 || code == 48 || code == 109 || code == 189)) {
                if (!e.preventDefault)
                    e.returnValue = false;
                else
                    e.preventDefault();
            }

        },


        // ------------------------------------------------------------------------------------
        // 백스페이지를 통한 뒤로가기 방지
        // ------------------------------------------------------------------------------------
        noBack: function (e) {

            var code;

            if (!e) e = window.event;
            if (e.keyCode) code = e.keyCode;
            else if (e.which) code = e.which;

            if (code == 8) {
                if (!e.preventDefault)
                    e.returnValue = false;
                else
                    e.preventDefault();
            }

        }
    },


    // ------------------------------------------------------------------------------------
    // ------------------------------------ 문자열 ----------------------------------------
    // ------------------------------------------------------------------------------------

    str: {

        // ------------------------------------------------------------------------------------
        // 글자수 계산
        //
        // str : 문자열
        // ------------------------------------------------------------------------------------
        len: function (str) {

            var str_len = 0;

            var Nav = navigator.appName;
            var Ver = navigator.appVersion;

            var IsExplorer = false;

            var ch;

            if ((Nav == 'Microsoft Internet Explorer') && (Ver.charAt(0) >= 4))
                IsExplorer = true;

            if (IsExplorer) {
                for (var i = 0; i < str.length; i++) {
                    ch = str.charAt(i);

                    if ((ch == "\n") || ((ch >= "ㅏ") && (ch <= "히")) || ((ch >= "ㄱ") && (ch <= "ㅎ")))
                        str_len += 2;
                    else
                        str_len += 1;
                }
            }
            else
                str_len = str.length;

            return str_len;

        },

        // ------------------------------------------------------------------------------------
        // 오른쪽부터 원하는 만큼의 잘라냄
        //
        // str : 문자열
        // ------------------------------------------------------------------------------------
        right: function (str, len) {

            return str.substring(str.length - len, str.length);

        },

        // ------------------------------------------------------------------------------------
        // HTML Encode
        //
        // html : 문자열
        // ------------------------------------------------------------------------------------
        encodeHtml: function (html) {

            return html.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");

        },

        // ------------------------------------------------------------------------------------
        // HTML Decode
        //
        // text : 문자열
        // ------------------------------------------------------------------------------------
        decodeHtml: function (text) {

            return text.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">");

        }
    },



    // ------------------------------------------------------------------------------------
    // ------------------------------------ 폼 컨트롤  ------------------------------------
    // ------------------------------------------------------------------------------------

    ctrl: {

        // ------------------------------------------------------------------------------------
        // 리스트에서 체크박스 전체선택 (반전)
        //
        // oAllChkBox : 전체선택 체크박스
        // oChkBox    : 처리될 체크박스
        // ------------------------------------------------------------------------------------
        checkAll: function (oAllChkBox, oChkBox) {

            var bln_checked;

            if (oAllChkBox.checked)
                bln_checked = true;
            else
                bln_checked = false;

            if (eval(oChkBox)) {
                if (eval(oChkBox.length)) {
                    var chkbox_count = oChkBox.length;

                    for (var i = 0; i < chkbox_count; i++)
                        oChkBox[i].checked = bln_checked;
                }
                else
                    oChkBox.checked = bln_checked;
            }

        }

    },


    // ------------------------------------------------------------------------------------
    // -------------------------------------- 이미지 ---------------------------------------
    // ------------------------------------------------------------------------------------

    img: {

        // ------------------------------------------------------------------------------------
        // 이미지 크기 리사이즈
        //
        // oIMG  : 이미지
        // max_w : 가로 제한 크기
        // max_h : 세로 제한 크기
        // ------------------------------------------------------------------------------------
        resizeImg: function (oIMG, max_w, max_h) {

            var tmpImg = new Image();

            tmpImg.src = oIMG.src;

            if (!IsImageOk(tmpImg)) {
                while (!IsImageOk(tmpImg))
                    setTimeout("void()", 1000);
            }

            var img_w = tmpImg.width;
            var img_h = tmpImg.height;

            if (img_w >= img_h) {
                if (img_w > max_w) {
                    oIMG.style.width = max_w + "px";
                    oIMG.style.height = max_w * (img_h / img_w) + "px";
                }
                else {
                    oIMG.style.width = img_w + "px";
                    oIMG.style.height = img_h + "px";
                }
            }
            else {
                if (img_h > max_h) {
                    oIMG.style.height = max_h + "px";
                    oIMG.style.width = max_h * (img_w / img_h) + "px";
                }
                else {
                    oIMG.style.height = img_h + "px";
                    oIMG.style.width = img_w + "px";
                }
            }
        },

        IsImageOk: function (oIMG) {

            if (!oIMG.complete)
                return false;

            if (typeof oIMG.naturalWidth != "undefined" && oIMG.naturalWidth == 0)
                return false;

            return true;
        }
    },


    // ------------------------------------------------------------------------------------
    // -------------------------------------- 메시지 --------------------------------------
    // ------------------------------------------------------------------------------------

    goMenu: function (menu_cd, prm1, prm2) {

        var http_host = "www.k-auction.com";

        switch (menu_cd) {
            case "aboutCompany":
                location.href = "http://" + http_host + "/Company/CompanyInfo.aspx";
                break;
            case "academy":
                location.href = "http://" + http_host + "/Business/Academy.aspx";
                break;
            case "auctionAgree":
                location.href = "http://" + http_host + "/Auction/Agree.aspx";
                break;
            case "auctionResult":
                U.confirmLoginMove("http://" + http_host + "/Auction/WorkList.aspx");
                break;
            case "auctionSchedule":
                location.href = "http://" + http_host + "/Auction/ScheduleList.aspx";
                break;
            case "auctionSketch":
                location.href = "http://" + http_host + "/Photo/PhotoList.aspx";
                break;
            case "boardList":
                location.href = "http://" + http_host + "/Board/BoardList.aspx?b_seq=" + prm1;
                break;
            case "business":
                location.href = "http://" + http_host + "/Business/ArtAuction.aspx";
                break;
            case "consign":
                U.confirmLoginMove("https://" + http_host + "/Consign/ConsignWrite.aspx");
                break;
            case "contact":
                location.href = "http://" + http_host + "/Company/Contact.aspx";
                break;
            case "consignInfo":
                location.href = "http://" + http_host + "/Consign/ConsignInfo.aspx";
                break;
            case "finance":
                location.href = "http://" + http_host + "/Business/Finance.aspx";
                break;
            case "findId":
                location.href = "https://" + http_host + "/Member/PopMemberFindId.aspx";
                break;
            case "findPwd":
                location.href = "https://" + http_host + "/Member/PopMemberFindPwd.aspx";
                break;
            case "history":
                location.href = "http://" + http_host + "/Company/History.aspx";
                break;
            case "howtoBuy":
                location.href = "http://" + http_host + "/Auction/HowtoBuy.aspx";
                break;
            case "kmall":
                location.href = "/KMall/Auction/WorkList.aspx";
                //location.href = "http://kmall.k-auction.com/";
                break;
            case "location":
                location.href = "http://" + http_host + "/Company/Location.aspx";
                break;
            case "logOut":
                location.href = "http://" + http_host + "/Member/MemberLogOut.aspx";
                break;
            case "modifyMyInfo":
                location.href = "https://" + http_host + "/Member/MemberModify.aspx";
                break;
            case "myAuction":
                location.href = "http://" + http_host + "/Member/MyAuction.aspx";
                break;
            case "myConsign":
                location.href = "http://" + http_host + "/Member/ConsignList.aspx";
                break;
            case "myOnlineBid":
                location.href = "http://" + http_host + "/Member/MyOnlineBid.aspx";
                break;
            case "popLogin":
                U.window.open("https://" + http_host + "/Member/PopMemberLogin.aspx?pl=" + encodeURIComponent(location.href) + ((prm1 != null) ? "&url=" + encodeURIComponent(prm1) : ""), "popLogin", 409, 300);
                break;
            case "popFindId":
                U.window.open("https://" + http_host + "/Member/PopMemberFindId.aspx", "popFindId", 409, 300);
                break;
            case "popFindPwd":
                U.window.open("https://" + http_host + "/Member/PopMemberFindPwd.aspx", "popFindPwd", 409, 300);
                break;
            case "popMemKindInfo":
                U.window.open("http://" + http_host + "/Member/PopMemKindInfo.aspx", "popMemKindInfo", 655, 450);
                break;
            case "popMobileApp":
                U.window.open("http://" + http_host + "/PopUp/PopMobileApp.aspx", "popMobileApp", 618, 351);
                break;
            case "popZipCode":
                U.window.open("/Common/PopZipCode.aspx", "popZipCode", 409, 342);
                break;
            case "search":
                location.href = "http://" + http_host + "/Auction/WorkSearch.aspx";
                break;
            case "searchDetail":
                U.confirmLoginMove("http://" + http_host + "/Auction/WorkSearchDetail.aspx");
                break;
            case "signUp":
                location.href = "http://" + http_host + "/Member/MemberAgreement.aspx";
                break;
            case "storage":
                location.href = "http://" + http_host + "/Business/Storage.aspx";
                break;
            case "viewWork":
                if (prm2 != null)
                    location.href = "http://" + http_host + "/Auction/WorkView.aspx?auc_num=" + prm1 + "&lot_num=" + prm2;
                else
                    location.href = "http://" + http_host + "/Auction/WorkView.aspx?work_seq=" + prm1;
                break;
            case "workList":
                location.href = "http://" + http_host + "/Auction/WorkList.aspx";
                break;
            case "_auctionSchedule":
                location.href = "/KMall/Auction/ScheduleList.aspx";
                break;
            case "_bid":
                location.href = "http://" + http_host + "/KMall/Auction/Bid.aspx?work_seq=" + prm1;
                break;
            case "_bidList":
                location.href = "http://" + http_host + "/KMall/Auction/BidList.aspx?work_seq=" + prm1;
                break;
            case "_bidPre":
                location.href = "http://" + http_host + "/KMall/Auction/BidPre.aspx?work_seq=" + prm1;
                break;
            case "_companyInfo":
                location.href = "/KMall/Company/CompanyInfo.aspx";
                break;
            case "_contact":
                location.href = "mailto:art@k-auction.com";
                break;
            case "_guideFaq":
                location.href = "/KMall/Guide/GuideFAQ.aspx";
                break;
            case "_guide":
                location.href = "/KMall/Guide/";
                break;
            case "_guideBid":
                location.href = "/KMall/Guide/GuideBid.aspx";
                break;
            case "_guideConsign":
                location.href = "/KMall/Guide/GuideConsign.aspx";
                break;
            case "_guidePolicy":
                location.href = "/KMall/Guide/GuidePolicy.aspx";
                break;
            case "_guideTerms":
                location.href = "/KMall/Guide/GuideTerms.aspx";
                break;
            case "_logIn":
                location.href = "http://" + http_host + "/KMall/Member/MemberLogin.aspx";
                break;
            case "_logOut":
                location.href = "http://" + http_host + "/KMall/Member/MemberLogOut.aspx";
                break;
            case "_myAuction":
                location.href = "http://" + http_host + "/KMall/Member/MyAuction.aspx";
                break;
            case "_myInfo":
                location.href = "http://" + http_host + "/KMall/Member/MemberModify.aspx";
                break;
            case "_notice":
                location.href = "/KMall/Board/BoardList.aspx?b_seq=1";
                break;
            case "_popFindIdPwd":
                U.window.open("http://" + http_host + "/KMall/Member/PopMemberFindIdPwd.aspx", "popFindIdPwd", 375, 270);
                break;
            case "_popMyBidList":
                U.window.openWScroll("http://" + http_host + "/KMall/Member/PopMyAuctionBidList.aspx?work_seq=" + prm1, "popMyBidList", 685, 500);
                break;
            case "_popZipCode":
                U.window.open("/KMall/Common/PopZipCode.aspx", "popZipCode", 375, 310);
                break;
            case "_signUp":
                location.href = "http://" + http_host + "/KMall/Member/MemberAgreement.aspx";
                break;
            case "_viewWork":
                location.href = "http://" + http_host + "/KMall/Auction/WorkView.aspx?work_seq=" + prm1;
                break;
            case "_viewCategory":
                location.href = "http://" + http_host + "/KMall/Auction/WorkList.aspx?page_no=1"
                    + "&auc_num="
                    + "&cls=" + prm1
                break;
        }

    }


}



try {
    $(document).ready(function () {
        document.title = "K-Auction";

        $("a").focus(function () {
            this.blur();
        });
    });
}
catch (ex) {
    document.title = "K-Auction";
}



function ShowFlash(url, width, height) {
    var obj = "";

    obj += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.1.82.76\" width=\"" + width + "\" height=\"" + height + "\">";
    obj += "<param name=\"flashvars\" value=\"\">";
    obj += "<param name=\"movie\" value=\"" + url + "\">";
    obj += "<param name=\"src\" value=\"" + url + "\">";
    obj += "<param name=\"wmode\" value=\"opaque\">";
    obj += "<param name=\"quality\" value=\"high\">";
    obj += "<param name=\"allowscriptaccess\" value=\"always\">";
    obj += "<param name=\"bgcolor\" value=\"\">";
    obj += "<embed src=\"" + url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\" quality=\"high\" allowscriptaccess=\"always\" bgcolor=\"\"></embed>";
    obj += "</object>";
    
    document.write(obj);
}

function ShowFlashx(url, width, height, noflash) {

    if (U.validation.isiOS()) {
        document.write(noflash);
    }
    else {
        var obj = "";

        obj += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.1.82.76\" width=\"" + width + "\" height=\"" + height + "\">";
        obj += "<param name=\"flashvars\" value=\"\">";
        obj += "<param name=\"movie\" value=\"" + url + "\">";
        obj += "<param name=\"src\" value=\"" + url + "\">";
        obj += "<param name=\"wmode\" value=\"opaque\">";
        obj += "<param name=\"quality\" value=\"high\">";
        obj += "<param name=\"allowscriptaccess\" value=\"always\">";
        obj += "<param name=\"bgcolor\" value=\"\">";
        obj += "<embed src=\"" + url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\" quality=\"high\" allowscriptaccess=\"always\" bgcolor=\"\"></embed>";
        obj += "</object>";
    
        document.write(obj);
    }
}

var wwwImgPath = "http://images.k-auction.com/www/ko";

function onGNB(no, path) {
    if (path == null)
        path = wwwImgPath;

    $("#gnb" + no).attr("src", path + "/images/gnb" + no + "_ov.gif");
    $("#sub" + no).css("display", "block");
}

function outGNB(no, path) {
    if (path == null)
        path = wwwImgPath;

    $("#gnb" + no).attr("src", path + "/images/gnb" + no + ".gif");
    $("#sub" + no).css("display", "none");
}

function onGNBSub(no, path) {
    if (path == null)
        path = wwwImgPath;

    $("#sub" + no).attr("src", path + "/images/sub" + no + "_ov.gif");
}

function outGNBSub(no, path) {
    if (path == null)
        path = wwwImgPath;

    $("#sub" + no).attr("src", path + "/images/sub" + no + ".gif");
}

