var SmileCafeCtl = {
    sUrlBase : '/servlet/com.sure.smilecat.smilecafe.SmileCafeServlet',
    loadLs : function (sCmd, iPageNo, sIfrmId) {
        if (iPageNo <= 0) {
            return false;
        }
        var sUrl = this.sUrlBase;
        sUrl += '?cmd=' + sCmd;
        sUrl += '&page_no=' + iPageNo;
        document.location.replace(sUrl);
    },
    procListBest : function (sCmd, iPageNo) {
        if (iPageNo <= 0) {
            return false;
        }
        var sUrl = this.sUrlBase;
        sUrl += '?cmd=' + sCmd;
        sUrl += '&page_no=' + iPageNo;
        document.location.replace(sUrl);
    },
    initListFull : function (sPrdtType, sRecomType, sSkw, sSortField) {
        this.setPrdtType(sPrdtType);
        this.setRecomType(sRecomType);
        this.setSkw(sSkw);
        this.setSortField(sSortField);
    },
    setPrdtType : function (arg) {
        this.sPrdtType = arg ? arg : '';
        var iPostFix = 1;
        if (arg == 'b') {
            iPostFix = 2;
        } else if (arg == 'c') {
            iPostFix = 3;
        }
        for (var iCnt = 1, iLen = 3; iCnt <= iLen; iCnt++) {
            document.getElementById('himgPrdtType' + iCnt).src = '/images/barista/baristalist_menu_arrow_off.gif'
            document.getElementById('htdPrdtType' + iCnt).className = 'menu_photo_off';
        }
        document.getElementById('himgPrdtType' + iPostFix).src = '/images/barista/baristalist_menu_arrow_on.gif'
        document.getElementById('htdPrdtType' + iPostFix).className = 'menu_photo_on';
    },
    setRecomType : function (arg, bIsOnlyQuery) {
        this.sRecomType = arg ? arg : '';
        var iPostFix = 1;
        if (arg == 'B') {
            iPostFix = 2;
        } else if (arg == 'M') {
            iPostFix = 3;
        }
        if (bIsOnlyQuery) return;
        for (var iCnt = 1, iLen = 3; iCnt <= iLen; iCnt++) {
            document.getElementById('htdRecom' + iCnt).className = 'menu_box_off';
        }
        document.getElementById('htdRecom' + iPostFix).className = 'menu_box_on';
    },
    setSkw : function (arg) {
        this.sSkw = arg ? arg : '';
        var iPostFix = 1;
        if (arg == 'º£ÀÌºñ') iPostFix = 2;
        if (arg == '·¯ºê') iPostFix = 3;
        if (arg == '¿©Çà') iPostFix = 4;
        if (arg == 'ÀÏ»ó') iPostFix = 5;
        if (!iPostFix) return;
        document.getElementById('htdSkw' + iPostFix).style.fontWeight = 'bold';
    },
    setSortField : function (arg) {
        var hObj = document.getElementById('hselSortField');
        this.sSortField = arg;
        for (var iCnt = 0, iLen = hObj.options.length; iCnt < iLen; iCnt++) {
            if (hObj.options[iCnt].value == arg) {
                hObj.options[iCnt].selected = true;
                break;
            }
        }
    },
    procListFull : function () {
        var sUrl = this.sUrlBase;
        sUrl += '?cmd=procListFull';
        sUrl += '&sPrdtType=' + this.sPrdtType;
        sUrl += '&sRecomType=' + this.sRecomType;
        sUrl += '&sSortField=' + this.sSortField;
        sUrl += '&skw[]=' + this.sSkw;
        document.location.href= sUrl;
    },
    procView : function (iKey) {
        LayerCtl.layerShowIfrm('/smilecafe/smilecafe_dlg_view.jsp?pk_idx=' + iKey, 761, 645+46)
    }
}

