jQuery(function( $ ){
	$(".sublisting").hide();
	$(".clhead").click(function(){
		var rel = $(this).attr("rel");
		var links = $( "#"+$(this).attr("rel") );
		if(links.css("display")=="none"){
			$(".sublisting").hide();
			links.show();
		} else {
			$(".sublisting").hide();
		}
		return false;
	});
	
	$(".companycount").each(function(){
		var val = $(this).html();
		if(val==1) $(this).remove();
	});
	
	$("#clzipcode, #clcountry, #clcompany").change(function(){
		$("#clsubmit").click();
	});
	
	$(".sublisting").each(function(){
		$(this).find("span.cpsubline:last").css({"border-bottom":"0px"});
	});
	
	$(".resetbutton input").click(function(){
		$("#clzipcode, #clcountry, #clcompany").find("option:selected").removeAttr("selected");
		$("#clsubmit").click();
		return false;
	});
	
	$(".main-header p.bodytext").remove();
});
