(function(){var c=LIModules.imports("i18n"),l=function(){function e(b){return"function"===typeof b}function g(){h=c&&c.page&&c.page.readsRTL()}var k={left:"right",right:"left",ltr:"rtl",rtl:"ltr"},h;g();return{init:g,flip:function(b,d){var a;h?void 0===d?(a=b,a=e(a)?a():a,!0===a||!1===a||"[object Boolean]"===Object.prototype.toString.call(a)?a=!a:a&&k[a]&&(a=k[a])):a=e(d)?d():d:a=e(b)?b():b;return a},applyWhenRTL:function(b){return this.flip(null,b)},isRtl:function(b){function d(a,b){if(null===a)return!1;
var c=Array.prototype.indexOf;return c&&a.indexOf===c?-1!==a.indexOf(b):Array.prototype.some(a,function(a){return a===b})}if(void 0===b||null===b)return!1;for(var a=0,f,c=b.length,e=" \n\r\t\f\u00a0\u2028\u2029".split("").concat("~!@#$%^\x26*()_+`1234567890-\x3d{}|[]\\:\";'\x3c\x3e?,./".split(""));a<c&&(f=b.charAt(a),d(e,f));a++);return a>=c?!1:"\u0590"<=f&&"\u06ff">=f?!0:!1}}}();LIModules.exports("Bidi",l)})();LI.BidiInput=function(){function b(a){a=$(a.target);var c=h,b=a.attr(e),d;d=$(f).attr(e);var g=a.data("bidiEvent");if(a.val().length)d=a.val(),LI.BidiInput._isRtl(d)&&(c=k);else if(d)c=d;else{a.removeAttr(e);return}if("undefined"===typeof b||b!==c)a.attr(e,c),g&&a.trigger(g,[c])}var e="dir",h="ltr",k="rtl",f="body",l=LIModules.requires("Bidi.isRtl");$(document).ready(function(){$(f).on("input propertychange BidiReset","textarea:not(.no-bidi-input), input:not(.no-bidi-input)",b)});return{_updateDir:b,
_isRtl:l,EVENT_RESET:"BidiReset"}}();/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.8.1
*/
(function(){var lang=YAHOO.lang,util=YAHOO.util,Ev=util.Event;util.DataSourceBase=function(oLiveData,oConfigs){if(oLiveData===null||oLiveData===undefined){return;}this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};this.responseSchema={};if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}var maxCacheEntries=this.maxCacheEntries;if(!lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}this._aIntervals=[];this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");var DS=util.DataSourceBase;this._sName="DataSource instance"+DS._nIndex;DS._nIndex++;};var DS=util.DataSourceBase;lang.augmentObject(DS,{TYPE_UNKNOWN:-1,TYPE_JSARRAY:0,TYPE_JSFUNCTION:1,TYPE_XHR:2,TYPE_JSON:3,TYPE_XML:4,TYPE_TEXT:5,TYPE_HTMLTABLE:6,TYPE_SCRIPTNODE:7,TYPE_LOCAL:8,ERROR_DATAINVALID:"Invalid data",ERROR_DATANULL:"Null data",_nIndex:0,_nTransactionId:0,_getLocationValue:function(field,context){var locator=field.locator||field.key||field,xmldoc=context.ownerDocument||context,result,res,value=null;try{if(!lang.isUndefined(xmldoc.evaluate)){result=xmldoc.evaluate(locator,context,xmldoc.createNSResolver(!context.ownerDocument?context.documentElement:context.ownerDocument.documentElement),0,null);while(res=result.iterateNext()){value=res.textContent;}}else{xmldoc.setProperty("SelectionLanguage","XPath");result=context.selectNodes(locator)[0];value=result.value||result.text||null;}return value;}catch(e){}},issueCallback:function(callback,params,error,scope){if(lang.isFunction(callback)){callback.apply(scope,params);}else{if(lang.isObject(callback)){scope=callback.scope||scope||window;var callbackFunc=callback.success;if(error){callbackFunc=callback.failure;}if(callbackFunc){callbackFunc.apply(scope,params.concat([callback.argument]));}}}},parseString:function(oData){if(!lang.isValue(oData)){return null;}var string=oData+"";if(lang.isString(string)){return string;}else{return null;}},parseNumber:function(oData){if(!lang.isValue(oData)||(oData==="")){return null;}var number=oData*1;if(lang.isNumber(number)){return number;}else{return null;}},convertNumber:function(oData){return DS.parseNumber(oData);},parseDate:function(oData){var date=null;if(!(oData instanceof Date)){date=new Date(oData);}else{return oData;}if(date instanceof Date){return date;}else{return null;}},convertDate:function(oData){return DS.parseDate(oData);}});DS.Parser={string:DS.parseString,number:DS.parseNumber,date:DS.parseDate};DS.prototype={_sName:null,_aCache:null,_oQueue:null,_aIntervals:null,maxCacheEntries:0,liveData:null,dataType:DS.TYPE_UNKNOWN,responseType:DS.TYPE_UNKNOWN,responseSchema:null,useXPath:false,toString:function(){return this._sName;},getCachedResponse:function(oRequest,oCallback,oCaller){var aCache=this._aCache;if(this.maxCacheEntries>0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i<nCacheLength-1){aCache.splice(i,1);this.addToCache(oRequest,oResponse);}oResponse.cached=true;break;}}return oResponse;}}}else{if(aCache){this._aCache=null;}}return null;},isCacheHit:function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);},addToCache:function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}while(aCache.length>=this.maxCacheEntries){aCache.shift();}var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;
}else{if(oRawResponse&&oRawResponse.nodeType&&(oRawResponse.nodeType===9||oRawResponse.nodeType===1||oRawResponse.nodeType===11)){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var arrayEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,arrayEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e1){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse);break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){var el=document.createElement("div");el.innerHTML=oRawResponse.responseText;oFullResponse=el.getElementsByTagName("table")[0];}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);
}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i<len;++i){var bError=false,sRecord=recordsarray[i];if(lang.isString(sRecord)&&(sRecord.length>0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;if(this.useXPath){data=YAHOO.util.DataSource._getLocationValue(field,result);}else{var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)){var item=xmlNode.item(0);data=(item)?((item.text)?item.text:(item.textContent)?item.textContent:null):null;if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j<len;j++){if(item.childNodes[j].nodeValue){datapieces[datapieces.length]=item.childNodes[j].nodeValue;}}if(datapieces.length>0){data=datapieces.join("");}}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{if(this.useXPath){for(k in metaLocators){oParsedResponse.meta[k]=YAHOO.util.DataSource._getLocationValue(metaLocators[k],oFullResponse);}}else{metaNode=metaNode?oFullResponse.getElementsByTagName(metaNode)[0]:oFullResponse;if(metaNode){for(k in metaLocators){if(lang.hasOwnProperty(metaLocators,k)){loc=metaLocators[k];v=metaNode.getElementsByTagName(loc)[0];if(v){v=v.firstChild.nodeValue;}else{v=metaNode.attributes.getNamedItem(loc);if(v){v=v.value;}}if(lang.isValue(v)){oParsedResponse.meta[k]=v;}}}}}xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;}catch(e){}if(!xmlList||!lang.isArray(schema.fields)){bError=true;}else{oParsedResponse.results=[];for(i=xmlList.length-1;i>=0;--i){var oResult=this.parseXMLResult(xmlList.item(i));oParsedResponse.results[i]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;},parseJSONData:function(oRequest,oFullResponse){var oParsedResponse={results:[],meta:{}};if(lang.isObject(oFullResponse)&&this.responseSchema.resultsList){var schema=this.responseSchema,fields=schema.fields,resultsList=oFullResponse,results=[],metaFields=schema.metaFields||{},fieldParsers=[],fieldPaths=[],simpleFields=[],bError=false,i,len,j,v,key,parser,path;var buildPath=function(needle){var path=null,keys=[],i=0;if(needle){needle=needle.replace(/\[(['"])(.*?)\1\]/g,function(x,$1,$2){keys[i]=$2;return".@"+(i++);}).replace(/\[(\d+)\]/g,function(x,$1){keys[i]=parseInt($1,10)|0;return".@"+(i++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(needle)){path=needle.split(".");for(i=path.length-1;i>=0;--i){if(path[i].charAt(0)==="@"){path[i]=keys[parseInt(path[i].substr(1),10)];}}}else{}}return path;};var walkPath=function(path,origin){var v=origin,i=0,len=path.length;for(;i<len&&v;++i){v=v[path[i]];}return v;};path=buildPath(schema.resultsList);if(path){resultsList=walkPath(path,oFullResponse);if(resultsList===undefined){bError=true;}}else{bError=true;}if(!resultsList){resultsList=[];}if(!lang.isArray(resultsList)){resultsList=[resultsList];}if(!bError){if(schema.fields){var field;for(i=0,len=fields.length;i<len;i++){field=fields[i];key=field.key||field;parser=((typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""])||field.converter;path=buildPath(key);if(parser){fieldParsers[fieldParsers.length]={key:key,parser:parser};}if(path){if(path.length>1){fieldPaths[fieldPaths.length]={key:key,path:path};}else{simpleFields[simpleFields.length]={key:key,path:path[0]};}}else{}}for(i=resultsList.length-1;i>=0;--i){var r=resultsList[i],rec={};if(r){for(j=simpleFields.length-1;j>=0;--j){rec[simpleFields[j].key]=(r[simpleFields[j].path]!==undefined)?r[simpleFields[j].path]:r[j];}for(j=fieldPaths.length-1;j>=0;--j){rec[fieldPaths[j].key]=walkPath(fieldPaths[j].path,r);}for(j=fieldParsers.length-1;j>=0;--j){var p=fieldParsers[j].key;rec[p]=fieldParsers[j].parser(rec[p]);if(rec[p]===undefined){rec[p]=null;}}}results[i]=rec;}}else{results=resultsList;}for(key in metaFields){if(lang.hasOwnProperty(metaFields,key)){path=buildPath(metaFields[key]);if(path){v=walkPath(path,oFullResponse);oParsedResponse.meta[key]=v;}}}}else{oParsedResponse.error=true;}oParsedResponse.results=results;}else{oParsedResponse.error=true;}return oParsedResponse;},parseHTMLTableData:function(oRequest,oFullResponse){var bError=false;var elTable=oFullResponse;var fields=this.responseSchema.fields;var oParsedResponse={results:[]};if(lang.isArray(fields)){for(var i=0;i<elTable.tBodies.length;i++){var elTbody=elTable.tBodies[i];for(var j=elTbody.rows.length-1;j>-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(lang.isValue(field.key))?field.key:field;
var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}oParsedResponse.results[j]=oResult;}}}else{bError=true;}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;}};lang.augmentProto(DS,util.EventProvider);util.LocalDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_LOCAL;if(oLiveData){if(YAHOO.lang.isArray(oLiveData)){this.responseType=DS.TYPE_JSARRAY;}else{if(oLiveData.nodeType&&oLiveData.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;oLiveData=oLiveData.cloneNode(true);}else{if(YAHOO.lang.isString(oLiveData)){this.responseType=DS.TYPE_TEXT;}else{if(YAHOO.lang.isObject(oLiveData)){this.responseType=DS.TYPE_JSON;}}}}}}else{oLiveData=[];this.responseType=DS.TYPE_JSARRAY;}util.LocalDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.LocalDataSource,DS);lang.augmentObject(util.LocalDataSource,DS);util.FunctionDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_JSFUNCTION;oLiveData=oLiveData||function(){};util.FunctionDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.FunctionDataSource,DS,{scope:null,makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=(this.scope)?this.liveData.call(this.scope,oRequest,this):this.liveData(oRequest);if(this.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;}});lang.augmentObject(util.FunctionDataSource,DS);util.ScriptNodeDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_SCRIPTNODE;oLiveData=oLiveData||"";util.ScriptNodeDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.ScriptNodeDataSource,DS,{getUtility:util.Get,asyncMode:"allowAll",scriptCallbackParam:"callback",generateRequestCallback:function(id){return"&"+this.scriptCallbackParam+"=YAHOO.util.ScriptNodeDataSource.callbacks["+id+"]";},doBeforeGetScriptNode:function(sUri){return sUri;},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});if(util.ScriptNodeDataSource._nPending===0){util.ScriptNodeDataSource.callbacks=[];util.ScriptNodeDataSource._nId=0;}var id=util.ScriptNodeDataSource._nId;util.ScriptNodeDataSource._nId++;var oSelf=this;util.ScriptNodeDataSource.callbacks[id]=function(oRawResponse){if((oSelf.asyncMode!=="ignoreStaleResponses")||(id===util.ScriptNodeDataSource.callbacks.length-1)){if(oSelf.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){oSelf.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse.nodeType&&oRawResponse.nodeType==9){oSelf.responseType=DS.TYPE_XML;}else{if(oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){oSelf.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){oSelf.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){oSelf.responseType=DS.TYPE_TEXT;}}}}}}oSelf.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);}else{}delete util.ScriptNodeDataSource.callbacks[id];};util.ScriptNodeDataSource._nPending++;var sUri=this.liveData+oRequest+this.generateRequestCallback(id);sUri=this.doBeforeGetScriptNode(sUri);this.getUtility.script(sUri,{autopurge:true,onsuccess:util.ScriptNodeDataSource._bumpPendingDown,onfail:util.ScriptNodeDataSource._bumpPendingDown});return tId;}});lang.augmentObject(util.ScriptNodeDataSource,DS);lang.augmentObject(util.ScriptNodeDataSource,{_nId:0,_nPending:0,callbacks:[]});util.XHRDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_XHR;this.connMgr=this.connMgr||util.Connect;oLiveData=oLiveData||"";util.XHRDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.XHRDataSource,DS,{connMgr:null,connXhrMode:"allowAll",connMethodPost:false,connTimeout:0,makeConnection:function(oRequest,oCallback,oCaller){var oRawResponse=null;var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oSelf=this;var oConnMgr=this.connMgr;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.connXhrMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}else{if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:null,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);return null;}else{if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oResponse.getResponseHeader)?oResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}}this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};
oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}else{if(oQueue.conn){var allRequests=oQueue.requests;allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return;}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift();}else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);}return tId;}});lang.augmentObject(util.XHRDataSource,DS);util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){lang.augmentObject(util.DataSource,util.ScriptNodeDataSource);return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}else{lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(B,E){if(!isFinite(+B)){return"";}B=!isFinite(+B)?0:+B;E=YAHOO.lang.merge(YAHOO.util.Number.format.defaults,(E||{}));var C=B<0,F=Math.abs(B),A=E.decimalPlaces,I=E.thousandsSeparator,H,G,D;if(A<0){H=F-(F%1)+"";D=H.length+A;if(D>0){H=Number("."+H).toFixed(D).slice(2)+new Array(H.length-D+1).join("0");}else{H="0";}}else{H=F<1&&F>=0.5&&!A?"1":F.toFixed(A);}if(F>1000){G=H.split(/\D/);D=G[0].length%3||3;G[0]=G[0].slice(0,D)+G[0].slice(D).replace(/(\d{3})/g,I+"$1");H=G.join(E.decimalSeparator);}H=E.prefix+H+E.suffix;return C?E.negativeFormat.replace(/#/,H):H;}};YAHOO.util.Number.format.defaults={decimalSeparator:".",decimalPlaces:null,thousandsSeparator:"",prefix:"",suffix:"",negativeFormat:"-#"};(function(){var A=function(C,E,D){if(typeof D==="undefined"){D=10;}for(;parseInt(C,10)<D&&D>1;D/=10){C=E.toString()+C;}return C.toString();};var B={formats:{a:function(D,C){return C.a[D.getDay()];},A:function(D,C){return C.A[D.getDay()];},b:function(D,C){return C.b[D.getMonth()];},B:function(D,C){return C.B[D.getMonth()];},C:function(C){return A(parseInt(C.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(C){return A(parseInt(B.formats.G(C)%100,10),0);},G:function(E){var F=E.getFullYear();var D=parseInt(B.formats.V(E),10);var C=parseInt(B.formats.W(E),10);if(C>D){F++;}else{if(C===0&&D>=52){F--;}}return F;},H:["getHours","0"],I:function(D){var C=D.getHours()%12;return A(C===0?12:C,0);},j:function(G){var F=new Date(""+G.getFullYear()+"/1/1 GMT");var D=new Date(""+G.getFullYear()+"/"+(G.getMonth()+1)+"/"+G.getDate()+" GMT");var C=D-F;var E=parseInt(C/60000/60/24,10)+1;return A(E,0,100);},k:["getHours"," "],l:function(D){var C=D.getHours()%12;return A(C===0?12:C," ");},m:function(C){return A(C.getMonth()+1,0);},M:["getMinutes","0"],p:function(D,C){return C.p[D.getHours()>=12?1:0];},P:function(D,C){return C.P[D.getHours()>=12?1:0];},s:function(D,C){return parseInt(D.getTime()/1000,10);},S:["getSeconds","0"],u:function(C){var D=C.getDay();return D===0?7:D;},U:function(F){var C=parseInt(B.formats.j(F),10);var E=6-F.getDay();var D=parseInt((C+E)/7,10);return A(D,0);},V:function(F){var E=parseInt(B.formats.W(F),10);var C=(new Date(""+F.getFullYear()+"/1/1")).getDay();var D=E+(C>4||C<=1?0:1);if(D===53&&(new Date(""+F.getFullYear()+"/12/31")).getDay()<4){D=1;}else{if(D===0){D=B.formats.V(new Date(""+(F.getFullYear()-1)+"/12/31"));}}return A(D,0);},w:"getDay",W:function(F){var C=parseInt(B.formats.j(F),10);var E=7-B.formats.u(F);var D=parseInt((C+E)/7,10);return A(D,0,10);},y:function(C){return A(C.getFullYear()%100,0);},Y:"getFullYear",z:function(E){var D=E.getTimezoneOffset();var C=A(parseInt(Math.abs(D/60),10),0);var F=A(Math.abs(D%60),0);return(D>0?"-":"+")+C+F;},Z:function(C){var D=C.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(D.length>4){D=B.formats.z(C);}return D;},"%":function(C){return"%";}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(G,F,D){F=F||{};if(!(G instanceof Date)){return YAHOO.lang.isValue(G)?G:"";}var H=F.format||"%m/%d/%Y";if(H==="YYYY/MM/DD"){H="%Y/%m/%d";}else{if(H==="DD/MM/YYYY"){H="%d/%m/%Y";}else{if(H==="MM/DD/YYYY"){H="%m/%d/%Y";}}}D=D||"en";if(!(D in YAHOO.util.DateLocale)){if(D.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){D=D.replace(/-[a-zA-Z]+$/,"");
}else{D="en";}}var J=YAHOO.util.DateLocale[D];var C=function(L,K){var M=B.aggregates[K];return(M==="locale"?J[K]:M);};var E=function(L,K){var M=B.formats[K];if(typeof M==="string"){return G[M]();}else{if(typeof M==="function"){return M.call(G,G,J);}else{if(typeof M==="object"&&typeof M[0]==="string"){return A(G[M[0]](),M[1]);}else{return K;}}}};while(H.match(/%[cDFhnrRtTxX]/)){H=H.replace(/%([cDFhnrRtTxX])/g,C);}var I=H.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,E);C=E=undefined;return I;}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=B;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};YAHOO.util.DateLocale["en"]=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"]);})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.8.1",build:"19"});YAHOO.widget.DS_JSArray=YAHOO.util.LocalDataSource;YAHOO.widget.DS_JSFunction=YAHOO.util.FunctionDataSource;YAHOO.widget.DS_XHR=function(b,a,d){var c=new YAHOO.util.XHRDataSource(b,d);c._aDeprecatedSchema=a;return c};YAHOO.widget.DS_ScriptNode=function(b,a,d){var c=new YAHOO.util.ScriptNodeDataSource(b,d);c._aDeprecatedSchema=a;return c};YAHOO.widget.DS_XHR.TYPE_JSON=YAHOO.util.DataSourceBase.TYPE_JSON;YAHOO.widget.DS_XHR.TYPE_XML=YAHOO.util.DataSourceBase.TYPE_XML;YAHOO.widget.DS_XHR.TYPE_FLAT=YAHOO.util.DataSourceBase.TYPE_TEXT;YAHOO.widget.AutoComplete=function(g,b,j,c){if(g&&b&&j){if(j&&YAHOO.lang.isFunction(j.sendRequest)){this.dataSource=j}else{return}this.key=0;var d=j.responseSchema;if(j._aDeprecatedSchema){var k=j._aDeprecatedSchema;if(YAHOO.lang.isArray(k)){if((j.responseType===YAHOO.util.DataSourceBase.TYPE_JSON)||(j.responseType===YAHOO.util.DataSourceBase.TYPE_UNKNOWN)){d.resultsList=k[0];this.key=k[1];d.fields=(k.length<3)?null:k.slice(1)}else{if(j.responseType===YAHOO.util.DataSourceBase.TYPE_XML){d.resultNode=k[0];this.key=k[1];d.fields=k.slice(1)}else{if(j.responseType===YAHOO.util.DataSourceBase.TYPE_TEXT){d.recordDelim=k[0];d.fieldDelim=k[1]}}}j.responseSchema=d}}if(YAHOO.util.Dom.inDocument(g)){if(YAHOO.lang.isString(g)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+g;this._elTextbox=document.getElementById(g)}else{this._sName=(g.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+g.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=g}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input")}else{return}if(YAHOO.util.Dom.inDocument(b)){if(YAHOO.lang.isString(b)){this._elContainer=document.getElementById(b)}else{this._elContainer=b}if(this._elContainer.style.display=="none"){}var e=this._elContainer.parentNode;var a=e.tagName.toLowerCase();if(a=="div"){YAHOO.util.Dom.addClass(e,"yui-ac")}else{}}else{return}if(this.dataSource.dataType===YAHOO.util.DataSourceBase.TYPE_LOCAL){this.applyLocalFilter=true}if(c&&(c.constructor==Object)){for(var i in c){if(i){this[i]=c[i]}}}this._initContainerEl();this._initProps();this._initListEl();this._initContainerHelperEls();var h=this;var f=this._elTextbox;YAHOO.util.Event.addListener(f,"keyup",h._onTextboxKeyUp,h);YAHOO.util.Event.addListener(f,"keydown",h._onTextboxKeyDown,h);YAHOO.util.Event.addListener(f,"focus",h._onTextboxFocus,h);YAHOO.util.Event.addListener(f,"blur",h._onTextboxBlur,h);YAHOO.util.Event.addListener(b,"mouseover",h._onContainerMouseover,h);YAHOO.util.Event.addListener(b,"mouseout",h._onContainerMouseout,h);YAHOO.util.Event.addListener(b,"click",h._onContainerClick,h);YAHOO.util.Event.addListener(b,"scroll",h._onContainerScroll,h);YAHOO.util.Event.addListener(b,"resize",h._onContainerResize,h);YAHOO.util.Event.addListener(f,"keypress",h._onTextboxKeyPress,h);YAHOO.util.Event.addListener(window,"unload",h._onWindowUnload,h);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerPopulateEvent=new YAHOO.util.CustomEvent("containerPopulate",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);this.textboxChangeEvent=new YAHOO.util.CustomEvent("textboxChange",this);f.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.applyLocalFilter=null;YAHOO.widget.AutoComplete.prototype.queryMatchCase=false;YAHOO.widget.AutoComplete.prototype.queryMatchContains=false;YAHOO.widget.AutoComplete.prototype.queryMatchSubset=false;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.typeAheadDelay=0.5;YAHOO.widget.AutoComplete.prototype.queryInterval=500;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.suppressInputUpdate=false;YAHOO.widget.AutoComplete.prototype.resultTypeList=true;YAHOO.widget.AutoComplete.prototype.queryQuestionMark=true;YAHOO.widget.AutoComplete.prototype.autoSnapContainer=true;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName};YAHOO.widget.AutoComplete.prototype.getInputEl=function(){return this._elTextbox};YAHOO.widget.AutoComplete.prototype.getContainerEl=function(){return this._elContainer};YAHOO.widget.AutoComplete.prototype.isFocused=function(){return this._bFocused};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen};YAHOO.widget.AutoComplete.prototype.getListEl=function(){return this._elList};YAHOO.widget.AutoComplete.prototype.getListItemMatch=function(a){if(a._sResultMatch){return a._sResultMatch}else{return null}};YAHOO.widget.AutoComplete.prototype.getListItemData=function(a){if(a._oResultData){return a._oResultData}else{return null}};YAHOO.widget.AutoComplete.prototype.getListItemIndex=function(a){if(YAHOO.lang.isNumber(a._nItemIndex)){return a._nItemIndex}else{return null}};YAHOO.widget.AutoComplete.prototype.setHeader=function(b){if(this._elHeader){var a=this._elHeader;if(b){a.innerHTML=b;a.style.display=""}else{a.innerHTML="";a.style.display="none"}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(b){if(this._elFooter){var a=this._elFooter;if(b){a.innerHTML=b;a.style.display=""}else{a.innerHTML="";a.style.display="none"}}};YAHOO.widget.AutoComplete.prototype.setBody=function(a){if(this._elBody){var b=this._elBody;YAHOO.util.Event.purgeElement(b,true);if(a){b.innerHTML=a;b.style.display=""}else{b.innerHTML="";b.style.display="none"}this._elList=null}};YAHOO.widget.AutoComplete.prototype.generateRequest=function(b){var a=this.dataSource.dataType;if(a===YAHOO.util.DataSourceBase.TYPE_XHR){if(!this.dataSource.connMethodPost){b=(this.queryQuestionMark?"?":"")+(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"")}else{b=(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"")}}else{if(a===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE){b="&"+(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"")}}return b};YAHOO.widget.AutoComplete.prototype.sendQuery=function(b){this._bFocused=true;var a=(this.delimChar)?this._elTextbox.value+b:b;this._sendQuery(a)};YAHOO.widget.AutoComplete.prototype.snapContainer=function(){var a=this._elTextbox,b=YAHOO.util.Dom.getXY(a);b[1]+=YAHOO.util.Dom.get(a).offsetHeight+2;YAHOO.util.Dom.setXY(this._elContainer,b)};YAHOO.widget.AutoComplete.prototype.expandContainer=function(){this._toggleContainer(true)};YAHOO.widget.AutoComplete.prototype.collapseContainer=function(){this._toggleContainer(false)};YAHOO.widget.AutoComplete.prototype.clearList=function(){var b=this._elList.childNodes,a=b.length-1;for(;a>-1;a--){b[a].style.display="none"}};YAHOO.widget.AutoComplete.prototype.getSubsetMatches=function(e){var d,c,a;for(var b=e.length;b>=this.minQueryLength;b--){a=this.generateRequest(e.substr(0,b));this.dataRequestEvent.fire(this,d,a);c=this.dataSource.getCachedResponse(a);if(c){return this.filterResults.apply(this.dataSource,[e,c,c,{scope:this}])}}return null};YAHOO.widget.AutoComplete.prototype.preparseRawResponse=function(c,b,a){var d=((this.responseStripAfter!=="")&&(b.indexOf))?b.indexOf(this.responseStripAfter):-1;if(d!=-1){b=b.substring(0,d)}return b};YAHOO.widget.AutoComplete.prototype.filterResults=function(l,n,r,m){if(m&&m.argument&&m.argument.query){l=m.argument.query}if(l&&l!==""){r=YAHOO.widget.AutoComplete._cloneObject(r);var j=m.scope,q=this,c=r.results,o=[],b=j.maxResultsDisplayed,k=(q.queryMatchCase||j.queryMatchCase),a=(q.queryMatchContains||j.queryMatchContains);for(var d=0,h=c.length;d<h;d++){var f=c[d];var e=null;if(YAHOO.lang.isString(f)){e=f}else{if(YAHOO.lang.isArray(f)){e=f[0]}else{if(this.responseSchema.fields){var p=this.responseSchema.fields[0].key||this.responseSchema.fields[0];e=f[p]}else{if(this.key){e=f[this.key]}}}}if(YAHOO.lang.isString(e)){var g=(k)?e.indexOf(decodeURIComponent(l)):e.toLowerCase().indexOf(decodeURIComponent(l).toLowerCase());if((!a&&(g===0))||(a&&(g>-1))){o.push(f)}}if(h>b&&o.length===b){break}}r.results=o}else{}return r};YAHOO.widget.AutoComplete.prototype.handleResponse=function(c,a,b){if((this instanceof YAHOO.widget.AutoComplete)&&this._sName){this._populateList(c,a,b)}};YAHOO.widget.AutoComplete.prototype.doBeforeLoadData=function(c,a,b){return true};YAHOO.widget.AutoComplete.prototype.formatResult=function(b,d,a){var c=(a)?a:"";return c};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(d,a,c,b){return true};YAHOO.widget.AutoComplete.prototype.destroy=function(){var b=this.toString();var a=this._elTextbox;var d=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerPopulateEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();this.textboxChangeEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(a,true);YAHOO.util.Event.purgeElement(d,true);d.innerHTML="";for(var c in this){if(YAHOO.lang.hasOwnProperty(this,c)){this[c]=null}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerPopulateEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete.prototype.textboxChangeEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=false;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._elList=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sPastSelections="";YAHOO.widget.AutoComplete.prototype._sInitInputValue=null;YAHOO.widget.AutoComplete.prototype._elCurListItem=null;YAHOO.widget.AutoComplete.prototype._elCurPrehighlightItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nRealKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var b=this.minQueryLength;if(!YAHOO.lang.isNumber(b)){this.minQueryLength=1}var e=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(e)||(e<1)){this.maxResultsDisplayed=10}var f=this.queryDelay;if(!YAHOO.lang.isNumber(f)||(f<0)){this.queryDelay=0.2}var c=this.typeAheadDelay;if(!YAHOO.lang.isNumber(c)||(c<0)){this.typeAheadDelay=0.2}var a=this.delimChar;if(YAHOO.lang.isString(a)&&(a.length>0)){this.delimChar=[a]}else{if(!YAHOO.lang.isArray(a)){this.delimChar=null}}var d=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(d)||(d<0)){this.animSpeed=0.3}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed)}else{this._oAnim.duration=this.animSpeed}}if(this.forceSelection&&a){}};YAHOO.widget.AutoComplete.prototype._initContainerHelperEls=function(){if(this.useShadow&&!this._elShadow){var a=document.createElement("div");a.className="yui-ac-shadow";a.style.width=0;a.style.height=0;this._elShadow=this._elContainer.appendChild(a)}if(this.useIFrame&&!this._elIFrame){var b=document.createElement("iframe");b.src=this._iFrameSrc;b.frameBorder=0;b.scrolling="no";b.style.position="absolute";b.style.width=0;b.style.height=0;b.style.padding=0;b.tabIndex=-1;b.role="presentation";b.title="Presentational iframe shim";this._elIFrame=this._elContainer.appendChild(b)}};YAHOO.widget.AutoComplete.prototype._initContainerEl=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var c=document.createElement("div");c.className="yui-ac-content";c.style.display="none";this._elContent=this._elContainer.appendChild(c);var b=document.createElement("div");b.className="yui-ac-hd";b.style.display="none";this._elHeader=this._elContent.appendChild(b);var d=document.createElement("div");d.className="yui-ac-bd";this._elBody=this._elContent.appendChild(d);var a=document.createElement("div");a.className="yui-ac-ft";a.style.display="none";this._elFooter=this._elContent.appendChild(a)}else{}};YAHOO.widget.AutoComplete.prototype._initListEl=function(){var c=this.maxResultsDisplayed,a=this._elList||document.createElement("ul"),b;while(a.childNodes.length<c){b=document.createElement("li");b.style.display="none";b._nItemIndex=a.childNodes.length;a.appendChild(b)}if(!this._elList){var d=this._elBody;YAHOO.util.Event.purgeElement(d,true);d.innerHTML="";this._elList=d.appendChild(a)}this._elBody.style.display=""};YAHOO.widget.AutoComplete.prototype._focus=function(){var a=this;setTimeout(function(){try{a._elTextbox.focus()}catch(b){}},0)};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var a=this;if(!a._queryInterval&&a.queryInterval){a._queryInterval=setInterval(function(){a._onInterval()},a.queryInterval)}};YAHOO.widget.AutoComplete.prototype.enableIntervalDetection=YAHOO.widget.AutoComplete.prototype._enableIntervalDetection;YAHOO.widget.AutoComplete.prototype._onInterval=function(){var a=this._elTextbox.value;var b=this._sLastTextboxValue;if(a!=b){this._sLastTextboxValue=a;this._sendQuery(a)}};YAHOO.widget.AutoComplete.prototype._clearInterval=function(){if(this._queryInterval){clearInterval(this._queryInterval);this._queryInterval=null}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(a){if((a==9)||(a==13)||(a==16)||(a==17)||(a>=18&&a<=20)||(a==27)||(a>=33&&a<=35)||(a>=36&&a<=40)||(a>=44&&a<=45)||(a==229)){return true}return false};YAHOO.widget.AutoComplete.prototype._sendQuery=function(d){if(this.minQueryLength<0){this._toggleContainer(false);return}if(this.delimChar){var a=this._extractQuery(d);d=a.query;this._sPastSelections=a.previous}if((d&&(d.length<this.minQueryLength))||(!d&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID)}this._toggleContainer(false);return}d=encodeURIComponent(d);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var c=this.getSubsetMatches(d);if(c){this.handleResponse(d,c,{query:d});return}}if(this.dataSource.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults}var b=this.generateRequest(d);this.dataRequestEvent.fire(this,d,b);this.dataSource.sendRequest(b,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:d}})};YAHOO.widget.AutoComplete.prototype._populateListItem=function(b,a,c){b.innerHTML=this.formatResult(a,c,b._sResultMatch)};YAHOO.widget.AutoComplete.prototype._populateList=function(n,f,c){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID)}n=(c&&c.query)?c.query:n;var h=this.doBeforeLoadData(n,f,c);if(h&&!f.error){this.dataReturnEvent.fire(this,n,f.results);if(this._bFocused){var p=decodeURIComponent(n);this._sCurQuery=p;this._bItemSelected=false;var u=f.results,a=Math.min(u.length,this.maxResultsDisplayed),m=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(a>0){if(!this._elList||(this._elList.childNodes.length<a)){this._initListEl()}this._initContainerHelperEls();var l=this._elList.childNodes;for(var t=a-1;t>=0;t--){var s=l[t],e=u[t];if(this.resultTypeList){var b=[];b[0]=(YAHOO.lang.isString(e))?e:e[m]||e[this.key];var o=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(o)&&(o.length>1)){for(var q=1,v=o.length;q<v;q++){b[b.length]=e[o[q].key||o[q]]}}else{if(YAHOO.lang.isArray(e)){b=e}else{if(YAHOO.lang.isString(e)){b=[e]}else{b[1]=e}}}e=b}s._sResultMatch=(YAHOO.lang.isString(e))?e:(YAHOO.lang.isArray(e))?e[0]:(e[m]||"");s._oResultData=e;this._populateListItem(s,e,p);s.style.display=""}if(a<l.length){var g;for(var r=l.length-1;r>=a;r--){g=l[r];g.style.display="none"}}this._nDisplayedItems=a;this.containerPopulateEvent.fire(this,n,u);if(this.autoHighlight){var d=this._elList.firstChild;this._toggleHighlight(d,"to");this.itemArrowToEvent.fire(this,d);this._typeAhead(d,n)}else{this._toggleHighlight(this._elCurListItem,"from")}h=this._doBeforeExpandContainer(this._elTextbox,this._elContainer,n,u);this._toggleContainer(h)}else{this._toggleContainer(false)}return}}else{this.dataErrorEvent.fire(this,n,f)}};YAHOO.widget.AutoComplete.prototype._doBeforeExpandContainer=function(d,a,c,b){if(this.autoSnapContainer){this.snapContainer()}return this.doBeforeExpandContainer(d,a,c,b)};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var a=(this.delimChar)?this._extractQuery(this._elTextbox.value):{previous:"",query:this._elTextbox.value};this._elTextbox.value=a.previous;this.selectionEnforceEvent.fire(this,a.query)};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var a=null;for(var b=0;b<this._nDisplayedItems;b++){var c=this._elList.childNodes[b];var d=(""+c._sResultMatch).toLowerCase();if(d==this._sCurQuery.toLowerCase()){a=c;break}}return(a)};YAHOO.widget.AutoComplete.prototype._typeAhead=function(b,d){if(!this.typeAhead||(this._nKeyCode==8)){return}var a=this,c=this._elTextbox;if(c.setSelectionRange||c.createTextRange){this._nTypeAheadDelayID=setTimeout(function(){var f=c.value.length;a._updateValue(b);var g=c.value.length;a._selectText(c,f,g);var e=c.value.substr(f,g);a.typeAheadEvent.fire(a,d,e)},(this.typeAheadDelay*1000))}};YAHOO.widget.AutoComplete.prototype._selectText=function(d,a,b){if(d.setSelectionRange){d.setSelectionRange(a,b)}else{if(d.createTextRange){var c=d.createTextRange();c.moveStart("character",a);c.moveEnd("character",b-d.value.length);c.select()}else{d.select()}}};YAHOO.widget.AutoComplete.prototype._extractQuery=function(h){var c=this.delimChar,f=-1,g,e,b=c.length-1,d;for(;b>=0;b--){g=h.lastIndexOf(c[b]);if(g>f){f=g}}if(c[b]==" "){for(var a=c.length-1;a>=0;a--){if(h[f-1]==c[a]){f--;break}}}if(f>-1){e=f+1;while(h.charAt(e)==" "){e+=1}d=h.substring(0,e);h=h.substr(e)}else{d=""}return{previous:d,query:h}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(d){var e=this._elContent.offsetWidth+"px";var b=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){var c=this._elIFrame;if(d){c.style.width=e;c.style.height=b;c.style.padding=""}else{c.style.width=0;c.style.height=0;c.style.padding=0}}if(this.useShadow&&this._elShadow){var a=this._elShadow;if(d){a.style.width=e;a.style.height=b}else{a.style.width=0;a.style.height=0}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(i){var d=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return}if(!i){this._toggleHighlight(this._elCurListItem,"from");this._nDisplayedItems=0;this._sCurQuery=null;if(this._elContent.style.display=="none"){return}}var a=this._oAnim;if(a&&a.getEl()&&(this.animHoriz||this.animVert)){if(a.isAnimated()){a.stop(true)}var g=this._elContent.cloneNode(true);d.appendChild(g);g.style.top="-9000px";g.style.width="";g.style.height="";g.style.display="";var f=g.offsetWidth;var c=g.offsetHeight;var b=(this.animHoriz)?0:f;var e=(this.animVert)?0:c;a.attributes=(i)?{width:{to:f},height:{to:c}}:{width:{to:b},height:{to:e}};if(i&&!this._bContainerOpen){this._elContent.style.width=b+"px";this._elContent.style.height=e+"px"}else{this._elContent.style.width=f+"px";this._elContent.style.height=c+"px"}d.removeChild(g);g=null;var h=this;var j=function(){a.onComplete.unsubscribeAll();if(i){h._toggleContainerHelpers(true);h._bContainerOpen=i;h.containerExpandEvent.fire(h)}else{h._elContent.style.display="none";h._bContainerOpen=i;h.containerCollapseEvent.fire(h)}};this._toggleContainerHelpers(false);this._elContent.style.display="";a.onComplete.subscribe(j);a.animate()}else{if(i){this._elContent.style.display="";this._toggleContainerHelpers(true);this._bContainerOpen=i;this.containerExpandEvent.fire(this)}else{this._toggleContainerHelpers(false);this._elContent.style.display="none";this._bContainerOpen=i;this.containerCollapseEvent.fire(this)}}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(a,c){if(a){var b=this.highlightClassName;if(this._elCurListItem){YAHOO.util.Dom.removeClass(this._elCurListItem,b);this._elCurListItem=null}if((c=="to")&&b){YAHOO.util.Dom.addClass(a,b);this._elCurListItem=a}}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(b,c){var a=this.prehighlightClassName;if(this._elCurPrehighlightItem){YAHOO.util.Dom.removeClass(this._elCurPrehighlightItem,a)}if(b==this._elCurListItem){return}if((c=="mouseover")&&a){YAHOO.util.Dom.addClass(b,a);this._elCurPrehighlightItem=b}else{YAHOO.util.Dom.removeClass(b,a)}};YAHOO.widget.AutoComplete.prototype._updateValue=function(c){if(!this.suppressInputUpdate){var f=this._elTextbox;var e=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var b=c._sResultMatch;var d="";if(e){d=this._sPastSelections;d+=b+e;if(e!=" "){d+=" "}}else{d=b}f.value=d;if(f.type=="textarea"){f.scrollTop=f.scrollHeight}var a=f.value.length;this._selectText(f,a,a);this._elCurListItem=c}};YAHOO.widget.AutoComplete.prototype._selectItem=function(a){this._bItemSelected=true;this._updateValue(a);this._sPastSelections=this._elTextbox.value;this._clearInterval();this.itemSelectEvent.fire(this,a,a._oResultData);this._toggleContainer(false)};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._elCurListItem){this._selectItem(this._elCurListItem)}else{this._toggleContainer(false)}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(g){if(this._bContainerOpen){var h=this._elCurListItem,d=-1;if(h){d=h._nItemIndex}var e=(g==40)?(d+1):(d-1);if(e<-2||e>=this._nDisplayedItems){return}if(h){this._toggleHighlight(h,"from");this.itemArrowFromEvent.fire(this,h)}if(e==-1){if(this.delimChar){this._elTextbox.value=this._sPastSelections+this._sCurQuery}else{this._elTextbox.value=this._sCurQuery}return}if(e==-2){this._toggleContainer(false);return}var f=this._elList.childNodes[e],b=this._elContent,c=YAHOO.util.Dom.getStyle(b,"overflow"),i=YAHOO.util.Dom.getStyle(b,"overflowY"),a=((c=="auto")||(c=="scroll")||(i=="auto")||(i=="scroll"));if(a&&(e>-1)&&(e<this._nDisplayedItems)){if(g==40){if((f.offsetTop+f.offsetHeight)>(b.scrollTop+b.offsetHeight)){b.scrollTop=(f.offsetTop+f.offsetHeight)-b.offsetHeight}else{if((f.offsetTop+f.offsetHeight)<b.scrollTop){b.scrollTop=f.offsetTop}}}else{if(f.offsetTop<b.scrollTop){this._elContent.scrollTop=f.offsetTop}else{if(f.offsetTop>(b.scrollTop+b.offsetHeight)){this._elContent.scrollTop=(f.offsetTop+f.offsetHeight)-b.offsetHeight}}}}this._toggleHighlight(f,"to");this.itemArrowToEvent.fire(this,f);if(this.typeAhead){this._updateValue(f)}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":if(c.prehighlightClassName){c._togglePrehighlight(d,"mouseover")}else{c._toggleHighlight(d,"to")}c.itemMouseOverEvent.fire(c,d);break;case"div":if(YAHOO.util.Dom.hasClass(d,"yui-ac-container")){c._bOverContainer=true;return}break;default:break}d=d.parentNode;if(d){b=d.nodeName.toLowerCase()}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":if(c.prehighlightClassName){c._togglePrehighlight(d,"mouseout")}else{c._toggleHighlight(d,"from")}c.itemMouseOutEvent.fire(c,d);break;case"ul":c._toggleHighlight(c._elCurListItem,"to");break;case"div":if(YAHOO.util.Dom.hasClass(d,"yui-ac-container")){c._bOverContainer=false;return}break;default:break}d=d.parentNode;if(d){b=d.nodeName.toLowerCase()}}};YAHOO.widget.AutoComplete.prototype._onContainerClick=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":c._toggleHighlight(d,"to");c._selectItem(d);return;default:break}d=d.parentNode;if(d){b=d.nodeName.toLowerCase()}}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(a,b){b._focus()};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(a,b){b._toggleContainerHelpers(b._bContainerOpen)};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(a,b){var c=a.keyCode;b._nRealKeyCode=c;if(b._nTypeAheadDelayID!=-1){clearTimeout(b._nTypeAheadDelayID)}switch(c){case 9:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(b._elCurListItem){if(b.delimChar&&(b._nKeyCode!=c)){if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a)}}b._selectItem(b._elCurListItem)}else{b._toggleContainer(false)}}break;case 13:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(b._elCurListItem){if(b._nKeyCode!=c){if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a)}}b._selectItem(b._elCurListItem)}else{b._toggleContainer(false)}}break;case 27:b._toggleContainer(false);return;case 39:if(!b.actionsEnabled){b._jumpSelection()}break;case 38:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);b._moveSelection(c)}break;case 40:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);b._moveSelection(c)}break;default:if(b.actionsEnabled&&c===37){break}b._bItemSelected=false;b._toggleHighlight(b._elCurListItem,"from");b.textboxKeyEvent.fire(b,c);break}if(c===18){b._enableIntervalDetection()}b._nKeyCode=c};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(a,b){var c=a.keyCode;if(YAHOO.env.ua.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&(YAHOO.env.ua.webkit<420)){switch(c){case 9:if(b._bContainerOpen){if(b.delimChar){YAHOO.util.Event.stopEvent(a)}if(b._elCurListItem){b._selectItem(b._elCurListItem)}else{b._toggleContainer(false)}}break;case 13:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);if(b._elCurListItem){b._selectItem(b._elCurListItem)}else{b._toggleContainer(false)}}break;default:break}}else{if(c==229){b._enableIntervalDetection()}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(a,c){var b=this.value;c._initProps();var d=a.keyCode;if(c._isIgnoreKey(d)){return}if(c._nDelayID!=-1){clearTimeout(c._nDelayID)}c._nDelayID=setTimeout(function(){c._sendQuery(b)},(c.queryDelay*1000))};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(a,b){if(!b._bFocused){b._elTextbox.setAttribute("autocomplete","off");b._bFocused=true;b._sInitInputValue=b._elTextbox.value;b.textboxFocusEvent.fire(b)}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(a,c){if(!c._bOverContainer||(c._nKeyCode==9)){if(!c._bItemSelected){var b=c._textMatchesOption();if(!c._bContainerOpen||(c._bContainerOpen&&(b===null))){if(c.forceSelection){c._clearSelection()}else{c.unmatchedItemSelectEvent.fire(c,c._sCurQuery)}}else{if(c.forceSelection){c._selectItem(b)}}}c._clearInterval();c._bFocused=false;if(c._sInitInputValue!==c._elTextbox.value){c.textboxChangeEvent.fire(c)}c.textboxBlurEvent.fire(c);c._toggleContainer(false)}else{c._focus()}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(a,b){if(b&&b._elTextbox&&b.allowBrowserAutocomplete){b._elTextbox.setAttribute("autocomplete","on")}};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(a){return this.generateRequest(a)};YAHOO.widget.AutoComplete.prototype.getListItems=function(){var c=[],b=this._elList.childNodes;for(var a=b.length-1;a>=0;a--){c[a]=b[a]}return c};YAHOO.widget.AutoComplete._cloneObject=function(d){if(!YAHOO.lang.isValue(d)){return d}var f={};if(YAHOO.lang.isFunction(d)){f=d}else{if(YAHOO.lang.isArray(d)){var e=[];for(var c=0,b=d.length;c<b;c++){e[c]=YAHOO.widget.AutoComplete._cloneObject(d[c])}f=e}else{if(YAHOO.lang.isObject(d)){for(var a in d){if(YAHOO.lang.hasOwnProperty(d,a)){if(YAHOO.lang.isValue(d[a])&&YAHOO.lang.isObject(d[a])||YAHOO.lang.isArray(d[a])){f[a]=YAHOO.widget.AutoComplete._cloneObject(d[a])}else{f[a]=d[a]}}}}else{f=d}}}return f};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.8.1",build:"19"});LI.define("DataSource");LI.define("DataSource.Factory");LI.DataSource.Factory={createSource:function(a,b){var d=null,c="";"string"===typeof b?(c=b,LI.DataSource.Sources.hasOwnProperty(c)&&(d=LI.DataSource.Sources[c].create(a))):b.hasOwnProperty("create")&&"function"===typeof b.create&&(d=b.create(a));return d}};LI.define("DataSource.RegexHelper");LI.DataSource.RegexHelper={esc:function(a){return(a+"").replace(/[\-#$\^*()+\[\]{}|\\,.?\s]/g,"\\$\x26")}};LI.define("DataSource.Filters");
LI.DataSource.Filters={startsWithMatch:function(a,b){return a?0===b.toLowerCase().indexOf(a):!0},subwordAnyMatch:function(a,b){b=LI.htmlUnencode?LI.htmlUnencode(b):b;var d,c;d=/\s+/;var f=a.toLowerCase().split(d),g=f.length,h=b.toLowerCase().split(d),k=h.length;for(d=0;d<g;d++)for(c=0;c<k;c++)if(0===h[c].indexOf(f[d]))return!0;return!1},subwordAllMatch:function(a,b){b=LI.htmlUnencode?LI.htmlUnencode(b):b;var d,c;d=/\s+/;var f=a.toLowerCase().split(d),g=f.length,h=b.toLowerCase().split(d),k=h.length,
l=0;for(d=0;d<g;d++)for(c=0;c<k;c++)if(0===h[c].indexOf(f[d])){l+=1;break}return l===g?!0:!1},phraseMatch:function(a,b){return-1<b.toLowerCase().indexOf(a)}};
LI.DataSource.clientSideFilterFactory=function(a,b,d){var c=a||"subwordAllMatch",f=!1===b?!1:!0,g=d||!1;return function(a,b,d,p){b=[];p&&p.argument&&p.argument.query&&(a=p.argument.query);if(a&&""!==a){d=YAHOO.widget.AutoComplete._cloneObject(d);var r=d.results,s=[];p=p.scope.maxResultsDisplayed;var e,m,n,q,t;q=0;for(t=r.length;q<t;q++){e=r[q];m=null;YAHOO.lang.isString(e)?m=e:YAHOO.lang.isArray(e)?m=e[0]:this.responseSchema.fields?(n=this.responseSchema.fields[0].key||this.responseSchema.fields[0],
m=e[n]):this.key&&(m=e[this.key]);if(YAHOO.lang.isString(m)&&(n=LI.DataSource.Filters.hasOwnProperty(c)?LI.DataSource.Filters[c]:LI.Datasource.Filters.subwordAllMatch,n(decodeURIComponent(a),m))){f&&(m=LI.DataSource.Highlighter.highlight(m,decodeURIComponent(a).split(/\s+/)),YAHOO.lang.isString(e)?e=m:YAHOO.lang.isArray(e)?e[0]=m:this.responseSchema.fields?(n=this.responseSchema.fields[0].key||this.responseSchema.fields[0],e[n]=m):this.key&&(e[this.key]=m));if(g)if(-1<b.indexOf(e.id))continue;else b.push(e.id);
s.push(e)}if(t>p&&s.length===p)break}d.results=s}return d}};LI.define("DataSource.Highlighter");
LI.DataSource.Highlighter={_REGEX:"(^|\\s)(\x26[^;\\s]*)?(%needles)",_TEMPLATE:'\x3cstrong class\x3d"ta-highlight"\x3e{s}\x3c/strong\x3e',_REPLACER:function(a,b,d,c){return d&&!/\s/.test(c)?a:LI.DataSource.Highlighter._TEMPLATE.replace(/\{s\}/g,b+c)},highlight:function(a,b,d){var c=[],f,g,h,k,l;d||(d={});k=LI.DataSource.Highlighter._REGEX;l=d.replacer||LI.DataSource.Highlighter._REPLACER;b=YAHOO.lang.isArray(b)?b:[b];f=0;for(g=b.length;f<g;++f)h=b[f],(h=LI.htmlEncode?LI.htmlEncode(h):h)&&c.push(LI.DataSource.RegexHelper.esc(h));
return c.length?a.replace(RegExp(k.replace("%needles",c.join("|")),d.caseSensitive?"g":"gi"),l):a}};LI.define("DataSource.MultiSourceHelper");
LI.DataSource.MultiSourceHelper={filterAndSortBeforeCallback:function(a,b,d,c){c&&c.argument&&c.argument.query&&(a=c.argument.query);if(a&&""!==a){d=YAHOO.widget.AutoComplete._cloneObject(d);if(c&&c.argument&&c.argument.skipFilterAndSort)return d;a=c.scope;b=d.results;c=[];var f={},g=a.maxResultsPerSource||5,h=null,k={},l=[],p=0,r=0,s=0,e,m,n,q;if("number"===typeof g)h=g;else for(e=0,m=g.length;e<m;e++)k[g[e].sourceID]=g[e].max,l.push(g[e].sourceID);e=0;for(g=b.length;e<g;e++)"category"!==b[e].type&&
("sourceID"in b[e]?(b[e].sourceID in f?f[b[e].sourceID]+=1:(f[b[e].sourceID]=1,c.push({type:"category",displayName:b[e].sourceID,sourceID:b[e].sourceID,rank:b[e].rank||"0"})),f[b[e].sourceID]<=(h?h:k[b[e].sourceID])&&(b[e].type="item",b[e]._index=e,c.push(b[e]))):c.push(b[e]));b=c;l&&0<l.length&&b.sort(function(a,b){n=l.indexOf(a.sourceID);q=l.indexOf(b.sourceID);return-1===n&&-1===q?0:-1===n?1:-1===n?-1:0!==n-q?n-q:"category"!==a.type&&"category"!==b.type?"number"===typeof a._index&&"number"===typeof b._index?
a._index-b._index:0:"category"===a.type?-1:"category"===b.type?1:0});e=0;for(g=b.length;e<g;e++)"category"===b[e].type?(p++,r=0):"item"===b[e].type&&(s++,r++,b[e].categoryIndex=p,b[e].itemIndex=s,b[e].itemInCategoryIndex=r);a.maxResultsDisplayed=Math.max(a.maxResultsDisplayed,b.length);d.results=b}return d},addCategoriesBeforeCallback:function(a,b,d,c){var f=b=0,g=0,h="",k;c&&c.argument&&c.argument.query&&(a=c.argument.query);if(a&&""!==a){d=YAHOO.widget.AutoComplete._cloneObject(d);if(c&&c.argument&&
c.argument.skipFilterAndSort)return d;c=d.results;k=c.length;for(a=0;k--;)"category"!==c[a].type&&(c[a].sourceID===h?(c[a].type="item",c[a]._index=a):(c.splice(a,0,{type:"category",displayName:c[a].sourceID,sourceID:c[a].sourceID,rank:c[a].rank||"0"}),k++),h=c[a].sourceID,a++);a=0;for(k=c.length;a<k;a++)"category"===c[a].type?(b++,f=0):"item"===c[a].type&&(g++,f++,c[a].categoryIndex=b,c[a].itemIndex=g,c[a].itemInCategoryIndex=f);d.results=c}return d},flattenResponseBeforeParseData:function(a,b,d){a=
{};d=[];var c={},f,g,h,k,l;for(f in b)if(b.hasOwnProperty(f))if("meta"===f)c=b[f];else if(k=b[f],k.resultList)for(g=0,h=k.resultList.length;g<h;g++)l=k.resultList[g],l.hasOwnProperty("sourceID")||(l.sourceID=f),d.push(l);a.resultList=d;a.meta=c;return a}};LI.define("DataSource.Helper");
LI.DataSource.Helper={defaultXHRConfig:{responseType:YAHOO.util.DataSourceBase.TYPE_JSON,responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine imageUrl id url".split(" "),metaFields:{}},connXhrMode:"ignoreStaleResponses",maxCacheEntries:100},defaultLocalConfig:{responseType:YAHOO.util.DataSourceBase.TYPE_JSON,responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine imageUrl id url".split(" "),metaFields:{}},maxCacheEntries:100},createXHRDataSource:function(a,
b){return new YAHOO.util.XHRDataSource(a,b)},createLocalDataSource:function(a,b){b.doBeforeCallback=b.doBeforeCallback||LI.DataSource.clientSideFilterFactory();return new YAHOO.util.LocalDataSource(a,b)},createLocalXHRDataSource:function(a,b,d,c){function f(){YEvent.removeListener(a,"focus",f);!0!==k&&(k=!0,YAHOO.util.Connect.asyncRequest("GET",g,{success:function(a){try{l=YJson.parse(a.responseText),h.liveData=l}catch(b){}}}))}d.doBeforeCallback=d.doBeforeCallback||LI.DataSource.clientSideFilterFactory();
c=c||{resultList:[]};var g=b,h=new YAHOO.util.LocalDataSource(c,d),k=!1,l;if(YEvent.DOMReady)f();else YEvent.on(a,"focus",f,this,!0);return h},createFederatorXHRDataSource:function(a,b,d){"string"!==typeof b.scriptQueryAppend&&(b.scriptQueryAppend="types\x3d");b.doBeforeParseData=b.doBeforeParseData||LI.DataSource.MultiSourceHelper.flattenResponseBeforeParseData;b.doBeforeCallback=b.doBeforeCallback||LI.DataSource.MultiSourceHelper.filterAndSortBeforeCallback;b.categoryI18nMap=d||null;return new YAHOO.util.XHRDataSource(a,
b)},createAggregatedDataSource:function(a,b,d){b.doBeforeParseData=b.doBeforeParseData||LI.DataSource.MultiSourceHelper.flattenResponseBeforeParseData;b.doBeforeCallback=b.doBeforeCallback||LI.DataSource.MultiSourceHelper.filterAndSortBeforeCallback;b.categoryI18nMap=d||null;return new LI.DataSourceAggregator2(a,b)}};LI.define("DataSource.Sources");
LI.DataSource.Sources={TYPE_COMPANY:{liveData:"/ta/company",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.COMPANY)?this.liveData:LI.TypeaheadDataSourceUrls.COMPANY;return LI.DataSource.Helper.createXHRDataSource(a,this.config)}},TYPE_INDUSTRY:{liveData:"/ta/industry",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultLocalConfig,{}),create:function(a){var b=
YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.INDUSTRY)?this.liveData:LI.TypeaheadDataSourceUrls.INDUSTRY;return LI.DataSource.Helper.createLocalXHRDataSource(a,b,this.config)}},TYPE_REGION:{liveData:"/ta/region",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.REGION)?this.liveData:LI.TypeaheadDataSourceUrls.REGION;return LI.DataSource.Helper.createXHRDataSource(a,this.config)}},TYPE_GROUP:{liveData:"/ta/group",
config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.GROUP)?this.liveData:LI.TypeaheadDataSourceUrls.GROUP;return LI.DataSource.Helper.createXHRDataSource(a,this.config)}},TYPE_JOB_TITLE:{liveData:"/ta/titleV2",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.JOB_TITLE)?this.liveData:LI.TypeaheadDataSourceUrls.JOB_TITLE;return LI.DataSource.Helper.createXHRDataSource(a,
this.config)}},TYPE_JOB_FUNCTION:{liveData:"/ta/jobfunc",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultLocalConfig,{}),create:function(a){var b=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.JOB_FUNCTION)?this.liveData:LI.TypeaheadDataSourceUrls.JOB_FUNCTION;return LI.DataSource.Helper.createLocalXHRDataSource(a,b,this.config)}},TYPE_SKILL:{liveData:"/ta/skill",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.SKILL)?
this.liveData:LI.TypeaheadDataSourceUrls.SKILL;return LI.DataSource.Helper.createXHRDataSource(a,this.config)}},TYPE_LANGUAGE:{liveData:"/ta/language",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultLocalConfig,{}),create:function(a){var b=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.LANGUAGE)?this.liveData:LI.TypeaheadDataSourceUrls.LANGUAGE;return LI.DataSource.Helper.createLocalXHRDataSource(a,b,this.config)}},TYPE_SCHOOL:{liveData:"/ta/school",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,
{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.SCHOOL)?this.liveData:LI.TypeaheadDataSourceUrls.SCHOOL;return LI.DataSource.Helper.createXHRDataSource(a,this.config)}},TYPE_DEGREE:{liveData:"/ta/degree",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultLocalConfig,{doBeforeCallback:LI.DataSource.clientSideFilterFactory(null,null,!0)}),create:function(a){var b=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.DEGREE)?
this.liveData:LI.TypeaheadDataSourceUrls.DEGREE;return LI.DataSource.Helper.createLocalXHRDataSource(a,b,this.config)}},TYPE_FIELD_OF_STUDY:{liveData:"/ta/fieldofstudy",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FIELD_OF_STUDY)?this.liveData:LI.TypeaheadDataSourceUrls.FIELD_OF_STUDY;return LI.DataSource.Helper.createXHRDataSource(a,this.config)}},TYPE_SCHOOLS_AND_DEGREES_AND_FIELDS_OF_STUDY:{liveData:"/ta/federator",
config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dfieldofstudy,school,degree",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id".split(" ")}}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR)?this.liveData:LI.TypeaheadDataSourceUrls.FEDERATOR;return LI.DataSource.Helper.createFederatorXHRDataSource(a,this.config,{fieldofstudy:LI.i18n.get("typeahead2-search-fields-of-study"),
school:LI.i18n.get("typeahead2-search-schools"),degree:LI.i18n.get("typeahead2-search-degrees")})}},TYPE_MY_NETWORK:{liveData:"/ta/mynetwork",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.MY_NETWORK);return LI.DataSource.Helper.createXHRDataSource(this.liveData,
this.config)}},TYPE_ALL_FIRST_DEGREE_CONNECTIONS:{liveData:"/ta/my1stnetwork",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){a=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FIRST_DEGREE_MY_NETWORK)?this.liveData:LI.TypeaheadDataSourceUrls.FIRST_DEGREE_MY_NETWORK;return LI.DataSource.Helper.createXHRDataSource(a,this.config)}},TYPE_COMPANIES_AND_FIRST_DEGREE_CONNECTIONS:{liveData:"/ta/federator",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,
{scriptQueryAppend:"types\x3dmy1stnetwork,company",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{my1stnetwork:LI.i18n.get("typeahead2-search-connections"),company:LI.i18n.get("typeahead2-search-companies")})}},
TYPE_COMPANIES_AND_FIRST_DEGREE_CONNECTIONS_AND_SCHOOLS:{liveData:"/ta/federator",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dmy1stnetwork,company,school",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,
this.config,{my1stnetwork:LI.i18n.get("typeahead2-search-connections"),company:LI.i18n.get("typeahead2-search-companies"),school:LI.i18n.get("typeahead2-search-schools")})}},TYPE_COMPANIES_AND_NETWORK:{liveData:"/ta/federator",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dmynetwork,company",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||
YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{mynetwork:LI.i18n.get("typeahead2-search-connections"),company:LI.i18n.get("typeahead2-search-companies")})}},TYPE_COMPANIES_AND_NETWORK_AND_SCHOOLS:{liveData:"/ta/federator",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dmynetwork,company,school",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),
create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{mynetwork:LI.i18n.get("typeahead2-search-connections"),company:LI.i18n.get("typeahead2-search-companies"),school:LI.i18n.get("typeahead2-search-school")})}},TYPE_GROUP_MEMBERS_AND_COMPANIES:{liveData:"/ta/federator",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dgroupmembers,company",
responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{groupmembers:LI.i18n.get("typeahead2-search-group-members"),company:LI.i18n.get("typeahead2-search-companies")})}},TYPE_GROUP_MEMBERS:{liveData:"/ta/federator",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,
{scriptQueryAppend:"types\x3dgroupmembers",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{groupmembers:LI.i18n.get("typeahead2-search-group-members")})}},TYPE_GROUP_MEMBERS_AND_NETWORK:{liveData:"/ta/federator",
config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dgroupmembers,my1stnetwork",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{groupmembers:LI.i18n.get("typeahead2-search-group-members"),
my1stnetwork:LI.i18n.get("typeahead2-search-connections")})}},TYPE_DISCUSSION_PARTICIPANTS:{liveData:"/ta/discussionparticipants",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultLocalConfig,{}),create:function(a){var b=YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.DISCUSSION_PARTICIPANTS)?this.liveData:LI.TypeaheadDataSourceUrls.DISCUSSION_PARTICIPANTS;return LI.DataSource.Helper.createLocalXHRDataSource(a,b,this.config)}},TYPE_DISCUSSION_PARTICIPANTS_COMPANIES_FIRST_DEGREE_CONNECTIONS:{liveData:"/ta/federator",
config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3ddiscussionparticipants,my1stnetwork,company",responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{my1stnetwork:LI.i18n.get("typeahead2-search-connections"),
company:LI.i18n.get("typeahead2-search-companies"),discussionparticipants:LI.i18n.get("typeahead2-search-discussion-participants")})}},TYPE_MY_GROUPS:{liveData:"/typeahead/mygroup",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.MY_GROUPS);return LI.DataSource.Helper.createXHRDataSource(this.liveData,this.config)}},TYPE_UNIVERSAL_SEARCH:{liveData:"/ta/federator",
config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dmynetwork,company,group,sitefeature,skill",responseSchema:{resultsList:"resultList",metaFields:{tarId:"meta.tarId"},fields:"headLine displayName subLine url sourceID imageUrl id misc".split(" ")}}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.FEDERATOR);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,
{mynetwork:LI.i18n.get("typeahead2-search-connections"),company:LI.i18n.get("typeahead2-search-companies"),group:LI.i18n.get("typeahead2-search-groups"),sitefeature:LI.i18n.get("typeahead2-search-features"),skill:LI.i18n.get("typeahead2-search-skills")})}},TYPE_CAP_PROSPECTS_PROJECTS_JOBS:{liveData:"/cap/lookup/capTaAjax",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,{scriptQueryAppend:"types\x3dJob,Project,Prospect",responseSchema:{resultsList:"resultList",fields:"displayName id headLine subLine imageUrl sourceID".split(" ")},
maxCacheEntries:10}),create:function(a){YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls)||YAHOO.lang.isUndefined(LI.TypeaheadDataSourceUrls.CAP_PROSPECTS_PROJECTS_JOBS);return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{Prospect:LI.i18n.get("typeahead2-cap-prospects"),Job:LI.i18n.get("typeahead2-cap-jobs"),Project:LI.i18n.get("typeahead2-cap-projects")})}},TYPE_CAP_PROJECTS:{liveData:"/cap/lookup/capTaProjectsAjax",config:YAHOO.lang.merge(LI.DataSource.Helper.defaultXHRConfig,
{scriptQueryAppend:"types\x3dProject",responseSchema:{resultsList:"resultList",fields:"displayName id headLine subLine imageUrl sourceID".split(" ")},maxCacheEntries:10}),create:function(a){return LI.DataSource.Helper.createFederatorXHRDataSource(this.liveData,this.config,{Project:LI.i18n.get("typeahead2-cap-projects")})}}};LI.define("DataSourceAggregator2");LI.DataSourceAggregator2=function(a,b){this.config=b||{};this.sources=a||{};this.results={};this.numSourcesLoading=0;this.onAllDataRequest=new YAHOO.util.CustomEvent("allDataRequest",this);this.onAllDataResponse=new YAHOO.util.CustomEvent("allDataResponse",this);LI.DataSourceAggregator2.superclass.constructor.call(this,null,b)};
YAHOO.lang.extend(LI.DataSourceAggregator2,YAHOO.util.LocalDataSource,{sources:{},results:{},numSourcesLoading:0,formatQuery:function(a,b){var d=a.dataType;d===YAHOO.util.DataSourceBase.TYPE_XHR?b=a.connMethodPost?(a.scriptQueryParam||"query")+"\x3d"+b+(a.scriptQueryAppend?"\x26"+a.scriptQueryAppend:""):"?"+(a.scriptQueryParam||"query")+"\x3d"+b+(a.scriptQueryAppend?"\x26"+a.scriptQueryAppend:""):d===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE&&(b="\x26"+(a.scriptQueryParam||"query")+"\x3d"+b+(a.scriptQueryAppend?
"\x26"+a.scriptQueryAppend:""));return b},sendRequest:function(a,b,d){var h=YAHOO.util.DataSourceBase._nTransactionId++,e,g,f;f=b.scope;this.results={};this.numSourcesLoading=0;for(e in this.sources)this.sources.hasOwnProperty(e)&&(this.numSourcesLoading+=1);this.onAllDataRequest.fire();this.maxResultsDisplayed=f.maxResultsDisplayed;this.maxResultsPerSource=-1;for(g in this.sources)f={success:this.sourceSuccessCallback,failure:this.sourceFailureCallback,scope:this,argument:{sourceID:g,query:a,skipFilterAndSort:!0}},
e=this.sources[g],e.sendRequest(this.formatQuery(e,a),f,d);this.onAllDataResponse.subscribers.length||this.onAllDataResponse.subscribe(function(){var c={};this.results=this.doBeforeParseData(a,this.results,this);c.results=this.results.resultList;c.meta={};c.error=!1;c.error?(c.error=!0,this.fireEvent("dataErrorEvent",{request:a,response:c,callback:b,caller:d,message:YAHOO.util.DataSourceBase.ERROR_DATANULL})):c=this.doBeforeCallback(a,c,c,b);c.tId=h;YAHOO.util.DataSourceBase.issueCallback(b,[a,c],
c.error,d)});return h},sourceSuccessCallback:function(a,b,d){a=d.sourceID;(d=this.config.doWithSourceSuccessCallback||null)&&"function"===typeof d&&(b=d(b,this.results));this.results.hasOwnProperty(a)&&this.results[a].hasOwnProperty("resultList")?this.results[a].resultList=this.results[a].resultList.concat(b.results):this.results[a]={resultList:b.results};this.numSourcesLoading--;0===this.numSourcesLoading&&this.onAllDataResponse.fire()},sourceFailureCallback:function(){this.numSourcesLoading--;0===
this.numSourcesLoading&&this.onAllDataResponse.fire()},flushCache:function(){var a,b;for(b in this.sources)a=this.sources[b],a.flushCache()},destroy:function(){this.flushCache();this.source={};this.results=[];this.numSourcesLoading=0}});LI.define("Typeahead2.RenderHandlerHelpers");
LI.Typeahead2.RenderHandlerHelpers={truncateStrToWidth:function(d,b,a){var e=d,c,f,m,g=-1,g=0,h;a=a||{};c={ellipEntity:a.ellipEntity||"\x26hellip;",textStyles:a.textStyles||{},keepStr:a.keepStr||"",keepStrCaseSensitive:a.keepStrCaseSensitive||!1,keepStrEllipAfter:a.keepStrEllipAfter||!1,tailStr:a.tailStr||"",thresholdLength:a.thresholdLength};c=YAHOO.lang.merge(c,a);c.keepStr&&(c.keepStrRegExp=RegExp(c.keepStr.replace(/[\-#$\^*()+\[\]{}|\\,.?\s]/g,"\\$\x26"),c.keepStrCaseSensitive?"":"i"),c.keepStr=
d.match(c.keepStrRegExp));if(!e)return e;if(c.thresholdLength&&e.length<c.thresholdLength)return e+c.tailStr;a=document.createElement("span");for(f in c.textStyles)c.textStyles.hasOwnProperty(f)&&YDom.setStyle(a,f,c.textStyles[f]);YDom.setStyle(a,"visibility","hidden");YDom.setStyle(a,"display","inline-block");YDom.setStyle(a,"padding","0px");document.body.appendChild(a);a.innerHTML=e;f=[/&#?\w*$/];m=f.length;if(a.clientWidth>b){g=0;for(h=d.length;;){e=g+Math.ceil((h-g)/2);if(e===h||e===g)break;a.innerHTML=
d.substring(0,e)+c.ellipEntity;c.keepStr&&!c.keepStrRegExp.test(a.innerHTML)&&(a.innerHTML+=c.keepStr+(c.keepStrEllipAfter?c.ellipEntity:""));c.tailStr&&(a.innerHTML+=c.tailStr);a.clientWidth>b?h=e:g=e}e=d.substring(0,g).replace(/(\s.)?\s*$/,"");for(d=0;d<m;d++)g=e.search(f[d]),0<g&&(e=e.substring(0,g));e+=c.ellipEntity;c.keepStr&&(c.keepStrRegExp.test(e)||(e+=c.keepStr+(c.keepStrEllipAfter?c.ellipEntity:"")))}c.tailStr&&(e+=c.tailStr);document.body.removeChild(a);return e},formatResultFunctionFactory:function(d){d=
{formatCategoryResult:d.formatCategoryResult||function(b,a,d,c,f){return b+("\x3ch3\x3e\x3cstrong\x3e"+a+"\x3c/strong\x3e\x3c/h3\x3e")},formatItemResult:d.formatItemResult||function(b,a,d,c){b=a.imageUrl&&0<a.imageUrl.length?b+('\x3cimg src\x3d"'+a.imageUrl+'" /\x3e'):a.misc&&a.misc.verticalType?b+('\x3cspan class\x3d"ghost-image '+a.misc.verticalType.toLowerCase()+'"\x3e\x3c/span\x3e'):b+'\x3cspan class\x3d"ghost-image"\x3e\x3c/span\x3e';a.headLine&&0<a.headLine.length&&(b=a.subLine?b+('\x3ch4 class\x3d"item-headline has-subline"\x3e'+
a.headLine+"\x3c/h4\x3e"):b+('\x3ch4 class\x3d"item-headline"\x3e'+a.headLine+"\x3c/h4\x3e"));null!==a.headLine&&a.subLine&&""!==a.subLine&&(b+='\x3cp class\x3d"item-subline"\x3e'+a.subLine+"\x3c/p\x3e");return b}};return function(b,a,e){var c;return b.sourceID&&"category"===b.type?(c=(c=this.dataSource.categoryI18nMap||null)&&c.hasOwnProperty(b.sourceID)?c[b.sourceID]:b.sourceID,d.formatCategoryResult("",c,b,a,e)):d.formatItemResult("",b,a,e)}},doBeforeExpandContainerFunctionFactory:function(d){d=
{showCategory:!1===d.showCategory?!1:!0,includeRank:!0===d.includeRank,truncateConfigs:d.truncateConfigs||null};return function(b,a,e,c){b=[];var f,m=this.getListEl(),g=m.childNodes,h,u,n="",s=0,t=d.showCategory,l,k,p,q,r;h=0;for(u=Math.min(g.length,c.length);h<u;h++){a=g[h];l=c[h];k=l.type;p=l.rank||"0";n=l.sourceID||"";YDom.hasClass(a,this.highlightClassName)&&b.push(this.highlightClassName);YDom.hasClass(a,this.preHighlightClassName)&&b.push(this.preHighlightClassName);d.includeRank&&b.push("rank-"+
p);(0===h||t&&"item"===k&&1===h)&&b.push("top");if(!k)f||b.push("first"),f=a;else if(t&&"category"===k)b.push("category"),b.push(n),YDom.addClass(m,"hasCategory"),s+=1;else if(t&&"item"===k){b.push("item");b.push(n);if(d.truncateConfigs)for(q in d.truncateConfigs)d.truncateConfigs.hasOwnProperty(q)&&(k=YAHOO.lang.merge({},d.truncateConfigs[q]),r=Y$(k.selector,a,!0),k.keepStr="\x3cstrong\x3e"+e+"\x3c/strong\x3e","mynetwork"===l.sourceID&&"headLine"===q&&l.misc&&l.misc.degree&&(k.tailStr='\x3cspan class\x3d"separator"\x3e\x26middot;\x3c/span\x3e\x3cspan class\x3d"typeahead-degree"\x3e'+
l.misc.degree+"\x3c/span\x3e"),r&&(p=r.innerHTML,r.innerHTML=LI.Typeahead2.RenderHandlerHelpers.truncateStrToWidth(p,k.width,k)));if(!f||f&&!YDom.hasClass(f,n))b.push("first"),YDom.addClass(f,"last");0===s%2?b.push("secondary-ta"):b.push("primary-ta");f=a}a.className=b.join(" ");b=[]}f&&(YDom.addClass(f,"last"),YDom.addClass(f,"bottom"),0<m.getElementsByTagName("img").length&&YDom.addClass(m,"hasImage"));return!0}}};LI.define("Typeahead2.RenderHandlers");
LI.Typeahead2.RenderHandlers={DEFAULT:{resultTypeList:!1,applyLocalFilter:!1,animVert:!1,useIFrame:!0,allowBrowserAutocomplete:!0,forceSelection:!1,forceSelectionAndRevert:!1,autoHighlight:!1,typeahead:!0,queryMatchContains:!1,queryMatchSubset:!1,suppressInputUpdate:!0,formatResult:LI.Typeahead2.RenderHandlerHelpers.formatResultFunctionFactory({}),doBeforeExpandContainer:LI.Typeahead2.RenderHandlerHelpers.doBeforeExpandContainerFunctionFactory({})},AUTOCHOOSE:{forceSelection:!1,forceSelectionAndRevert:!1,
autoHighlight:!0},FORCE_SELECTION:{forceSelection:!0,forceSelectionAndRevert:!0,autoHighlight:!0},HEADLINE_ONLY:{formatResult:LI.Typeahead2.RenderHandlerHelpers.formatResultFunctionFactory({formatItemResult:function(d,b,a,e){b.headLine&&0<b.headLine.length&&(d+='\x3ch4 class\x3d"item-headline"\x3e'+b.headLine+"\x3c/h4\x3e");null!==b.headLine&&b.subLine&&""!==b.subLine&&(d+='\x3cp class\x3d"item-subline"\x3e'+b.subLine+"\x3c/p\x3e");return d}})},HIDE_CATEGORIES:{formatResult:LI.Typeahead2.RenderHandlerHelpers.formatResultFunctionFactory({formatCategoryResult:function(d,
b,a,e,c){return""}}),doBeforeExpandContainer:LI.Typeahead2.RenderHandlerHelpers.doBeforeExpandContainerFunctionFactory({showCategory:!1})},UNIVERSAL_SEARCH:{doBeforeExpandContainer:LI.Typeahead2.RenderHandlerHelpers.doBeforeExpandContainerFunctionFactory({truncateConfigs:{headLine:{selector:".item-headline",width:"218",textStyles:{"font-weight":"bold","font-size":"12px"},keepStrCaseSensitive:!1,keepStrEllipAfter:!0},subLine:{selector:".item-subline",textStyles:{"font-weight":"normal","font-size":"11px"},
width:"200"}}})},UNIVERSAL_SEARCH_VOLTRON:{doBeforeExpandContainer:LI.Typeahead2.RenderHandlerHelpers.doBeforeExpandContainerFunctionFactory({truncateConfigs:{headLine:{selector:".item-headline",width:"368",textStyles:{"font-weight":"bold","font-size":"12px"},keepStrCaseSensitive:!1,keepStrEllipAfter:!0,thresholdLength:45}},includeRank:!0})},UNIVERSAL_SEARCH_VOLTRON_INSTANT:{doBeforeExpandContainer:LI.Typeahead2.RenderHandlerHelpers.doBeforeExpandContainerFunctionFactory({truncateConfigs:{headLine:{selector:".item-headline",
width:"368",textStyles:{"font-weight":"bold","font-size":"13px"},keepStrCaseSensitive:!1,keepStrEllipAfter:!0,thresholdLength:45}},includeRank:!0})}};LI.define("Typeahead2.EventHelper");
LI.Typeahead2.EventHelper={constants:{NO_MATCH_ID_VALUE:""},populateInputField:function(d,b,a){var c;a&&(c=a.rawText||a.displayName,null!=c&&(LI.htmlUnencode&&(c=LI.htmlUnencode(c)),d.value=c),b&&(b.value=a.id||LI.Typeahead2.EventHelper.constants.NO_MATCH_ID_VALUE))},handleUnmatchSelect:function(d,b,a){!b||d.value===d.defaultValue&&b.value===b.defaultValue||(b.value=LI.Typeahead2.EventHelper.constants.NO_MATCH_ID_VALUE);a&&""!==YAHOO.lang.trim(d.value)&&(d.value=d.defaultValue,b&&(b.value=b.defaultValue))},
clearInputField:function(d,b){d.value="";b&&(b.value=LI.Typeahead2.EventHelper.constants.NO_MATCH_ID_VALUE)},goToUrl:function(d,b,a){var c="",e,f=[];d.url&&(c=d.url,d=c.split("#"),d[1]&&(c=d[0],e=d[1]),d=c.split("?"),c=d[1]?c+"\x26":c+"?",b&&f.push("trk\x3d"+encodeURIComponent(b)),a&&f.push("trkInfo\x3d"+encodeURIComponent(a)),c+=f.join("\x26"),e&&(c+="#"+e),document.location.href=c)},getNoResults:function(){var d=null,b;return function(){null===d&&(b=document.createElement("div"),b.className="typeahead-noresults",
YEvent.onDOMReady(function(){document.body.appendChild(b)}),d=b);return d}}(),toggleNoResults:function(d,b,a,c,e){if(YDom.get(c))d=YDom.get(c),b?(YDom.addClass(d,"show"),e&&(e.value=LI.Typeahead2.EventHelper.constants.NO_MATCH_ID_VALUE)):e.value!==LI.Typeahead2.EventHelper.constants.NO_MATCH_ID_VALUE&&YDom.removeClass(d,"show");else{e=LI.Typeahead2.EventHelper.getNoResults();a=a||LI.i18n.get("typeahead2-no-matching-results");c=[];var f={};a||(a="No Results");b?(e.innerHTML=a,f=YDom.getRegion(d),c[0]=
f.left,c[1]=f.bottom,YDom.setStyle(e,"display","block"),YDom.setXY(e,c)):YDom.setStyle(e,"display","none")}},getLoadingImg:function(d){var b={},a;return function(c){b.hasOwnProperty(c)||(a=new Image,a.src=c,YDom.addClass(a,"typeahead-loading-icon"),b[c]=a);return b[c]}}(),toggleLoadingImg:function(d,b,a,c){var e,f;c&&c.loaderClass?(f=c.loaderClass,e=Y$("."+f,d.parentNode,!0),e||(a=document.createElement("span"),YDom.addClass(a,f),c.loaderText&&(a.innerHTML=c.loaderText),e=d.parentNode.appendChild(a))):
a&&(a=LI.Typeahead2.EventHelper.getLoadingImg(a),(e=Y$(".typeahead-loading-icon",d.parentNode,!0))||(e=d.parentNode.appendChild(a)));b?YDom.addClass(e,"loading"):YDom.removeClass(e,"loading")}};LI.define("Typeahead2.EventHandlers");
LI.Typeahead2.EventHandlers={DEFAULT:{itemSelectEvent:function(d,b){var a=b[0],c=b[2],e=a.getInputEl(),f=a.hiddenField;"category"!==c.type&&LI.Typeahead2.EventHelper.populateInputField(e,f,c,a.forceSelectionAndRevert)},dataRequestEvent:function(d,b){var a=b[0];LI.Typeahead2.EventHelper.toggleLoadingImg(a.getInputEl(),!0,a.loadingImgSrc,a.loadingImgConfig)},dataReturnEvent:function(d,b){var a=b[0],c=b[1],e=b[2];LI.Typeahead2.EventHelper.toggleLoadingImg(a.getInputEl(),!1,a.loadingImgSrc,a.loadingImgConfig);
a.hiddenField&&0===e.length&&""!==YAHOO.lang.trim(c)?a.hiddenField.value=LI.Typeahead2.EventHelper.constants.NO_MATCH_ID_VALUE:YDom.removeClass(YDom.get(a.noResultsEl),"show")},dataErrorEvent:function(d,b){var a=b[0];LI.Typeahead2.EventHelper.toggleLoadingImg(a.getInputEl(),!1,a.loadingImgSrc,a.loadingImgConfig);a.collapseContainer()},unmatchedItemSelectEvent:function(d,b){LI.Typeahead2.EventHelper.handleUnmatchSelect(this.getInputEl(),this.hiddenField,this.forceSelectionAndRevert)},textboxFocusEvent:function(d,
b){var a=b[0];YAHOO.env.ua.gecko&&LI.i18n&&LI.i18n.isCJK()&&a.enableIntervalDetection()},itemArrowToEvent:function(d,b){var a=b[0],c=b[1],e=a.getListItemData(c),f="undefined"!==typeof a._nRealKeyCode?a._nRealKeyCode:a._nKeyCode,f=40===f||38===f?f:40;if(e&&"category"===e.type)if(a.isContainerOpen())a._moveSelection(f);else if(a._toggleHighlight(c,"from"),c=a.getListItemIndex(c),f=a._elList.childNodes[40===f?c+1:c-1])a._toggleHighlight(f,"to"),a.typeahead&&(a._updateValue(f),a._sCurQuery=f._sResultMatch)}},
USE_NO_RESULTS:{containerExpandEvent:function(d,b){var a=b[0];LI.Typeahead2.EventHelper.toggleNoResults(a.getInputEl(),!1,a.noResultsText,a.noResultsEl,a.hiddenField)},dataReturnEvent:function(d,b){var a=b[0],c=b[1],e=b[2],f=a.getInputEl();LI.Typeahead2.EventHandlers.DEFAULT.dataReturnEvent.apply(a,arguments);0===e.length&&""!==YAHOO.lang.trim(c)&&LI.Typeahead2.EventHelper.toggleNoResults(f,!0,a.noResultsText,a.noResultsEl,a.hiddenField)},dataErrorEvent:function(d,b){var a=b[0];LI.Typeahead2.EventHandlers.DEFAULT.dataErrorEvent.apply(a,
arguments);LI.Typeahead2.EventHelper.toggleNoResults(a.getInputEl(),!0,a.noResultsText,a.noResultsEl,a.hiddenField)},textboxBlurEvent:function(d,b){var a=b[0];LI.Typeahead2.EventHelper.toggleNoResults(a.getInputEl(),!1,a.noResultsText,a.noResultsEl,a.hiddenField)},textboxKeyEvent:function(d,b){var a=b[0];""===this.getInputEl().value&&LI.Typeahead2.EventHelper.toggleNoResults(a.getInputEl(),!1,a.noResultsText,a.noResultsEl,a.hiddenField)}},GO_TO_URL_ON_SELECT:{itemSelectEvent:function(d,b){var a=b[0],
c=b[2],e=null,f=null;a.itemUrlTrackingKey&&("string"===typeof a.itemUrlTrackingKey?e=a.itemUrlTrackingKey:"function"===typeof a.itemUrlTrackingKey&&(e=a.itemUrlTrackingKey(d,b)));a.itemUrlTrackingInfo&&("string"===typeof a.itemUrlTrackingInfo?f=a.itemUrlTrackingInfo:"function"===typeof a.itemUrlTrackingInfo&&(f=a.itemUrlTrackingInfo(d,b)));"category"!==c.type&&LI.Typeahead2.EventHelper.goToUrl(c,e,f)}}};LI.define("Typeahead");
LI.Typeahead=function(b,a){function f(a,f){function c(){YEvent.removeListener(b,"focus",c);!0!==g&&(g=!0,YAHOO.util.Connect.asyncRequest("GET",a,{success:function(a){try{var b=YJson.parse(a.responseText);f.liveData=b}catch(c){}}}))}var g=!1;if(YEvent.DOMReady)c();else YEvent.on(b,"focus",c,this,!0)}b=YDom.get(b);var p=this,c=b,k=LI.Bidi,d="left";k&&(d=k.flip(d));a={hiddenField:a.hiddenField||null,maxResultsPerSource:a.maxResultsPerSource||5,maxResultsDisplayed:a.maxResultsDisplayed||10,sources:a.sources||
[],resultsClass:a.resultsClass||"",resultsID:a.resultsID||null,noResults:!0===a.noResults?!0:!1,noResultsText:a.noResultsText||null,autofill:!1===a.autofill?!1:!0,autofillHiddenInput:!1===a.autofillHiddenInput?!1:!0,autocomplete:a.autocomplete||{},headlineOnly:!0===a.headlineOnly?!0:!1,resultsAlign:a.resultsAlign||d,showCategories:!0===a.showCategories?!0:!1,categoryI18nMap:a.categoryI18nMap||{},offsetAlignX:a.offsetAlignX||0,offsetAlignY:a.offsetAlignY||0,highlightType:a.highlightType||"SO_FAR",
loadingImgSrc:a.loadingImgSrc||"",containerEl:YDom.get(a.containerEl)||document.body,forceSelectionAndRevert:!0===a.forceSelectionAndRevert,lazyInit:a.lazyInit||!1};this.onResultsUpdated=new YAHOO.util.CustomEvent("resultsUpdated");if(!b)throw"You did not pass a proper element to the Typeahead object.";if(0===a.sources.length)throw"You haven't defined any sources for Typeahead";var h=null;a.hiddenField&&(h=YDom.get(a.hiddenField));var m=document.createElement("div");m.className="typeahead-results-container";
YDom.addClass(m,a.resultsClass);a.resultsID&&(m.id=a.resultsID);var r=null;if(a.noResults){k=a.noResultsText||LI.i18n.get("typeahead-null-results");if(!k)throw"No i18n text was defined for the 'No Results' message. Read the Typeaehad YUI docs for the noResults config property for more details.";r=document.createElement("div");r.className="typeahead-noresults";r.innerHTML=k;YEvent.onDOMReady(function(){document.body.appendChild(r)})}0<YAHOO.env.ua.ie?a.containerEl.appendChild(m):a.containerEl.insertBefore(m,
a.containerEl.firstChild);var n=new LI.DataSourceAggregator(a.maxResultsPerSource);n.setHighlightType(a.highlightType);var l,s=!1;if(a.loadingImgSrc){var q=function(){YEvent.removeListener(b,"focus",q);this.createLoadingImg&&!s&&(this.createLoadingImg(),s=!0)};n.onAllDataRequest.subscribe(function(){s&&this.showLoading()},this,!0);n.onAllDataResponse.subscribe(function(){s&&this.hideLoading()},this,!0);YEvent.on(b,"focus",q,this,!0)}var k=a.sources,v=!0,e,t,u,x,w;for(t in k){d=null;e=k[t];e.url&&
(/typeahead/.test(e.url)||/ta/.test(e.url))&&(v=!1);!0===e.local&&e.url?(d=new YAHOO.util.LocalDataSource({resultList:[]}),f(e.url,d)):"object"===typeof e.data?d=new YAHOO.util.LocalDataSource(e.data):"function"===typeof e.functionDataSource?(d=new YAHOO.util.FunctionDataSource(e.functionDataSource),"undefined"!==typeof e.context&&(d.scope=e.context)):e.url&&(d=new YAHOO.util.XHRDataSource(e.url),d.connXhrMode="ignoreStaleResponses",d.responseType=YAHOO.widget.DS_XHR.TYPE_JSON,d.maxCacheEntries=100);
if(e.dataSourceConfig&&"object"===typeof e.dataSourceConfig)for(w in e.dataSourceConfig)d[w]=e.dataSourceConfig[w];u=!1!==e.filterResults;x=!0===e.filterResultsBooleanAnd;e=e.dedupe||null;d&&n.addSource(t,d,u,x,e)}var g;g=a.lazyInit?new LI.LazyInitAutocomplete(c,m,n):new YAHOO.widget.AutoComplete(c,m,n);g.minQueryLength=1;g.animVert=!1;g.useIFrame=!0;g.forceSelection=!1;g.autoHighlight=!1;g.resultTypeList=!1;g.queryMatchSubset=!0;g.suppressInputUpdate=!0;g.applyLocalFilter=!1;g.maxResultsDisplayed=
a.maxResultsDisplayed;for(var y in a.autocomplete)g[y]=a.autocomplete[y];var z=LI&&LI.Bidi&&LI.Bidi.isRtl;g.formatResult=function(b,c,f){c="";f=b.sourceID;var g=v?(LI.htmlEncode(b.headLine)||"").replace("\x26lt;strong\x26gt;","\x3cstrong\x3e").replace("\x26lt;/strong\x26gt;","\x3c/strong\x3e"):b.headLine,e=v?(LI.htmlEncode(b.subLine)||"").replace("\x26lt;strong\x26gt;","\x3cstrong\x3e").replace("\x26lt;/strong\x26gt;","\x3c/strong\x3e"):b.subLine,d;f=b.type?b.type+" "+f:"item "+f;!a.headlineOnly&&
b.imageUrl&&(c+='\x3cimg src\x3d"'+b.imageUrl+'" /\x3e');"poll"===b.sourceID?c+="\x3ch4\x3e\x3cstrong\x3e"+g+"\x3c/strong\x3e\x3c/h4\x3e":"degree"===b.sourceID?(d=g.lastIndexOf("("),0>d&&(d=g.length),c+="\x3ch4\x3e\x3cbdi\x3e"+g.substring(0,d).trim()+"\x3c/bdi\x3e",0<g.length-d&&(c+=' \x3cspan dir\x3d"',b=b.displayName.substring(b.displayName.lastIndexOf("(")),c+=z&&z(b)?"rtl":"ltr",c+='"\x3e'+g.substring(d)+"\x3c/span\x3e"),c+="\x3c/h4\x3e"):c+="\x3ch4\x3e"+g+"\x3c/h4\x3e";!a.headlineOnly&&e&&null!==
g&&(c+='\x3cp class\x3d"item-subline"\x3e'+e+"\x3c/p\x3e");return'\x3cdiv class\x3d"'+f+'"\x3e'+c+"\x3c/div\x3e"};g.doBeforeExpandContainer=function(b,c,f,g){var d=YDom.getRegion(b),e=[],h=!1,l=!1;"right"===a.resultsAlign?(h=YDom.getRegion(c),e[0]=d.right-h.width+a.offsetAlignX):e[0]=d.left+a.offsetAlignX;e[1]=d.bottom+a.offsetAlignY;YDom.setXY(c,e);var k,m,q=Y$("li \x3e div",c);a.showCategories&&(l=0);for(var n=0,s=q.length;n<s;n++)if(d=q[n],e=d.parentNode,e.className=YDom.hasClass(e,"yui-ac-highlight")?
"yui-ac-highlight":"",m=1<d.className.split(" ").length?d.className.split(" ")[0]:d.className,h=1<d.className.split(" ").length?d.className.split(" ")[1]:d.className,(0===n||a.showCategories&&"item"===m&&1===n)&&YDom.addClass(e,"top"),a.showCategories&&"category"===m)YDom.addClass(e,"category"),YDom.addClass(e.parentNode,"hasCategory"),a.categoryI18nMap[h]&&(h=a.categoryI18nMap[h]),e.innerHTML="\x3ch3\x3e\x3cstrong\x3e"+h+"\x3c/strong\x3e\x3c/h3\x3e",l++;else if("item"===m){YDom.addClass(e,"item");
0<d.getElementsByTagName("img").length&&YDom.addClass(e.parentNode,"hasImage");if(!k||k&&!YDom.hasClass(k,h))YDom.addClass(e,"first"),YDom.addClass(k,"last");0===l%2?YDom.addClass(e,"secondary"):YDom.addClass(e,"primary");YDom.addClass(e,h);e.innerHTML=d.innerHTML;k=e}YDom.addClass(k,"last");YDom.addClass(k,"bottom");r&&(r.style.display="none");p.onResultsUpdated.fire(b,c,f,g);return!0};g.itemSelectEvent.subscribe(function(b,e){var d=e[2];h&&a.autofillHiddenInput&&(h.value=d.id||0);a.autofill&&d&&
(d.displayName||d.headLine)&&(c.value=LI.htmlUnencode?LI.htmlUnencode(d.displayName)||LI.htmlUnencode(d.headLine):d.displayName||d.headLine)});g.unmatchedItemSelectEvent.subscribe(function(b,d){!h||c.value===c.defaultValue&&h.value===h.defaultValue||(h.value=0);a.forceSelectionAndRevert&&""!==YAHOO.lang.trim(c.value)&&(c.value=c.defaultValue,h&&(h.value=h.defaultValue))});g.dataErrorEvent.subscribe(function(a,b,d){if(g.dataSource&&g.dataSource.results)for(var e in g.dataSource.results)if(g.dataSource.results[e]&&
0<g.dataSource.results[e].length)return;g.collapseContainer();r&&(r.style.display="block",a=[],b=YDom.getRegion(c),a[0]=b.left,a[1]=b.bottom,YDom.setXY(r,a))});g.textboxBlurEvent.subscribe(function(){r&&(r.style.display="none")});g.textboxFocusEvent.subscribe(function(){YAHOO.env.ua.gecko&&LI.i18n&&LI.i18n.isCJK()&&g.enableIntervalDetection()});if(r)YEvent.on(c,"keyup",function(){""===this.value&&(r.style.display="none")});this.autocomplete=g;this.destroy=function(){this.autocomplete&&this.autocomplete.destroy();
this.autocomplete=null;n&&n.destroy();n=null;l&&b.parentNode.removeChild(l);l=null;m&&m.parentNode&&m.parentNode.removeChild(m)};this.showLoading=function(){YDom.addClass(l,"loading")};this.hideLoading=function(){YDom.removeClass(l,"loading")};this.createLoadingImg=function(){l&&b.parentNode.removeChild(l);l=new Image;l.src=a.loadingImgSrc;YDom.addClass(l,"typeahead-loading-icon");b.parentNode.appendChild(l)};this.resetLoadingImg=function(){l&&(l.src=l.src)}};LI.define("DataSourceAggregator");
LI.DataSourceAggregator=function(b,a){this.sources={};this.numSources=0;this.results={};this.numSourcesLoading=this.numResults=0;b&&(this.maxResultsPerSource=b);a&&this.setResponseSchema(a);this.onAllDataRequest=new YAHOO.util.CustomEvent("allDataRequest");this.onAllDataResponse=new YAHOO.util.CustomEvent("allDataResponse");LI.DataSourceAggregator.superclass.constructor.call(this,null,null)};
YAHOO.lang.extend(LI.DataSourceAggregator,YAHOO.util.DataSourceBase,{sources:{},numSources:0,results:{},responseSchema:{resultsList:"resultList",fields:"headLine displayName subLine imageUrl id url sourceID".split(" ")},numResults:0,maxResultsPerSource:-1,numSourcesLoading:0,highlightType:"SO_FAR",setHighlightType:function(b){this.highlightType=b},formatQuery:function(b,a){var f=b.dataType;f===YAHOO.util.DataSourceBase.TYPE_XHR?a=b.connMethodPost?(b.scriptQueryParam||"query")+"\x3d"+a+(b.scriptQueryAppend?
"\x26"+b.scriptQueryAppend:""):"?"+(b.scriptQueryParam||"query")+"\x3d"+a+(b.scriptQueryAppend?"\x26"+b.scriptQueryAppend:""):f===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE&&(a="\x26"+(b.scriptQueryParam||"query")+"\x3d"+a+(b.scriptQueryAppend?"\x26"+b.scriptQueryAppend:""));return a},setResponseSchema:function(b){b.fields.push("sourceID");this.responseSchema=b},addSource:function(b,a,f,p,c){var k=0,d=a.liveData;a.dataType===YAHOO.util.DataSourceBase.TYPE_XHR&&0<=(k=d.indexOf("?"))&&(a.scriptQueryAppend=
d.substring(k+1),a.liveData=d.substring(0,k));a.LIFilterResults=!1!==f;a.LIFilterResultsBooleanAnd=!0===p;a.dedupe=c||!1;this.numSources++;this.sources[b]=a},sendRequest:function(b,a,f){var p=YAHOO.util.DataSourceBase._nTransactionId++;this.results={};this.numResults=0;this.numSourcesLoading=this.numSources;this.onAllDataRequest.fire();var c,k,d;for(k in this.sources){d={success:this.successCallback,failure:this.failureCallback,scope:this,argument:{id:k,callback:a,caller:f,tid:p}};c=this.sources[k];
if(!c.customResponseSchema&&!this.responseSchema)throw"You must set a master responseSchema on the DataSourceAggregator.";c.responseSchema=c.customResponseSchema||this.responseSchema;c.sendRequest(this.formatQuery(c,b),d,f)}return p},getRows:function(b){var a=[];this.numResults=0;if("string"===typeof b)if(a=this.results[b])a.length>this.maxResultsPerSource&&(a=a.slice(0,this.maxResultsPerSource));else return[];else{var f,p;for(f in this.sources)if(p=this.results[f])for(var c=0,k=p.length;c<k;c++)b=
p[c],b.sourceID||(b.sourceID=f),a[a.length]=b}this.numResults=a.length;return a},getSize:function(b){return"string"===typeof b?(b=this.results[b])?b.length:0:this.numResults},_cloneObject:function(b){if(!YAHOO.lang.isValue(b))return b;var a={};if("[object RegExp]"===Object.prototype.toString.apply(b))a=b;else if(YAHOO.lang.isFunction(b))a=b;else if(YAHOO.lang.isArray(b))for(var a=[],f=0,p=b.length;f<p;f++)a[f]=this._cloneObject(b[f]);else if(YAHOO.lang.isObject(b))for(f in b)YAHOO.lang.hasOwnProperty(b,
f)&&(YAHOO.lang.isValue(b[f])&&YAHOO.lang.isObject(b[f])||YAHOO.lang.isArray(b[f])?a[f]=this._cloneObject(b[f]):a[f]=b[f]);else a=b;return a},successCallback:function(b,a,f){var p=f.id,c=this.sources[p],k=f.callback,d=[];a=this._cloneObject(a);var h=null,m=null,r=null,n=/[.*+?|()\[\]{}\\]/g;this.numSourcesLoading--;0===this.numSourcesLoading&&this.onAllDataResponse.fire();if(""!==YAHOO.lang.trim(decodeURIComponent(b))){if(c.dataType===YAHOO.util.DataSourceBase.TYPE_LOCAL&&!0===c.LIFilterResults){if(c.customFilterResults)d=
c.customFilterResults(b,a,f);else if(this.responseSchema.fields){var l,s,q,v,e,t=this.responseSchema.fields[0].key||this.responseSchema.fields[0],u=a.results,x=/___LiHiB___/g,w=/___LiHiE___/g;if(!0===c.dedupe){h=[];m=[];r=u.length;for(q=0;q<r;q++)0>h.indexOf(u[q].id)&&(m.push(u[q]),h.push(u[q].id));u=m}b=YAHOO.lang.trim(decodeURIComponent(b));b=b.replace(n,"\\$\x26");if(0<b.length){q=b.split(/\s+/);var m=q.length,r=RegExp("(?:^|\\b)("+q.reverse().join("|")+")","i"),n=RegExp("(?:^|\\b)("+q.reverse().join("|")+
")","ig"),g=[];if(c.LIFilterResultsBooleanAnd)for(h=0;h<m;h++)g.push(RegExp("(?:^|\\b)"+q[h],"i"));q=0;for(v=u.length;q<v;q++)if(s=u[q],l=LI.htmlUnencode(s[t]),r.test(l)){if(c.LIFilterResultsBooleanAnd&&1<g.length){for(h=e=0;h<m;h++)g[h].test(l)&&(e+=1);if(e<m)continue}switch(this.highlightType){case "SO_FAR":s[t]=l.replace(n,"___LiHiB___$1___LiHiE___");break;case "REST":s[t]="___LiHiB___"+l.replace(n,"___LiHiE___$1___LiHiB___")+"___LiHiE___";break;case "REMAINING":s[t]=l.replace(n,"$1___LiHiB___")+
"___LiHiE___";break;default:s[t]=l.replace(n,"___LiHiB___$1___LiHiE___")}s[t]=LI.htmlEncode(s[t]);s[t]=s[t].replace(x,"\x3cstrong\x3e").replace(w,"\x3c/strong\x3e");d[d.length]=s}}}a.results=d}this.results[p]=a.results;0===this.numSourcesLoading&&k&&(a.results=this.getRows(),p=0===this.getSize(),a.error=p,YAHOO.util.DataSourceBase.issueCallback(k,[b,a],p,f.caller))}},failureCallback:function(b,a,f){var p=f.callback;a=this._cloneObject(a);this.numSourcesLoading--;if(0===this.numSourcesLoading&&p){this.onAllDataResponse.fire();
a.results=this.getRows();var c=0===this.getSize();a.error=c;YAHOO.util.DataSourceBase.issueCallback(p,[b,a],c,f.caller)}},flushCache:function(){var b,a;for(a in this.sources)b=this.sources[a],b.flushCache()},destroy:function(){this.flushCache();this.source={};this.numSources=0;this.results={};this.numSourcesLoading=this.numResults=0}});LI.define("Typeahead2");
LI.Typeahead2=function(s,a){function v(){c=new YAHOO.widget.AutoComplete(w,g,r,{maxResultsDisplayed:a.maxResultsDisplayed,actionsEnabled:a.actionsEnabled});c._onTextboxFocus(null,c);for(var k=c,b=[{name:"hiddenField",value:a.hiddenField},{name:"maxResultsPerSource",value:a.maxResultsPerSource},{name:"loadingImgSrc",value:a.loadingImgSrc},{name:"loadingImgConfig",value:a.loadingImgConfig},{name:"noResultsText",value:a.noResultsText},{name:"noResultsEl",value:a.noResultsEl},{name:"itemUrlTrackingKey",
value:a.itemUrlTrackingKey},{name:"itemUrlTrackingInfo",value:a.itemUrlTrackingInfo}],f=0,l=b.length;f<l;f++)k[b[f].name]||(k[b[f].name]=b[f].value);var k=c,b=a.renderAs,f={},m,d,n={},h,p=LI.Typeahead2.RenderHandlers;if(YAHOO.util.Lang.isObject(p))for(l=0,d=b.length;l<d;l++)"string"===typeof b[l]?(h=b[l],p.hasOwnProperty(h)&&(n=p[b[l]])):"object"===typeof b[l]&&(n=b[l]),f=YAHOO.lang.merge(f,n);for(m in f)f.hasOwnProperty(m)&&(k[m]=f[m]);m=c;var k=a.handleEventAs,b={},t;d={};h=LI.Typeahead2.EventHandlers;
if(YAHOO.util.Lang.isObject(h))for(f=0,l=k.length;f<l;f++)"string"===typeof k[f]?(n=k[f],h.hasOwnProperty(n)&&(d=h[k[f]])):"object"===typeof k[f]&&(d=k[f]),b=YAHOO.lang.merge(b,d);e.onItemSelect&&m.itemSelectEvent.subscribe(e.onItemSelect,e,!0);e.onUnmatchedItemSelect&&m.unmatchedItemSelectEvent.subscribe(e.onUnmatchedItemSelect,e,!0);e.onDataReturn&&m.dataReturnEvent.subscribe(e.onDataReturn,e,!0);e.onItemArrowTo&&m.itemArrowToEvent.subscribe(e.onItemArrowTo,e,!0);e.onItemArrowFrom&&m.itemArrowFromEvent.subscribe(e.onItemArrowFrom,
e,!0);for(t in b)b.hasOwnProperty(t)&&m[t].subscribe(b[t])}function B(){LI.Typeahead2.RenderHandlers.UNIVERSAL_SEARCH_WITH_ACTIONS={doBeforeExpandContainer:LI.Typeahead2.RenderHandlerHelpers.doBeforeExpandContainerFunctionFactory({truncateConfigs:{headLine:{selector:".item-headline",width:"368",textStyles:{"font-weight":"bold","font-size":"13px"},keepStrCaseSensitive:!1,keepStrEllipAfter:!0,thresholdLength:45}},includeRank:!0}),formatResult:LI.Typeahead2.RenderHandlerHelpers.formatResultFunctionFactory({formatItemResult:function(a,
b,c,d){c={message:"message",connect:"connect",inmail:"send-inmail",post:"follow",view:"view"};a=b.misc&&b.misc.actionUrl?a+('\x3ca href\x3d"'+b.url+'" class\x3d"entity has-action"/\x3e'):a+('\x3ca href\x3d"'+b.url+'" class\x3d"entity"/\x3e');a=b.imageUrl&&0<b.imageUrl.length?a+('\x3cimg src\x3d"'+b.imageUrl+'" alt\x3d""\x3e'):b.misc&&b.misc.verticalType?a+('\x3cspan class\x3d"ghost-image '+b.misc.verticalType.toLowerCase()+'"\x3e\x3c/span\x3e'):a+'\x3cspan class\x3d"ghost-image"\x3e\x3c/span\x3e';
b.headLine&&0<b.headLine.length&&(a=b.subLine?a+('\x3cspan class\x3d"item-headline has-subline"\x3e'+b.headLine+"\x3c/span\x3e"):a+('\x3cspan class\x3d"item-headline"\x3e'+b.headLine+"\x3c/span\x3e"));null!==b.headLine&&b.subLine&&""!==b.subLine&&(a+='\x3cspan class\x3d"item-subline"\x3e'+b.subLine+"\x3c/span\x3e");a+="\x3c/a\x3e";b.misc&&b.misc.actionUrl&&(a+='\x3ca class\x3d"typeahead-action" href\x3d"'+b.misc.actionUrl+'"\x3e'+LI.i18n.get("typeahead2-"+c[b.misc.actionType])+"\x3c/a\x3e");return a}})}}
function x(){a.actionsEnabled&&LI.Typeahead2Navigator&&(q=new LI.Typeahead2Navigator("main-search-box","universal-typeahead-results"),q.bindEvents())}function C(a){var b,f={},d=0,e=0,g=0;b=0;var n,h,p="";a&&(c&&c.containerExpandEvent&&c.containerExpandEvent.subscribe(function(a,c){WebTracking.trackUserAction("tyahPerf-paint",{responseToPaint:+new Date-b},!0);b=0}),a.subscribe("requestEvent",function(a){n=a.tId;h="k"+n;d++;a=f[h]||{};a.timeStart=+new Date;f[h]=a}),a.subscribe("responseEvent",function(a){n=
a.tId;h="k"+n;if(a=f[h])e++,a.responseTime=+new Date-a.timeStart,b=+new Date,g+=a.responseTime,3<=d&&(p=d+","+e+",",p+=Math.floor(1*g/e).toString(),WebTracking&&WebTracking.trackUserAction("tyahPerf",p),f={},e=g=d=0,p="")}),a.subscribe("cacheResponseEvent",function(){b=+new Date}))}function y(){YAHOO.lang.isUndefined(e.source)||a.source===e.source||(a.source=e.source);if(a.source)r=LI.DataSource.Factory.createSource(w,a.source);else throw"You haven't defined a source for Typeahead";if(!r)throw"The data source is invalid";
}function z(){A||(a.hiddenField&&(a.hiddenField=YDom.get(a.hiddenField)),y(),g=document.createElement("div"),g.className=D.TYPEAHEAD_RESULTS_CONTAINER,a.resultsClass&&YDom.addClass(g,a.resultsClass),a.resultsID&&(g.id=a.resultsID),0<YAHOO.env.ua.ie?a.containerEl.appendChild(g):a.containerEl.insertBefore(g,a.containerEl.firstChild),a.actionsEnabled&&B(),v(),x(),a.trackTARequest&&C(r))}function E(){var a=LI.Typeahead2Dependencies.scripts,b=a.length,c=b,d,e,g;if(!LI.Typeahead2.lazyLoad.fetchingDependencies)for(e=
function(){c--;0===c&&LI.Typeahead2.lazyLoad.onDependenciesLoaded.fire()},g=function(){LI.Typeahead2.lazyLoad.fetchingDependencies=!1;throw"Failed fetching dependencies.";},b&&(LI.Typeahead2.lazyLoad.fetchingDependencies=!0),d=0;d<b;d++)YAHOO.util.Get.script(a[d],{onSuccess:e,onFailure:g})}function u(){YEvent.removeListener(s,"focus",u);YAHOO.util.Lang.isObject(LI.DataSource)&&YAHOO.util.Lang.isObject(LI.Typeahead2.RenderHandlers)?z():E();LI.Typeahead2.lazyLoad.onDependenciesLoaded.subscribe(z,e,
!0)}var r=null,c,q,A,w=s,g=null,D={TYPEAHEAD_RESULTS_CONTAINER:"typeahead-results-container"},e=this,d;a={queryAppend:a.queryAppend||null,source:a.source||null,hiddenField:a.hiddenField||null,containerEl:YDom.get(a.containerEl)||document.body,maxResultsDisplayed:a.maxResultsDisplayed||10,maxResultsPerSource:a.maxResultsPerSource||5,actionsEnabled:a.actionsEnabled||!1,resultsClass:a.resultsClass||"",resultsID:a.resultsID||null,renderAs:a.renderAs||["DEFAULT"],handleEventAs:a.handleEventAs||["DEFAULT"],
itemUrlTrackingKey:a.itemUrlTrackingKey||null,itemUrlTrackingInfo:a.itemUrlTrackingInfo||null,itemSelectEventHandler:a.itemSelectEventHandler||null,unmatchedItemSelectEventHandler:a.unmatchedItemSelectEventHandler||null,loadingImgSrc:a.loadingImgSrc||null,loadingImgConfig:{loaderClass:(a.loadingImgConfig?a.loadingImgConfig.loaderClass:null)||null,loaderText:(a.loadingImgConfig?a.loadingImgConfig.loaderText:null)||null},noResultsText:a.noResultsText||null,noResultsEl:a.noResultsEl||null,onDataReturn:a.onDataReturn||
null,onItemArrowTo:a.onItemArrowTo||null,onItemArrowFrom:a.onItemArrowFrom||null,trackTARequest:a.trackTARequest||null};YEvent.on(s,"focus",u);(d=a.itemSelectEventHandler)&&"function"===typeof d&&(this.onItemSelect=d);(d=a.unmatchedItemSelectEventHandler)&&"function"===typeof d&&(this.onUnmatchedItemSelect=d);(d=a.onDataReturn)&&"function"===typeof d&&(this.onDataReturn=d);(d=a.onItemArrowTo)&&"function"===typeof d&&(this.onItemArrowTo=d);(d=a.onItemArrowFrom)&&"function"===typeof d&&(this.onItemArrowFrom=
d);this.sendQuery=function(a){c.sendQuery.call(c,a)};this.expandContainer=function(){c.expandContainer.call(c)};this.isContainerOpen=function(){return c.isContainerOpen.call(c)};this.isFocused=function(){return c.isFocused.call(c)};this.collapseContainer=function(){c&&c.collapseContainer&&c.collapseContainer.call(c)};this.flushCache=function(){r&&r.flushCache()};this.setMaxResultsPerSource=function(d){a.maxResultsPerSource=d;c&&(c.maxResultsPerSource=a.maxResultsPerSource);this.flushCache()};this.setSource=
function(a){this.source=a;c&&(y(),c.destroy.call(c),c=null,q&&(q.unbindEvents(),q=null),v(),x())};this.destroy=function(){YEvent.removeListener(s,"focus",u);c&&(c.destroy.call(c),a.containerEl.removeChild(g));q&&q.unbindEvents();A=!0};this.init=u;this.proxyKeyDown=function(a){c._onTextboxKeyDown(a,c)}};LI.Typeahead2.lazyLoad={fetchingDependencies:!1,onDependenciesLoaded:new YAHOO.util.CustomEvent("TA2DependenciesLoaded")};
LI.Typeahead2.prototype={onItemSelect:function(){},onUnmatchedItemSelect:function(){},onDataReturn:function(){},onItemArrowTo:function(){},onItemArrowFrom:function(){}};(function(){function c(b,a){return b.exists(a.get(["categoryName"],!1),a,{block:d},null).write("\x3cspan").exists(a.getPath(!1,["misc","actionType"]),a,{block:e},null).write('\x3e\x3ca id\x3d"').exists(a.get(["sourceID"],!1),a,{block:f},null).write("item-").reference(a.get(["id"],!1),a,"h").write('" role\x3d"button" href\x3d"').reference(a.get(["url"],!1),a,"h").write('" class\x3d"').reference(a.get(["type"],!1),a,"h").exists(a.get(["sourceID"],!1),a,{block:g},null).exists(a.getPath(!1,["misc","actionType"]),
a,{block:h},null).write('" aria-label\x3d"').reference(a.get(["displayName"],!1),a,"h",["et","s"]).write('" title\x3d"').reference(a.get(["displayName"],!1),a,"h",["et","s"]).write('"\x3e').exists(a.get(["imageUrl"],!1),a,{"else":k,block:l},null).write('\x3cspan class\x3d"item-headline').notexists(a.get(["subLine"],!1),a,{block:m},null).write('"\x3e').reference(a.get(["headLine"],!1),a,"h",["mk","s"]).exists(a.getPath(!1,["misc","degree"]),a,{block:n},null).write('\x3c/span\x3e\x3cspan class\x3d"item-subline"\x3e').reference(a.get(["subLine"],
!1),a,"h",["et","s"]).write("\x3c/span\x3e\x3c/a\x3e").exists(a.getPath(!1,["misc","actionType"]),a,{block:p},null).write("\x3c/span\x3e")}function d(b,a){return b.write('\x3cdiv class\x3d"category').exists(a.get(["sourceID"],!1),a,{block:q},null).write('"\x3e\x3ch3\x3e\x3cstrong\x3e').reference(a.get(["categoryName"],!1),a,"h").write("\x3c/strong\x3e\x3c/h3\x3e\x3c/div\x3e")}function q(b,a){return b.write(" ").reference(a.get(["sourceID"],!1),a,"h")}function e(b,a){return b.write(' role\x3d"toolbar" aria-labelledby\x3d"').exists(a.get(["sourceID"],
!1),a,{block:r},null).write("item-").reference(a.get(["id"],!1),a,"h").write(" ").exists(a.get(["sourceID"],!1),a,{block:s},null).write("action-").reference(a.get(["id"],!1),a,"h").write('" ')}function r(b,a){return b.reference(a.get(["sourceID"],!1),a,"h").write("-")}function s(b,a){return b.reference(a.get(["sourceID"],!1),a,"h").write("-")}function f(b,a){return b.reference(a.get(["sourceID"],!1),a,"h").write("-")}function g(b,a){return b.write(" ").reference(a.get(["sourceID"],!1),a,"h")}function h(b,
a){return b.write(" has-action")}function k(b,a){return b.write('\x3cspan class\x3d"ghost-image').exists(a.get(["suggestionType"],!1),a,{block:t},null).write('"\x3e\x3c/span\x3e')}function t(b,a){return b.write(" ").reference(a.get(["suggestionType"],!1),a,"h")}function l(b,a){return b.write('\x3cimg src\x3d"').reference(a.get(["imageUrl"],!1),a,"h").write('" alt\x3d"').reference(a.get(["displayName"],!1),a,"h",["et","s"]).write('"/\x3e')}function m(b,a){return b.write(" no-subline")}function n(b,
a){return b.write('\x3cspan class\x3d"separator"\x3e\x26middot;\x3c/span\x3e\x3cspan class\x3d"typeahead-degree"\x3e').reference(a.getPath(!1,["misc","degree"]),a,"h",["mk","s"]).write("\x3c/span\x3e")}function p(b,a){return b.write('\x3ca id\x3d"').exists(a.get(["sourceID"],!1),a,{block:u},null).write("action-").reference(a.get(["id"],!1),a,"h").write('" role\x3d"button" class\x3d"typeahead-action" href\x3d"').reference(a.getPath(!1,["misc","actionUrl"]),a,"h").write('" aria-label\x3d"').reference(a.getPath(!1,
["misc","actionDisplayName"]),a,"h").write(" ").reference(a.get(["displayName"],!1),a,"h",["et","s"]).write('"\x3e').reference(a.getPath(!1,["misc","actionDisplayName"]),a,"h").write("\x3c/a\x3e")}function u(b,a){return b.reference(a.get(["sourceID"],!1),a,"h").write("-")}dust.register("tl/shared/typeahead/complexTypeahead",c);return c})();(function(){dust.register("complexTypeahead",dust.cache["tl/shared/typeahead/complexTypeahead"])})();(function(){function b(b,a){return b.write('\x3cdiv class\x3d"search-history-footer"\x3e\x3cbutton type\x3d"button" class\x3d"clear-history"\x3e').reference(a.getPath(!1,["i18n","clearLabel"]),a,"h").write("\x3c/button\x3e\x3cspan\x3e").reference(a.getPath(!1,["i18n","clearDescription"]),a,"h").write('\x3c/span\x3e\x3ca class\x3d"search-history-help" href\x3d"').reference(a.getPath(!1,["urls","helpCenterUrl"]),a,"h").write('"\x3e\x3cspan\x3e').reference(a.getPath(!1,["i18n","clearHelp"]),a,"h").write("\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e")}
dust.register("tl/shared/typeahead/searchHistoryFooter",b);return b})();(function(){dust.register("searchHistoryFooter",dust.cache["tl/shared/typeahead/searchHistoryFooter"])})();define("jquery",[],function(){return jQuery});
define("UniversalSearchGhostLabel",["jquery"],function(b){var h=["ghostText"],c=!!("placeholder"in document.createElement("input")),a=function(){};a.prototype.init=function(a){this._elId=a;this._cacheDOMElements();this._attachEventListeners()};a.prototype._cacheDOMElements=function(){this._$el=b("#"+this._elId);this._$form=this._$el.parents("form")};a.prototype._attachEventListeners=function(){c||(this._$form.on("submit",b.proxy(this._clearVal,this)),this._$el.on("focus",b.proxy(this._clearVal,this)),
this._$el.on("blur",b.proxy(this._setValToPlaceholder,this)))};a.prototype._validateData=function(a,f){var b="",c=[],e,d,g;d=0;for(g=f.length;d<g;d++)e=f[d],a.hasOwnProperty(e)||c.push(e);c.length&&(b+="The keys {"+c.join(",")+"} are missing in the vertical dataset.");return b};a.prototype._setGhostLabel=function(a){this._clearVal();this._$el.attr("placeholder",a);this._setValToPlaceholder()};a.prototype._clearVal=c?function(){}:function(){this._$el.hasClass("ghost-label-active")&&(this._$el.removeClass("ghost-label-active"),
this._$el.val(""))};a.prototype._setValToPlaceholder=c?function(){}:function(){""===this._$el.val()&&(this._$el.addClass("ghost-label-active"),this._$el.val(this._$el.attr("placeholder")))};a.prototype.onNewVerticalData=function(a){var b=this._validateData(a,h);if(b)throw Error(b);this._setGhostLabel(a.ghostText)};return new a});define("jquery",[],function(){return jQuery});
define("UniversalSearchForm",["jquery"],function(h){var k=["formAction","formMethod","advancedLinkHref","advancedLinkVisible"],a=function(){};a.prototype.init=function(a){this._elId=a;this._cacheDOMElements();this._attachEventListeners()};a.prototype._cacheDOMElements=function(){this._$el=h("#"+this._elId);this._$mainTextBoxEl=this._$el.find("#main-search-box");this._$advancedLinkEl=this._$el.find("#advanced-search")};a.prototype._attachEventListeners=function(){LI.Events.on("focusInputEvent",this.focus,
this)};a.prototype._validateData=function(a,b){var d="",e=[],f,c,g;c=0;for(g=b.length;c<g;c++)f=b[c],a.hasOwnProperty(f)||e.push(f);e.length&&(d+="The keys {"+e.join(",")+"} are missing in the vertical dataset.");return d};a.prototype._showAdvancedLink=function(){this._$el.removeClass("basic-search")};a.prototype._hideAdvancedLink=function(){this._$el.addClass("basic-search")};a.prototype.focus=function(){this._$mainTextBoxEl.focus()};a.prototype.onNewVerticalData=function(a){var b=this._validateData(a,
k);if(b)throw Error(b);this._$el.attr("method",a.formMethod);this._$el.attr("action",a.formAction);a.advancedLinkVisible?(this._$advancedLinkEl.attr("href",a.advancedLinkHref),this._showAdvancedLink()):this._hideAdvancedLink()};return new a});define("jquery",[],function(){return jQuery});define("WebTracking",[],function(){return WebTracking});
define("UniversalSearchTracking",["jquery","WebTracking"],function(h,b){var k=["trkCode"],a=function(){};a.prototype.init=function(a){this._elId=a;this._cacheDOMElements();this._attachEventListeners();this.webTracking=b};a.prototype._cacheDOMElements=function(){this._$el=h("#"+this._elId)};a.prototype._attachEventListeners=function(){this._$el.off("focus",this._trackNewSearch);this._$el.one("focus",this._trackNewSearch)};a.prototype._trackNewSearch=function(){b.trackUserAction("glhd-srch-init")};
a.prototype._validateData=function(a,f){var b="",d=[],e,c,g;c=0;for(g=f.length;c<g;c++)e=f[c],a.hasOwnProperty(e)||d.push(e);d.length&&(b+="The keys {"+d.join(",")+"} are missing in the vertical dataset.");return b};a.prototype._trackVerticalChange=function(a){b.trackUserAction(a)};a.prototype.onNewVerticalData=function(a){var b=this._validateData(a,k);if(b)throw Error(b);this._trackVerticalChange(a.trkCode);this._attachEventListeners()};return new a});define("jquery",[],function(){return jQuery});
define("TypeaheadNavigator",["jquery"],function(b){var a=function(){};a.prototype.init=function(c,a){null!=a&&"object"===typeof a&&"splice"in a&&"join"in a||(a=[a]);a=a.map(function(a){return".tt-dataset-"+a});this._$dropdown=b(a.join(","));this._$el=b("#"+c);this._currentSelectionType="item";this._$currentSuggestion=b();this._$currentSelection=b();this._dropdownMutationObserver="undefined"!==typeof MutationObserver?new MutationObserver(this._scrollContainer.bind(this)):null};a.prototype.bindKeyEvents=
function(){this._$el.on("keydown",b.proxy(this.onKeyDown,this));if(this._dropdownMutationObserver)this._dropdownMutationObserver.observe(this._$dropdown[0],{childList:!0});else this._$dropdown.on("DOMSubtreeModified",this._scrollContainer.bind(this))};a.prototype.bindMouseEvents=function(){this._$dropdown.on("mouseenter",".item",b.proxy(this.onMouseEnter,this)).on("mouseleave",".item",b.proxy(this.resetSelected,this)).on("mouseenter",".typeahead-action",b.proxy(this.onMouseEnter,this)).on("mouseleave",
".typeahead-action",b.proxy(this.resetSelected,this))};a.prototype.unbindEvents=function(){this._$el.off("keydown",b.proxy(this.onKeyDown,this));this._$dropdown.off("mouseenter",".item",b.proxy(this.onMouseEnter,this)).off("mouseleave",".item",b.proxy(this.resetSelected,this)).off("mouseenter",".typeahead-action",b.proxy(this.onMouseEnter,this)).off("mouseleave",".typeahead-action",b.proxy(this.resetSelected,this));this._dropdownMutationObserver?this._dropdownMutationObserver.disconnect():this._$dropdown.off("DOMSubtreeModified",
b.proxy(this._scrollContainer,this))};a.prototype.resetSelected=function(){this._$dropdown.find(".item.selected").removeClass("selected");this._$dropdown.find(".typeahead-action.selected").removeClass("selected")};a.prototype.onMouseEnter=function(a){a=b(a.currentTarget);this.resetSelected();a.addClass("selected");this._currentSelectionType=!0===a.hasClass("typeahead-action")?"typeahead-action":"item"};a.prototype._toggleColumn=function(){this._$currentSuggestion.find(".item").hasClass("has-action")&&
(this._currentSelectionType="item"===this._currentSelectionType?"typeahead-action":"item")};a.prototype._getCurrentSelection=function(){var a=this._$currentSuggestion.find("."+this._currentSelectionType);a.length||(this._currentSelectionType="item",a=this._$currentSuggestion.find("."+this._currentSelectionType));return a};a.prototype._selectCurrent=function(){var a=this._getCurrentSelection();this.resetSelected();this._getCurrentSelection().addClass("selected");this._$el.attr("aria-activedescendant",
a.attr("id"))};a.prototype._goToCurrentUrl=function(){this._$currentSelection.length&&(document.location.href=this._$currentSelection.attr("href"))};a.prototype._scrollContainer=function(){var a=this._getCurrentSelection().length?this._$currentSuggestion.position().top:0;(a>this._$dropdown.scrollTop()+this._$dropdown.height()||a<this._$dropdown.scrollTop())&&this._$dropdown.scrollTop(a)};a.prototype._preventDefault=function(a){this._$currentSuggestion.length&&a.preventDefault()};a.prototype.onKeyDown=
function(a){var b=a.keyCode;this._$currentSuggestion=this._$dropdown.find(".tt-suggestion.tt-cursor");switch(b){case 37:this._toggleColumn();this._selectCurrent();this._preventDefault(a);break;case 38:this._scrollContainer();this._selectCurrent();break;case 39:this._toggleColumn();this._selectCurrent();this._preventDefault(a);break;case 40:this._scrollContainer();this._selectCurrent();break;case 13:this._preventDefault(a),this._goToCurrentUrl()}this._$currentSelection=this._getCurrentSelection()};
return new a});(function(){var b=LIModules.requires("jQuery"),g=["dataset","bloodhoundEngine","i18nStrings","regionId"],f,a;f=function(h,c){this._$el=h;this._config=c;this._checkMissingConfigs();this._$label=b("#"+this._config.regionId);this._dropdownId="tt-dataset-"+this._config.dataset;this._attachAriaAttributes();this._attachTypeaheadEvents();this._handleResultLength()};a=f.prototype;a.destroy=function(){this._$el.off("typeahead:opened",b.proxy(this._setDropdownAttrs,this)).off("typeahead:cursorchanged",b.proxy(this._setActiveDescendant,
this)).off("typeahead:closed",b.proxy(this._removeActiveDescendant,this)).off("keyup.typeahead",b.proxy(this._resetLabelLength,this));this._$el.attr(this._originalElAriaAttrs);this._$label.attr(this._originalLabelAriaAttrs);this._config.bloodhoundEngine.get=this._originalGetResults};a._checkMissingConfigs=function(){var b=[],c,a,e;this._config.regionId=this._config.regionId||this._config.labelId;a=0;for(e=g.length;a<e;a++)c=g[a],this._config[c]||b.push(c);if(b.length)throw"["+b.join(",")+"] config(s) are missing from the AccessibleTwitterTypeahead module";
};a._attachAriaAttributes=function(){this._originalElAriaAttrs={role:this._$el.attr("role")||null,"aria-owns":this._$el.attr("aria-owns")||null,"aria-labelledby":this._$el.attr("aria-labelledby")||null,"aria-live":this._$el.attr("aria-live")||null,"aria-autocomplete":this._$el.attr("aria-autocomplete")||null};this._originalLabelAriaAttrs={"aria-live":this._$label.attr("aria-live")||null};this._$el.attr({role:"combobox","aria-owns":"tt-dataset-"+this._config.dataset,"aria-labelledby":this._config.regionId,
"aria-live":"polite","aria-autocomplete":"list"});this._$label.attr("aria-live")||this._$label.attr("aria-live","polite")};a._attachTypeaheadEvents=function(){this._$el.on("typeahead:opened",b.proxy(this._setDropdownAttrs,this)).on("typeahead:cursorchanged",b.proxy(this._setActiveDescendant,this)).on("typeahead:closed",b.proxy(this._removeActiveDescendant,this)).on("keyup.typeahead",b.proxy(this._resetLabelLength,this))};a._setDropdownAttrs=function(){b("."+this._dropdownId).attr({id:this._dropdownId,
role:"listbox"})};a._setActiveDescendant=function(a,c){var d=c.sourceID?c.sourceID+"-item-"+c.id:"item-"+c.id;this._$el.attr("aria-activedescendant",d);this._$dropdown=this._$dropdown||b("#"+this._dropdownId);this._$dropdown.find("[aria-selected\x3dtrue]").attr("aria-selected",!1);b("#"+d).attr("aria-selected",!0)};a._removeActiveDescendant=function(){this._$el.removeAttr("aria-activedescendant");this._resetRegion()};a._setLabelToLength=function(a){var c="";switch(a?a.length:0){case 0:c=this._config.i18nStrings.zeroResults;
break;case 1:c=this._config.i18nStrings.singleResult;break;default:c=this._config.i18nStrings.multipleResults}this._$label.html(b("\x3cspan/\x3e").text(c))};a._handleResultLength=function(){var a=this;this._originalGetResults=this._config.bloodhoundEngine.get;this._config.bloodhoundEngine.get=function(b,d){var e=d;d=function(b){a._setLabelToLength(b);e(b)};a._originalGetResults.call(a._config.bloodhoundEngine,b,d)}};a._resetRegion=function(){this._$label.text("")};a._resetLabelLength=function(){""===
b.trim(this._$el.val())&&this._resetRegion()};LIModules.exports("AccessibleTwitterTypeahead",f)})();define("jquery",[],function(){return jQuery});define("WebTracking",[],function(){return WebTracking});
define("UniversalTypeahead",["jquery","TypeaheadNavigator","WebTracking"],function(f,n,p){var q=["key"],r=LIModules.requires("readCookie"),s=LIModules.requires("createCookie"),d=function(){};d.prototype.init=function(a,c){this._searchType="";this._elId=a;this._lixTests=c||{};this._userInputValue="";this._guid=(new Date).getTime();this._refTarId="";this._requestCount=0;this._historyLimit=10;this._currentTypeaheadSelectionType="item";this._cacheDOMElements();this._getI18nStrings();this._parseConfigs();
this._parseLix();this._instantiateTypeahead();this._attachEventListeners();this._toggleClearButton();this._webTracking=p};d.prototype._cacheDOMElements=function(){this._$el=f("#"+this._elId);this._$mainTextBoxEl=this._$el.find("#main-search-box");this._$trkInput=this._$el.find("#main-search-trkInfo");this._$clearButton=this._$el.find("#clear-main-search")};d.prototype._attachEventListeners=function(){var a=this;this._$mainTextBoxEl.on({keydown:f.proxy(this._toggleClearButton,this),paste:f.proxy(this._toggleClearButton,
this),input:f.proxy(this._toggleClearButton,this)}).on({keydown:f.proxy(function(){this._resetWrapperDirection()},this),input:f.proxy(function(){this._resetWrapperDirection()},this)});this._$clearButton.on("click",function(c){c.preventDefault();a._clearSearchBox();a._$mainTextBoxEl.focus()});this._searchHistoryEnabled&&(this._$el.on("submit",f.proxy(this._beforeSubmit,this)),this._$el.find(".tt-dropdown-menu").on("click",f.proxy(this._clearHistoryClickHandler,this)))};d.prototype._clearHistoryClickHandler=
function(a){f(a.target).hasClass("clear-history")&&(this._clearHistory(),this.reinstantiateTypeahead())};d.prototype._getI18nStrings=function(){this.i18nMap={};this.i18nMap.refine=LI.i18n.get("universal-search-refine");this.i18nMap.suggestion=LI.i18n.get("typeahead2-search-suggestions");this.i18nMap.autocomplete=LI.i18n.get("typeahead2-search-suggestions");this.i18nMap.mynetwork="people"===this._lixTests.networkHeadline?LI.i18n.get("typeahead2-search-people"):LI.i18n.get("typeahead2-search-connections");
this.i18nMap.company=LI.i18n.get("typeahead2-search-companies");this.i18nMap.group=LI.i18n.get("typeahead2-search-groups");this.i18nMap.sitefeature=LI.i18n.get("typeahead2-search-features");this.i18nMap.school=LI.i18n.get("typeahead2-search-schools");this.i18nMap.showcase=LI.i18n.get("typeahead2-search-showcases");this.i18nMap.skill=LI.i18n.get("typeahead2-search-skills");this.i18nMap.connect=LI.i18n.get("typeahead2-connect");this.i18nMap.message=LI.i18n.get("typeahead2-message");this.i18nMap.inmail=
LI.i18n.get("typeahead2-send-inmail");this.i18nMap.post=LI.i18n.get("typeahead2-post");this.i18nMap.follow=LI.i18n.get("typeahead2-follow");this.i18nMap.view=LI.i18n.get("typeahead2-view");this.i18nMap.edit=LI.i18n.get("typeahead2-edit-profile");this.i18nMap.zeroresults=LI.i18n.get("typeahead2-search-input-title-no-results");this.i18nMap.oneresult=LI.i18n.get("typeahead2-search-input-title-singular");this.i18nMap.manyresults=LI.i18n.get("typeahead2-search-input-title-plural");this.i18nMap.clearLabel=
LI.i18n.get("typeahead2-search-clear-history-dismiss");this.i18nMap.clearDescription=LI.i18n.get("typeahead2-search-clear-history-description");this.i18nMap.clearHelp=LI.i18n.get("typeahead2-search-clear-history-help")};d.prototype._parseConfigs=function(){var a=this._$el.data("li-blud"),c=r("wutan"),b=this._$el.data("li-help-center-url");this._encryptionKey=c||a;c||s("wutan",this._encryptionKey,null,"."+document.domain);this._helpCenterUrl=b};d.prototype._parseLix=function(){var a=this._lixTests.typeaheadDebounceTime,
c=this._lixTests.taSearchHistoryLS,b=this._lixTests.typeaheadIgnoreCategories;this._debounceTime=parseInt(a&&a.substring(1),10)||200;this._searchHistoryEnabled=c;this._ignoreCategories=b};d.prototype._instantiateTypeahead=function(){var a=this,c={compile:function(a,c){return function(b){b=f.extend({},c,b);var d;dust.render(a,b,function(a,b){d=b});return d}}},b;b=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("displayName"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:"/ta/federator?orig\x3dGLHD",
rateLimitWait:this._debounceTime,replace:function(b,c){var d={verticalSelector:a._searchType,query:c,tracking:!0};a._$el.addClass("loading");a._userInputValue=a._$mainTextBoxEl.typeahead("val");a._refTarId&&(d.refTarId=a._refTarId);return b=a._addParamsToUrl(b,d)},filter:function(b){a._$el.removeClass("loading");a._setTarID(b);return a._decorateTypeaheadResponse(b)},ajax:{complete:_.bind(this._fuseLimit,this)}},limit:999});new LI.AccessibleTwitterTypeahead(this._$mainTextBoxEl,{dataset:"GLHD",bloodhoundEngine:b,
i18nStrings:{zeroResults:this.i18nMap.zeroresults,singleResult:this.i18nMap.oneresult,multipleResults:this.i18nMap.manyresults},labelId:"main-search-box-label"});b.initialize();b=[{highlight:!1,hint:!1,minLength:0},{name:"GLHD",displayKey:"displayName",source:b.ttAdapter(),templates:{suggestion:c.compile("tl/shared/typeahead/complexTypeahead")}}];this._searchHistoryEnabled&&this._attachSearchHistorySource(b,c);this._$mainTextBoxEl.typeahead.apply(this._$mainTextBoxEl,b).on("typeahead:selected",function(b,
c,d){a._searchHistoryEnabled&&("GLHD"===d&&"category"!==c.type?(b=_.pick(c,"sourceID","type","displayName","url","imageUrl","headLine","id"),b.displayName||(b.displayName=f("\x3cspan\x3e"+b.headLine+"\x3c/span\x3e").text()),"autocomplete"===b.sourceID||"suggestion"===b.sourceID?(b.sourceID="history",b.entityType="queryHistoryName",c.misc&&c.misc.searchAssistType&&(b.idInfo=c.misc.searchAssistType)):b.entityType="entityHistoryName","suggestion"!==c.sourceID&&(b.headLine=c.displayName),a.addItemToHistory(b)):
"GLHD_SEARCH_HISTORY"===d&&a.addItemToHistory(c));a._lixTests.actionsEnabled||(a._$mainTextBoxEl.val(c.rawName),document.location.href=c.url)}).on("typeahead:autocompleted",function(b,c){a._trackAutoComplete(c)}).on("typeahead:cursorchanged",function(){a._$mainTextBoxEl.typeahead("val",a._userInputValue)}).on("typeahead:opened",function(){n.init(a._$mainTextBoxEl.attr("id"),["GLHD","GLHD_SEARCH_HISTORY"]);n.bindKeyEvents();n.bindMouseEvents()}).on("typeahead:closed",function(){n.unbindEvents()});
this._$wrapper=f("#global-search .twitter-typeahead");this._resetWrapperAndInputDirection();this._configureTypeaheadPresentation()};d.prototype._attachSearchHistorySource=function(a,c){var b=this;this._setSafeLocalStorage();this._getCurrentHistory();a.splice(1,0,{name:"GLHD_SEARCH_HISTORY",source:function(a,c){var d=[];a||(d=b._attachSearchHistoryTracking(b._searchHistoryFromStorage));c(d)},templates:{suggestion:c.compile("tl/shared/typeahead/complexTypeahead"),footer:c.compile("tl/shared/typeahead/searchHistoryFooter",
{i18n:{clearLabel:this.i18nMap.clearLabel,clearDescription:this.i18nMap.clearDescription,clearHelp:this.i18nMap.clearHelp},urls:{helpCenterUrl:this._helpCenterUrl}})}})};d.prototype.addItemToHistory=function(a){var c;a.id="history"===a.sourceID?a.sourceID+"_"+a.displayName:a.sourceID+"_"+a.id;a.idInfo&&(a.id+="_"+a.idInfo);(c=_.find(this._searchHistoryFromStorage,function(b){return b.id===a.id}))?(this._searchHistoryFromStorage.splice(this._searchHistoryFromStorage.indexOf(c),1),c.url=a.url,this._searchHistoryFromStorage.unshift(c)):
(a.headLine=a.headLine||a.displayName,this._searchHistoryFromStorage.unshift(a));this._safeLocalStorage.setItem("GLHD_SEARCH_HISTORY",this._searchHistoryFromStorage)};d.prototype._setSafeLocalStorage=function(){var a=this._encryptionKey;this._safeLocalStorage={setItem:function(c,b){var d,f;try{d=sjcl.encrypt(a,JSON.stringify(b)),f=JSON.stringify({version:3,data:d}),window.localStorage.setItem(c,f)}catch(g){}},getItem:function(c){var b,d;try{return(d=JSON.parse(localStorage.getItem(c)))&&3===d.version&&
(b=JSON.parse(sjcl.decrypt(a,d.data))),b}catch(f){return null}}}};d.prototype._getCurrentHistory=function(){(this._searchHistoryFromStorage=(this._searchHistoryFromStorage=this._safeLocalStorage.getItem("GLHD_SEARCH_HISTORY"))?this._searchHistoryFromStorage.slice(0,this._historyLimit):this._searchHistoryFromStorage)||this._clearHistory()};d.prototype._clearHistory=function(){this._searchHistoryFromStorage=[];this._safeLocalStorage.setItem("GLHD_SEARCH_HISTORY",this._searchHistoryFromStorage)};d.prototype._attachSearchHistoryTracking=
function(a){a=a||[];var c,b,d;c=0;for(b=a.length;c<b;c++)d=a[c],d.itemIndex=c,d.url=this._constructItemUrl(d.url,d);return a};d.prototype.reinstantiateTypeahead=function(){this._$mainTextBoxEl.typeahead("destroy");this._instantiateTypeahead()};d.prototype._resetWrapperDirection=function(){this._$wrapper.css("direction","ltr")};d.prototype._resetWrapperAndInputDirection=function(){this._resetWrapperDirection();LI&&LI.BidiInput&&this._$mainTextBoxEl.trigger(LI.BidiInput.EVENT_RESET)};d.prototype._configureTypeaheadPresentation=
function(){var a="clipped"+(this._lixTests.actionsEnabled?" typeahead-actions":" transparent")+("control"!==this._lixTests.taSuggestionRecolor?" colorful-suggestions":"")+("blue"===this._lixTests.taSuggestionRecolor?" blue-variant":"")+(this._lixTests.taGlyphIcons?" glyph-icons":"");this._$el.find(".tt-dropdown-menu").addClass(a);if(this._searchHistoryEnabled)this._$mainTextBoxEl.on("focus input change",function(){var a=f(this),b=""===a.val();f(document.activeElement).is(a)&&(f(".tt-dataset-GLHD_SEARCH_HISTORY").toggle(b),
f(".tt-dataset-GLHD").toggle(!b),b&&f(this).data().ttTypeahead.input.trigger("queryChanged",""))})};d.prototype._fuseLimit=function(){100<=this._requestCount&&!this._fuseLimitReached?(this._fuseLimitReached=!0,this._debounceTime=200,this.reinstantiateTypeahead()):this._requestCount++};d.prototype._setTarID=function(a){a=a.meta||{};var c=this._$trkInput.val(),c=c?c.split(","):[],b,d;!this._refTarId&&a&&(this._refTarId=a.tarId);a.tarId&&(b="tarId:"+a.tarId,(a=c.some(function(a,c,f){if((d=a.match(/tarId:[0-9]+/g))&&
d.length)return f[c]=b,!0}))||c.push(b),this._$trkInput.val(c.join(",")))};d.prototype._decorateTypeaheadResponse=function(a){var c=a.resultList||[];a=a.meta||{};var b="",d=0,f=0,g=0,h=/authType=(\w+)/,k,l,e;k=0;for(l=c.length;k<l;k++)e=c[k],e.type="item",e._index=k,e.sourceID!==b&&(e.categoryName=this.i18nMap[e.sourceID],f=0,d++),b=e.sourceID,f++,g++,e.categoryIndex=d,e.itemIndex=g,e.itemInCategoryIndex=f,e.misc&&e.misc.actionType&&(e.misc.actionDisplayName=this.i18nMap[e.misc.actionType]),e.rawName=
e.rawName||LI.htmlUnencode(e.displayName),this._ignoreCategories&&(delete e.categoryName,delete e.categoryIndex,delete e.itemInCategoryIndex),""===e.url&&(e.url=this._addParamsToUrl(this._$el.attr("action"),{keywords:e.rawName})),!e.authType&&h.test(e.url)&&(e.authType=h.exec(e.url)[1]),"suggestion"===e.sourceID&&e.misc&&e.misc.verticalType&&(e.suggestionType=e.misc.verticalType.toLowerCase()),e.url=this._constructItemUrl(e.url,e,a),e.misc&&e.misc.actionUrl&&(e.misc.actionUrl=this._constructActionUrl(e.misc.actionUrl,
e,a)),!this._lixTests.actionsEnabled&&e.misc&&(delete e.misc.actionType,delete e.misc.actionUrl);return c};d.prototype._getBaseTrackingParams=function(a,c){var b=[],d={};a.sourceID&&b.push("clickedVertical:"+a.sourceID);a.entityType&&b.push("entityType:"+a.entityType);a.id&&b.push("clickedEntityId:"+a.id);a.authType&&b.push("authType:"+a.authType);"undefined"!==typeof a.categoryIndex&&"undefined"!==typeof a.itemInCategoryIndex&&"undefined"!==typeof a.itemIndex?b.push("idx:"+a.categoryIndex+"-"+a.itemInCategoryIndex+
"-"+a.itemIndex):"undefined"!==typeof a.itemIndex&&b.push("idx:"+a.itemIndex);c&&c.tarId&&b.push("tarId:"+c.tarId);this._userInputValue&&b.push("tas:"+this._userInputValue);d.trk="tyah";d.trkInfo=b.join(",");return d};d.prototype._constructItemUrl=function(a,c,b){c=this._getBaseTrackingParams(c,b);return this._addParamsToUrl(a,c)};d.prototype._constructActionUrl=function(a,c,b){b=this._getBaseTrackingParams(c,b);c.misc&&(b.trk+="_"+c.sourceID+"_action_"+c.misc.actionType,"connect"===c.misc.actionType&&
(b.connectionParam="member_desktop_search_search-bar"));return this._addParamsToUrl(a,b)};d.prototype._beforeSubmit=function(){var a={sourceID:"history",entityType:"queryHistoryName",url:this._$el.attr("action")+"?keywords\x3d"+this._userInputValue,displayName:LI.htmlEncode(this._userInputValue),headLine:LI.htmlEncode(this._userInputValue),type:"item"};a.displayName&&this.addItemToHistory(a)};d.prototype._addParamsToUrl=function(a,c){var b,d,m={},g=[];if(!c)return a;b=a.split("?");d=b[0]+"?";b=b[1]?
b[1].split("\x26")||"":"";for(var h=0;h<b.length;h++){var k=b[h].split("\x3d");m[k[0]]=decodeURIComponent(k[1])}var m=f.extend({},m,c),l;for(l in m)g.push({name:l,value:m[l]});d+=f.param(g);return d=d.replace(/\+/g,"%20")};d.prototype._trackAutoComplete=function(a){p.trackUserAction("search-assist-accept",{input:this._userInputValue,suggestion:a.displayName,guid:this._guid,ts:(new Date).getTime(),prefixLength:this._userInputValue.length})};d.prototype._toggleClearButton=function(){var a=this;setTimeout(function(){a._$mainTextBoxEl.val()?
a._$clearButton.addClass("show"):a._$clearButton.removeClass("show")},50)};d.prototype._clearSearchBox=function(){this._$mainTextBoxEl.typeahead("val","");this._resetWrapperAndInputDirection();this._$clearButton.removeClass("show")};d.prototype._validateData=function(a,c){var b="",d=[],f,g,h;g=0;for(h=c.length;g<h;g++)f=c[g],a.hasOwnProperty(f)||d.push(f);d.length&&(b+="The keys {"+d.join(",")+"} are missing in the vertical dataset.");return b};d.prototype.onTextInputChanged=function(a){this._userInputValue=
a};d.prototype.onNewVerticalData=function(a){var c=this._validateData(a,q);if(c)throw Error(c);this._searchType=a.key};return new d});define("UniversalSearch",["jquery","UniversalTypeahead","UniversalSearchForm","UniversalSearchGhostLabel","UniversalSearchTracking"],function(d,e,h,k,l){var m={mainSearchBoxId:"main-search-box",dropdownName:"universal-search-selector",itemSelectEvent:"itemSelectEvent",updateKeywordsEvent:"universalKeywordsUpdated",updateSearchHistoryWithItem:"updateSearchHistoryWithItem",defaultSelected:"all",verticalSettings:{all:{key:"all",formMethod:"get",advancedLinkVisible:!0,trkCode:"vsrp_all_vertical_selector_item"},
people:{key:"people",formMethod:"get",advancedLinkVisible:!0,trkCode:"vsrp_people_vertical_selector_item"},jobs:{key:"jobs",formMethod:"get",advancedLinkVisible:!0,trkCode:"vsrp_jobs_vertical_selector_item"},companies:{key:"companies",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_companies_vertical_selector_item"},groups:{key:"groups",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_groups_vertical_selector_item"},inbox:{key:"inbox",formMethod:"post",advancedLinkVisible:!1,trkCode:"vsrp_inbox_vertical_selector_item"},
content:{key:"content",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_content_vertical_selector_item"},edu:{key:"edu",formMethod:"get",advancedLinkVisible:!1,trkCode:"vsrp_edu_vertical_selector_item"}}},f,b=function(){};b.prototype.init=function(a,b){var c=this,g=new d.Deferred;this._vertical="";this._modules=[];this._elId=a;this._config=b;this._setup();d(document).ready(function(){c._cacheDOMElements();c._setLixTests();c._areTypeaheadDepsLoaded()?c._afterLoad():(d(window).load(function(){g.resolve()}),
c._$input.one("focus",function(){g.resolve()}))});g.then(function(){!c._areTypeaheadDepsLoaded()&&LI.TwitterTADependencies?d.ajax({url:LI.TwitterTADependencies.scripts[0],dataType:"script",cache:!0,success:function(){c._afterLoad()}}):c._areTypeaheadDepsLoaded()&&c._afterLoad()})};b.prototype._areTypeaheadDepsLoaded=function(){return!(!d.fn.typeahead||!Bloodhound)};b.prototype._setup=function(){this._config=d.extend(!0,{},m,this._config);this._attachEventListeners()};b.prototype._cacheDOMElements=
function(){var a=d("#"+this._elId);this._$input=a.find("#"+this._config.mainSearchBoxId);this._$form=a.is("form")?a:a.find("form")};b.prototype._afterLoad=function(){var a;this._config.lixTests&&this._config.lixTests.noFederated&&(this._config.defaultSelected="people");this._initModules();a=this._$form.find(":selected").val()||this._config.defaultSelected;this.setCurrentVertical(a)};b.prototype._setLixTests=function(){try{this._config.lixTests=d.parseJSON(this._$form.attr("data-li-lix-tests"))}catch(a){this._config.lixTests=
null}};b.prototype._initModules=function(){this._config.lixTests&&(f=this._$form.attr("id"),e.init(f,this._config.lixTests),this._modules.push(e),h.init(f),this._modules.push(h),k.init(this._config.mainSearchBoxId),this._modules.push(k),l.init(this._config.mainSearchBoxId),this._modules.push(l))};b.prototype._attachEventListeners=function(){LI.Events.on(this._config.itemSelectEvent,this.handleVerticalChangeEvent,this);LI.Events.on(this._config.updateKeywordsEvent,this.setInputText,this);LI.Events.on(this._config.updateSearchHistoryWithItem,
this.addItemToSearchHistory,this)};b.prototype._broadcast=function(a){var b=Array.prototype.slice.call(arguments,1);a="on"+a;var c,d,e;d=0;for(e=this._modules.length;d<e;d++)c=this._modules[d],c[a]&&"function"===typeof c[a]&&c[a].apply(c,b)};b.prototype._setVerticalDataAttributes=function(a){var b=this._config.verticalSettings[a],c;"object"!==typeof b||b.dataAttributesPopulated||(c=this._$form.find('option[value\x3d"'+a+'"]'),b.formAction=c.attr("data-li-search-action"),b.advancedLinkHref=c.attr("data-li-advanced-link"),
b.ghostText=c.attr("data-li-ghost-text"),b.dataAttributesPopulated=!0,this._config.verticalSettings[a]=b)};b.prototype.addItemToSearchHistory=function(a){e.addItemToHistory(a);e.reinstantiateTypeahead()};b.prototype.setInputText=function(a){this._$input.val(a);this._broadcast("TextInputChanged",a)};b.prototype.getCurrentVertical=function(){return this._vertical};b.prototype.setCurrentVertical=function(a){this._vertical=a;this._setVerticalDataAttributes(this._vertical);if(a=this._config.verticalSettings[this._vertical])this._broadcast("NewVerticalData",
a);else throw Error("data for the vertical {"+this._vertical+"} does not exist");};b.prototype.handleVerticalChangeEvent=function(a){var b=(a.option||"").value||"";(a.name||"")===this._config.dropdownName&&this._$form&&this._vertical!==b&&this.setCurrentVertical(b)};return new b});require(["UniversalSearch"],function(d){d.init("global-search",{})});"use strict";function q(a){throw a;}var r=void 0,s=!1;var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};
sjcl.cipher.aes=function(a){this.j[0][0][0]||this.B();var b,c,d,e,g=this.j[0][4],f=this.j[1];b=a.length;var h=1;4!==b&&(6!==b&&8!==b)&&q(new sjcl.exception.invalid("invalid aes key size"));this.b=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}for(b=0;a;b++,a--)c=d[b&3?a:a-4],e[b]=4>=a||4>b?c:f[0][g[c>>>24]]^f[1][g[c>>16&255]]^f[2][g[c>>8&255]]^f[3][g[c&
255]]};
sjcl.cipher.aes.prototype={encrypt:function(a){return w(this,a,0)},decrypt:function(a){return w(this,a,1)},j:[[[],[],[],[],[]],[[],[],[],[],[]]],B:function(){var a=this.j[0],b=this.j[1],c=a[4],d=b[4],e,g,f,h=[],k=[],l,p,m,n;for(e=0;0x100>e;e++)k[(h[e]=e<<1^283*(e>>7))^e]=e;for(g=f=0;!c[g];g^=l||1,f=k[f]||1){m=f^f<<1^f<<2^f<<3^f<<4;m=m>>8^m&255^99;c[g]=m;d[m]=g;p=h[e=h[l=h[g]]];n=0x1010101*p^0x10001*e^0x101*l^0x1010100*g;p=0x101*h[m]^0x1010100*m;for(e=0;4>e;e++)a[e][g]=p=p<<24^p>>>8,b[e][m]=n=n<<24^n>>>8}for(e=
0;5>e;e++)a[e]=a[e].slice(0),b[e]=b[e].slice(0)}};
function w(a,b,c){4!==b.length&&q(new sjcl.exception.invalid("invalid aes block size"));var d=a.b[c],e=b[0]^d[0],g=b[c?3:1]^d[1],f=b[2]^d[2];b=b[c?1:3]^d[3];var h,k,l,p=d.length/4-2,m,n=4,v=[0,0,0,0];h=a.j[c];a=h[0];var t=h[1],u=h[2],y=h[3],z=h[4];for(m=0;m<p;m++)h=a[e>>>24]^t[g>>16&255]^u[f>>8&255]^y[b&255]^d[n],k=a[g>>>24]^t[f>>16&255]^u[b>>8&255]^y[e&255]^d[n+1],l=a[f>>>24]^t[b>>16&255]^u[e>>8&255]^y[g&255]^d[n+2],b=a[b>>>24]^t[e>>16&255]^u[g>>8&255]^y[f&255]^d[n+3],n+=4,e=h,g=k,f=l;for(m=0;4>
m;m++)v[c?3&-m:m]=z[e>>>24]<<24^z[g>>16&255]<<16^z[f>>8&255]<<8^z[b&255]^d[n++],h=e,e=g,g=f,f=b,b=h;return v}
sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.O(a.slice(b/32),32-(b&31)).slice(1);return c===r?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return 32===d?a.concat(b):sjcl.bitArray.O(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0===
b?0:32*(b-1)+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;b&=31;0<c&&b&&(a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+0x10000000000*a},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return s;var c=0,d;for(d=0;d<a.length;d++)c|=a[d]^b[d];return 0===
c},O:function(a,b,c,d){var e;e=0;for(d===r&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1));return d},F:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b<a.length;++b)c=a[b],a[b]=c>>>24|c>>>8&0xff00|(c&0xff00)<<8|c<<24;return a}};
sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++)0===(d&3)&&(e=a[d/4]),b+=String.fromCharCode(e>>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++)d=d<<8|a.charCodeAt(c),3===(c&3)&&(b.push(d),d=0);c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};
sjcl.codec.base64={H:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,g=sjcl.codec.base64.H,f=0,h=sjcl.bitArray.bitLength(a);c&&(g=g.substr(0,62)+"-_");for(c=0;6*d.length<h;)d+=g.charAt((f^a[c]>>>e)>>>26),6>e?(f=a[c]<<6-e,e+=26,c++):(f<<=6,e-=6);for(;d.length&3&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d,e=0,g=sjcl.codec.base64.H,f=0,h;b&&(g=g.substr(0,62)+"-_");for(d=0;d<a.length;d++)h=g.indexOf(a.charAt(d)),
0>h&&q(new sjcl.exception.invalid("this isn't base64!")),26<e?(e-=26,c.push(f^h>>>e),f=h<<32-e):(e+=6,f^=h<<32-e);e&56&&c.push(sjcl.bitArray.partial(e&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.b[0]||this.B();a?(this.o=a.o.slice(0),this.m=a.m.slice(0),this.g=a.g):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};
sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.o=this.M.slice(0);this.m=[];this.g=0;return this},update:function(a){"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.m=sjcl.bitArray.concat(this.m,a);b=this.g;a=this.g=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)x(this,c.splice(0,16));return this},finalize:function(){var a,b=this.m,c=this.o,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.g/
4294967296));for(b.push(this.g|0);b.length;)x(this,b.splice(0,16));this.reset();return c},M:[],b:[],B:function(){function a(a){return 0x100000000*(a-Math.floor(a))|0}var b=0,c=2,d;a:for(;64>b;c++){for(d=2;d*d<=c;d++)if(0===c%d)continue a;8>b&&(this.M[b]=a(Math.pow(c,0.5)));this.b[b]=a(Math.pow(c,1/3));b++}}};
function x(a,b){var c,d,e,g=b.slice(0),f=a.o,h=a.b,k=f[0],l=f[1],p=f[2],m=f[3],n=f[4],v=f[5],t=f[6],u=f[7];for(c=0;64>c;c++)16>c?d=g[c]:(d=g[c+1&15],e=g[c+14&15],d=g[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+g[c&15]+g[c+9&15]|0),d=d+u+(n>>>6^n>>>11^n>>>25^n<<26^n<<21^n<<7)+(t^n&(v^t))+h[c],u=t,t=v,v=n,n=m+d|0,m=p,p=l,l=k,k=d+(l&p^m&(l^p))+(l>>>2^l>>>13^l>>>22^l<<30^l<<19^l<<10)|0;f[0]=f[0]+k|0;f[1]=f[1]+l|0;f[2]=f[2]+p|0;f[3]=f[3]+m|0;f[4]=f[4]+n|0;f[5]=f[5]+v|0;f[6]=
f[6]+t|0;f[7]=f[7]+u|0}
sjcl.mode.ccm={name:"ccm",p:[],listenProgress:function(a){sjcl.mode.ccm.p.push(a)},unListenProgress:function(a){a=sjcl.mode.ccm.p.indexOf(a);-1<a&&sjcl.mode.ccm.p.splice(a,1)},U:function(a){var b=sjcl.mode.ccm.p.slice(),c;for(c=0;c<b.length;c+=1)b[c](a)},encrypt:function(a,b,c,d,e){var g,f=b.slice(0),h=sjcl.bitArray,k=h.bitLength(c)/8,l=h.bitLength(f)/8;e=e||64;d=d||[];7>k&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"));for(g=2;4>g&&l>>>8*g;g++);g<15-k&&(g=15-k);c=h.clamp(c,8*(15-
g));b=sjcl.mode.ccm.J(a,b,c,d,e,g);f=sjcl.mode.ccm.K(a,f,c,b,e,g);return h.concat(f.data,f.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var g=sjcl.bitArray,f=g.bitLength(c)/8,h=g.bitLength(b),k=g.clamp(b,h-e),l=g.bitSlice(b,h-e),h=(h-e)/8;7>f&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"));for(b=2;4>b&&h>>>8*b;b++);b<15-f&&(b=15-f);c=g.clamp(c,8*(15-b));k=sjcl.mode.ccm.K(a,k,c,l,e,b);a=sjcl.mode.ccm.J(a,k.data,c,d,e,b);g.equal(k.tag,a)||q(new sjcl.exception.corrupt("ccm: tag doesn't match"));
return k.data},aa:function(a,b,c,d,e,g){var f=[],h=sjcl.bitArray,k=h.F;d=[h.partial(8,(b.length?64:0)|d-2<<2|g-1)];d=h.concat(d,c);d[3]|=e;d=a.encrypt(d);if(b.length){c=h.bitLength(b)/8;65279>=c?f=[h.partial(16,c)]:0xffffffff>=c&&(f=h.concat([h.partial(16,65534)],[c]));f=h.concat(f,b);for(b=0;b<f.length;b+=4)d=a.encrypt(k(d,f.slice(b,b+4).concat([0,0,0])))}return d},J:function(a,b,c,d,e,g){var f=sjcl.bitArray,h=f.F;e/=8;(e%2||4>e||16<e)&&q(new sjcl.exception.invalid("ccm: invalid tag length"));(0xffffffff<
d.length||0xffffffff<b.length)&&q(new sjcl.exception.bug("ccm: can't deal with 4GiB or more data"));c=sjcl.mode.ccm.aa(a,d,c,e,f.bitLength(b)/8,g);for(d=0;d<b.length;d+=4)c=a.encrypt(h(c,b.slice(d,d+4).concat([0,0,0])));return f.clamp(c,8*e)},K:function(a,b,c,d,e,g){var f,h=sjcl.bitArray;f=h.F;var k=b.length,l=h.bitLength(b),p=k/50,m=p;c=h.concat([h.partial(8,g-1)],c).concat([0,0,0]).slice(0,4);d=h.bitSlice(f(d,a.encrypt(c)),0,e);if(!k)return{tag:d,data:[]};for(f=0;f<k;f+=4)f>p&&(sjcl.mode.ccm.U(f/
k),p+=m),c[3]++,e=a.encrypt(c),b[f]^=e[0],b[f+1]^=e[1],b[f+2]^=e[2],b[f+3]^=e[3];return{tag:d,data:h.clamp(b,l)}}};sjcl.misc.hmac=function(a,b){this.L=b=b||sjcl.hash.sha256;var c=[[],[]],d,e=b.prototype.blockSize/32;this.l=[new b,new b];a.length>e&&(a=b.hash(a));for(d=0;d<e;d++)c[0][d]=a[d]^909522486,c[1][d]=a[d]^1549556828;this.l[0].update(c[0]);this.l[1].update(c[1]);this.D=new b(this.l[0])};
sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){this.P&&q(new sjcl.exception.invalid("encrypt on already updated hmac called!"));this.update(a);return this.digest(a)};sjcl.misc.hmac.prototype.reset=function(){this.D=new this.L(this.l[0]);this.P=s};sjcl.misc.hmac.prototype.update=function(a){this.P=!0;this.D.update(a)};sjcl.misc.hmac.prototype.digest=function(){var a=this.D.finalize(),a=(new this.L(this.l[1])).update(a).finalize();this.reset();return a};
sjcl.misc.pbkdf2=function(a,b,c,d,e){c=c||1E3;(0>d||0>c)&&q(sjcl.exception.invalid("invalid params to pbkdf2"));"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));"string"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));e=e||sjcl.misc.hmac;a=new e(a);var g,f,h,k,l=[],p=sjcl.bitArray;for(k=1;32*l.length<(d||1);k++){e=g=a.encrypt(p.concat(b,[k]));for(f=1;f<c;f++){g=a.encrypt(g);for(h=0;h<g.length;h++)e[h]^=g[h]}l=l.concat(e)}d&&(l=p.clamp(l,d));return l};
sjcl.prng=function(a){this.c=[new sjcl.hash.sha256];this.h=[0];this.C=0;this.q={};this.A=0;this.I={};this.N=this.d=this.i=this.W=0;this.b=[0,0,0,0,0,0,0,0];this.f=[0,0,0,0];this.u=r;this.w=a;this.n=s;this.t={progress:{},seeded:{}};this.k=this.V=0;this.r=1;this.s=2;this.R=0x10000;this.G=[0,48,64,96,128,192,0x100,384,512,768,1024];this.S=3E4;this.Q=80};
sjcl.prng.prototype={randomWords:function(a,b){var c=[],d;d=this.isReady(b);var e;d===this.k&&q(new sjcl.exception.notReady("generator isn't seeded"));if(d&this.s){d=!(d&this.r);e=[];var g=0,f;this.N=e[0]=(new Date).valueOf()+this.S;for(f=0;16>f;f++)e.push(0x100000000*Math.random()|0);for(f=0;f<this.c.length&&!(e=e.concat(this.c[f].finalize()),g+=this.h[f],this.h[f]=0,!d&&this.C&1<<f);f++);this.C>=1<<this.c.length&&(this.c.push(new sjcl.hash.sha256),this.h.push(0));this.d-=g;g>this.i&&(this.i=g);this.C++;
this.b=sjcl.hash.sha256.hash(this.b.concat(e));this.u=new sjcl.cipher.aes(this.b);for(d=0;4>d&&!(this.f[d]=this.f[d]+1|0,this.f[d]);d++);}for(d=0;d<a;d+=4)0===(d+1)%this.R&&A(this),e=B(this),c.push(e[0],e[1],e[2],e[3]);A(this);return c.slice(0,a)},setDefaultParanoia:function(a,b){0===a&&"Setting paranoia=0 will ruin your security; use it only for testing"!==b&&q("Setting paranoia=0 will ruin your security; use it only for testing");this.w=a},addEntropy:function(a,b,c){c=c||"user";var d,e,g=(new Date).valueOf(),
f=this.q[c],h=this.isReady(),k=0;d=this.I[c];d===r&&(d=this.I[c]=this.W++);f===r&&(f=this.q[c]=0);this.q[c]=(this.q[c]+1)%this.c.length;switch(typeof a){case "number":b===r&&(b=1);this.c[f].update([d,this.A++,1,b,g,1,a|0]);break;case "object":c=Object.prototype.toString.call(a);if("[object Uint32Array]"===c){e=[];for(c=0;c<a.length;c++)e.push(a[c]);a=e}else{"[object Array]"!==c&&(k=1);for(c=0;c<a.length&&!k;c++)"number"!==typeof a[c]&&(k=1)}if(!k){if(b===r)for(c=b=0;c<a.length;c++)for(e=a[c];0<e;)b++,
e>>>=1;this.c[f].update([d,this.A++,2,b,g,a.length].concat(a))}break;case "string":b===r&&(b=a.length);this.c[f].update([d,this.A++,3,b,g,a.length]);this.c[f].update(a);break;default:k=1}k&&q(new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string"));this.h[f]+=b;this.d+=b;h===this.k&&(this.isReady()!==this.k&&C("seeded",Math.max(this.i,this.d)),C("progress",this.getProgress()))},isReady:function(a){a=this.G[a!==r?a:this.w];return this.i&&this.i>=a?this.h[0]>this.Q&&
(new Date).valueOf()>this.N?this.s|this.r:this.r:this.d>=a?this.s|this.k:this.k},getProgress:function(a){a=this.G[a?a:this.w];return this.i>=a?1:this.d>a?1:this.d/a},startCollectors:function(){this.n||(this.a={loadTimeCollector:D(this,this.$),mouseCollector:D(this,this.ba),keyboardCollector:D(this,this.Z),accelerometerCollector:D(this,this.T),touchCollector:D(this,this.da)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,s),window.addEventListener("mousemove",this.a.mouseCollector,
s),window.addEventListener("keypress",this.a.keyboardCollector,s),window.addEventListener("devicemotion",this.a.accelerometerCollector,s),window.addEventListener("touchmove",this.a.touchCollector,s)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):q(new sjcl.exception.bug("can't attach event")),this.n=!0)},stopCollectors:function(){this.n&&(window.removeEventListener?
(window.removeEventListener("load",this.a.loadTimeCollector,s),window.removeEventListener("mousemove",this.a.mouseCollector,s),window.removeEventListener("keypress",this.a.keyboardCollector,s),window.removeEventListener("devicemotion",this.a.accelerometerCollector,s),window.removeEventListener("touchmove",this.a.touchCollector,s)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",
this.a.keyboardCollector)),this.n=s)},addEventListener:function(a,b){this.t[a][this.V++]=b},removeEventListener:function(a,b){var c,d,e=this.t[a],g=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&g.push(d);for(c=0;c<g.length;c++)d=g[c],delete e[d]},Z:function(){E(1)},ba:function(a){var b,c;try{b=a.x||a.clientX||a.offsetX||0,c=a.y||a.clientY||a.offsetY||0}catch(d){c=b=0}0!=b&&0!=c&&sjcl.random.addEntropy([b,c],2,"mouse");E(0)},da:function(a){a=a.touches[0]||a.changedTouches[0];sjcl.random.addEntropy([a.pageX||
a.clientX,a.pageY||a.clientY],1,"touch");E(0)},$:function(){E(2)},T:function(a){a=a.accelerationIncludingGravity.x||a.accelerationIncludingGravity.y||a.accelerationIncludingGravity.z;if(window.orientation){var b=window.orientation;"number"===typeof b&&sjcl.random.addEntropy(b,1,"accelerometer")}a&&sjcl.random.addEntropy(a,2,"accelerometer");E(0)}};function C(a,b){var c,d=sjcl.random.t[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;c<e.length;c++)e[c](b)}
function E(a){"undefined"!==typeof window&&window.performance&&"function"===typeof window.performance.now?sjcl.random.addEntropy(window.performance.now(),a,"loadtime"):sjcl.random.addEntropy((new Date).valueOf(),a,"loadtime")}function A(a){a.b=B(a).concat(B(a));a.u=new sjcl.cipher.aes(a.b)}function B(a){for(var b=0;4>b&&!(a.f[b]=a.f[b]+1|0,a.f[b]);b++);return a.u.encrypt(a.f)}function D(a,b){return function(){b.apply(a,arguments)}}sjcl.random=new sjcl.prng(6);
a:try{var F,G,H,I;if(I="undefined"!==typeof module){var J;if(J=module.exports){var K;try{K=require("crypto")}catch(L){K=null}J=(G=K)&&G.randomBytes}I=J}if(I)F=G.randomBytes(128),F=new Uint32Array((new Uint8Array(F)).buffer),sjcl.random.addEntropy(F,1024,"crypto['randomBytes']");else if("undefined"!==typeof window&&"undefined"!==typeof Uint32Array){H=new Uint32Array(32);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(H);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(H);
else break a;sjcl.random.addEntropy(H,1024,"crypto['getRandomValues']")}}catch(M){"undefined"!==typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(M))}
sjcl.json={defaults:{v:1,iter:1E3,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},Y:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json,g=e.e({iv:sjcl.random.randomWords(4,0)},e.defaults),f;e.e(g,c);c=g.adata;"string"===typeof g.salt&&(g.salt=sjcl.codec.base64.toBits(g.salt));"string"===typeof g.iv&&(g.iv=sjcl.codec.base64.toBits(g.iv));(!sjcl.mode[g.mode]||!sjcl.cipher[g.cipher]||"string"===typeof a&&100>=g.iter||64!==g.ts&&96!==g.ts&&128!==g.ts||128!==g.ks&&192!==g.ks&&0x100!==g.ks||2>g.iv.length||4<
g.iv.length)&&q(new sjcl.exception.invalid("json encrypt: invalid parameters"));"string"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,g),a=f.key.slice(0,g.ks/32),g.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.publicKey&&(f=a.kem(),g.kemtag=f.tag,a=f.key.slice(0,g.ks/32));"string"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));"string"===typeof c&&(g.adata=c=sjcl.codec.utf8String.toBits(c));f=new sjcl.cipher[g.cipher](a);e.e(d,g);d.key=a;g.ct="ccm"===g.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&&
b instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.encrypt(f,b,g.iv,c,g.ts):sjcl.mode[g.mode].encrypt(f,b,g.iv,c,g.ts);return g},encrypt:function(a,b,c,d){var e=sjcl.json,g=e.Y.apply(e,arguments);return e.encode(g)},X:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json;b=e.e(e.e(e.e({},e.defaults),b),c,!0);var g,f;g=b.adata;"string"===typeof b.salt&&(b.salt=sjcl.codec.base64.toBits(b.salt));"string"===typeof b.iv&&(b.iv=sjcl.codec.base64.toBits(b.iv));(!sjcl.mode[b.mode]||!sjcl.cipher[b.cipher]||"string"===
typeof a&&100>=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&0x100!==b.ks||!b.iv||2>b.iv.length||4<b.iv.length)&&q(new sjcl.exception.invalid("json decrypt: invalid parameters"));"string"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,b),a=f.key.slice(0,b.ks/32),b.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.secretKey&&(a=a.unkem(sjcl.codec.base64.toBits(b.kemtag)).slice(0,b.ks/32));"string"===typeof g&&(g=sjcl.codec.utf8String.toBits(g));f=new sjcl.cipher[b.cipher](a);g="ccm"===
b.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&&b.ct instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.decrypt(f,b.ct,b.iv,b.tag,g,b.ts):sjcl.mode[b.mode].decrypt(f,b.ct,b.iv,g,b.ts);e.e(d,b);d.key=a;return 1===c.raw?g:sjcl.codec.utf8String.fromBits(g)},decrypt:function(a,b,c,d){var e=sjcl.json;return e.X(a,e.decode(b),c,d)},encode:function(a){var b,c="{",d="";for(b in a)if(a.hasOwnProperty(b))switch(b.match(/^[a-z0-9]+$/i)||q(new sjcl.exception.invalid("json encode: invalid property name")),c+=d+'"'+b+
'":',d=",",typeof a[b]){case "number":case "boolean":c+=a[b];break;case "string":c+='"'+escape(a[b])+'"';break;case "object":c+='"'+sjcl.codec.base64.fromBits(a[b],0)+'"';break;default:q(new sjcl.exception.bug("json encode: unsupported type"))}return c+"}"},decode:function(a){a=a.replace(/\s/g,"");a.match(/^\{.*\}$/)||q(new sjcl.exception.invalid("json decode: this isn't json!"));a=a.replace(/^\{|\}$/g,"").split(/,/);var b={},c,d;for(c=0;c<a.length;c++)(d=a[c].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i))||
q(new sjcl.exception.invalid("json decode: this isn't json!")),null!=d[3]?b[d[2]]=parseInt(d[3],10):null!=d[4]?b[d[2]]=d[2].match(/^(ct|adata|salt|iv)$/)?sjcl.codec.base64.toBits(d[4]):unescape(d[4]):null!=d[5]&&(b[d[2]]="true"===d[5]);return b},e:function(a,b,c){a===r&&(a={});if(b===r)return a;for(var d in b)b.hasOwnProperty(d)&&(c&&(a[d]!==r&&a[d]!==b[d])&&q(new sjcl.exception.invalid("required parameter overridden")),a[d]=b[d]);return a},fa:function(a,b){var c={},d;for(d in a)a.hasOwnProperty(d)&&
a[d]!==b[d]&&(c[d]=a[d]);return c},ea:function(a,b){var c={},d;for(d=0;d<b.length;d++)a[b[d]]!==r&&(c[b[d]]=a[b[d]]);return c}};sjcl.encrypt=sjcl.json.encrypt;sjcl.decrypt=sjcl.json.decrypt;sjcl.misc.ca={};sjcl.misc.cachedPbkdf2=function(a,b){var c=sjcl.misc.ca,d;b=b||{};d=b.iter||1E3;c=c[a]=c[a]||{};d=c[d]=c[d]||{firstSalt:b.salt&&b.salt.length?b.salt.slice(0):sjcl.random.randomWords(2,0)};c=b.salt===r?d.firstSalt:b.salt;d[c]=d[c]||sjcl.misc.pbkdf2(a,c,b.iter);return{key:d[c].slice(0),salt:c.slice(0)}};

