(function($){$.fn.extend({linkup:function(options){var __clean=function($s){$s.find('option[value!=""]').remove()};var ___lnp=function($papa,$son){var v=$papa.val();if(v.length==0){__clean($son);return}$.ajax({url:"/ajax/dict",type:"get",data:{type:options.type,id:$papa.val()},success:function(r){__clean($son);$.each(eval(r),function(i,item){$son.append('<option value="'+item.id+'">'+item.text+"</option>")});$son.trigger("change.linkup");$son.change()},error:function(r,a,e){}})};return $(this).each(function(){var $linkup=$(this);var $select1=$linkup.find("select:eq(0)"),$select2=$linkup.find("select:eq(1)"),$select3=$linkup.find("select:eq(2)");$select1.change(function(){if(options.incepting&&options.incepting.call(this,$select1,$select2)!=false){return}___lnp($select1,$select2)});if(!$select3.length){return}$select2.change(function(){setTimeout(function(){___lnp($select2,$select3)},0)})})}})})(jQuery);
