$(document).ready(function () {
    m.i();
    $("#mainnavigation > li").each(function (index) {
        var id = "s" + eval(index + 2);
        if (!$(this).hasClass(id)) {
            $(this).hover(
		    function () {
		        $(this).parent().addClass(id);
		        //		    var img$ = $(this).parent().parent().find(".tn");
		        //		    m.si(img$, img$.attr('src').replace('_s1.png', '_s2.png'));
		    },
		    function () {
		        $(this).parent().removeClass(id);
		        //		    var img$ = $(this).parent().parent().find(".tn");
		        //		    m.si(img$, img$.attr('src').replace('_s2.png', '_s1.png'));
		    }
	    );
        }
    });
    $("#aboutus,#capabilities").hover(
		function () {
		    $("ul", this).show();
		},
		function () {
		    $("ul", this).hide();
		}
	);
});
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;
    }
}
