$(document).ready(function() {
var selected = $('#searchCat option:selected');
var sel = $('#searchCat');
if(selected.val() =="all") {$('#fs #fsCat').hide();}
 if(selected.val() !=0 ){
$('#fsCat').show().load('selectSubcat.php?sf=y&subcatid='+selected.val());
}
	  $('#searchCat').change( function(){
	     var catId=$(this).val();
//	    alert('category chosen='+catId);
	     if (catId=="all"){$('#fs #fsCat').hide();} 
		else {
		var exp=catId.split("-");
		//alert(exp[0]);
		if(exp[0]=="sub"){
	     $('#fsCat').show().addClass('s').load('selectSubcat.php?sf=y&subcatid='+catId);
		} else {
	     $('#fsCat').show().removeClass('s').load('selectSubcat.php?sf=y&subcatid='+catId);		
		}
	     }
	  });
	  });

