$(document).ready(function () {
    $("#container").supersleight();
    m.i();


    $("#nav li").hover(
		function () {
		    //		    $("ul", this).fadeIn("slow");
		    $("ul", this).show();
		},
		function () {
		    //		    $("ul", this).fadeOut("fast");
		    $("ul", this).hide();
		}
	);
    $(".subnav li").hover(
		function () {
		    var img$ = $(this).parent().parent().find(".tn");
		    m.si(img$, img$.attr('src').replace('_s1.png', '_s2.png'));
		},
		function () {
		    var img$ = $(this).parent().parent().find(".tn");
		    m.si(img$, img$.attr('src').replace('_s2.png', '_s1.png'));
		}
	);
});
$.fn.hoverClass = function (c) {
    return this.each(function () {
        $(this).hover(
			function () { $(this).addClass(c); },
			function () { $(this).removeClass(c); }
		);
    });
};

m = {
    i: function () {
        $(".nav img:not(.exclude)").hover(function () {
            m.o(this);
        }, function () {
            m.ou(this);
        });
    },
    o: function (e) {
        if (!$(e).hasClass('on')) {

            m.si(e, $(e).attr('src').replace('_s1.png', '_s2.png'));
        }
    },
    ou: function (e) {
        if (!$(e).hasClass('on')) {
            m.si(e, $(e).attr('src').replace('_s2.png', '_s1.png'));
        }
    },
    si: function (e, s) {
        if ($.browser.msie && $.browser.version < 7 && $(e).hasClass("png")) {
        } else {
            $(e).attr('src', s);
        }
    }
}
function GotoValidationSummary() {
    if (typeof (ValidatorOnSubmit) == "function") {
        var isValidated = ValidatorOnSubmit();
        if (!isValidated) {
            var pos = $(".validationsummary").show().position();
            window.scrollTo(pos.left, pos.top);
            return false;
        }
        return true;
    }
}
