(function($j){
$j.incrementSearch = function(callback){
this.exec=callback;
this.timer=null;
}
$j.extend($j.incrementSearch.prototype,{
queue : function(target){
var o=this;
if(o.timer)clearTimeout(o.timer);
o.timer = setTimeout(function(){
if(o.isChange(target))
o.exec()
},500)
},
isChange : function(target){
var buf=target.data('prev')
var val=target.val();
if(buf==undefined){
target.data('prev',val);
return target.attr('defaultValue')!=val;
}
target.data('prev',val);
return buf != val;
}
});
})(jQuery);
jQuery(function($j){
var search=new $j.incrementSearch(function(){
});
$j('#search-content').keyup(function(evt){
var target=$j(evt.target);
if(target.attr('tagName')=='INPUT')search.queue(target);
});
});