﻿var ajaxOptions = {
    httpMethod: {
        POST: 'POST',
        GET: 'GET'
    },
    dataType: {
        JSON: 'json',
        TEXT: 'text',
        SCRIPT: 'script',
        XML: 'xml',
        HTML: 'html'
    },
    uncache: false,
    cache: true
}

function isNumber() {
    try {
        if (!/NaN/.test(parseInt(arguments[0])))
            return true;
        else
            return false;
    }
    catch (e) {
        return false;
    }
}

function evalDateString(_text) {
    try {
        return eval('new ' + _text.replace(new RegExp('\/', 'g'), ''));
    }
    catch (e)
    { }
}

Date.prototype.toStringExt = function() {
    var a = arguments;
    if (a == null || a.length == 0 || a[0].toString().length == 0)
        return this.toString();
    else
        var a0 = arguments[0];

    function z(s, l) {
        var o = '';
        if (s.toString().length < l) {
            while (--l > 0) {
                o += '0';
            }
        }
        return o + s.toString();
    }

    var weeks = ['日', '一', '二', '三', '四', '五', '六'];
    var months = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
    a0 = a0.replace(/dddd/g, '星期' + weeks[this.getDay()]);
    a0 = a0.replace(/ddd/g, weeks[this.getDay()]);
    a0 = a0.replace(/dd/g, z(this.getDate(), 2));
    a0 = a0.replace(/d/g, this.getDate());

    a0 = a0.replace(/hh/g, z(this.getHours() % 12, 2));
    a0 = a0.replace(/h/g, this.getHours() % 12);
    a0 = a0.replace(/HH/g, z(this.getHours(), 2));
    a0 = a0.replace(/h/g, this.getHours());

    a0 = a0.replace(/mm/g, z(this.getMinutes(), 2));
    a0 = a0.replace(/m/g, this.getMinutes());
    a0 = a0.replace(/MMMM/g, months[this.getMonth()] + '月');
    a0 = a0.replace(/MMM/g, months[this.getMonth()]);
    a0 = a0.replace(/MM/g, z(this.getMonth() + 1, 2));
    a0 = a0.replace(/M/g, this.getMonth() + 1);

    a0 = a0.replace(/ss/g, z(this.getSeconds(), 2));
    a0 = a0.replace(/s/g, this.getSeconds());

    a0 = a0.replace(/tt/g, Math.ceil(this.getHours() / 12) == 0 ? 'AM' : 'PM');
    a0 = a0.replace(/t/g, Math.ceil(this.getHours() / 12) == 0 ? 'A' : 'P');
    a0 = a0.replace(/TT/g, this.toLocaleTimeString().substring(0, 2));

    a0 = a0.replace(/yyyy/g, this.getFullYear())
    a0 = a0.replace(/yy/g, this.getFullYear().toString().substring(2, 4));
    return a0;
}

Array.prototype.has = function(_v) {
    for (var _idx = 0; _idx < this.length; _idx++) {
        if (this[_idx] == _v)
            return true;
    }
    return false;
}

function getData(_u, _t, _dt, _d, _c, _sf, _cf, _ef) {
    _ef = /function/.test(typeof _ef) ? _ef : function(_e) {
        if (!isNullOrEmpty(_e.status) && _e.status == 403) {
            location.reload();
        }
        else if (!isNullOrEmpty(_e.statusText) && !/OK/.test(_e.statusText)) {
            alert(_e.statusText);
        }
        else if (!isNullOrEmpty(_e.Error)) {
            if (!isNullOrEmpty(_e.CallBack)) {
                eval(_e.CallBack);
            }
            else {
                alert(_e.Error);
            }
        }
    }
    try {
        _d.isAjaxRequest = true;
        $.ajax({
            url: _u,
            type: _t,
            dataType: _dt,
            data: _d,
            cache: _c,
            success: function(_d) {
                if (!isNullOrEmpty(_d) && _d.Error) {
                    _ef.call(this, _d);
                }
                else {
                    _sf.call(this, _d);
                }
            },
            error: _ef,
            complete: function(_r) {
                if (_r.status >= 300 && _r.status < 400) {
                    location.reload();
                }
                else if ($.isFunction(_cf)) {
                    _cf.call(this, _r);
                }
            }
        });
    }
    catch (e) {
        alert(e);
    }
}

