/*! Jkefexmultisortsel - v0.1.0 - 2013-10-29
* https://github.com/kiranml1/jkefexMultiSortSel
* Copyright (c) 2013 kiran kumar; Licensed MIT */
!function(a){a.fn.jkefexMultiSortSel=function(b){var c={data:[],empty:!0,selElem:""};b&&a.extend(!0,c,b),a("select[id^="+c.selElem+"]").each(function(){var b=a(this);b.html(""),a.map(c.data,function(a){b.append("<option val="+a+">"+a+"</option>")})});var d;a("select[id^="+c.selElem+"]").focus(function(){d=a(this).val()}).change(function(){var b,e=a(this),f=this.selectedIndex;a("select[id^="+c.selElem+"]").not(this).each(function(){a(this),a.map(a(this).children(),function(c){a(c).text()==e.val()&&""!=a(c).text()&&(a(c).remove(),b=!0),a(c).text()!=d&&(b=!1)}),b||""==d||(b=!0,f>0?a(this).children()[f]?a(a(this).children()[f]).before("<option val="+d+">"+d+"</option>"):a(a(this).children()[f-1]).before("<option val="+d+">"+d+"</option>"):a(this).children()[f]&&a(a(this).children()[f]).after("<option val="+d+">"+d+"</option>")),a("select[id^="+c.selElem+"]").blur()})})}}(jQuery);