sws.app.filter = function(header, list, element,search){
    
    /* ---[ CONSTRUCTOR ]--- */
    function init(){

    	// create and add the filter form to the header
	    var form = $("<div>").attr({"class":"filterform","action":"#"}),
	        input = $("<input>").attr({"class":"filterinput","type":"text"});
	    $(form).append(input).appendTo(header);
	
	    $(input)
	      .change( function () {
	        var filter = $(this).val();
	        if(filter) {
	          // this finds all links in a list that contain the input,
	          // and hide the ones not containing the input while showing the ones that do
	          $(list).find(search + ":not(:Contains(" + filter + "))").parent().slideUp();
	          $(list).find(search + ":Contains(" + filter + ")").parent().slideDown();
	        } else {
	          $(list).find(element).slideDown();
	        }
	        return false;
	      })
	    .keyup( function () {
	        // fire the above change event after every letter
	        $(this).change();
	    });
	    
		/* initialization code */
		setupEventListeners();

    }
    
    /* ---[ PRIVATE METHODS ]--- */

    /* ---[ EVENT LISTENERS ]--- */
    function setupEventListeners(){  
    	
    }

    /* ---[ RUN ]--- */
    init();
};

$(document).ready(function(){
   // sws.filter = new sws.app.filter();
});