function isNullOrEmpty(_o) {
    return (_o == null) || /undefined/.test(typeof _o) || _o.length == 0;
}

Number.prototype.toStringExt = function() {
    return trimDecimal(this, arguments[0], arguments[1]);
};

function trimDecimal(_dec, _showComma, _offset) {
    var _tmp = 0;
    if (/NaN/.test(typeof (_tmp = parseFloat(_dec.toString()))))
        return 0;

    _rz = _tmp.toString().split('.');
    if (/number/.test(typeof parseInt(_offset)) && _rz.length > 1) {
        _rz[1] = _rz[1].substring(0, _offset);
    }

    if (_showComma && Math.abs(_rz[0]) > 999) {
        _rz[0] = Math.abs(_rz[0]).toString().split('').reverse().join('').replace(/(\d{3})/g, '$1,').split('').reverse().join('');
        if (_rz[0].charAt(0) == ',') {
            _rz[0] = _rz[0].substring(1);
        }
    }

    return _rz.join('.');
}



function dialogExt(_o, _caller, _title) {
    var _titleId = _o.attr('id') + '_dialogExtTitle';
    if ($('#' + _titleId).length > 0) {
        $('#' + _titleId).remove();
    }
    var _titleBlock = $('<div id="' + _titleId + '"/>').addClass('borderOnePx borderMozRadius').css({ padding: '2px', textAlign: 'center', backgroundColor: '#e3fbfb' });
    _o.prepend(_titleBlock.text(_title));

    _caller.click(function() {
        if (_o.css('display') == 'none')
            _o.slideDown(500);
        else
            _o.slideUp(200);
    });
    _o.hide();
}

function asyncSelectItem(_url, _data, _targetSelectElement, _options, _callback) {
    var _default = $.extend({
        returnData: 'List',
        optionValue: 'Value',
        optionText: 'Text'
    }, _options);

    function _createOption(_val, _text) {
        return $('<option />').val(_val).text(_text);
    }
    function buildOptions(_data) {
        _targetSelectElement.find('option').remove();
        if (isNullOrEmpty(_data) || isNullOrEmpty(_data[_default.returnData])) {
            _targetSelectElement.append(_createOption('0', '無資料'));
        }
        else {
            $.each(_data[_default.returnData], function() {
                if (/function/.test(typeof this))
                    return;
                _targetSelectElement.append(_createOption(this[_default.optionValue], this[_default.optionText]));
            });
        }
        if ($.browser.msie) {//解決IE6第一次載入select時無法hidden的bug
            _targetSelectElement.css('display', 'none').css('display', '');
        }
        if (/function/.test(_callback)) {
            if ($.browser.msie) {
                setTimeout(function() { _callback.call(this); }, 500);
            }
            else {
                _callback.call(this);
            }
        }
    }

    if (/function/.test(typeof _url)) {
        _url.call(this, {
            data: _data,
            success: buildOptions
        });
    }
    else {
        getData(_url, 'POST', 'json', _data, true, buildOptions);
    }
}

function textCounter(_str) {
    try {
        if (arguments.length == 1)
            return (_str.length + _str.split(/[\u4e00-\u9a05]/).length - 1);
        else {
            var _len = arguments[1];
            while (textCounter(_str) > _len) {
                _str = _str.substring(0, _str.length - 1);
            }
            return _str;
        }
    }
    catch (e) {
    }
    return 0;
}

