/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.0 Alpha 5
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2009 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
vBulletin.events.systemInit.subscribe(function(){var C,A=null,B=null;if(vBulletin.elements.vB_List_Filter){for(C=0;C<vBulletin.elements.vB_List_Filter.length;C++){B=vBulletin.elements.vB_List_Filter[C];new vB_List_Filter(B[0],B[1],B[2],B[3])}vBulletin.elements.vB_List_Filter=null}});function vB_List_Filter(A,C,B,D){this.filterbox=YAHOO.util.Dom.get(A);this.containers=C;this.haystack=B;this.descriptor=D;YAHOO.util.Event.on(this.filterbox,"keyup",this.perform_filter,this,true);YAHOO.util.Event.on(this.filterbox,"focus",this.handle_focus,this,true);YAHOO.util.Event.on(this.filterbox,"blur",this.handle_blur,this,true);this.labeltext=new String(this.filterbox.value);YAHOO.util.Dom.setStyle(this.filterbox,"display","inline")}vB_List_Filter.prototype.perform_filter=function(G){var C,A,F,D,E,B;C=this.filterbox.value;if(C==this.labeltext){return }A=PHP.trim(C.toLowerCase());console.log("vB_List_Filter :: Filtering results to entries containing '%s'.",A);for(F in this.haystack){if(this.filterbox.value==C){E=(F.toLowerCase().indexOf(A)!=-1?"block":"none");for(B=0;B<this.containers.length;B++){D=YAHOO.util.Dom.get(this.containers[B]+this.descriptor+this.haystack[F]);if(D!=null){D.style.display=E}}}else{console.warn("vB_List_Filter :: Filter race condition; search string '%s' does not match input value '%s'. Aborting.",C,this.filterbox.value);return }}};vB_List_Filter.prototype.handle_focus=function(A){YAHOO.util.Dom.removeClass(this.filterbox,"filterbox_inactive");if(this.filterbox.value==this.labeltext){this.filterbox.value=""}};vB_List_Filter.prototype.handle_blur=function(A){if(PHP.trim(this.filterbox.value)==""){YAHOO.util.Dom.addClass(this.filterbox,"filterbox_inactive");this.filterbox.value=this.labeltext}};