if(!window.MS){window.MS={};}MS.Support=MS.Support||{};MS.Support.AC=MS.Support.AC||{};MS.Support.AC.EMT=function(options){if(typeof options==="undefined"){return null;}return this.CreateEMT(options);};MS.Support.AC.EMT.MakeErrorTool=function(options){MS.Support.AC.AddEvent(window,'load',function(){
 if(options.id&&MS.Support.AC.acarray){var newac=new MS.Support.AC.EMT(options);MS.Support.AC.acarray.push({key:options.id,val:newac});
 if(newac.options.emtAutoLoaded){newac.WriteScript(newac.options.resultsParams);}}});};MS.Support.AC.EMT.EMTOutputSuggestions=function(query,output,element){MS.Support.AC.ACArrayEl(element).OutputSuggestions(query,output);};MS.Support.AC.EMT.EMTOutputResults=function(element){MS.Support.AC.ACArrayEl(element).OutputResults();};MS.Support.AC.EMT.EMTErrorSuggestions=function(query,output,element){MS.Support.AC.ACArrayEl(element).ErrorSuggestions(query,output);};MS.Support.AC.EMT.CallSearch=function(element){var params='';if(MS.Support.AC.ACArrayEl(element).emtQueryStr["fr"]){params="&fr="+MS.Support.AC.ACArrayEl(element).emtQueryStr["fr"];}window.document.location.href="/search/default.aspx?query="+MS.Support.AC.EMT.OutputEncoder_EncodeUrl(document.getElementById(element).value)+params;};MS.Support.AC.EMT.OutputEncoder_EncodeUrl=function(strInput){if(typeof(strInput)=='undefined'){return "";}strInput=strInput.toString();var c;var EncodeUrl='';for(var cnt=0;cnt<strInput.length;cnt++){c=strInput.charCodeAt(cnt);if(((c>96)&&(c<123))||((c>64)&&(c<91))||((c>47)&&(c<58))||(c==46)||(c==45)||(c==95)){EncodeUrl=EncodeUrl+String.fromCharCode(c);}else if(c>127){EncodeUrl=EncodeUrl+'%u'+OutputEncoder_TwoByteHex(c);}else{EncodeUrl=EncodeUrl+'%'+OutputEncoder_SingleByteHex(c);}}return EncodeUrl;};MS.Support.AC.EMT.OutputEncoder_SingleByteHex=function(charC){var SingleByteHex=charC.toString(16);for(var cnt=SingleByteHex.length;cnt<2;cnt++){SingleByteHex="0"+SingleByteHex;}return SingleByteHex;};MS.Support.AC.EMT.OutputEncoder_TwoByteHex=function(charC){var TwoByteHex=charC.toString(16);for(var cnt=TwoByteHex.length;cnt<4;cnt++){TwoByteHex="0"+TwoByteHex;}return TwoByteHex;};MS.Support.AC.EMT.EmtResult=function(url,title,description,id){var retVal={URL : unescape(url),Title : unescape(title),Description : unescape(description),ID : id};return retVal;};MS.Support.AC.EMT.SetQueryLocaleInfo=function(selObjId,qInputId){var emtQueryBox=document.getElementById(qInputId);var selObj=document.getElementById(selObjId);MS.Support.AC.ACArrayEl(qInputId).SetEMTLang(selObj,emtQueryBox,true);if(!emtQueryBox.initialFlag){emtQueryBox.value='';}};MS.Support.AC.EMT.prototype={CreateEMT : function(opts){var emtopts={langID : '',outputDiv : '',instructionMsg : '',dosearch : false,noResultsMsg : '',appliesToMsg : '',outputUrl : '',outputError : '',emtCountDiv : null,emtSugText : null,emtAutoLoaded : false,emtATimer : null,acWidth : 'self',charbolding : 3,resultsParams : ''};this.ACOptionsFill(emtopts,opts||{});var t=this.CreateAC(emtopts);var o=this.options;o.startChar=1;
 t.options.removeInstr=function(event){t.EmtRemoveInstruction(event);};t.options.activityOn=function(event){t.emtActvShow(event);};t.options.activityOff=function(event){t.emtActvHide(event);};if(!q&&(!o.langID||typeof(o.langID)!=='string')){o.langID='en-us';}var q=document.getElementById(o.id);if(q){var d3=document.createElement('span');var d4=document.createElement('span');d3.style.overflow=d4.style.overflow='hidden';d4.style.fontFamily=d3.style.fontFamily=t.ACComputedStyle(q,"fontFamily");d3.className='gss_ac_countdiv';d3.style.whiteSpace='normal';d4.className='gss_ac_dtxt';d4.style.position='relative';if(this.options.lndir=='ltr'){
 d4.style.styleFloat=d4.style.cssFloat='left';d3.style.styleFloat=d3.style.cssFloat='right';d3.style.textAlign='right';}else{
 d4.style.styleFloat=d4.style.cssFloat='right';d3.style.styleFloat=d3.style.cssFloat='left';d3.style.textAlign='left';}var errorID=parseInt(t.emtQueryStr["errorid"],10);q.instructionMsg=(o.instructionMsg)? unescape(o.instructionMsg): 'Type Error Message Here';if(((!errorID||errorID==0)&&(!q.value||q.value.length===0))||(q.value==q.instructionMsg)){q.style.color='#888';q.value=q.instructionMsg;q.initialFlag=true;t.ACAddEvt(q,'mousedown',o.removeInstr);t.ACAddEvt(q,'keydown',o.removeInstr);}else{o.dosearch=true;}q.noResultsMsg=(o.noResultsMsg)? unescape(o.noResultsMsg): 'No matching results';q.outputError=(o.outputError)? unescape(o.outputError): 'Service Unavailable';q.outputURL=(o.outputURL)? unescape(o.outputURL): null;q.langID=unescape(o.langID);q.cookieKey=o.cookieKey;q.lcID=o.lcID;o.charbolding=o.enableBolding ? 3 : 0;if(o.outputDiv){q.outputDiv=o.outputDiv;q.appliesToMsg=(o.appliesToMsg)? unescape(o.appliesToMsg): 'Applies to:';}o.emtCountDiv=d3;o.emtSugText=d4;if(errorID>0&&document.getElementById(q.outputDiv).tagName){o.emtAutoLoaded=true;o.resultsParams="&op=2&id="+errorID;}var selectAddnLang=document.getElementById(o.langSelectId);if(selectAddnLang){t.ACAddEvt(selectAddnLang,'change',function(e){MS.Support.AC.EMT.SetQueryLocaleInfo(o.langSelectId,o.id)});this.SetEMTLang(selectAddnLang,q,true);}else{q.lcID=unescape(o.lcID);q.langID=unescape(o.langID);}}
 this.options.ACEllipsis.style.left=this.options.ACEllipsis.style.right='auto';return this;},emtQueryStr : new EmtQueryString(),EmtRemoveInstruction : function(e){e=this.ACSrcEl(e);if(e){e.value="";e.style.color='#000';e.initialFlag=false;this.options.acQueryBox.focus();this.options.dosearch=true;var t=this;t.ACKillEvt(e,'mousedown',t.options.removeInstr);t.ACKillEvt(e,'keydown',t.options.removeInstr);}},WriteScript: function(params){this.options.emtATimer=setTimeout(this.options.activityOn,500);var temp=document.getElementById('acScript');if(temp){this.options.achead.removeChild(temp);}var script=document.createElement('SCRIPT');script.id='acScript';script.setAttribute("type","text/javascript");script.src=this.options.acURL+'/ErrorFeed.aspx?eleid='+this.options.acQueryBox.id+'&lang='+this.options.acQueryBox.langID+params+'&lcid='+this.options.acQueryBox.lcID;this.options.achead.appendChild(script);},emtActvShow : function(){this.options.acQueryBox.style.background='#FFF url('+this.options.acURL+'/images/indicator_snake.gif) no-repeat scroll right center';if(this.options.lndir=='ltr'){this.options.acQueryBox.style.backgroundPosition='right center';}else{this.options.acQueryBox.style.backgroundPosition='left center';}this.options.emtATimer=setTimeout(this.options.activityOff,2000);},emtActvHide : function(){clearTimeout(this.options.emtATimer);this.options.acQueryBox.style.background='#FFF';},ACHideTarget : function(){if(this.options.acListDiv){this.ACDoHideTarget();this.options.acQueryBox.selectedIndex=-1;document.getElementById(this.options.noResultsLinkDivId).style.display='none';}},ACGetSuggestions : function(){if(this.options.acOldValue.length===0||!this.options.dosearch){this.ACHideTarget();return;}if(this.options.statsObj){
 
 this.options.statsObj.eventCollectionId=SetLogCollectionBit(this.options.statsObj.eventCollectionId,40);
 this.options.statsObj.flexId=11;this.options.statsObj.flexValue1=this.options.acOldValue.substr(0,256);}try{this.WriteScript("&op=1&fragment="+encodeURIComponent(this.options.acOldValue));}catch(e){}},EmtSuggestion : function(id,error,count){var retVal={ID : id,Error : unescape(error),Count : count};return retVal;},ACSort : function(arr){var srt=function(a,b){return a.Error.length - b.Error.length;};return arr.sort(srt);},OutputSuggestions : function(query,output){try{this.PopBubble();if(!this.options.acListDiv){return;}var sg=[];for(var i=0;i<output.length-1;i+=3){sg.push(this.EmtSuggestion(parseInt(output[i],10),output[i+1],output[i+2]));}sg=this.ACSort(sg);this.options.acListDiv.innerHTML="";if(sg.length===0){var d0=this.options.acNode.cloneNode(true);d0.style.cursor='default';var dtxt=this.options.emtSugText.cloneNode(true);dtxt.innerHTML=this.options.acQueryBox.noResultsMsg;d0.appendChild(dtxt);this.options.acListDiv.appendChild(d0);if(document.location.href.toLowerCase().indexOf('/gp/errormessage')>=0){document.getElementById(this.options.noResultsLinkDivId).style.display='block';}}else{document.getElementById(this.options.noResultsLinkDivId).style.display='none';}var t=this;
 
 

 query=query.RemoveRegexChrs();for(var i=0;i<sg.length;i++){var d0=this.options.acNode.cloneNode(true);d0.ErrorID=sg[i].ID;d0.setAttribute('textVal',sg[i].Error);d0.setAttribute('queryVal',query);var txt=document.createElement('span');txt.innerHTML=this.BoldChars(sg[i].Error,query);var dtxt=this.options.emtSugText.cloneNode(true);dtxt.id=dtxt.className+i;dtxt.appendChild(txt);var d2=this.options.emtCountDiv.cloneNode(true);d2.innerHTML=sg[i].Count.toString()+' '+this.options.resultsText;d0.ErrorTxt=sg[i].Error;this.ACAddEvt(d0,"mouseover",function(event){t.acMouseHighlight(event);});this.ACAddEvt(d2,"mouseover",function(event){t.acMouseHighlight(event);});this.ACAddEvt(dtxt,"mouseover",function(event){t.acMouseHighlight(event);});this.ACAddEvt(dtxt,"keyup",function(event){t.BlowBubble(event);});this.ACAddEvt(dtxt,"mouseover",function(event){t.BlowBubble(event);});this.ACAddEvt(d2,"keyup",function(event){t.BlowBubble(event);});this.ACAddEvt(d2,"mouseover",function(event){t.BlowBubble(event);});d0.appendChild(dtxt);d0.appendChild(d2);this.options.acListDiv.appendChild(d0);d2.style.width=(d2.offsetWidth+7)+'px';dtxt.style.width=(this.options.acListDiv.offsetWidth -(d2.offsetWidth+14))+'px';if(txt.offsetWidth>dtxt.offsetWidth){d0.setAttribute('balloon',true);var elip=this.options.ACEllipsis.cloneNode(true);dtxt.appendChild(elip);if(this.options.lndir=='ltr'){elip.style.right=0 -(parseInt(dtxt.style.width)% 2);}else{elip.style.left=0 -(parseInt(dtxt.style.width)% 2);}}}this.ACDoShowTarget();this.emtActvHide();}catch(ex){
 this.ACHideTarget();}},ErrorSuggestions : function(){try{if(!this.options.acListDiv){return;}this.options.acListDiv.innerHTML='';var d0=this.options.acNode.cloneNode(true);var d2=this.options.emtSugText.cloneNode(true);d2.innerHTML=this.options.acQueryBox.outputError;d0.appendChild(d2);this.options.acListDiv.appendChild(d0);this.ACDoShowTarget();}catch(ex){this.ACHideTarget();}},ACClickHandler : function(event){var el=this.ACSrcEl(event);var ic=this.ACIsChild(el,this.options.acListDiv);if(el===this.options.acQueryBox){return false;}if(!ic){this.ACHideTarget();return false;}var eeid;var eid=el.ErrorID;var ic=this.ACIsChild(el,this.options.acListDiv);while(!eid&&el.parentNode){el=el.parentNode;eid=el.ErrorID;}if(!this.options.acListDiv&&(!ic||(ic&&eid))){this.ACHideTarget();}if(!eid){return;}this.EmtGetResults(el);},EmtGetResults : function(e){var el=this.ACSrcEl(e);if(this.options.statsObj){
 
 this.options.statsObj.eventCollectionId=SetLogCollectionBit(this.options.statsObj.eventCollectionId,41);
 this.options.statsObj.flexId=11;this.options.statsObj.flexValue1=el.ErrorTxt.substr(0,256);}this.options.acQueryBox.value=el.ErrorTxt;var count=el.childNodes[0];if(count&&count.className=='emtCountDiv'&&count.innerHTML=='1'){var loc="&eleid="+this.options.acQueryBox.id+"op=2&id="+el.ErrorID;if(emtQueryStr["fr"]){loc+="&fr="+this.emtQueryStr["fr"];}this.WriteScript(loc);}else{var loc=this.options.outputURL+el.ErrorID;if(this.emtQueryStr["fr"]){loc+="&fr="+this.emtQueryStr["fr"];}document.location=loc;}},OutputResults : function(){this.emtActvHide();if(EmtResults.length==1){var addparam=(this.emtQueryStr["fr"])? "?fr="+this.emtQueryStr["fr"] : '';addparam=(addparam.length==0&&this.emtQueryStr["sd"])? "?sd="+this.emtQueryStr["sd"] : addparam;if(this.options.emtAutoLoaded){document.location.replace(EmtResults[0].URL+addparam);}else{document.location=EmtResults[0].URL+addparam;}return;}var ul=document.createElement("ul");document.getElementById(this.options.outputDiv).innerHTML='';document.getElementById(this.options.outputDiv).appendChild(ul);if(errorVerbatim){this.EmtRemoveInstruction(this.options.acQueryBox);this.options.acQueryBox.value=errorVerbatim;}var fr=(this.emtQueryStr['fr'])? '?fr=1' : '';for(var i=0;i<EmtResults.length;i++){var li=document.createElement('li');ul.appendChild(li);var a=document.createElement('a');a.href=EmtResults[i].URL+fr;a.appendChild(document.createTextNode(EmtResults[i].Title));li.appendChild(a);li.appendChild(document.createElement('br'));li.appendChild(document.createTextNode(EmtResults[i].Description));var ps=pids[EmtResults[i].ID];var pidFound=false;if(ps){var pidDiv=document.createElement('a');this.ACAddEvt(pidDiv,'click',this.ACStopDefault);pidDiv.href='#';var pidIcon=document.createElement('img');pidIcon.src=this.options.imgpath+'appliesto.gif';pidIcon.width='16';pidIcon.height='17';pidDiv.appendChild(pidIcon);var pidSpan=document.createElement('span');pidSpan.appendChild(document.createTextNode(this.options.appliesToMsg));pidSpan.appendChild(document.createElement('br'));var psa=ps.split(",");for(var j=0;j<psa.length&&j<10;j++){if(pnam[parseInt(psa[j],10)]){var li2=document.createElement('li');li2.appendChild(document.createTextNode(unescape(pnam[parseInt(psa[j],10)])));pidSpan.appendChild(li2);pidFound=true;}}pidDiv.appendChild(pidSpan);pidDiv.id="pidContainer";if(pidFound){li.appendChild(document.createElement('br'));li.appendChild(pidDiv);}}}},SetEMTLang : function(values,object,force){if(force){MS.Support.AC.SetCookie(object.cookieKey,values.value);}else{values.value=MS.Support.AC.FetchCookie(object.cookieKey);}var lcIdLNPair=values.value.split('|');object.lcID=unescape(lcIdLNPair[0]);object.langID=unescape(lcIdLNPair[1]);}};function EmtQueryString(){var qs=document.location.search.toString();if(qs.length>0){qs=qs.substring(1);}var pairs=qs.split('&');for(var i=0;i<pairs.length;i++){var pair=pairs[i].split('=');if(pair.length!=2){continue;}if(pair[1]==''){continue;}try{var key=decodeURI(pair[0]).toLowerCase();var value=decodeURI(pair[1]);}catch(e){var key=unescape(pair[0]).toLowerCase();var value=unescape(pair[1]);}if(this[key]){this[key]+=', '+value;}else{this[key]=value;}}}function mergeObjs(){var returnObj={};for(var i=0;i<arguments.length;i++){for(var p in arguments[i]){var pi=arguments[i][p];var pii=returnObj[p];if(pii&&typeof pi=='object'&&typeof pii=='object'){returnObj[p]=mergeObjs(pii,pi);}else{returnObj[p]=pi;}}}return returnObj;}MS.Support.AC.EMT.prototype=mergeObjs(MS.Support.AC.prototype,MS.Support.AC.EMT.prototype);