$(window).load(function()
{
	$("#menu a").mouseenter(function () {
		if (!$(this).parent().find("span").hasClass("active"))
		{
			$(this).parent().find("span").addClass("hover");
			if (!$.browser.msie || !($.browser.version*1<9))
			{
				$(this).parent().find("span").css({"visibility" : "visible", "opacity" : 0}).stop().animate({"opacity" : 1}, 300);
			}
		}
	});
	$("#menu a").mouseleave(function () {
		if (!$(this).parent().find("span").hasClass("active"))
		{
			$(this).parent().find("span").removeClass("hover");
			if (!$.browser.msie || !($.browser.version*1<9))
			{
				$(this).parent().find("span").css({"visibility" : "visible", "opacity" : 1}).stop().animate({"opacity" : 0}, 300, function () { $(this).css({"visibility" : "hidden"}); });
			}
		}
	});
});


function addInputSubmitEvent(form, input) {
    input.onkeydown = function(e) {
        e = e || window.event;
        if (e.keyCode == 13) {
            form.submit();
            return false;
        }
    };
}

window.onload = function() {
    var forms = document.getElementsByTagName('form');

    for (var i=0;i < forms.length;i++) {
        var inputs = forms[i].getElementsByTagName('input');

        for (var j=0;j < inputs.length;j++)
            addInputSubmitEvent(forms[i], inputs[j]);
    }
};

