/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.3.0 build: 3167 */ YUI.add('array-extras',function(Y){var L=Y.Lang,Native=Array.prototype,A=Y.Array;A.lastIndexOf=Native.lastIndexOf?function(a,val,fromIndex){return fromIndex||fromIndex===0?a.lastIndexOf(val,fromIndex):a.lastIndexOf(val);}:function(a,val,fromIndex){var len=a.length,i=len-1;if(fromIndex||fromIndex===0){i=Math.min(fromIndex<0?len+fromIndex:fromIndex,len);} if(i>-1&&len>0){for(;i>-1;--i){if(a[i]===val){return i;}}} return-1;};A.unique=function(a,sort){var i=0,len=a.length,results=[],item,j;for(;i-1;--j){if(item===results[j]){break;}} if(j===-1){results.push(item);}} if(sort){if(L.isNumber(results[0])){results.sort(A.numericSort);}else{results.sort();}} return results;};A.filter=Native.filter?function(a,f,o){return a.filter(f,o);}:function(a,f,o){var i=0,len=a.length,results=[],item;for(;i