define(["jquery","nicescroll"],function(e,r){var a,n,t,o;return n=function(){e(".search input").focus(function(){e(this).parent().parent(".search").addClass("on")}).blur(function(){e(this).parent().parent(".search").removeClass("on"),e(this).parent().parent(".search").find("ul").fadeOut()}),e(".search").mouseleave(function(r){e(this).removeClass("on"),e(".search input").val(""),e(".search input").blur()})},t=function(){e(".search input").unbind("input propertychange"),e(".search input").bind("input propertychange",function(){var r=e(this).val(),a=e(".search").attr("data-url"),n=e(".search").attr("data-method"),t=e(".search").attr("data-jump");if(t&&e("#search-submit").attr("href","/search?keywords="+r),null===r||""===r)return e(".search ul").fadeOut(),!1;if("get"!=n){var o={keywords:r};return e.post(a,o,function(r){"114"===r.err_code?r.err_info?e(".search ul").fadeIn().html(r.err_info):e(".search ul").fadeIn().html('<li><a href="javascript:void(0);">未找到搜索结果!</a></li>'):e(".search ul").fadeOut()},"json"),!1}e.getJSON(a+"?keywords="+r,function(r){"114"==r.err_code?(e(".search").addClass("on"),e(".search ul").stop().animate({scrollTop:0},400),e(".search ul").fadeIn().html(r.err_info)):(e(".search").addClass("on"),e(".search ul").fadeIn().html('<li><a href="javascript:void(0);">未找到搜索结果!</a></li>'))})})},o=function(){e(".search ul").niceScroll({cursorcolor:"#f57921",cursorwidth:"2px",horizrailenabled:!1,zindex:10,scrollspeed:70,mousescrollstep:70,hwacceleration:!0,directionlockdeadzone:0,oneaxismousemode:!1,preventmultitouchscrolling:!0,cursordragontouch:!0,directionlockdeadzone:1})},a=function(){n(),t(),o()},{initModule:a}});