     (function () {
    if (window.chi) window.V = window.chi;
	window.ntptAddPair=function(){}; 
	window.ntptEventTag=function(){}; 

    if (!window.console) window.console = {
        N6: $('<ul></ul>').attr('id', 'console.log').css({
            'zIndex': '10000',
            'height': '200px',
            'width': '980px',
            'margin': 'auto',
            'overflow': 'auto',
            'padding': '5px',
            'border': '1px solid #999',
            'backgroundColor': '#eee',
            'font': '12px normal \"Courier New\"'
        }),
        show: function () {
            $('body').append(this.N6);
            this.N6.show()
        },
        hide: function () {
            this.N6.hide()
        },
        log: function (oz) {
            this.N6.append('<li><pre>' + oz + '</pre></li>')
        }
    };
    window.chi = {
        m9: 'Choice Hotels International Base Javascript',
        gbl: {},
        scriptsLoc: '../Library',
        mod: {
            'search': {}
        
        },
        eV: [],
        init: function () {
            $.each(chi.mod, function (Gq, jq) {
                $.extend(chi.mod[Gq], {
                    className: '.mod-' + Gq,
                    load: function (jd) {
                        if ($.inArray(Gq, chi.eV) < 0) {
                            $.ajaxSetup({
                                cache: true
                            });
                            $.getScript(chi.scriptsLoc + '/chi/chi.mod.' + Gq + '.js', function () {
                                try {
                                    chi.mod[Gq].init(jd)
                                } catch (jY) {}
                            });
                            chi.eV.push(Gq)
                        }
                    }
                })
            });
            $("button").live('mouseover', function () {
                if (!$(this).hasClass('btn-disabled')) {
                    $(this).addClass('btn-hover')
                }
            });
            $("a.button").live('mouseover', function () {
                if (!$(this).hasClass('btn-disabled')) {
                    $(this).addClass('btn-hover')
                }
            });
            $("button, a.button").live('mouseout', function () {
                $(this).removeClass('btn-hover')
            });
            $(document).ready(function () {
                chi.FW($('body'))
            })
        },
        Jw: function (nz) {
            if (jQuery.browser.msie) {
                $('button', nz ? nz : document).each(function () {
                    var kq = $('.btn-wrp-1', this);
                    if (kq.length > 0 && kq.outerWidth() > 0) {
                        $(this).css('width', (kq.outerWidth(true) + 6) + 'px')
                    }
                })
            }
        },
        map: {},
        time: {
            log: [],
            split: function () {
                this.log.push((new Date()).getTime())
            },
            output: function (dz, Hz) {
                var Jz = "Timing Log [" + dz + "]\n";
                var ez = 0;
                for (var bz = 1; bz < this.log.length; bz++) {
                    var sz = this.log[bz] - this.log[bz - 1];
                    Jz += ' - Split [' + bz + ']: ' + sz + "\n";
                    ez += sz
                }
                Jz += ' - Total Time: ' + ez;
                if (Hz) alert(Jz);
                else console.log(Jz);
                this.log = []
            }
        },
        dialog: {
            kw: function (Zz) {
                $('<div class=\"mod-dialog mod-dialog-ok\"></div>').html(Zz).dialog({
                    bgiframe: true,
                    modal: true,
                    buttons: {
                        'Ok': function () {
                            $(this).dialog('close')
                        }
                    }
                })
            },
            confirm: function (fz) {},
            error: function (Vz) {}
        },
        FW: function (Wz) {
            $('.has-dfn', Wz).each(function () {
                if ($(this).data('hasQtip')) return;
                var Tq = $(this).next('.dfn');
                if ($(this).attr('rel') || (Tq.size() > 0)) {
                    var pq = $(this).attr('rel') ? {
                        'url': $(this).attr('rel')
                    } : Tq.html();
                    if ($(this).is('a')) $(this).bind('click', function () {
                        return false
                    });
                    $(this).find('span').css({
                        'cursor': 'help',
                        'text-decoration': 'underline'
                    });
                    $(this).qtip({
                        content: pq,
                        position: {
                            corner: {
                                target: 'bottomMiddle',
                                tooltip: 'topMiddle'
                            }
                        },
                        style: {
                            width: $(this).attr('rev') ? parseInt($(this).attr('rev'), 10) + 20 : 200,
                            tip: {
                                corner: 'topMiddle',
                                color: false,
                                size: {
                                    x: 30,
                                    y: 10
                                }
                            },
                            border: {
                                width: 2,
                                radius: 5,
                                color: '#eee'
                            }
                        },
                        show: {
                            delay: 1000
                        },
                        hide: {
                            fixed: true,
                            delay: 1000
                        }
                    })
                }
                $(this).data('hasQtip', true)
            })
        },
        popWindow: function (Lz, Uz, Xz, Pz) {
            var az;
            var rz;
            var Oz;
            var Yz;
            if (document.all) {
                if (document.body) {
                    az = screenLeft;
                    rz = screenTop;
                    Oz = document.body.clientWidth;
                    Yz = document.body.clientHeight
                } else {
                    az = 0;
                    rz = 0;
                    Oz = screen.width;
                    Yz = screen.height
                }
            } else {
                az = screenX;
                rz = screenY;
                Oz = outerWidth;
                Yz = outerHeight
            }
            var Kz = parseInt(Xz);
            var xz = parseInt(Pz);
            az = az + ((Oz - Kz) / 2);
            rz = rz + ((Yz - xz) / 2);
            if ((az + Kz) > screen.width) az = screen.width - Xz - 10;
            if ((rz + xz) > screen.height) rz = screen.height - Pz - 10;
            PSU = window.open(Lz, Uz, "toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + Xz + ",height=" + Pz + ",top=" + rz + ",left=" + az);
            try {
                PSU.moveTo(az, rz)
            } catch (_z) {}
            try {
                PSU.resizeTo(Xz, Pz)
            } catch (_z) {}
            PSU.focus();
            return PSU
        },
        printPage: function (Dz) {
            $(Dz.document).find('.print-body').html($('.printme:first').html());
            Dz.document.title = window.document.title;
            $(Dz.document).find('.print-body').bind('click', function () {
                return (false)
            });
            $(Dz.document).find('.print-page-link').bind('click', function () {
                Dz.print();
                return (false)
            });
            $(Dz.document).find('.close-page-link').bind('click', function () {
                Dz.close();
                return (false)
            });
            $(Dz.document).find('.print-orig-url').text(window.location.href)
        },
        As: function (vz) {
            var uz = new VEMap(vz);
            var Fz = $('#' + vz).parent().attr('rev');
            if (Fz && ((Fz = $.trim(Fz)) != '')) uz.SetClientToken(Fz);
            return uz
        }
    };
    chi.init()
})();
$(document).ready(function () {});
jQuery.cookie = function (dx, bx, Ox) {
    if (typeof bx != 'undefined') {
        Ox = Ox || {};
        if (bx === null) {
            bx = '';
            Ox.Q9 = -1
        }
        var ex = '';
        if (Ox.Q9 && (typeof Ox.Q9 == 'number' || Ox.Q9.toUTCString)) {
            var Vx;
            if (typeof Ox.Q9 == 'number') {
                Vx = new Date();
                Vx.setTime(Vx.getTime() + (Ox.Q9 * 24 * 60 * 60 * 1000))
            } else {
                Vx = Ox.Q9
            }
            ex = '; expires=' + Vx.toUTCString()
        }
        var Jx = Ox.path ? '; path=' + (Ox.path) : '';
        var Hx = Ox.domain ? '; domain=' + (Ox.domain) : '';
        var sx = Ox.s9 ? '; secure' : '';
        document.cookie = [dx, '=', encodeURIComponent(bx), ex, Jx, Hx, sx].join('')
    } else {
        var Wx = null;
        if (document.cookie && document.cookie != '') {
            var Zx = document.cookie.split(';');
            for (var xx = 0; xx < Zx.length; xx++) {
                var nx = jQuery.trim(Zx[xx]);
                if (nx.substring(0, dx.length + 1) == (dx + '=')) {
                    Wx = decodeURIComponent(nx.substring(dx.length + 1));
                    break
                }
            }
        }
        return Wx
    }
};
