//collapsing left men
var sfHover = function() {
//	var sfEls = document.getElementById("submenu").getElementsByTagName("li");
//	var selected = "";
//	for (var i=0; i<sfEls.length; i++) {
//		sfEls[i].onmouseover=function() {
//			this.className = "sfhover";
//		}
//		sfEls[i].onmouseout=function() {
//			this.className = "";
//		}
//	}
}

$(function() {

        //$(".lightbox, a[title='Technische Documentatie']").colorbox({width:"80%", height:"80%", iframe:true});

	//submit form on enter
	$("form input").keypress(function (e) {
		if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
			$('button[type=submit] .default').click();
			return false;
		} else {
			return true;
		}
	});

	//prevent double submit
	$('form').submit(function(){
		$(':submit', this).click(function() {
			return false;
		});
	});

        var headmenuhover = {
             sensitivity    : 3,
             interval       : 200,
             timeout        : 500,
             over           : function()
             {
                 $(this).children("ul").show();
             },
             out            : function()
             {
                 $(this).children("ul").hide();
             }
        };

        var submenuhover = {
             sensitivity    : 3,
             interval       : 200,
             timeout        : 2000,
             over           : function()
             {
                 $(this).children("ul").show();
             },
             out            : function()
             {
                 //$(this).children("ul").hide();
             }
        };
        
        $("#headerMenu li").hoverIntent(headmenuhover);

        $("#submenu li").hoverIntent(submenuhover);


});
