jQuery(document).ready(function($) {
	
	
	jQuery("a.avhec-widget-post-id").live('mouseover mouseout', function(event){
		if(event.type == 'mouseover'){
			var id = jQuery(this).attr("id");
			if( typeof( gmshc_map_exported_markers ) != "undefined"){
				var	current_marker = gmshc_map_exported_markers[id];
			}
			
			if( typeof( current_marker ) != "undefined" ){
				current_marker.setIcon(current_marker.alternateImage);
			}
		}else{
			var id = jQuery(this).attr("id");
			if( typeof( gmshc_map_exported_markers ) != "undefined"){
				var	current_marker = gmshc_map_exported_markers[id];
			}
			if( typeof( current_marker ) != "undefined" ){
				current_marker.setIcon(current_marker.originalImage);
			}
		}
	});
	
	jQuery("ul.avhec-widget-cat-post-list").hide();
	jQuery("ul.avhec-widget-cat-post-list").parent().siblings("ul.children").hide();
	
	jQuery("div.avhec-widget-line > a").toggle(
		function(){
			jQuery(this).
				parent().
					children("ul.avhec-widget-cat-post-list").show("slow").end().
					siblings("ul.children").show("slow");
			
			return false;
		},
		function(){
			jQuery(this).
				parent().
					children("ul.avhec-widget-cat-post-list").hide("slow").end().
					siblings("ul.children").hide("slow");

			return false;
		}
	);
	
	jQuery("#all-project-scaffolder").toggle(
		    function() {
		        jQuery("#sidebar ul.avhec-widget-cat-post-list:hidden").show('slow');
			return false;
		    },
		    function() {
		        jQuery("ul.avhec-widget-cat-post-list").hide("slow");
			return false;
		    }
	);
	
	jQuery("li.cat-item-86")
		.find('ul.avhec-widget-cat-post-list:first')
			.remove();

	jQuery("li.cat-item-147")
		.find('ul.avhec-widget-cat-post-list:first')
			.remove();

	jQuery("li.cat-item-148")
		.find('ul.avhec-widget-cat-post-list:first')
			.remove();
});
