(function(A){A.extend({populateDropDown:function(F,D,B,C){F=A(F);D=A(D).map(function(){return A("<option value='"+A.trim(this.value)+"'>"+A.trim(this.name)+"</option>")[0]});F.html("<option value=''>"+B+"</option>");if(D.length){F.append(D)}F.removeAttr("disabled");if(C){try{F.val(C)}catch(E){}}F.change()},updateSteps:function(D){D=D||false;A("#steps > li:eq(1)").removeClass("on").next().removeClass("next on");A("#step2").unblock({fadeOut:0});if(A(".searchList :checkbox:checked").length>0){A("#steps > li:eq(1)").addClass("on").next().addClass("next");A("#step3").unblock({fadeOut:0});A("#step2 :text").removeAttr("disabled");A("#step2 select").removeAttr("disabled");if(A("#step2 :input[value!='']").length>0){A("#steps > li:eq(2)").addClass("on");if(!D){var C=A("#step2 :text[value!='']");var B=A("#step2 select[value!='']");if(C.length>0){A("#step2 :text").removeAttr("disabled");A("#step2 select").attr("disabled","disabled")}else{if(B.length>0){A("#step2 select").removeAttr("disabled");A("#step2 :text").attr("disabled","disabled")}}}}else{A("#step3").block({message:null,overlayCSS:{cursor:"default"}})}}else{A("#step2").block({message:null,overlayCSS:{cursor:"default"}})}}});A.fn.extend({styleSubmit:function(){return this.each(function(){var C=A(this);var B=C.val();C.after("<span class='arrow bluearrow'></span><a class='submit' href='#'>"+B+"</a>");if(A.browser.msie){C.replaceWith("<input type='submit' style='width:0;height:0;margin:0;padding:0;border:none;visibility:visible;' />")}else{C.replaceWith("<input type='image' src='/searchcollections/Content/_images/blank.gif' style='width:0;height:0;margin:0;padding:0;border:none;visibility:hidden;' />")}A("a.submit").click(function(D){D.preventDefault();A("form:first").submit();return false});A("form:first").submit(function(){if(A(this).find(":input:not(:hidden, :checkbox)[value!='']").length>0){return true}return false})})},searchCategories:function(B){return this.each(function(){var C=A(this);C.find(":checkbox").click(function(){if(this.checked){if(this.id=="all_categories"){C.find(":checkbox:not(#all_categories):checked").removeAttr("checked")}else{C.find(":checkbox#all_categories").removeAttr("checked")}}if(typeof B=="function"){B()}})})}})})(jQuery);
