$(document).ready(function() {

	// dropdown nav
	dropdownNav();

	// form submit
	formSubmit();

});

function dropdownNav() {
    $('.nav li').hover(
        function(){ $('ul', this).slideDown(100); },
        function() { $('ul', this).slideUp(100); }
    );

    if (document.all) {
        $('.nav li').hoverClass('hover');
    }
}

/**
 * IE compliant navigation hovering.
 */
$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover(
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};

function formSubmit() {
	$('form').submit(function() {
		var formid = $(this).attr('id');
		if (typeof formid != 'string') {
			alert("The submitted form needs an id!");
			return false;
		}
		$(this).append('<input type="hidden" name="htmlformid" value="' + formid + '"/>');
		return true;
	});
}