﻿


//$(document).ready(function () {

//    var isIE6 = ($.browser.msie && $.browser.version.substr(0, 1) < 7);

//    // Adds the scroll down animation to the dropdowns and adds the over class
//    // The commented out parts is the fade effect which is not supported in IE
//    $("#mainnav dd").hover(function () {
//        $(this).children('.ddWrap').stop(true, true);
//        $(this).children('.ddWrap').pause(0).animate({
//            "height": "show"
//            //"opacity": "show"
//        }, "fast", "swing", function () {
//            $(this).parent().addClass('over');
//            //$(this).css({ "height": "", "opacity": "" });
//            $(this).css({ "height": "" });
//        });
//    },
//    function () {
//        $(this).children('.ddWrap').stop(true, true);
//        $(this).children('.ddWrap').animate({
//            "height": "hide"
//            //"opacity": "hide"
//        }, "fast", "swing", function () {
//            $(this).parent().removeClass('over');
//            //$(this).css({ "height": "", "opacity": "" });
//            $(this).css({ "height": "" });
//        });
//    });

//    // This adds the over class to the dropdown LIs so that we can get an over effect in IE6
//    $(".dropdown ul li").hover(function () {
//        $(this).addClass('over');
//    },
//    function () {
//        $(this).removeClass('over');
//    });

//    // This adds the little shift in the dropdown menu
//    if (!isIE6) {
//        $('.dropdown ul li a').hover(function () {
//            $(this).stop(true, true);
//            $(this).animate({ marginLeft: "4" }, { duration: 200 });
//        }, function () {
//            $(this).stop(true, true);
//            $(this).animate({ marginLeft: "0" }, { duration: 200 });
//        });
//    }
//    // This is the simplified img hover 
//    $('img[hvr]').hover(function () {
//        var currentImg = $(this).attr('src');
//        $(this).attr('src', $(this).attr('hvr'));
//        $(this).attr('hvr', currentImg);
//    }, function () {
//        var currentImg = $(this).attr('src');
//        $(this).attr('src', $(this).attr('hvr'));
//        $(this).attr('hvr', currentImg);
//    });

//    // This adds a watermark to the textbox using the ToolTip attribute for <asp:TextBox or the Title attribute on input.
//    $("input[title]").each(function () {
//        if ($(this).attr('title') != '') {
//            $(this).val($(this).attr('title'));
//            $(this).addClass("water");
//        }
//    }).focus(function () {
//        if ($(this).val() == $(this).attr('title')) {
//            $(this).val("");
//            $(this).removeClass("water");
//        }
//    }).blur(function () {
//        if ($.trim($(this).val()) == "") {
//            $(this).val($(this).attr('title'));
//            $(this).addClass("water");
//        }
//    });
//});

//var Cookies = {
//    add: function (name, value, days) {
//        var expires = '';
//        if (days) {
//            var date = new Date();
//            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
//            expires = '; expires=' + date.toGMTString(); ;
//        }
//        document.cookie = name + "=" + escape(value) + expires + "; path=/";
//    },
//    remove: function (name) {
//        this.add(name, '', -1);
//    },
//    get: function (name) {
//        var results = document.cookie.match(name + '=([^;]*?)(;|$)');
//        if (results)
//            return (unescape(results[1]));
//        else
//            return null;
//    }
//};

