$(function () {
    $("li[class*=producttype]").click(function () {
        for (i = 1; i < 10; i++) {
            var obj = $("#producttype0").find("li[class=producttype" + i + "]");
            if (obj) {
                $(obj).hide();
            }
        }
        var i = parseInt($(this).attr("class").replace("producttype", "")) + 1;
        var obj = $(this).next().find("ul");
				var objItem = obj.find(".producttype" + i);
        if (obj.html()!=null) {
           if (objItem.hasClass("none")||objItem.is(":visible")) {
						   objItem.removeClass("none");
               obj.find(".producttype" + i).show(); 						  
               }
               else {
							   objItem.addClass("none");
                 obj.find(".producttype" + i).hide();
               }
        }
        else {
            window.location.href = $(this).find("a").attr("href");
        }

        return false;
    });
})
