var o = jQuery.fn.search = function(settings) 
{
  /*
    Search functionlaity for archive page
  */
  settings = jQuery.extend(
  {
    
  }
  , settings);
  return this.each(
    function()
    {
      var el = this;
      /*
        1. Make all <li>'s into cusotm checkboxes (see jquery.castcheckbox)
        2. Add functionlity to the reset button so we reset the checkboxes
        3. Hide the radio buttons
        4. Recreate the radio button functionlity using labels
      */
      this.checkboxes = jQuery(".mugshots li", this).castcheckbox();
      jQuery("#search-control li.last").bind(
        'click',
        function(event)
        {
          event.preventDefault();
          el.checkboxes.each(
            function()
            {
              this.reset(true);
            }
          )
        }
      );
      var radios = jQuery("input[type=radio]", this);
      // radio hiding
      //radios.css("display", "none");
      radios.css(
        {
          position: "absolute",
          top: "-1000px"
        }
      );
      // css additions so we can see whats clicked and wat isn't
      radios.each(
        function()
        {
          var j = jQuery(this);
          var parent = j.parent();
          parent.css("cursor", "pointer");
          if(j.attr("checked")) {
            parent.addClass("light-blue");
          }
        }
      );
      // functionality for to change the label state, this will be triggered by the label
      /*radios.bind(
        'change',
        function()
        {
          var j = jQuery(this);
          radios.each(
            function()
            {
              jQuery(this).parent().removeClass("light-blue");
            }
          );
          if(j.attr("checked")) {
            j.parent().addClass("light-blue");
          }
        }
      );*/
      var labels = jQuery("#videotype label", this);
      labels.bind(
        'click',
        function()
        {
          radios.each(
            function()
            {
              jQuery(this).parent().removeClass("light-blue");
            }
          );
          var j = jQuery("input", this);
          if(j.attr("checked")) {
            j.parent().addClass("light-blue");
          }
        }
      );
    }
  );
};