jQuery(document).ready(function($) {
	
	$('#locator li').not(".location").each(function(index){
	quant = $(this).find('.location').size()
		if (quant == 0) {
			$(this).remove()
		} else {
			$(this).children(":header").append("<span> ("+quant+")</span>")			
		}
	
	});
	
	$('#locator li :header').click(function() {
		areaSet($(this).parent("li"))
	});
	
	$('.pseudo').click(function() {
		$(this).children("ul").children("li").clone(true).appendTo($(this).parent()).slideDown("fast");
		$(this).remove()
	});
	
	$('#locator li').children("ul").hide()
	
	// $('.area .location:nth-child(5n+5)').css('paddingRight', '10px')
	
});
	


function areaSet(li) {
	if (jQuery(li).children("ul").is(":visible")) {
		jQuery(li).removeClass("open").children("ul").slideUp("fast")
	} else {
		jQuery(li).siblings().children("ul").slideUp("fast").end().removeClass("open")
		jQuery(li).addClass("open").children("ul").slideDown("fast");
	}
}
