//jQuery.fn.exists = function(){return jQuery(this).length>0;}

$(function() {  
 	$("ul.submenu").each(function() {//disable click when submenu exists
		$(this).parent().children("a").click(function(){
			return false;
		});
	});
	
	$("ul#topmenu li").bind('mouseenter',function(e) {
		$(this).children(".submenu").fadeIn(300);
	});
	$("ul#topmenu li").bind('mouseleave',function(e) {
		$(this).children(".submenu").fadeOut(300);
	});
/* 	$("a.topmenulink,.submenu").bind('mouseenter',function(e) {
		$(this).parent().children(".submenu").fadeIn(300);
	});
	$("a.topmenulink,.submenu").bind('mouseleave',function(e) {
		$(this).parent().children(".submenu").fadeOut(300);
	});
 */
});
