/* * * jQuery listnav plugin * Copyright (c) 2009 iHwy, Inc. * Author: Jack Killpatrick * * Version 2.1 (08/09/2009) * Requires jQuery 1.3.2, jquery 1.2.6 or jquery 1.2.x plus the jquery dimensions plugin * * Visit http://www.ihwy.com/labs/jquery-listnav-plugin.aspx for more information. * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */(function(e){e.fn.listnav=function(t){var n=e.extend({},e.fn.listnav.defaults,t),r=["_","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","-"],i=!1;n.prefixes=e.map(n.prefixes,function(e){return e.toLowerCase()});return this.each(function(){function v(){t.append(x());u=e(".ln-letters",t).slice(0,1);n.showCounts&&(a=e(".ln-letter-count",t).slice(0,1));g();w();n.flagDisabled&&b();S();n.includeAll||o.show();n.includeAll||e(".all",u).remove();n.includeNums||e("._",u).remove();n.includeOther||e(".-",u).remove();e(":last",u).addClass("ln-last");if(e.cookie&&n.cookieName!=null){var s=e.cookie(n.cookieName);s!=null&&(n.initLetter=s)}if(n.initLetter!=""){i=!0;e("."+n.initLetter.toLowerCase(),u).slice(0,1).click()}else if(n.includeAll)e(".all",u).addClass("ln-selected");else for(var f=n.includeNums?0:1;f0){i=!0;e("."+r[f],u).slice(0,1).click();break}}function m(){a.css({top:e(".a",u).slice(0,1).offset({margin:!1,border:!0}).top-a.outerHeight({margin:!0})})}function g(){var t,r,i,s,u,a=n.prefixes.length>0;e(o).children().each(function(){u=e(this),r="";n.attribute&&(t=e.trim(u.attr(n.attribute)).toLowerCase());if(!n.attribute||t=="")t=e.trim(u.text()).toLowerCase();if(t!=""){if(a){s=t.split(" ");if(s.length>1&&e.inArray(s[0],n.prefixes)>-1){r=s[1].charAt(0);y(r,u,!0)}}r=t.charAt(0);y(r,u)}})}function y(e,t,n){/\W/.test(e)&&(e="-");isNaN(e)||(e="_");t.addClass("ln-"+e);l[e]==undefined&&(l[e]=0);l[e]++;n||c++}function b(){for(var t=0;t