/* * * Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version 2.2.4 * Demo: http://www.texotela.co.uk/code/jquery/select/ * * $LastChangedDate: 2008-06-17 17:27:25 +0100 (Tue, 17 Jun 2008) $ * $Rev: 5727 $ * */ (function(i){i.b.e=function(){function b(a,l,m,p,j){var n=document.createElement("option");n.value=l;n.text=m;m=a.options;var o=m.length;if(!a.c){a.c={};for(var k=0;k=2){if(typeof d[1]== "boolean"){e=d[1];startindex=d[2]}else{if(typeof d[2]=="boolean")e=d[2];startindex=d[1]}if(!f){c=d[0];g=d[1]}}this.a(function(){if(this.nodeName.toLowerCase()=="select")if(f)for(var a in h){b(this,a,h[a],e,startindex);startindex+=1}else b(this,c,g,e,startindex)});return this};i.b.k=function(b,d,e,f,h){if(typeof b!="string")return this;if(typeof d!="object")d={};if(typeof e!="boolean")e=true;this.a(function(){var c=this;i.n(b,d,function(g){i(c).e(g,e);if(typeof f=="function")typeof h=="object"?f.apply(c, h):f.call(c)})});return this};i.b.h=function(){var b=arguments;if(b.length==0)return this;var d=typeof b[0],e,f;if(d=="string"||d=="object"||d=="function"){e=b[0];if(e.constructor==Array){d=e.length;for(var h=0;h=0;a--){if(e.constructor==RegExp){if(g[a].value.match(e))c=true}else if(g[a].value== e)c=true;if(c&&b[1]===true)c=g[a].selected;if(c)g[a]=null;c=false}else(c=b[1]===true?g[f].selected:true)&&this.remove(f)}});return this};i.b.p=function(b){var d=i(this).i(),e=typeof b=="undefined"?true:!!b;this.a(function(){if(this.nodeName.toLowerCase()=="select"){for(var f=this.options,h=f.length,c=[],g=0;go2t?-1:1});for(g=0;g