(function ($) {
    jQuery.fn.FontSizer = function (type, upid, downid, resetid) {
        $.extend(this, {
            theconstructor: function (type, upid, downid, resetid) {
                this.type = type;
                this.baseSize = 14;
                this.minSize = 9;
                this.maxSize = 20;
                this.stepSize = 2;
                this.cookieName = type + 'FontSize';
                var x = Cookies.get(this.cookieName);
                this.currentSize = x ? parseInt(x) : this.baseSize;
                if (this.currentSize != this.baseSize) {
                    this.update();
                }
                var sizer = this;
                $('#' + upid).click(function (e) {
                    sizer.increase(e, this);
                });
                $('#' + downid).click(function (e) {
                    sizer.decrease(e, this);
                });
                $('#' + resetid).click(function (e) {
                    sizer.reset(e, this);
                });
                return this;
            },
            reset: function (e) {
                e.preventDefault();
                Cookies.remove(this.cookieName);
                this.currentSize = this.baseSize;
                this.update();
            },
            update: function () {
                Cookies.add(this.cookieName, this.currentSize, 7);
                cont = this.type;
                $('#' + cont).css('font-size', (this.currentSize / this.baseSize) + 'em');
            },
            increase: function (e) {
                e.preventDefault();
                this.currentSize = Math.min(this.currentSize + this.stepSize, this.maxSize);
                this.update();
            },
            decrease: function (e) {
                e.preventDefault();
                this.currentSize = Math.max(this.currentSize - this.stepSize, this.minSize);
                this.update();
            }
        });
        this.theconstructor(type, upid, downid, resetid);
        return this;
    };
})(jQuery);

function printWin(url) {
    popWin(url, "printWin", 700, 500, true);
}

var popWin = function (url, name, width, height, center) {
    var win,
    opt = [];
    if (width || height) {
        height = height || 570;
        width = width || 770;
        opt.push('height=' + height, 'width=' + width);
        if (center === false) {
            opt.push('top=' + ((screen.width) ? (screen.width - width) / 2 : 0));
            opt.push('left=' + ((screen.height) ? (screen.height - height) / 2 : 0));
        }
        opt.push('scrollbars=yes', 'resizable', 'menubar=1');
    }
    win = window.open(url, name, opt.join(','));
    if (win) win.focus();
    return win;
}


$.fn.pause = function (duration) {
    $(this).animate({ dummy: 1 }, duration);
    return this;
};

var bn = navigator.appName;
var vn = navigator.appVersion;

