$(document).ready(function () {
	//Nospam protection 
	$("input.nospam").val("n" + "e");
	$(".nospam").hide();
	
	 $("#categorymenu a.collapsable").click(function()  {
		$(this).next("ul").slideToggle(600);
		return false;
	 });
	
    // Change the image of hoverable images
    $("#top_menu_items").find("img").hover( function() {
        var hoverImg = HoverImgOf($(this).attr("src"));
        $(this).attr("src", hoverImg);
      }, function() {
        var normalImg = NormalImgOf($(this).attr("src"));
        $(this).attr("src", normalImg);
      }
    );
 });

 function HoverImgOf(filename)
 {
    var re = new RegExp("(.+)\\.(gif|png|jpg)", "g");
    return filename.replace(re, "$1_hover.$2");
 }
 function NormalImgOf(filename)
 {
    var re = new RegExp("(.+)_hover\\.(gif|png|jpg)", "g");
    return filename.replace(re, "$1.$2");
 }
