function countChecked() {
  var n = $("input:checked" , $("#featuresA")).length;
  if (n > 0) {
     $("#AnalogsButton").show();
  }
  else {
  	 $("#AnalogsButton").hide();
  }
}

$(document).ready(function(){



   $("span.analogs").show();
   $("#AnalogsContainAll").show();
   countChecked();
   $("input:checkbox", $("#featuresA")).click(countChecked);
   $("#AnalogsButton").children("input").click(function(){
      var blk = $("input:checked", $("#featuresA")).serialize();
      var catID = $(this).attr('name');
   	  zWOpen = window.open('/lib/analogs.php?name='+catID + '&' + blk, 'comparetools', 'width=780, height=600, toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=1, resizable=1');
   	  zWOpen.focus();
   });
});