(function($) {
    $.fn.extend({
        selectedText: function() {
            if (!/^SELECT$/i.test(this.attr('tagName'))) {
                return;
            }
            if (this.find('option:selected').length == 0) {
                return '';
            }
            return this.find('option:selected').text();
        }
    });
    $.fn.extend({
        ohtml: function() {
            var _b = $('<b/>').append(this);
            var _ohtml = _b.html();
            _b == null;
            return _ohtml;
        }
    });

    //    $.fn.extend({
    //        asyncDropDownList: function(_mvcAjaxCallFunc, _option, _callBack) {
    //            var _default = $.extend({
    //                postName: 'Value',
    //                dataName: 'ReturnData',
    //                itemValue: 'Value',
    //                itemText: 'Text',
    //                itemSelected: null,
    //                subDDL: null,
    //                auto: true,
    //                data: null
    //            }, _option),
    //            _createOption = function(_val, _text, _isSelected) {
    //                return $('<option />').val(_val).text(_text).attr('selected', _isSelected);
    //            }

    //            this.option = _default;
    //            this.change(function() {
    //                if (!_default.data && (_default.data = {})) {
    //                    _default.data[_default.postName] = $(this).val();
    //                }
    //                _mvcAjaxCallFunc.call(this, {
    //                    data: _default.data,
    //                    success: function(_data) {
    //                        if (_default.subDDL) {
    //                            _default.subDDL.find('option').remove();
    //                            if (isNullOrEmpty(_data) || isNullOrEmpty(_data[_default.dataName])) {
    //                                this.append(_createOption(0, '無資料'));
    //                            }
    //                            else {
    //                                $.each(_data[_default.dataName], function() {
    //                                    if (/function/.test(typeof this))
    //                                        return;
    //                                    _default.subDDL.append(_createOption(this[_default.itemValue], this[_default.itemText], (_default.itemSelected && this[_default.itemValue] == _default.itemSelected)));
    //                                });
    //                                if ($.browser.msie) {//解決IE6第一次載入select時無法hidden的bug
    //                                    _default.subDDL.css('display', 'none').css('display', '');
    //                                }
    //                            }
    //                        }
    //                        if (/function/.test(_callBack)) {
    //                            _callBack.call();
    //                        }
    //                        _default.itemSelected = null;
    //                    }
    //                });
    //            });

    //            if (_default.auto) {
    //                this.trigger('change');
    //            }
    //        }
    //    });

    $.fn.extend({
        dataPager: function(_cnt, _pn, _ps, _pageFunc, _opt) {
            var _default = $.extend({
                items: 10,
                itemCss: {},
                itemClass: '',
                itemSeekStyle: 2,
                enableBorder: true,
                enableSeekFirstEnd: false,
                enablePageNumber: true
            }, _opt);
            var _pgcnt = Math.ceil(_cnt / _ps);
            var _last = _pn <= 4 ? _pgcnt > _default.items ? _default.items : _pgcnt : _pn + 5 > _pgcnt ? _pgcnt : _pn + 5; //_default.items ? _pgcnt < _default.items ? _pgcnt : //(_pgcnt > _pn + 5 ? _pn + 5 : _pgcnt);
            this.empty();
            function pagerLink(_text, _pageNumber) {
                return $('<a />').text(_text.toString()).attr('href', '#' + _pageNumber).click(function() {
                    _pageFunc(_pageNumber);
                });
            }

            for (var _pgnum = _last; this.children().length != _default.items && _pgnum > 0; _pgnum--) {
                var _pager = (_pn + 1 == _pgnum ? $('<b/>').text(_pgnum.toString()) : pagerLink(_pgnum, _pgnum - 1));
                this.prepend(_pager);
            }

            function pagerIcon(_class, _pageNumber) {
                if (_default.itemSeekStyle == 1) {
                    return $('<span/>').addClass('iconStyle iconSeek' + _class).css({
                        backgroundImage: 'url(' + $.content('Images/', null, ['ui-icons_888888_256x240.png']) + ')',
                        backgroundColor: 'transparent'
                    }).click(function() {
                        _pageFunc(_pageNumber);
                    });
                }
                if (_default.itemSeekStyle == 2) {
                    var _currentClass = _class.toLowerCase();
                    var _settings = {
                        Prev: '上一頁',
                        Next: '下一頁',
                        First: '第一頁',
                        End: '最後頁'
                    };

                    var _item = $('<span/>').text(_settings[_class]).css({ width: '50px', padding: '0px 0px 2px 16px' }).addClass('border-RF icon-arrow icon-arrow-brown-' + _currentClass);
                    return $('<span/>').css({ width: '68px' })
                    .append($('<b class="rds"><b class="l1"></b><b class="l2"></b><b class="l3"></b></b>'))
                    .append(_item)
                    .append($('<b class="rds"><b class="l3"></b><b class="l2"></b><b class="l1"></b></b>'))
                    .click(function() {
                        _pageFunc(_pageNumber);
                    })
                    ;
                }
            }
            if (_pn > 0) {
                this.prepend(pagerIcon('Prev', _pn - 1));
            }

            if (_pn + 1 < _pgcnt) {
                this.append(pagerIcon('Next', _pn + 1));
            }

            if (_default.enableSeekFirstEnd) {
                if (_pn > _default.items / 2) {
                    this.prepend(pagerIcon('First', 0));
                }
                if (_pn < _pgcnt - _default.items) {
                    this.append(pagerIcon('End', _pgcnt - 1))
                }
            }

            if (_default.enablePageNumber) {
                this.prepend($('<span/>')
                .text('第' + (_pn + 1) + '/' + (_pgcnt != 0 ? _pgcnt : 1) + '頁')
                .css({
                    float: 'right',
                    padding: '3px'
                }));
            }

            this.children().css({
                float: 'left'
            });
            this.find('a').css({
                textDecoration: 'none',
                padding: '3px',
                margin: '0px 3px',
                border: 'solid 1px #C6C6C6'
            });
            this.find('b:not(.rds,.l1,.l2,.l3)').css({
                color: '#f26e03',
                margin: '0px 2px',
                padding: '3px 2px'
            });
        }
    });

    $.fn.extend({
        adLayout: function(_format) {
            if (isNullOrEmpty(_format))
                return;

            var _sys = {
                text: {
                    movie: 'http://pic.dotmore.com.tw/apps/Type_text_double_C.swf',
                    layer: [315, 135], size: [315, 200]
                },
                textpic: {
                    movie: 'http://pic.dotmore.com.tw/apps/Type_text_pic_H.swf',
                    layer: [375, 200], size: [375, 250]
                },
                flash: {
                    movie: 'http://pic.dotmore.com.tw/apps/Type_text_full_B.swf',
                    layer: [375, 200], size: [375, 200]
                },
                movie: {
                    movie: 'http://pic.dotmore.com.tw/apps/Type_BigSize_C.swf',
                    layer: [360, 320], size: [360, 320]
                },
                extra: {
                    movie: _format.Picture,
                    layer: [], size: []
                }
            };

            var _swfSettings = {
                cid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
                cbase: 'http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
                alwScript: 'always',
                qly: 'high',
                wmode: 'transparent',
                alg: 'middle',
                type: 'application/x-shockwave-flash',
                plg: 'http://adobe.com/go/getflashplayer'
            };

            var _type = _format.AdType;
            var _currSys = _sys[_type];
            if (isNullOrEmpty(_currSys))
                return;

            var _flashCollection = {};
            var _flashvarParams = ['ACT=' + encodeURIComponent(_format.Hyperlink)];

            
            if (!/^flash$/i.test(_type)) {
                _flashvarParams.push('AT=' + encodeURIComponent(_format.Title));
                _flashvarParams.push('AB=' + encodeURIComponent(_format.Body));
                _flashvarParams.push('AU=' + encodeURIComponent(_format.ShowURL));
            }
            if (!/^text$/i.test(_type)) {
                _flashvarParams.push('AP=' + encodeURIComponent(_format.Picture));
            }
            
            switch (_type) {
                case 'movie':
                    {
                        if (_format.FlashWidth && _format.FlashWidth != 0 && _format.FlashHeight != 0) {
                            _currSys.layer = _currSys.size = [_format.FlashWidth, _format.FlashHeight];
                        }
                        break;
                    }
                case 'extra':
                    {
                        _currSys.layer = _currSys.size = [_format.FlashWidth, _format.FlashHeight];
                        break;
                    }
            }

            var _flashvar = _flashvarParams.join('&');
            var _swfstr = '<object width="' + _currSys.size[0] + '" height="' + _currSys.size[1] + '" classid="' + _swfSettings.cid + '" codebase="' + _swfSettings.cbase + '" align="' + _swfSettings.alg + '">' +
                          '<param name="allowScriptAccess" value="' + _swfSettings.alwScript + '">' +
                          '<param name="quality" value="' + _swfSettings.qly + '">' +
                          '<param name="wmode" value="' + _swfSettings.wmode + '">' +
                          '<param name="movie" value="' + _currSys.movie + '">' +
                          '<param name="flashvars" value="' + _flashvar + '">' +
                          '<embed src="' + _currSys.movie + '" flashvars="' + _flashvar + '" width="' + _currSys.size[0] + '" height="' + _currSys.size[1] + '" pluginspage="' + _swfSettings.plg + '" type="' + _swfSettings.type + '" allowScriptAccess="' + _swfSettings.alwScript + '" align="' + _swfSettings.alg + '" wmode="' + _swfSettings.wmode + '" quality="' + _swfSettings.qly + '" />' +
                          '</object>';

            var _layerId = (Math.random() * 10000000).toString().replace('.', '');
            _flashCollection[_layerId] = _swfstr;
            var _layer = $('<span/>').attr('id', _layerId).append($('<ins/>').css({
                float: 'left',
                width: _currSys.layer[0],
                height: _currSys.layer[1],
                overflow: 'hidden'
            }));

            if ($.trim(this.text()).length > 0) {
                var _adLayerPad = $('#adLayerPad');
                _timer = null;

                if (_adLayerPad.length == 0) {
                    _adLayerPad = $('<span id="adLayerPad"/>');
                    $(document.body).append(_adLayerPad);
                }
                _adLayerPad.timer = null;

                function hideLayer() {
                    _timer = setTimeout(function() {
                        _adLayerPad.empty();
                        _adLayerPad.css('display', 'none');
                    }, 1000);
                }

                function removeTimer() {
                    if (_timer) {
                        clearTimeout(_timer);
                        _timer = null;
                    }
                }

                var _content = $('<span id="layer_"' + _layerId + ' class="DotMoreHighlight">' + this.text() + '</span>');
                _content.hover(function() {
                    removeTimer();
                    _adLayerPad.empty().css({
                        display: '',
                        position: 'absolute',
                        top: _content.offset().top + _content.height() + 10,
                        left: _content.offset().left
                    });
                    _adLayerPad.append(_layer.html(_flashCollection[_layerId]));
                }, hideLayer).click(function() {
                    window.open(_format.Hyperlink);
                });

                this.text('').append(_content);
                _adLayerPad.hover(function() {
                    removeTimer();
                }, hideLayer);

            }
            else {
                this.append((_layer.find('ins') || _layer).append(_flashCollection[_layerId]));
            }

            return this;
        }
    });

    $.fn.extend({
        lock: function(_callBack) {
            var createMask = function(_id) {
                return $('<div/>').attr('id', _id).css({ textAlign: 'center', height: '100%' }).html('<table cellpadding="0" cellspacing="0" border="0" style="height:100%;margin:0 auto"><tr><td algin="center" valign="middle"><b style="border:1px solid #8f8f8f;border-width:1px 0px;margin:0px 1px;display:block"><b style="border:1px solid #8f8f8f;border-width:0px 1px;margin:0px -1px;display:block"><b style="padding:10px;display:block;color:#666666;margin:0px;background-color:#b8b8b8;font-family:Verdana">Loading...</b></b></b></td></tr></table>');
            },
            lock = function(_target) {
                _target = convertTojQuery(_target);
                var _maskId = _target.attr('id') + '_mask';
                var _mask = _target.parent().find('#' + _maskId);
                if (_mask.length == 0) {
                    _mask = createMask(_maskId);
                    $(_target.parent()).append(_mask);
                    _mask.css('display', 'none');
                }

                var _pos = _target.position();
                var _size = {
                    width: _target.width(),
                    height: _target.height() < 100 ? 100 : _target.height()
                };
                _mask.css({ zIndex: '9999', backgroundColor: '#f0f0f0', top: _pos.top + 'px', left: _pos.left + 'px', width: _size.width, height: _size.height });
                _target.css('display', 'none');
                _mask.fadeIn('slow', _callBack);
            },
            convertTojQuery = function(_target) {
                if (typeof _target == 'string' && !/^#/.test(_target))
                    return $('#' + _target);
                else
                    return $(_target);
            };

            if (this.css('display') != 'none') {
                lock(this);
            }
            else {
                _callBack.call(this);
            }
        }
    });

    $.fn.extend({
        unlock: function(_callBack) {
            var unlock = function(_target) {
                _target = convertTojQuery(_target);
                var _maskId = _target.attr('id') + '_mask';
                var _mask = _target.parent().find('#' + _maskId);
                if (_mask.length != 0) {
                    _mask.css('display', 'none');
                    _target.fadeIn('slow', _callBack);
                }
            },
            convertTojQuery = function(_target) {
                if (typeof _target == 'string' && !/^#/.test(_target))
                    return $('#' + _target);
                else
                    return $(_target);
            };
            unlock(this);
        }
    });

    $.fn.extend({
        pageMask: function(_display, _callBack) {
            var _mask;
            if (_display) {
                if (!document.GlobalMask) {
                    var _maskId = 'mask_' + (Math.random()).toString().replace(/.[0-9]/, '');
                    _mask = $('<b/>').attr('id', _maskId).css({
                        width: $.browser.msie ? $(window).width() : '100%',
                        height: $.browser.msie ? $(window).height() : '100%',
                        position: $.browser.msie ? 'absolute' : 'fixed',
                        left: '0px',
                        top: '0px',
                        fontWeight: 'normal',
                        backgroundColor: '#DDD',
                        filter: 'alpha(opacity=80)',
                        '-moz-opacity': 0.8,
                        opacity: 0.8,
                        display: 'none',
                        textAlign: 'center',
                        verticalAlign: 'middle'
                    });

                    if ($.browser.msie) {
                        $(window).scroll(function() {
                            _mask.css({
                                top: document.documentElement.scrollTop,
                                left: document.documentElement.scrollLeft,
                                width: $(window).width(),
                                height: $(window).height()
                            });
                        });

                        $(window).resize(function() {
                            $(window).trigger('scroll');
                        });
                    }
                    $('body').append(_mask);
                    document.GlobalMask = _maskId;
                    _mask.show(1000, function() {
                    });
                }
                else {
                    _mask = $('#' + document.GlobalMask).show(1000, function() {
                    });
                }
            }
            else {
                if (document.GlobalMask) {
                    _mask = $('#' + document.GlobalMask).hide();
                }
            }

            if ($.isFunction(_callBack)) {
                callback.apply(_mask);
            }
            return _mask;
        }
    });

    $.fn.extend({
        tooltip: function(_content, _options, _callback) {
            var _default = $.extend({
                cursor: 'help',
                underline: 'none',
                link: null,
                symbol: '[?]',
                symbolStyle: {
                    textDecoration: 'none',
                    cursor: 'help',
                    fontWeight: 'bolder',
                    fontSize: '1em',
                    color: '#4E799A'
                },
                tipStyle: {
                    position: 'absolute',
                    display: 'none',
                    borderColor: '#999 #666',
                    borderWidth: '1px 2px 2px 1px',
                    borderStyle: 'solid',
                    background: '#FFFFEE',
                    color: '#333',
                    padding: '5px',
                    fontSize: '12px',
                    fontFamily: 'Arial, Helvetica, sans-serif'
                }
            }, _options);
            var _timer;
            var _close = $('<span />').css({
                float: 'right',
                backgroundColor: 'transparent'
            }).addClass('iconStyle icon888888 iconClose');
            var _showTip = $('<div/>')
                            .append(_close)
                            .append('<div style="clear:both"/>')
                            .append(_content)
                            .css(_default.tipStyle)
                            .css({
                                zIndex: '99999'
                            });
            _showTip.hover(function() {
                clearTimeout(_timer);
                _timer = null;
            }, function() {
                if (_timer == null) {
                    _timer = setTimeout(function() {
                        _showTip.hide();
                    }, 500);
                }
            });

            _close.click(function() {
                _showTip.hide();
            });

            var _tip = $('<a />')
                        .css(_default.symbolStyle)
                        .append(_default.symbol)
                        .hover(function() {
                            clearTimeout(_timer);
                            _timer = null;
                            _showTip.css({
                                left: _tip.offset().left + _tip.width() + 10,
                                top: _tip.offset().top
                            });
                            if (_showTip.width() > 400) {
                                _showTip.width(400);
                            }
                            _showTip.show();
                        }, function() {
                            if (_timer == null) {
                                _timer = setTimeout(function() {
                                    _showTip.hide();
                                }, 500);
                            }
                        });
            if (_default.link) {
                _tip.attr('href', _default.link)
            }
            $(document.body).prepend(_showTip);
            _tip.insertAfter(this);
            if (_callback && $.isFunction(_callback)) {
                _callback.call(this);
            }
        }
    });
})(jQuery);
