jQuery.fn.simpleContentSorting=function(a){var b={sortingList:".sortingList",effect:"show",type:"sort"};var c=this;return this.each(function(){if(a){$.extend(b,a)}if(b.type=="sort"){if($.fn.selectBox){c.selectBox({autoWidth:false}).focus(function(a){}).blur(function(a){}).change(function f(a){$(b.sortingList+" li").hide();var c=$(this).val();$(b.sortingList+" li").each(function(a){curListItem=$(this);temp=$(this).attr("filterA");temp=temp.split(",");for(var d=0,e=temp.length;d<e;++d){if(temp[d]==c){if(b.effect=="show"){curListItem.show()}else if(b.effect=="fadeIn"){curListItem.fadeIn(500)}else{curListItem.show()}}}});if(c=="all"){if(b.effect=="show"){$(b.sortingList+" li").show()}else if(b.effect=="fadeIn"){$(b.sortingList+" li").fadeIn()}else{$(b.sortingList+" li").show()}}})}else{c.change(function(){$(b.sortingList+" li").hide();var a=$(this).val();$(b.sortingList+" li").each(function(c){curListItem=$(this);temp=$(this).attr("filterA");temp=temp.split(",");for(var d=0,e=temp.length;d<e;++d){if(temp[d]==a){if(b.effect=="show"){curListItem.show()}else if(b.effect=="fadeIn"){curListItem.fadeIn(500)}else{curListItem.show()}}}});if(a=="all"){if(b.effect=="show"){$(b.sortingList+" li").show()}else if(b.effect=="fadeIn"){$(b.sortingList+" li").fadeIn()}else{$(b.sortingList+" li").show()}}})}}else{$("body").append("<div class='hiddenresult' style='display:none;'></div>");$(".hiddenresult").append($(b.sortingList).html());function d(a,c){var d=jQuery(".hiddenresult li:eq("+a+")").clone();var e=jQuery(".hiddenresult li").length;var f=5;var g=Math.min((a+1)*f,e);var h="";$(b.sortingList).prepend("<div class='pagerContent'></div>").append("<div class='clear'></div>");for(var i=a*f;i<g;i++){h+="<li>"+$(".hiddenresult li:eq("+i+")").html()+"</li>";$(b.sortingList+" .pagerContent").empty().append(h)}$(b.sortingList+" .pagerContent li:odd").addClass("odd");$(b.sortingList).prepend($(".resultHeader").html());return false}function e(){var a=jQuery(b.sortingList+" li").length;$(b.sortingList).pagination(a,{items_per_page:5,prev_text:"",next_text:"",callback:d})}e()}return this})}