if ((bn!="Microsoft Internet Explorer") || (vn.substring(0,3)!="2.0")) {
    
    things1 = new Image();
    things1.src = "/images/interior/tupelo_int_nav_top_01a.gif"
    things2 = new Image();
    things2.src = "/images/interior/tupelo_int_nav_top_01b.gif"
    
    places1 = new Image();
    places1.src = "/images/interior/tupelo_int_nav_top_02a.gif"
    places2 = new Image();
    places2.src = "/images/interior/tupelo_int_nav_top_02b.gif"
    
    restaurants1 = new Image();
    restaurants1.src = "/images/interior/tupelo_int_nav_top_03a.gif"
    restaurants2 = new Image();
    restaurants2.src = "/images/interior/tupelo_int_nav_top_03b.gif"
    
    events1 = new Image();
    events1.src = "/images/interior/tupelo_int_nav_top_04a.gif"
    events2 = new Image();
    events2.src = "/images/interior/tupelo_int_nav_top_04b.gif"
    
    maps1 = new Image();
    maps1.src = "/images/interior/tupelo_int_nav_top_05a.gif"
    maps2 = new Image();
    maps2.src = "/images/interior/tupelo_int_nav_top_05b.gif"

    about1 = new Image();
    about1.src = "/images/nav/tupelo_int_nav_side_01a.gif"
    about2 = new Image();
    about2.src = "/images/nav/tupelo_int_nav_side_01b.gif"

    convention1 = new Image();
    convention1.src = "/images/nav/tupelo_int_nav_side_02a.gif"
    convention2 = new Image();
    convention2.src = "/images/nav/tupelo_int_nav_side_02b.gif"
    
    sports1 = new Image();
    sports1.src = "/images/nav/tupelo_int_nav_side_03a.gif"
    sports2 = new Image();
    sports2.src = "/images/nav/tupelo_int_nav_side_03b.gif"
    
    motorcoach1 = new Image();
    motorcoach1.src = "/images/nav/tupelo_int_nav_side_04a.gif"
    motorcoach2 = new Image();
    motorcoach2.src = "/images/nav/tupelo_int_nav_side_04b.gif"
    
    film1 = new Image();
    film1.src = "/images/nav/tupelo_int_nav_side_05a.gif"
    film2 = new Image();
    film2.src = "/images/nav/tupelo_int_nav_side_05b.gif"
    
    school1 = new Image();
    school1.src = "/images/nav/tupelo_int_nav_side_06a.gif"
    school2 = new Image();
    school2.src = "/images/nav/tupelo_int_nav_side_06b.gif"
    
    vacation1 = new Image();
    vacation1.src = "/images/nav/tupelo_int_nav_side_07a.gif"
    vacation2 = new Image();
    vacation2.src = "/images/nav/tupelo_int_nav_side_07b.gif"
    
    media1 = new Image();
    media1.src = "/images/nav/tupelo_int_nav_side_08a.gif"
    media2 = new Image();
    media2.src = "/images/nav/tupelo_int_nav_side_08b.gif"
    
    contact1 = new Image();
    contact1.src = "/images/nav/tupelo_int_nav_side_09a.gif"
    contact2 = new Image();
    contact2.src = "/images/nav/tupelo_int_nav_side_09b.gif"
    
    home1 = new Image();
    home1.src = "/images/nav/tupelo_int_nav_side_10a.gif"
    home2 = new Image();
    home2.src = "/images/nav/tupelo_int_nav_side_10b.gif"
    
    //Calendar images
    january1 = new Image();
    january1.src = "/!img/events/tupelo_int_calendar_january_a.gif"
    january2 = new Image();
    january2.src = "/!img/events/tupelo_int_calendar_january_b.gif"
    
    february1 = new Image();
    february1.src = "/!img/events/tupelo_int_calendar_february_a.gif"
    february2 = new Image();
    february2.src = "/!img/events/tupelo_int_calendar_february_b.gif"
    
    march1 = new Image();
    march1.src = "/!img/events/tupelo_int_calendar_march_a.gif"
    march2 = new Image();
    march2.src = "/!img/events/tupelo_int_calendar_march_b.gif"
    
    april1 = new Image();
    april1.src = "/!img/events/tupelo_int_calendar_april_a.gif"
    april2 = new Image();
    april2.src = "/!img/events/tupelo_int_calendar_april_b.gif"
    
    may1 = new Image();
    may1.src = "/!img/events/tupelo_int_calendar_may_a.gif"
    may2 = new Image();
    may2.src = "/!img/events/tupelo_int_calendar_may_b.gif"
    
    june1 = new Image();
    june1.src = "/!img/events/tupelo_int_calendar_june_a.gif"
    june2 = new Image();
    june2.src = "/!img/events/tupelo_int_calendar_june_b.gif"
    
    july1 = new Image();
    july1.src = "/!img/events/tupelo_int_calendar_july_a.gif"
    july2 = new Image();
    july2.src = "/!img/events/tupelo_int_calendar_july_b.gif"
    
    august1 = new Image();
    august1.src = "/!img/events/tupelo_int_calendar_august_a.gif"
    august2 = new Image();
    august2.src = "/!img/events/tupelo_int_calendar_august_b.gif"
    
    september1 = new Image();
    september1.src = "/!img/events/tupelo_int_calendar_september_a.gif"
    september2 = new Image();
    september2.src = "/!img/events/tupelo_int_calendar_september_b.gif"
    
    october1 = new Image();
    october1.src = "/!img/events/tupelo_int_calendar_october_a.gif"
    october2 = new Image();
    october2.src = "/!img/events/tupelo_int_calendar_october_b.gif"
    
    november1 = new Image();
    november1.src = "/!img/events/tupelo_int_calendar_november_a.gif"
    november2 = new Image();
    november2.src = "/!img/events/tupelo_int_calendar_november_b.gif"
    
    december1 = new Image();
    december1.src = "/!img/events/tupelo_int_calendar_december_a.gif"
    december2 = new Image();
    december2.src = "/!img/events/tupelo_int_calendar_december_b.gif"
    
}

function hiLite(name, source) {
    var bn = navigator.appName;
    var vn = navigator.appVersion;
    
    if ((bn!="Microsoft Internet Explorer") || (vn.substring(0,3)!="2.0")) {
    document.images[name].src = eval(source + ".src");
    }
}