/*
 *  THE "NAV START" | "non-js" file
 *  ----------------------------------------------------------------------------
 *  My purpose in life:
 *  -------------------
 *  I know what you're thinking, "What in the flying F#@! is this," - yeah. I'm
 *  a bit for an odd-ball; my entire purpose in life is to "open" an annonymous
 *  function for the global-nav sandbox.
 *
 *  While I am javascript, technically I'm *not* javascript - because I'm not
 *  a valid js file.  This is why I have the funky .nocheck.js extension.  There's
 *  no way I can EVER pass JSHint.  I also am equally destructive without my
 *  navend counter-part.
 *
 *  I'm included by:              - SCDS remote-nav concat group within remote-nav fizzy embed
 *
 *  File PRE-CONDITIONS:          - SCDS changes to allow .nocheck.js files must be in place.
 *                                - must be the VERY FIRST file called in the sandbox concat group
 *
 *  File POST-CONDITIONS:
 *
 *  CAVEATS/GOTCHAS:
 */
(function (){function remote_nav_eval(g){eval.apply(window,[g])}
var remote_nav=function(){function g(a){this.message=a;this.name="SandboxException"}var b=this;b.CONFIGS={SBX_JSCONTROL_PATTERN:/\bli-control\b/g,SBX_JSCONTROL_TYPE:"linkedin/control",SBX_INITIALIZED_CONTROL_TYPE:"text/javascript+initialized",SBX_ENV_LABEL:"SANDBOX"};b.data={control_registry:[],rawControlCode:[],codeAlreadyEvaled:!1,EXCLUDED_CONTROLS:{UniversalSearch:!0,Typeahead2:!0,StyledDropdown:!0,A11yMenu:!0,QuickHelp2:!0,"kb.shortcuts":!0}};b.debug={enabled:!1,setMode:function(a){var e=/debug_mode=enabled/;
a||(a=e.test(window.location.search));b.debug.enabled=a},sbx_log:function(){b.debug.enabled&&window.console&&window.console.log&&window.console.log(arguments)}};b.events={};b.helpers={_addSandboxControl:function(a,e,d){b.debug.sbx_log("SANDBOX | _addSandboxControl() | started ");var c=document.getElementById(a),f=b.helpers,k=f._getJSControlSibling(c),g=f._checkSBXRegistry(a);b.debug.sbx_log("SANDBOX | _addSandboxControl | is Controls present in the registry? | ",g);c.type===b.CONFIGS.SBX_INITIALIZED_CONTROL_TYPE||
g||b.data.EXCLUDED_CONTROLS[e]?b.data.EXCLUDED_CONTROLS[e]?(b.debug.sbx_log("SANDBOX | _addSandboxControl  | EXCLUDED CONTROL - using LI.Controls.addControl() instead"),window.LI.Controls.addControl(a,e,d)):b.debug.sbx_log("SANDBOX | _addSandboxControl | CONTROL ALREADY DEFINED... IGNORING"):(f._addToSBXRegistry(a,e,k,d),f._addCodeToEvalString(c),f._changeJSControlType(c))},_addToSBXRegistry:function(a,e,d,c){b.data.control_registry.push({id:a,name:e,el:d,config:c});a=b.helpers._checkSBXRegistry(a);
if(!a)throw new g("the control for some reason was NOT added to the registry");return a},_cleanSandbox:function(){b.data.control_registry=[]},_addCodeToEvalString:function(a){if("script"!==a.nodeName.toLowerCase())throw new g("attempting to add non-script innerHTML to the eval string");b.debug.sbx_log("SANDBOX | _addCodeToEvalString | about to push code to array");b.data.rawControlCode.push(a.innerHTML.replace(/LI\.Controls\.addControl/,"window.sandboxControlInit"))},_checkSBXRegistry:function(a){var e,
d=b.data.control_registry,c=d.length;for(e=0;e<c;e++)if(d[e].id===a)return!0;return!1},_getJSControlScripts:function(a){a=a.getElementsByTagName("script");var e=a.length,d=b.helpers._addCodeToEvalString,c=b.CONFIGS.SBX_JSCONTROL_TYPE,f;for(f=0;f<e;f++)a[f].getAttribute("type")===c&&d(a[f])},_getJSControlSibling:function(a){b.debug.sbx_log(a);var e=function(){return"previousElementSibling"in HTMLElement.prototype?function(a){return a.previousElementSibling}:function(a){do a=a.previousSibling;while(a&&
1!==a.nodeType);return a}}();a=e(a);do{if("script"!==a.nodeName.toLowerCase()&&!a.className.match(b.CONFIGS.SBX_JSCONTROL_PATTERN))return a;a=e(a)}while(a);return!1},_changeJSControlType:function(a){a.setAttribute("type",b.CONFIGS.SBX_INITIALIZED_CONTROL_TYPE);a.className="sbx-li-control"}};b.sandbox={initControl:function(){b.debug.sbx_log("SANDBOX | window.sandboxControlInit() called for the following Control script: ",arguments);b.helpers._addSandboxControl.apply(this,arguments)},oldLI:window.LI,
LI:{isSandboxed:!0,assign:function(a,e){for(var d=b.sandbox.LI,c=0,f=a.split("."),g=f.length;c<g;c++)d[f[c]]||(d[f[c]]=c+1===g&&e?e:{},d=d[f[c]]);return d},define:function(a){b.sandbox.LI.assign(a,{})},sandboxFromWindow:function(a,e){b.sandbox.LI.assign(e,a)}}};b.deploy={executeSandbox:function(a){var e=(typeof a).toLowerCase(),d=null;b.debug.setMode();if("object"===e){if(a.containerIDs)for(var e=0,c=a.containerIDs.length;e<c;e++)(d=document.getElementById(a.containerIDs[e]))?b.helpers._getJSControlScripts(d):
b.debug.sbx_log("SANDBOX | WARNING: The DOM element or ID",a," was not found - ignoring")}else"string"===e&&((d=document.getElementById(a))?b.helpers._getJSControlScripts(d):b.debug.sbx_log("SANDBOX | WARNING: The DOM element or ID",a," was not found - ignoring"));b.debug.sbx_log("SANDBOX | evaling code in executeSandbox()");b.data.rawControlCode.push("remote_nav.debug.sbx_log('SANDBOX | LI OBJECT IN EVAL IS: ', LI )");b.data.codeAlreadyEvaled||(a=b.data.rawControlCode.join(";"),b.debug.sbx_log(a),
b.deploy.injectOrEval(a))},injectOrEval:function(a){var e=document.getElementsByTagName("head")[0],d=document.createElement("script"),c=!1;try{d.text=a}catch(f){b.debug.sbx_log("SANDBOX | injectOrEval() | .text not supported,... trying .innerHTML");try{d.innerHTML=a}catch(g){b.debug.sbx_log("SANDBOX | injectOrEval() | cannot use .innerHTML on the script Element, and now the script tag is EMPTY"),c=!0}}if(!c)try{e.appendChild(d),b.debug.sbx_log("SANDBOX | injectOrEval() | SCRIPT TAG INJECTION FINISHED.")}catch(h){b.debug.sbx_log("SANDBOX | injectOrEval() | unable to append script tag to head - falling back on eval()"),
c=!0}c&&(b.debug.sbx_log("SANDBOX | unjectOrEval() | unable to either append the tag or it's empty, using eval()"),remote_nav_eval(a),b.debug.sbx_log("SANDBOX | injectOrEval() | CODE EVAL() [FALLBACK]  FINISHED."));b.data.codeAlreadyEvaled=!0},initSandboxControls:function(){b.debug.sbx_log("SANDBOX | initSandboxControls() | function called.");for(var a=b.data.control_registry.length,e=0,d=null;a--;){var c=b.data.control_registry[e++];if(c&&!c.sbx_isInitialized)if(b.debug.sbx_log("SANDBOX | initSandBoxControls :"+
c.name),b.sandbox.LI[c.name]?(b.debug.sbx_log("SANDBOX | Presence of faceded JSControl: "+typeof LI[c.name]),d=b.sandbox.LI):(b.debug.sbx_log("SANDBOX | JSControl not in sandbox -\x3e punching out to GLOBAL JSControl."),d=window.LI),d[c.name])try{new d[c.name](c.el,c.config),c.sbx_isInitialized=!0}catch(f){b.debug.sbx_log("SANDBOX | We gots problems - ",f)}else b.debug.sbx_log("SANDBOX | WARNING | This Control",c," did not initialize.")}}};b.public_API={initializeControls:b.deploy.initSandboxControls,
setUp:b.deploy.executeSandbox,sandbox:b.sandbox,debug:b.debug};window.LI_JS_TEST&&(b.public_API._test={config:b.config,data:b.data,helpers:b.helpers,deploy:b.deploy});return b.public_API}(),LI=remote_nav.sandbox.LI,LIModules=function(){function g(a,e){var d=a.split(".");a=d.pop();if(d=d.join(".")){var c=LI,f=0,g,h,d=(d.split?d.split("."):d)||[];if(c){for(g=d.length;f<g-1;f++)h=d[f],c=c&&c[h]||{};d=c[d[g-1]]}else d=void 0}d=d||LI;if(e)d[a]=e;else return(c=d[a])||(c=a,c=b[c]||c,c="function"===typeof c?
c():window[c]||void 0),c}var b={jquery:function(){return window.jQuery||window.$},underscore:"_",fiber:"Fiber","li-backbone":"MVC",backbone:"Backbone"};return{imports:function(a){return g(a)},requires:function(a){var b=g(a);if(b)return b;throw Error(a+" was not loaded or could not be found");},exports:function(a,b){g(a,b)},isSandboxed:!0}}();LI.LIModules=LIModules;window.sandboxControlInit=remote_nav.sandbox.initControl;window.remote_nav=remote_nav;window.sandboxedLI=LI;
LI.sandboxFromWindow(window.LI.Events,"Events");LI.sandboxFromWindow(window.LI.i18n,"i18n");LI.sandboxFromWindow(window.LI.show,"show");LI.sandboxFromWindow(window.LI.hide,"hide");LI.sandboxFromWindow(window.LI.Controls,"Controls");LI.sandboxFromWindow(window.LI.htmlEncode,"htmlEncode");LI.sandboxFromWindow(window.LI.domify,"domify");LI.sandboxFromWindow(window.LI.getDataAttribute,"getDataAttribute");LI.sandboxFromWindow(window.LI.asyncRequest,"asyncRequest");
LI.sandboxFromWindow(window.LI.isFullPage,"isFullPage");LI.sandboxFromWindow(window.LI.htmlUnencode,"htmlUnencode");LI.sandboxFromWindow(window.LI.log,"log");LI.sandboxFromWindow(window.LI.BaseControl,"BaseControl");LI.sandboxFromWindow(window.LI.Lego,"Lego");(function(){remote_nav.setUp({containerIDs:["a11y-menu","header"]});remote_nav.initializeControls();remote_nav.debug.sbx_log("REMOTE NAV SANBOX DONE")})();
/*  THE "NAV END" | "no js" file
 *  ----------------------------------------------------------------------------
 *  My purpose in life:
 *  --------------------------
 *  I finish the job of navstart.nocheck.js - closing the anonymous function
 *  scope for the sandbox.  Like navstart.nocheck.js, I'm also not technically
 *  valid javascript, and therefore won't pass JSHint.  We both exist, however,
 *  so that logic modifications to SCDS do not have to be made.
 *
 *  I'm included by:                - remote_nav SCDS concat group
 *
 *  I'm styled by:                  - N/A; JS plumbing/infrastructure
 *
 *  File PRE-CONDITIONS:
 *  File POST-CONDITIONS:
 *  CAVEATS/GOTCHAS:
 */
}());