var show = ['price', 'name', 'material', 'color'];

$(document).ready(function() {
	$('div.searchCathegory > div.searchCathegoryResults').css('display', 'none');	
	$('div.searchCathegoryExpand').html('(+)');
	
	jQuery.each(show, function(){
	   	$('div#' + this + ' > div.searchCathegoryResults').css('display', 'block');
		$('div#' + this + ' > div.searchCathegoryName > div.searchCathegoryExpand').html('(-)');
	});
	
	$('a.delete').each(function(){
		$('div#' + this.parentNode.parentNode.parentNode.id + ' > div.searchCathegoryResults').css('display', 'block');
		$('div#' + this.parentNode.parentNode.parentNode.id + ' > div.searchCathegoryName > div.searchCathegoryExpand').html('(-)');
	});
	
	$('div.searchCathegoryName').click(function(){
		if( $('div#' + this.parentNode.id + ' > div.searchCathegoryName > div.searchCathegoryExpand').html() == '(+)' ){
			$('div#' + this.parentNode.id + ' >  div.searchCathegoryResults').slideDown('normal');
			$('div#' + this.parentNode.id + ' > div.searchCathegoryName > div.searchCathegoryExpand').html('(-)');
		}
		else{
			$('div#' + this.parentNode.id + ' >  div.searchCathegoryResults').slideUp('normal');
			$('div#' + this.parentNode.id + ' > div.searchCathegoryName > div.searchCathegoryExpand').html('(+)');
		}
		return false;
	});
});