var vbCr="\r";var vbCrLf="\r\n";var vbLf="\n";var vbInvalidDate=null;var vbInvalidInt=null;var vbInvalidDouble=null;var g_elUnicodeClean=null;function UnicodeClean(s){s=(s||"").toString();if(!g_elUnicodeClean){g_elUnicodeClean=document.createElement("span")}g_elUnicodeClean.textContent=s;g_elUnicodeClean.innerText=s;return g_elUnicodeClean.innerHTML.replace(/"/g,""")}var g_elDecodeHTMLEnt=null;function DecodeHTMLEnt(s){s=(s||"").toString();if(!g_elDecodeHTMLEnt){g_elDecodeHTMLEnt=document.createElement("span")}g_elDecodeHTMLEnt.innerHTML=s;return g_elDecodeHTMLEnt.textContent||g_elDecodeHTMLEnt.innerText||decodeAmp(decodeLTGT(g_elDecodeHTMLEnt.innerHTML))}function IsIE(){return window.ie}function IsIE8(){return window.ie8}function IsIE7(){return window.ie7}function IsIE6(){return window.ie6}function SingleQuoteForJavascript(s){s=(s||"").toString();return s.replace(/\\/gi,"\\\\").replace(/\'/gi,"\\'").replace(/\n/gi,"\\n").replace(/\/g,"\\x3e")}function UnicodeCleanTextArea(s){s=(s||"").toString();return UnicodeClean(s).replace(//gi,"\n")}function EscapeForRegExp(s){s=(s||"").toString();return s.replace(/([^a-zA-Z0-9 ])/g,"\\$1")}function Replace(s1,s2,s3){s1=(s1||"").toString();s2=(s2||"").toString();s3=(s3||"").toString();var res2=EscapeForRegExp(s2);var re=new RegExp(res2,"g");if(arguments[3]==undefined&&arguments[4]==undefined){return s1.replace(re,s3)}var ix=0;if(arguments[3]!=undefined){ix=arguments[3]-1}var right=s1.substr(ix);if(arguments[4]==undefined){return right.replace(re,s3)}re=new RegExp(res2,"");var c=arguments[4];var left="";while(c){ix=right.indexOf(s2);if(ix==-1)break;left=left+right.substr(0,ix)+s3;right=right.substr(ix+s2.length);c--}return left+right}function Len(s){if(s==undefined){return 0}if(s.toString){s=s.toString()}return s.length}function Left(s1,c){if(s1.toString){s1=s1.toString()}return s1.substr(0,c)}function Right(s1,c){if(s1.toString){s1=s1.toString()}return s1.substr(s1.length-c)}function InStr(s1,s2){if(s1.toString){s1=s1.toString()}if(s2.toString){s2=s2.toString()}var ixStart=0;if(arguments[2]!=undefined){ixStart=s1-1;s1=s2;s2=arguments[2]}var result=s1.indexOf(s2,ixStart);return result+1}function InStrRev(s1,s2){if(s1.toString){s1=s1.toString()}if(s2.toString){s2=s2.toString()}var ixStart=s1.length;if(arguments[2]!=undefined){ixStart=arguments[2]-1}var result=s1.lastIndexOf(s2,ixStart);return result+1}function Mid(s1,ix,c){if(s1.toString){s1=s1.toString()}if(isNaN(c)){return s1.substr(ix-1)}return s1.substr(ix-1,c)}function LCase(s){if(s.toString){s=s.toString()}return s.toLowerCase()}function UCase(s){if(s.toString){s=s.toString()}return s.toUpperCase()}function Join(rg,del){return rg.join(del)}function Split(s,del,c){if(s.toString){s=s.toString()}if(c!=undefined){return s.split(del,c)}else{return s.split(del)}}Swap1=swap1;Swap2=swap2;Swap3=swap3;Swap4=swap4;function CStr(x){if(x==undefined||x==null){return""}if(typeof x=="number"&&Math.floor(x)!=x){return floatToLocaleString(x)}return""+x}function IsEmpty(x){return typeof x=="undefined"}function IsNull(x){return x==null}function IsNumeric(x){return/^-?[0-9\.]+$/.test(x)}Err=new function(){this.Number=0};Now=function(){return new UTCDate};Int=parseInt;CLng=parseInt;CDbl=parseLocaleFloat;Round=function(x,places){if(!places){places=0}places=Math.pow(10,places);return Math.round(x*places)/places};var BrowserDate=Date;function UTCDate(){if(arguments.length>=3){this.__dt=new BrowserDate(arguments[0],arguments[1],arguments[2],arguments[3]||0,arguments[4]||0,arguments[5]||0,arguments[6]||0)}else if(arguments.length==1){this.__dt=new BrowserDate(arguments[0])}else{this.__dt=new BrowserDate;this.__dt.setMinutes(this.__dt.getMinutes()+this.__dt.getTimezoneOffset())}if(!UTCDate.prototype.getDate){var rg=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getTime","getTimezoneOffset","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getYear","setDate","setFullYear","setHours","setMilliseconds","setMinutes","setMonth","setSeconds","setTime","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setYear","toDateString","toGMTString","toLocaleString","toLocaleDateString","toLocaleTimeString","toSource","toString","toUTCString","valueOf"];function getWrapper(s){return function(){return this.__dt[s].apply(this.__dt,arguments)}}for(var ix=0;ix=g_ctzdtDaylightStart&&dtInTZ=g_ctzdtDaylightStart||dtInTZ12)nMonth-=12;while(nMonth<1)nMonth+=12;return nMonth}function CombineDateTime(xtzdtDate,xtzdtTime){return new UTCDate(xtzdtDate.getFullYear(),xtzdtDate.getMonth(),xtzdtDate.getDate(),xtzdtTime.getHours(),xtzdtTime.getMinutes(),xtzdtTime.getSeconds(),xtzdtTime.getMilliseconds())}function DateValue(dt){return new UTCDate(dt.getFullYear(),dt.getMonth(),dt.getDate(),0,0,0,0)}function TimeValue(dt){return new UTCDate(1970,0,0,dt.getHours(),dt.getMinutes(),dt.getSeconds(),dt.getMilliseconds())}function Year(dt){if(dt.getFullYear)return dt.getFullYear();var n=dt.getYear();if(n<10)return 2e3+n;if(n<100)return 1900+n;return n}function DateCombinator(s){return function(dt){return dt["get"+s]()}}Month=DateCombinator("Month");Day=DateCombinator("Date");Hour=DateCombinator("Hours");Minute=DateCombinator("Minutes");Second=DateCombinator("Seconds");function Dictionary(o){this.Items={};for(var key in o){this.Items[key]=o[key]}}Dictionary.prototype.Exists=function(key){return key in this.Items};Dictionary.prototype.Keys=function(){var rg=[];for(var key in this.Items){rg.push(key)}return rg};function IsDate(dt){return dt&&null!=dt.toUTCString}function LBound(rg){return 0}function UBound(rg){return rg.length-1}function CTZsDateFromUTC(dt){function Decoration(){var s=CTZsDateDecoratorFromUTC(dt,false);if(s){return" ("+s+")"}return""}return CTZsDateNoTimeFromUTC(dt)+Decoration()+" "+CTZsTimeFromUTC(dt)}function CTZsDateNoTimeFromUTC(dt){if(typeof dt=="string")dt=dt.replace(/\.|\-/g,"/");return CTZsDateRawFromUTC(new UTCDate(dt))}function InternalsDateNoTime(dt){if(typeof dt=="string")dt=dt.replace(/\.|\-/g,"/");return InternalsDateRaw(new BrowserDate(dt))}function InternalsDateRaw(dt){var sDate=GetLocaleDate();sDate=sDate.replace(new RegExp(FB_DATE_CODE),dt.getDate());sDate=sDate.replace(new RegExp(FB_MONTH_CODE),dt.getMonth()+1);sDate=sDate.replace(new RegExp(FB_YEAR_CODE),dt.getFullYear());return sDate}function InternalsTime(ctzdt){var sTime=GetLocaleTime();var lcsTime=sTime.toLowerCase();var f12HourTime=lcsTime.indexOf("a")!=-1||lcsTime.indexOf("p")!=-1;var sHours=ctzdt.getHours();var sMinutes=ctzdt.getMinutes()+"";var sActualAMPM="";var sAMPM="";var locAMPM=sTime.toLowerCase().lastIndexOf("a")!=-1?sTime.toLowerCase().lastIndexOf("a"):sTime.toLowerCase().lastIndexOf("p");if(locAMPM>0){sAMPM=sTime.substr(locAMPM);sAMPM=trim(sAMPM)}if(sAMPM.length>0){if(ctzdt.getHours()==0){sHours="12"}if(ctzdt.getHours()>12){sHours=ctzdt.getHours()-12}sActualAMPM=sAMPM;if(ctzdt.getHours()>11){sActualAMPM=sAMPM.replace(/a/,"p");sActualAMPM=sActualAMPM.replace(/A/,"P")}}sTime=sTime.replace(new RegExp(FB_HOUR_CODE),(sHours.length==1&&!this.f12HourTime?"0":"")+sHours);sTime=sTime.replace(new RegExp(FB_MINUTE_CODE),sMinutes.length==1?"0"+sMinutes:sMinutes);sTime=sTime.replace(sAMPM,sActualAMPM);return sTime}function ConvertDoubleToTime(dblHour){var nHour=Int(dblHour);var nMinute=(dblHour-nHour)*60;var dt=new UTCDate(1999,1,2,nHour,nMinute);return InternalsTime(dt)}function SerializeDate(dt){return""+dt.getFullYear()+"-"+(1+dt.getMonth())+"-"+dt.getDate()+" "+dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds()}function CTZsDateRawFromUTC(dt){return InternalsDateRaw(CTZFromUTC(dt))}function CTZsTimeFromUTC(dt){if(typeof dt=="string")dt=dt.replace(/\.|\-/g,"/");return InternalsTime(CTZFromUTC(new UTCDate(dt)))}function NullToBool(b){return!!(b||false)}function NullToZero(x){return x||0}function NullToBlank(x){if(x||x==0){return x}return""}function IntFromBool(b){return b?1:0}if(IsEmpty(Wasabi))var Wasabi={};if(IsEmpty(Wasabi.Runtime))Wasabi.Runtime={};Wasabi.Runtime.RegExp=function(pattern){this.Pattern=pattern};Wasabi.Runtime.RegExp.prototype={Pattern:"",Global:false,IgnoreCase:false,Multiline:false,Initialize:function(){if(this.re&&this.Pattern==this._Pattern&&this.Global==this._Global&&this.IgnoreCase==this._IgnoreCase&&this.Multiline==this._Multiline){return this.re}this._Pattern=this.Pattern;this._Global=this.Global;this._IgnoreCase=this.IgnoreCase;this._Multiline=this.Multiline;this.re=new RegExp(this.Pattern,(this.Global?"g":"")+(this.IgnoreCase?"i":"")+(this.Multiline?"m":""));return this.re},Execute:function(s){var re=this.Initialize();var rgMatch=[];var rgSubmatch;while(rgSubmatch=re.exec(s)){rgMatch.push(new Wasabi.Runtime.Match(rgSubmatch));if(!this.Global){break}}return new Wasabi.Runtime.MatchCollection(rgMatch)},Test:function(s){var re=this.Initialize();return re.test(s)},Replace:function(s,snew){var re=this.Initialize();return s.replace(re,snew)},Split:function(s){var re=this.Initialize();return s.split(re)}};Wasabi.Runtime.Match=function(arg){if(typeof arg=="string"){this.sValue=arg;this.rgSubmatch=new Wasabi.Runtime.MatchCollection([])}else{var rgSubmatch=arg;this.ixFirst=rgSubmatch.index;this.sValue=rgSubmatch[0];this.rgSubmatch=new Wasabi.Runtime.MatchCollection($(rgSubmatch.slice(1)).map(function(){return new Wasabi.Runtime.Match(this.toString())}))}};Wasabi.Runtime.Match.prototype={get_FirstIndex:function(){if(this.ixFirst==null){throw"Can't find the indices of RegExp submatches in Javascript."}return this.ixFirst+1},get_Length:function(){return this.get_Value().length},get_Value:function(){return this.sValue},get_SubMatches:function(){return this.rgSubmatch}};Wasabi.Runtime.MatchCollection=function(rgMatch){this.rgMatch=rgMatch};Wasabi.Runtime.MatchCollection.prototype={get_Count:function(){return this.rgMatch.length},get_item:function(i){return this.rgMatch[i]}};Array.prototype.select=function(fxn){var result=[];var ix;for(ix=0;ixbs){return 1}}return 0})}this._ix=-1;this._MoveTo=function(ix){var s,o;if(this._ix>=0){o=this._rg[this._ix];for(s in o){this[s]=undefined}}this._ix=ix;this.EOF=this._ix==this._rg.length;if(!this.EOF){o=this._rg[this._ix];for(s in o){this[s]=o[s]}}};this.MoveNext=function(){this._MoveTo(this._ix+1)};this.MoveFirst=function(){this._MoveTo(0)};this.get_EOF=function(){return this.EOF};this.Close=function(){this._rg=[];this._ix=2;this.EOF=true};this.MoveNext()}function CloseRS(rs){rs.Close()}function EntityClassGenerator(sTable){return function(){this.fLoaded=false;this.Load=function(ix){var sKey="ix"+sTable;var rg=DB[sTable].select(function(_){return _[sKey]==ix});this.fLoaded=rg.length==1;if(this.fLoaded){var s;for(s in rg[0]){this[s]=rg[0][s]}}return this.fLoaded};this.LoadByIx=function(ix){return this.Load(ix)};this.get_fDeleted=function(){return this.fDeleted}}}function ExtentEntityClasses(){CProject.prototype.LoadInbox=function(){var rg=DB.Project.select(function(_){return _.fInbox&&!_.fDeleted});if(rg.length==0)return false;return this.Load(rg.ixProject)};CPerson.prototype.IsSubscribedToBug=function(){return goBug.fSubscribed};CPerson.prototype.CanSee=function(ix){return IsVisible(ix)};CPerson.prototype.LoadMinimal=function(ix){return this.Load(ix)};CPerson.prototype.get_fLoaded=function(){return this.fLoaded};CPerson.Get=function(ix){var person=new CPerson;person.Load(ix);return person};CPerson.LoadPermissions=function(ix){var person=new CPerson;person.LoadMinimal(ix);return person}}var PERSON_NO_LINK=1;var PERSON_RSS=2;var PERSON_LINK_TOOLTIP=3;var PERSON_NAME_NO_CLEAN=4;function RenderAttributes(dict){for(var key in dict.Items){_g[_g.length]=" "+key+'="'+HtmlAttributeEncode(dict.Items[key])+'" '}}function FormatString(){var s=arguments[0];var data={};for(var i=1;i|\\("+sAAAEmailPattern+"\\)";var sEmailWithDisplayNameUnquotedPattern='[^\\s"]([^"]|\\\\")*('+sEmailBracketedPattern+")";var sEmailWithOptionalDisplayNamePattern='("(([^"]|\\\\")+)"\\s*)?('+sEmailBracketedPattern+"|"+sAAAEmailPattern+")";var sEmailWithRequiredDisplayNamePattern='("(([^"]|\\\\")+)"\\s*)('+sEmailBracketedPattern+"|"+sAAAEmailPattern+")";var sListOfEmails="^"+sEmailWithRequiredDisplayNamePattern+"(,\\s*"+sEmailWithRequiredDisplayNamePattern+")*$";var TIMESHEET_CASE_EM=6;var TIMESHEET_DELETE_EM=6;var TIMESHEET_MARGIN_EM=1;var TIMESHEET_START_TIME_EM=6;var TIMESHEET_TITLE_EM=25;function NavBarFilterMenuSaveAs(fSearch,sContent){var sLabel=sIif(fSearch,FB_SAVE_CURRENT_SEARCH_AS,FB_SAVE_CURRENT_FILTER_AS);var sPre=sIif(fSearch,"preSaveSearchAsFilter","preSaveCurrentFilterAs");_g[_g.length]=""+sLabel+""+'"}function HtmlBugTip(sHtmlTitle,sHtmlMsg,fError){HtmlBugTipWithClassAndWidth(sHtmlTitle,sHtmlMsg,fError,"bugTip","")}function HtmlBugTipWithClassAndWidth(sHtmlTitle,sHtmlMsg,fError,sHtmlAttrClass,sHtmlStylePropertyWidth){var sStyle="";var sID="";if(fError){sID='id="bugerror"';sStyle='style="color:#D7191C"'}_g[_g.length]='
0){_g[_g.length]='style="width:'+sHtmlStylePropertyWidth+';"'}_g[_g.length]=" "+sID+" >";if(Len(sHtmlTitle)>0){_g[_g.length]=""+sHtmlTitle+"
"}_g[_g.length]=sHtmlMsg;_g[_g.length]="

"}function MakeClientInfoAvailableForRelativeList(ixBug){}var IsInRelativeList_ixCurrent;var IsInRelativeList_fInList;function IsInRelativeList(sType,ixCurrent){var _r;_r=sType!=SEARCH_TYPE_BUG||ixCurrent!=IsInRelativeList_ixCurrent||IsInRelativeList_fInList;return _r}function LocalizedAxisName(sAxis){var _r;var rg=Split(sAxis,"|",2);if(UBound(rg)>=0){return rg[0]}return null;return _r}function BuildAxis(sAxis,sValue){var _r;var fQuote=InStr(sValue," ")>0||InStr(sValue,"-")>0||InStr(sValue,"+")>0;_r=Swap2(sIif(fQuote,'%1:"%2"',"%1:%2"),LocalizedAxisName(sAxis),Replace(sValue,'"',""));return _r}function PeopleSearchAsText(rgF){var sStatus=FB_USERS_ALL;if(rgF[0]){sStatus=FB_USERS_ACTIVE}if(rgF[1]){sStatus=FB_USERS_INACTIVE}var sType="";var sDesc="";if(rgF[3]&&rgF[4]&&rgF[5]){sType=""}else if(rgF[3]&&rgF[5]){sType=FB_USERS_NORMAL_VIRTUAL}else if(rgF[3]&&rgF[4]){sType=FB_USERS_NORMAL_COMMUNITY}else if(rgF[4]&&rgF[5]){sType=FB_USERS_COMMUNITY_VIRTUAL}else{if(rgF[3]){sType=FB_NORMAL_PLURAL}else if(rgF[4]){sType=FB_COMMUNITY_PLURAL}else if(rgF[5]){sType=FB_VIRTUAL_PLURAL}}if(Len(sType)==0&&!rgF[3]){sDesc=FB_NONE}else{sDesc=Swap2(sStatus,sType,FB_USERS)}_g[_g.length]=''+sDesc+' ';TreeDownIcon();_g[_g.length]=""}function UserDescription(fAdministrator,fCommunity,fVirtual){var _r;if(fAdministrator){_r=FB_ADMIN}else if(fCommunity){_r=FB_COMMUNITY_USER}else if(fVirtual){_r=FB_VIRTUAL_USER}else{_r=""}return _r}function NewUserControlSelect(fShowAnybodyCan,fAnybodyCanCreateAccounts,fShowCommunity,fAnybodyCanCreateCommunityAccounts){_g[_g.length]='\n \n"}function QueryPageNew(sCommand){var _r;return sCommand=="new"||sCommand=="newemail";return _r}function QueryPageEditable(sCommand){var _r;return sCommand=="assign"||sCommand=="close"||sCommand=="edit"||sCommand=="editClosed"||sCommand=="new"||sCommand=="newemail"||sCommand=="reactivate"||sCommand=="reopen"||sCommand=="resolve"||sCommand=="reply"||sCommand=="move"||sCommand=="forward"||sCommand=="email";return _r}function QueryPageEmail(sCommand){var _r;return sCommand=="reply"||sCommand=="forward"||sCommand=="newemail"||sCommand=="email";return _r}function QueryFieldsEditable(sCommand){var _r;return sCommand=="assign"||sCommand=="edit"||sCommand=="new"||sCommand=="newemail"||sCommand=="reactivate"||sCommand=="move"||sCommand=="reopen"||sCommand=="resolve";return _r}function ShowTime(sTimeFieldName,dt,sClass,fForceStyle,sTabIndexInput,sTabIndexButton){if(fForceStyle==_u){fForceStyle=true}if(sTabIndexInput==_u){sTabIndexInput=""}if(sTabIndexButton==_u){sTabIndexButton=""}var sId=sTimeFieldName;var ctzsDefault;if(dt==vbInvalidDate){ctzsDefault=GetLocaleTime()}else{ctzsDefault=CTZsTimeFromUTC(dt)}var dictAttrInput=new Dictionary({});dictAttrInput.Items["class"]=sClass+" dlgText";dictAttrInput.Items["tabindex"]=sTabIndexInput;if(fForceStyle){dictAttrInput.Items["style"]="width:75px; margin:2px 0;"}var dictAttrButton=new Dictionary({});dictAttrButton.Items["tabindex"]=sTabIndexButton;_g[_g.length]='';TimeInputField(sId,sTimeFieldName,ctzsDefault,dictAttrInput);TimeInputButton(sId,dictAttrButton);_g[_g.length]=""}function ShowCalendar(sDateFieldName,sTimeFieldName,dt,bPastAllowed,sClass,sKeyPressJs,sInvalidDateText,fForceStyle,sTabIndexInput,sTabIndexButton){if(sInvalidDateText==_u){sInvalidDateText=GetLocaleDate()}if(fForceStyle==_u){fForceStyle=true}if(sTabIndexInput==_u){sTabIndexInput=""}if(sTabIndexButton==_u){sTabIndexButton=""}var sId=sDateFieldName;var ctzsDefault;if(dt==vbInvalidDate){ctzsDefault=sInvalidDateText}else{ctzsDefault=CTZsDateRawFromUTC(dt)}var dictAttrInput=new Dictionary({});dictAttrInput.Items["class"]=sClass+" dlgText";dictAttrInput.Items["tabindex"]=sTabIndexInput;dictAttrInput.Items["onkeypress"]=sKeyPressJs;if(fForceStyle){dictAttrInput.Items["style"]="width:131px; margin:2px 0;"}var dictAttrButton=new Dictionary({});dictAttrButton.Items["tabindex"]=sTabIndexButton;_g[_g.length]='';DateInputField(sId,sDateFieldName,ctzsDefault,dictAttrInput,bPastAllowed,true);DateInputButton(sId,dictAttrButton,bPastAllowed,true);_g[_g.length]="";DateTimeBinding(sDateFieldName,sTimeFieldName)}function TimeInputField(sInputId,sInputName,sInputValue,dictAttrInput){if(dictAttrInput==null){dictAttrInput=new Dictionary({})}LCaseDict(dictAttrInput);var sInitialValue=sIif(IsDate(sInputValue),"",sInputValue);dictAttrInput.Items["id"]=sInputId;dictAttrInput.Items["name"]=sInputName;dictAttrInput.Items["value"]=sInputValue;dictAttrInput.Items["valueDefault"]=GetLocaleTime();dictAttrInput.Items["type"]="text";dictAttrInput.Items["onblur"]=Swap1("if(this.value != '' && this.value != '%1') { clo.setTime(clo.guessTime(this.value)); this.value=clo.getPrintableTime(); }",sInitialValue)+CStr(dictAttrInput.Items["onblur"]);dictAttrInput.Items["onclick"]=Swap1("if(this.value=='%1') { this.select(); }",sInitialValue)+CStr(dictAttrInput.Items["onclick"]);dictAttrInput.Items["onkeypress"]="if (stopFormSubmission(event)) this.onblur.apply(this);"+CStr(dictAttrInput.Items["onkeypress"]);RenderTag("input",dictAttrInput)}function TimeInputButton(sTimeInputId,dictAttrButton){if(dictAttrButton==null){dictAttrButton=new Dictionary({})}LCaseDict(dictAttrButton);if(!dictAttrButton.Exists("href")){dictAttrButton.Items["href"]="javascript:void 0;"}dictAttrButton.Items["onkeydown"]="if(isTab(event)) theMgr.hidePopup('tblTime');"+CStr(dictAttrButton.Items["onkeydown"]);dictAttrButton.Items["onclick"]=Swap1("clo.setTime(clo.guessTime(document.getElementById('%1').value));"+"clo.show('%1'); clo.focus(); return cancel(event);",sTimeInputId)+CStr(dictAttrButton.Items["onclick"]);RenderTag("a",dictAttrButton,pictureOf(ClockIcon))}function DateInputField(sInputId,sInputName,sInputValue,dictAttrInput,fAllowPast,fAllowFuture){if(fAllowPast==_u){fAllowPast=true}if(fAllowFuture==_u){fAllowFuture=true}if(dictAttrInput==null){dictAttrInput=new Dictionary({})}LCaseDict(dictAttrInput);var sInitialValue=sIif(IsDate(sInputValue),"",sInputValue);dictAttrInput.Items["id"]=sInputId;dictAttrInput.Items["name"]=sInputName;dictAttrInput.Items["value"]=sInputValue;dictAttrInput.Items["valueDefault"]=GetLocaleDate();dictAttrInput.Items["type"]="text";dictAttrInput.Items["onblur"]=Swap2("if(this.value != '' && this.value != '%1' && this.value.toLowerCase().indexOf('%2'.toLowerCase()) == -1) { cal.setDate(cal.guessDate(this.value)); this.value=CTZsDateRawFromUTC(cal.dt); }",sInitialValue,FB_NONE)+CStr(dictAttrInput.Items["onblur"]);dictAttrInput.Items["onclick"]=Swap1("if(this.value=='%1') { this.select(); }",sInitialValue)+CStr(dictAttrInput.Items["onclick"]);dictAttrInput.Items["onfocus"]=Swap2("cal.bFutureOK = %1; cal.bPastOK = %2;",SerializeBool(fAllowFuture),SerializeBool(fAllowPast))+CStr(dictAttrInput.Items["onfocus"]);dictAttrInput.Items["onkeypress"]="if (stopFormSubmission(event)) { this.onblur.apply(this); }"+CStr(dictAttrInput.Items["onkeypress"]);RenderTag("input",dictAttrInput)}function DateInputButton(sDateInputId,dictAttrButton,fAllowPast,fAllowFuture){if(fAllowPast==_u){fAllowPast=true}if(fAllowFuture==_u){fAllowFuture=true}if(dictAttrButton==null){dictAttrButton=new Dictionary({})}LCaseDict(dictAttrButton);if(!dictAttrButton.Exists("href")){dictAttrButton.Items["href"]="javascript:void 0;"}dictAttrButton.Items["onkeydown"]="if(isTab(event)) theMgr.hidePopup('tblTime');"+CStr(dictAttrButton.Items["onkeydown"]);dictAttrButton.Items["onclick"]=Swap2("cal.bFutureOK = %1; cal.bPastOK = %2; cal.fTextBar = true;",SerializeBool(fAllowFuture),SerializeBool(fAllowPast))+Swap1("cal.setDate(cal.guessDate(document.getElementById('%1').value));"+"cal.show('%1'); return cancel(event);",sDateInputId)+CStr(dictAttrButton.Items["onclick"]);RenderTag("a",dictAttrButton,pictureOf(CalendarIcon))}function DateTimeBinding(sDateInputId,sTimeInputId){if(!IsNothingOrEmpty(sDateInputId)&&!IsNothingOrEmpty(sTimeInputId)){_g[_g.length]=""}}function LCaseDict(dict){if(dict==null){return}var rgsKeys=dict.Keys();var ix;for(ix=LBound(rgsKeys);ix<=UBound(rgsKeys);ix++){var sKey=rgsKeys[ix];if(LCase(sKey)!=sKey){dict.Items[LCase(sKey)]=dict.Items[sKey];dict.Items[sKey]=null}}}function CalendarTable(){_g[_g.length]='\n \n';var i;var j;for(i=0;i<=5;i++){_g[_g.length]='';for(j=0;j<=6;j++){_g[_g.length]=''}_g[_g.length]=""}_g[_g.length]='\n
January
S M T W T F S
1
'+Replace(FB_NO_DATE," "," ")+' '+FB_CALENDAR_TODAY+' '+FB_TIPS+'
\n';_g[_g.length]='\n \n'; }function CalendarTimeTable(){var ws=GetWorkingSchedule();_g[_g.length]='"}function EditableTablePaneBegin(sId){_g[_g.length]="\n ";ClickMask("panemask"+sId,"EditableTableManager.hideAllPanes();theMgr.hideAllPopups();return false;");_g[_g.length]='\n
\n';ClickMask("panemaskSmall"+sId,"javascript:return (theMgr.hideAllPanePopups() || KeyManager.deactivateHotKeys());");_g[_g.length]='\n
 
\n'}function EditableTablePaneEnd(){_g[_g.length]="\n
\n"}function DeletePaneBegin(){_g[_g.length]='\n "+(numMonths[0]>0&&col==numMonths[1]-1?'
':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='
';var monthHtml="";if(secondary||!changeMonth)monthHtml+=''+monthNames[drawMonth]+"";else{var inMinYear=minDate&&minDate.getFullYear()==drawYear;var inMaxYear=maxDate&&maxDate.getFullYear()==drawYear;monthHtml+='"}if(!showMonthAfterYear)html+=monthHtml+(secondary||!(changeMonth&&changeYear)?" ":"");if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear)html+=''+drawYear+"";else{var years=this._get(inst,"yearRange").split(":");var thisYear=(new Date).getFullYear();var determineYear=function(value){var year=value.match(/c[+-].*/)?drawYear+parseInt(value.substring(1),10):value.match(/[+-].*/)?thisYear+parseInt(value,10):parseInt(value,10);return isNaN(year)?thisYear:year};var year=determineYear(years[0]);var endYear=Math.max(year,determineYear(years[1]||""));year=minDate?Math.max(year,minDate.getFullYear()):year;endYear=maxDate?Math.min(endYear,maxDate.getFullYear()):endYear;inst.yearshtml+='";html+=inst.yearshtml;inst.yearshtml=null}}html+=this._get(inst,"yearSuffix");if(showMonthAfterYear)html+=(secondary||!(changeMonth&&changeYear)?" ":"")+monthHtml;html+="
";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y")this._notifyChange(inst)},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var newDate=minDate&&datemaxDate?maxDate:newDate;return newDate},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange)onChange.apply(inst.input?inst.input[0]:null,[inst.selectedYear,inst.selectedMonth+1,inst])},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return numMonths==null?[1,1]:typeof numMonths=="number"?[1,numMonths]:numMonths},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null)},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0)date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));return this._isInRange(inst,date)},_isInRange:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return(!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime())},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=typeof shortYearCutoff!="string"?shortYearCutoff:(new Date).getFullYear()%100+parseInt(shortYearCutoff,10);return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=day?typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day)):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.bind("mouseout",function(event){var elem=$(event.target).closest(selector);if(!elem.length){return}elem.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(event){var elem=$(event.target).closest(selector);if($.datepicker._isDisabledDatepicker(instActive.inline?dpDiv.parent()[0]:instActive.input[0])||!elem.length){return}elem.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");elem.addClass("ui-state-hover");if(elem.hasClass("ui-datepicker-prev"))elem.addClass("ui-datepicker-prev-hover");if(elem.hasClass("ui-datepicker-next"))elem.addClass("ui-datepicker-next-hover")})}function extendRemove(target,props){$.extend(target,props);for(var name in props)if(props[name]==null||props[name]==undefined)target[name]=props[name];return target}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.fn.datepicker=function(options){if(!this.length){return this}if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate"||options=="widget"))return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker;$.datepicker.initialized=false;$.datepicker.uuid=(new Date).getTime();$.datepicker.version="1.8.23";window["DP_jQuery_"+dpuuid]=$})(jQuery);(function($,undefined){var uiDialogClasses="ui-dialog "+"ui-widget "+"ui-widget-content "+"ui-corner-all ",sizeRelatedOptions={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};$.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0){$(this).css("top",pos.top-topOffset)}}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string"){this.originalTitle=""}this.options.title=this.options.title||this.originalTitle;var self=this,options=self.options,title=options.title||" ",titleId=$.ui.dialog.getTitleId(self.element),uiDialog=(self.uiDialog=$("
")).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({zIndex:options.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(event){if(options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){self.close(event);event.preventDefault()}}).attr({role:"dialog","aria-labelledby":titleId}).mousedown(function(event){self.moveToTop(false,event)}),uiDialogContent=self.element.show().removeAttr("title").addClass("ui-dialog-content "+"ui-widget-content").appendTo(uiDialog),uiDialogTitlebar=(self.uiDialogTitlebar=$("
")).addClass("ui-dialog-titlebar "+"ui-widget-header "+"ui-corner-all "+"ui-helper-clearfix").prependTo(uiDialog),uiDialogTitlebarClose=$('').addClass("ui-dialog-titlebar-close "+"ui-corner-all").attr("role","button").hover(function(){ uiDialogTitlebarClose.addClass("ui-state-hover")},function(){uiDialogTitlebarClose.removeClass("ui-state-hover")}).focus(function(){uiDialogTitlebarClose.addClass("ui-state-focus")}).blur(function(){uiDialogTitlebarClose.removeClass("ui-state-focus")}).click(function(event){self.close(event);return false}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(self.uiDialogTitlebarCloseText=$("")).addClass("ui-icon "+"ui-icon-closethick").text(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$("").addClass("ui-dialog-title").attr("id",titleId).html(title).prependTo(uiDialogTitlebar);if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose)){options.beforeClose=options.beforeclose}uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();if(options.draggable&&$.fn.draggable){self._makeDraggable()}if(options.resizable&&$.fn.resizable){self._makeResizable()}self._createButtons(options.buttons);self._isOpen=false;if($.fn.bgiframe){uiDialog.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var self=this;if(self.overlay){self.overlay.destroy()}self.uiDialog.hide();self.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");self.uiDialog.remove();if(self.originalTitle){self.element.attr("title",self.originalTitle)}return self},widget:function(){return this.uiDialog},close:function(event){var self=this,maxZ,thisZ;if(false===self._trigger("beforeClose",event)){return}if(self.overlay){self.overlay.destroy()}self.uiDialog.unbind("keypress.ui-dialog");self._isOpen=false;if(self.options.hide){self.uiDialog.hide(self.options.hide,function(){self._trigger("close",event)})}else{self.uiDialog.hide();self._trigger("close",event)}$.ui.dialog.overlay.resize();if(self.options.modal){maxZ=0;$(".ui-dialog").each(function(){if(this!==self.uiDialog[0]){thisZ=$(this).css("z-index");if(!isNaN(thisZ)){maxZ=Math.max(maxZ,thisZ)}}});$.ui.dialog.maxZ=maxZ}return self},isOpen:function(){return this._isOpen},moveToTop:function(force,event){var self=this,options=self.options,saveScroll;if(options.modal&&!force||!options.stack&&!options.modal){return self._trigger("focus",event)}if(options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=options.zIndex}if(self.overlay){$.ui.dialog.maxZ+=1;self.overlay.$el.css("z-index",$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ)}saveScroll={scrollTop:self.element.scrollTop(),scrollLeft:self.element.scrollLeft()};$.ui.dialog.maxZ+=1;self.uiDialog.css("z-index",$.ui.dialog.maxZ);self.element.attr(saveScroll);self._trigger("focus",event);return self},open:function(){if(this._isOpen){return}var self=this,options=self.options,uiDialog=self.uiDialog;self.overlay=options.modal?new $.ui.dialog.overlay(self):null;self._size();self._position(options.position);uiDialog.show(options.show);self.moveToTop(true);if(options.modal){uiDialog.bind("keydown.ui-dialog",function(event){if(event.keyCode!==$.ui.keyCode.TAB){return}var tabbables=$(":tabbable",this),first=tabbables.filter(":first"),last=tabbables.filter(":last");if(event.target===last[0]&&!event.shiftKey){first.focus(1);return false}else if(event.target===first[0]&&event.shiftKey){last.focus(1);return false}})}$(self.element.find(":tabbable").get().concat(uiDialog.find(".ui-dialog-buttonpane :tabbable").get().concat(uiDialog.get()))).eq(0).focus();self._isOpen=true;self._trigger("open");return self},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$("
").addClass("ui-dialog-buttonpane "+"ui-widget-content "+"ui-helper-clearfix"),uiButtonSet=$("
").addClass("ui-dialog-buttonset").appendTo(uiDialogButtonPane);self.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof buttons==="object"&&buttons!==null){$.each(buttons,function(){return!(hasButtons=true)})}if(hasButtons){$.each(buttons,function(name,props){props=$.isFunction(props)?{click:props,text:name}:props;var button=$('').click(function(){props.click.apply(self.element[0],arguments)}).appendTo(uiButtonSet);$.each(props,function(key,value){if(key==="click"){return}if(key in button){button[key](value)}else{button.attr(key,value)}});if($.fn.button){button.button()}});uiDialogButtonPane.appendTo(self.uiDialog)}},_makeDraggable:function(){var self=this,options=self.options,doc=$(document),heightBeforeDrag;function filteredUi(ui){return{position:ui.position,offset:ui.offset}}self.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){heightBeforeDrag=options.height==="auto"?"auto":$(this).height();$(this).height($(this).height()).addClass("ui-dialog-dragging");self._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){self._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){options.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);self._trigger("dragStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}})},_makeResizable:function(handles){handles=handles===undefined?this.options.resizable:handles;var self=this,options=self.options,position=self.uiDialog.css("position"),resizeHandles=typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw";function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}self.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:self.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:self._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");self._trigger("resizeStart",event,filteredUi(ui))},resize:function(event,ui){self._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();self._trigger("resizeStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}}).css("position",position).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var options=this.options;if(options.height==="auto"){return options.minHeight}else{return Math.min(options.minHeight,options.height)}},_position:function(position){var myAt=[],offset=[0,0],isVisible;if(position){if(typeof position==="string"||typeof position==="object"&&"0"in position){myAt=position.split?position.split(" "):[position[0],position[1]];if(myAt.length===1){myAt[1]=myAt[0]}$.each(["left","top"],function(i,offsetPosition){if(+myAt[i]===myAt[i]){offset[i]=myAt[i];myAt[i]=offsetPosition}});position={my:myAt.join(" "),at:myAt.join(" "),offset:offset.join(" ")}}position=$.extend({},$.ui.dialog.prototype.options.position,position)}else{position=$.ui.dialog.prototype.options.position}isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position($.extend({of:window},position));if(!isVisible){this.uiDialog.hide()}},_setOptions:function(options){var self=this,resizableOptions={},resize=false;$.each(options,function(key,value){self._setOption(key,value);if(key in sizeRelatedOptions){resize=true}if(key in resizableRelatedOptions){resizableOptions[key]=value}});if(resize){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",resizableOptions)}},_setOption:function(key,value){var self=this,uiDialog=self.uiDialog;switch(key){case"beforeclose":key="beforeClose";break;case"buttons":self._createButtons(value);break;case"closeText":self.uiDialogTitlebarCloseText.text(""+value);break;case"dialogClass":uiDialog.removeClass(self.options.dialogClass).addClass(uiDialogClasses+value);break;case"disabled":if(value){uiDialog.addClass("ui-dialog-disabled")}else{uiDialog.removeClass("ui-dialog-disabled")}break;case"draggable":var isDraggable=uiDialog.is(":data(draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy")}if(!isDraggable&&value){self._makeDraggable()}break;case"position":self._position(value);break;case"resizable":var isResizable=uiDialog.is(":data(resizable)");if(isResizable&&!value){uiDialog.resizable("destroy")}if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value)}if(!isResizable&&value!==false){self._makeResizable(value)}break;case"title":$(".ui-dialog-title",self.uiDialogTitlebar).html(""+(value||" "));break}$.Widget.prototype._setOption.apply(self,arguments)},_size:function(){var options=this.options,nonContentHeight,minContentHeight,isVisible=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(options.minWidth>options.width){options.width=options.minWidth}nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).height();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);if(options.height==="auto"){if($.support.minHeight){this.element.css({minHeight:minContentHeight,height:"auto"})}else{this.uiDialog.show();var autoHeight=this.element.css("height","auto").height();if(!isVisible){this.uiDialog.hide()}this.element.height(Math.max(autoHeight,minContentHeight))}}else{this.element.height(Math.max(options.height-nonContentHeight,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});$.extend($.ui.dialog,{version:"1.8.23",uuid:0,maxZ:0,getTitleId:function($el){var id=$el.attr("id");if(!id){this.uuid+=1;id=this.uuid}return"ui-dialog-title-"+id},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog)}});$.extend($.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:$.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(event){return event+".dialog-overlay"}).join(" "),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length){$(document).bind($.ui.dialog.overlay.events,function(event){if($(event.target).zIndex()<$.ui.dialog.overlay.maxZ){return false}})}},1);$(document).bind("keydown.dialog-overlay",function(event){if(dialog.options.closeOnEscape&&!event.isDefaultPrevented()&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){dialog.close(event);event.preventDefault()}});$(window).bind("resize.dialog-overlay",$.ui.dialog.overlay.resize)}var $el=(this.oldInstances.pop()||$("
").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if($.fn.bgiframe){$el.bgiframe()}this.instances.push($el);return $el},destroy:function($el){var indexOf=$.inArray($el,this.instances);if(indexOf!=-1){this.oldInstances.push(this.instances.splice(indexOf,1)[0])}if(this.instances.length===0){$([document,window]).unbind(".dialog-overlay")}$el.remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css("z-index"))});this.maxZ=maxZ},height:function(){var scrollHeight,offsetHeight;if($.browser.msie&&$.browser.version<7){scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight0?position.left-over:Math.max(position.left-data.collisionPosition.left,position.left)},top:function(position,data){var win=$(window),over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop();position.top=over>0?position.top-over:Math.max(position.top-data.collisionPosition.top,position.top)}},flip:{left:function(position,data){if(data.at[0]===center){return}var win=$(window),over=data.collisionPosition.left+data.collisionWidth-win.width()-win.scrollLeft(),myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:-data.targetWidth,offset=-2*data.offset[0];position.left+=data.collisionPosition.left<0?myOffset+atOffset+offset:over>0?myOffset+atOffset+offset:0},top:function(position,data){if(data.at[1]===center){return}var win=$(window),over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop(),myOffset=data.my[1]==="top"?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:-data.targetHeight,offset=-2*data.offset[1];position.top+=data.collisionPosition.top<0?myOffset+atOffset+offset:over>0?myOffset+atOffset+offset:0}}};if(!$.offset.setOffset){$.offset.setOffset=function(elem,options){if(/static/.test($.curCSS(elem,"position"))){elem.style.position="relative"}var curElem=$(elem),curOffset=curElem.offset(),curTop=parseInt($.curCSS(elem,"top",true),10)||0,curLeft=parseInt($.curCSS(elem,"left",true),10)||0,props={top:options.top-curOffset.top+curTop,left:options.left-curOffset.left+curLeft};if("using"in options){options.using.call(elem,props)}else{curElem.css(props)}};$.fn.offset=function(options){var elem=this[0];if(!elem||!elem.ownerDocument){return null}if(options){if($.isFunction(options)){return this.each(function(i){$(this).offset(options.call(this,i,$(this).offset()))})}return this.each(function(){$.offset.setOffset(this,options)})}return _offset.call(this)}}if(!$.curCSS){$.curCSS=$.css}(function(){var body=document.getElementsByTagName("body")[0],div=document.createElement("div"),testElement,testElementParent,testElementStyle,offset,offsetTotal;testElement=document.createElement(body?"div":"body");testElementStyle={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(body){$.extend(testElementStyle,{position:"absolute",left:"-1000px",top:"-1000px"})}for(var i in testElementStyle){testElement.style[i]=testElementStyle[i]}testElement.appendChild(div);testElementParent=body||document.documentElement;testElementParent.insertBefore(testElement,testElementParent.firstChild);div.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;";offset=$(div).offset(function(_,offset){return offset}).offset();testElement.innerHTML="";testElementParent.removeChild(testElement);offsetTotal=offset.top+offset.left+(body?2e3:0);support.fractions=offsetTotal>21&&offsetTotal<22})()})(jQuery);(function($,undefined){$.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=$("
").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove();$.Widget.prototype.destroy.apply(this,arguments)},value:function(newValue){if(newValue===undefined){return this._value()}this._setOption("value",newValue);return this},_setOption:function(key,value){if(key==="value"){this.options.value=value;this._refreshValue();if(this._value()===this.options.max){this._trigger("complete")}}$.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var val=this.options.value;if(typeof val!=="number"){val=0}return Math.min(this.options.max,Math.max(this.min,val))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var value=this.value();var percentage=this._percentage();if(this.oldValue!==value){this.oldValue=value;this._trigger("change")}this.valueDiv.toggle(value>this.min).toggleClass("ui-corner-right",value===this.options.max).width(percentage.toFixed(0)+"%");this.element.attr("aria-valuenow",value)}});$.extend($.ui.progressbar,{version:"1.8.23"})})(jQuery);(function($,undefined){var numPages=5;$.widget("ui.slider",$.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var self=this,o=this.options,existingHandles=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),handle="",handleCount=o.values&&o.values.length||1,handles=[];this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(o.disabled?" ui-slider-disabled ui-disabled":""));this.range=$([]);if(o.range){if(o.range===true){if(!o.values){o.values=[this._valueMin(),this._valueMin()]}if(o.values.length&&o.values.length!==2){o.values=[o.values[0],o.values[0]]}}this.range=$("
").appendTo(this.element).addClass("ui-slider-range"+" ui-widget-header"+(o.range==="min"||o.range==="max"?" ui-slider-range-"+o.range:""))}for(var i=existingHandles.length;ithisDistance){distance=thisDistance;closestHandle=$(this);index=i}});if(o.range===true&&this.values(1)===o.min){index+=1;closestHandle=$(this.handles[index])}allowed=this._start(event,index);if(allowed===false){return false}this._mouseSliding=true;self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();offset=closestHandle.offset();mouseOverHandle=!$(event.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-closestHandle.width()/2,top:event.pageY-offset.top-closestHandle.height()/2-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue)}this._animateOff=true;return true},_mouseStart:function(event){return true},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}percentMouse=pixelMouse/pixelTotal;if(percentMouse>1){percentMouse=1}if(percentMouse<0){percentMouse=0}if(this.orientation==="vertical"){percentMouse=1-percentMouse}valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse)},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values()}return this._trigger("start",event,uiHash)},_slide:function(event,index,newVal){var otherVal,newValues,allowed;if(this.options.values&&this.options.values.length){otherVal=this.values(index?0:1);if(this.options.values.length===2&&this.options.range===true&&(index===0&&newVal>otherVal||index===1&&newVal1){this.options.values[index]=this._trimAlignValue(newValue);this._refreshValue();this._change(null,index);return}if(arguments.length){if($.isArray(arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i=this._valueMax()){return this._valueMax()}var step=this.options.step>0?this.options.step:1,valModStep=(val-this._valueMin())%step,alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=valModStep>0?step:-step}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var oRange=this.options.range,o=this.options,self=this,animate=!this._animateOff?o.animate:false,valPercent,_set={},lastValPercent,value,valueMin,valueMax;if(this.options.values&&this.options.values.length){this.handles.each(function(i,j){valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(self.options.range===true){if(self.orientation==="horizontal"){if(i===0){self.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({width:valPercent-lastValPercent+"%"},{queue:false,duration:o.animate})}}else{if(i===0){self.range.stop(1,1)[animate?"animate":"css"]({bottom:valPercent+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({height:valPercent-lastValPercent+"%"},{queue:false,duration:o.animate})}}}lastValPercent=valPercent})}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=valueMax!==valueMin?(value-valueMin)/(valueMax-valueMin)*100:0;_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate)}if(oRange==="max"&&this.orientation==="horizontal"){this.range[animate?"animate":"css"]({width:100-valPercent+"%"},{queue:false,duration:o.animate})}if(oRange==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate)}if(oRange==="max"&&this.orientation==="vertical"){this.range[animate?"animate":"css"]({height:100-valPercent+"%"},{queue:false,duration:o.animate})}}}});$.extend($.ui.slider,{version:"1.8.23" })})(jQuery);(function($,undefined){var tabId=0,listId=0;function getNextTabId(){return++tabId}function getNextListId(){return++listId}$.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(key,value){if(key=="selected"){if(this.options.collapsible&&value==this.options.selected){return}this.select(value)}else{this.options[key]=value;this._tabify()}},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+getNextTabId()},_sanitizeSelector:function(hash){return hash.replace(/:/g,"\\:")},_cookie:function(){var cookie=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+getNextListId());return $.cookie.apply(null,[cookie].concat($.makeArray(arguments)))},_ui:function(tab,panel){return{tab:tab,panel:panel,index:this.anchors.index(tab)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var el=$(this);el.html(el.data("label.tabs")).removeData("label.tabs")})},_tabify:function(init){var self=this,o=this.options,fragmentId=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=$(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return $("a",this)[0]});this.panels=$([]);this.anchors.each(function(i,a){var href=$(a).attr("href");var hrefBase=href.split("#")[0],baseEl;if(hrefBase&&(hrefBase===location.toString().split("#")[0]||(baseEl=$("base")[0])&&hrefBase===baseEl.href)){href=a.hash;a.href=href}if(fragmentId.test(href)){self.panels=self.panels.add(self.element.find(self._sanitizeSelector(href)))}else if(href&&href!=="#"){$.data(a,"href.tabs",href);$.data(a,"load.tabs",href.replace(/#.*$/,""));var id=self._tabId(a);a.href="#"+id;var $panel=self.element.find("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(self.panels[i-1]||self.list);$panel.data("destroy.tabs",true)}self.panels=self.panels.add($panel)}else{o.disabled.push(i)}});if(init){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(o.selected===undefined){if(location.hash){this.anchors.each(function(i,a){if(a.hash==location.hash){o.selected=i;return false}})}if(typeof o.selected!=="number"&&o.cookie){o.selected=parseInt(self._cookie(),10)}if(typeof o.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){o.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}o.selected=o.selected||(this.lis.length?0:-1)}else if(o.selected===null){o.selected=-1}o.selected=o.selected>=0&&this.anchors[o.selected]||o.selected<0?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.lis.filter(".ui-state-disabled"),function(n,i){return self.lis.index(n)}))).sort();if($.inArray(o.selected,o.disabled)!=-1){o.disabled.splice($.inArray(o.selected,o.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(o.selected>=0&&this.anchors.length){self.element.find(self._sanitizeSelector(self.anchors[o.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(o.selected).addClass("ui-tabs-selected ui-state-active");self.element.queue("tabs",function(){self._trigger("show",null,self._ui(self.anchors[o.selected],self.element.find(self._sanitizeSelector(self.anchors[o.selected].hash))[0]))});this.load(o.selected)}$(window).bind("unload",function(){self.lis.add(self.anchors).unbind(".tabs");self.lis=self.anchors=self.panels=null})}else{o.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[o.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(o.cookie){this._cookie(o.selected,o.cookie)}for(var i=0,li;li=this.lis[i];i++){$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(o.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(o.event!=="mouseover"){var addState=function(state,el){if(el.is(":not(.ui-state-disabled)")){el.addClass("ui-state-"+state)}};var removeState=function(state,el){el.removeClass("ui-state-"+state)};this.lis.bind("mouseover.tabs",function(){addState("hover",$(this))});this.lis.bind("mouseout.tabs",function(){removeState("hover",$(this))});this.anchors.bind("focus.tabs",function(){addState("focus",$(this).closest("li"))});this.anchors.bind("blur.tabs",function(){removeState("focus",$(this).closest("li"))})}var hideFx,showFx;if(o.fx){if($.isArray(o.fx)){hideFx=o.fx[0];showFx=o.fx[1]}else{hideFx=showFx=o.fx}}function resetStyle($el,fx){$el.css("display","");if(!$.support.opacity&&fx.opacity){$el[0].style.removeAttribute("filter")}}var showTab=showFx?function(clicked,$show){$(clicked).closest("li").addClass("ui-tabs-selected ui-state-active");$show.hide().removeClass("ui-tabs-hide").animate(showFx,showFx.duration||"normal",function(){resetStyle($show,showFx);self._trigger("show",null,self._ui(clicked,$show[0]))})}:function(clicked,$show){$(clicked).closest("li").addClass("ui-tabs-selected ui-state-active");$show.removeClass("ui-tabs-hide");self._trigger("show",null,self._ui(clicked,$show[0]))};var hideTab=hideFx?function(clicked,$hide){$hide.animate(hideFx,hideFx.duration||"normal",function(){self.lis.removeClass("ui-tabs-selected ui-state-active");$hide.addClass("ui-tabs-hide");resetStyle($hide,hideFx);self.element.dequeue("tabs")})}:function(clicked,$hide,$show){self.lis.removeClass("ui-tabs-selected ui-state-active");$hide.addClass("ui-tabs-hide");self.element.dequeue("tabs")};this.anchors.bind(o.event+".tabs",function(){var el=this,$li=$(el).closest("li"),$hide=self.panels.filter(":not(.ui-tabs-hide)"),$show=self.element.find(self._sanitizeSelector(el.hash));if($li.hasClass("ui-tabs-selected")&&!o.collapsible||$li.hasClass("ui-state-disabled")||$li.hasClass("ui-state-processing")||self.panels.filter(":animated").length||self._trigger("select",null,self._ui(this,$show[0]))===false){this.blur();return false}o.selected=self.anchors.index(this);self.abort();if(o.collapsible){if($li.hasClass("ui-tabs-selected")){o.selected=-1;if(o.cookie){self._cookie(o.selected,o.cookie)}self.element.queue("tabs",function(){hideTab(el,$hide)}).dequeue("tabs");this.blur();return false}else if(!$hide.length){if(o.cookie){self._cookie(o.selected,o.cookie)}self.element.queue("tabs",function(){showTab(el,$show)});self.load(self.anchors.index(this));this.blur();return false}}if(o.cookie){self._cookie(o.selected,o.cookie)}if($show.length){if($hide.length){self.element.queue("tabs",function(){hideTab(el,$hide)})}self.element.queue("tabs",function(){showTab(el,$show)});self.load(self.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if($.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(index){if(typeof index=="string"){index=this.anchors.index(this.anchors.filter("[href$='"+index+"']"))}return index},destroy:function(){var o=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var href=$.data(this,"href.tabs");if(href){this.href=href}var $this=$(this).unbind(".tabs");$.each(["href","load","cache"],function(i,prefix){$this.removeData(prefix+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if($.data(this,"destroy.tabs")){$(this).remove()}else{$(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(o.cookie){this._cookie(null,o.cookie)}return this},add:function(url,label,index){if(index===undefined){index=this.anchors.length}var self=this,o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label)),id=!url.indexOf("#")?url.replace("#",""):this._tabId($("a",$li)[0]);$li.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var $panel=self.element.find("#"+id);if(!$panel.length){$panel=$(o.panelTemplate).attr("id",id).data("destroy.tabs",true)}$panel.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(index>=this.lis.length){$li.appendTo(this.list);$panel.appendTo(this.list[0].parentNode)}else{$li.insertBefore(this.lis[index]);$panel.insertBefore(this.panels[index])}o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this._tabify();if(this.anchors.length==1){o.selected=0;$li.addClass("ui-tabs-selected ui-state-active");$panel.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){self._trigger("show",null,self._ui(self.anchors[0],self.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[index],this.panels[index]));return this},remove:function(index){index=this._getIndex(index);var o=this.options,$li=this.lis.eq(index).remove(),$panel=this.panels.eq(index).remove();if($li.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(index+(index+1=index?--n:n});this._tabify();this._trigger("remove",null,this._ui($li.find("a")[0],$panel[0]));return this},enable:function(index){index=this._getIndex(index);var o=this.options;if($.inArray(index,o.disabled)==-1){return}this.lis.eq(index).removeClass("ui-state-disabled");o.disabled=$.grep(o.disabled,function(n,i){return n!=index});this._trigger("enable",null,this._ui(this.anchors[index],this.panels[index]));return this},disable:function(index){index=this._getIndex(index);var self=this,o=this.options;if(index!=o.selected){this.lis.eq(index).addClass("ui-state-disabled");o.disabled.push(index);o.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[index],this.panels[index]))}return this},select:function(index){index=this._getIndex(index);if(index==-1){if(this.options.collapsible&&this.options.selected!=-1){index=this.options.selected}else{return this}}this.anchors.eq(index).trigger(this.options.event+".tabs");return this},load:function(index){index=this._getIndex(index);var self=this,o=this.options,a=this.anchors.eq(index)[0],url=$.data(a,"load.tabs");this.abort();if(!url||this.element.queue("tabs").length!==0&&$.data(a,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(index).addClass("ui-state-processing");if(o.spinner){var span=$("span",a);span.data("label.tabs",span.html()).html(o.spinner)}this.xhr=$.ajax($.extend({},o.ajaxOptions,{url:url,success:function(r,s){self.element.find(self._sanitizeSelector(a.hash)).html(r);self._cleanup();if(o.cache){$.data(a,"cache.tabs",true)}self._trigger("load",null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.success(r,s)}catch(e){}},error:function(xhr,s,e){self._cleanup();self._trigger("load",null,self._ui(self.anchors[index],self.panels[index]));try{o.ajaxOptions.error(xhr,s,index,a)}catch(e){}}}));self.element.dequeue("tabs");return this},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(index,url){this.anchors.eq(index).removeData("cache.tabs").data("load.tabs",url);return this},length:function(){return this.anchors.length}});$.extend($.ui.tabs,{version:"1.8.23"});$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){var self=this,o=this.options;var rotate=self._rotate||(self._rotate=function(e){clearTimeout(self.rotation);self.rotation=setTimeout(function(){var t=o.selected;self.select(++t1&&(value===null||typeof value!=="object")){options=jQuery.extend({},options);if(value===null){options.expires=-1}if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setDate(t.getDate()+days)}return document.cookie=[encodeURIComponent(key),"=",options.raw?String(value):encodeURIComponent(String(value)),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}options=value||{};var result,decode=options.raw?function(s){return s}:decodeURIComponent;return(result=new RegExp("(?:^|; )"+encodeURIComponent(key)+"=([^;]*)").exec(document.cookie))?decode(result[1]):null};window.Modernizr=function(window,document,undefined){var version="2.7.1",Modernizr={},enableClasses=true,docElement=document.documentElement,mod="modernizr",modElem=document.createElement(mod),mStyle=modElem.style,inputElem=document.createElement("input"),smile=":)",toString={}.toString,prefixes=" -webkit- -moz- -o- -ms- ".split(" "),omPrefixes="Webkit Moz O ms",cssomPrefixes=omPrefixes.split(" "),domPrefixes=omPrefixes.toLowerCase().split(" "),ns={svg:"http://www.w3.org/2000/svg"},tests={},inputs={},attrs={},classes=[],slice=classes.slice,featureName,injectElementWithStyles=function(rule,callback,nodes,testnames){var style,ret,node,docOverflow,div=document.createElement("div"),body=document.body,fakeBody=body||document.createElement("body");if(parseInt(nodes,10)){while(nodes--){node=document.createElement("div");node.id=testnames?testnames[nodes]:mod+(nodes+1);div.appendChild(node)}}style=["­",'"].join("");div.id=mod;(body?div:fakeBody).innerHTML+=style;fakeBody.appendChild(div);if(!body){fakeBody.style.background="";fakeBody.style.overflow="hidden";docOverflow=docElement.style.overflow;docElement.style.overflow="hidden";docElement.appendChild(fakeBody)}ret=callback(div,rule);if(!body){fakeBody.parentNode.removeChild(fakeBody);docElement.style.overflow=docOverflow}else{div.parentNode.removeChild(div)}return!!ret},testMediaQuery=function(mq){var matchMedia=window.matchMedia||window.msMatchMedia;if(matchMedia){return matchMedia(mq).matches}var bool;injectElementWithStyles("@media "+mq+" { #"+mod+" { position: absolute; } }",function(node){bool=(window.getComputedStyle?getComputedStyle(node,null):node.currentStyle)["position"]=="absolute"});return bool},isEventSupported=function(){var TAGNAMES={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function isEventSupported(eventName,element){element=element||document.createElement(TAGNAMES[eventName]||"div");eventName="on"+eventName;var isSupported=eventName in element;if(!isSupported){if(!element.setAttribute){element=document.createElement("div")}if(element.setAttribute&&element.removeAttribute){element.setAttribute(eventName,"");isSupported=is(element[eventName],"function");if(!is(element[eventName],"undefined")){element[eventName]=undefined}element.removeAttribute(eventName)}}element=null;return isSupported}return isEventSupported}(),_hasOwnProperty={}.hasOwnProperty,hasOwnProp;if(!is(_hasOwnProperty,"undefined")&&!is(_hasOwnProperty.call,"undefined")){hasOwnProp=function(object,property){return _hasOwnProperty.call(object,property)}}else{hasOwnProp=function(object,property){return property in object&&is(object.constructor.prototype[property],"undefined")}}if(!Function.prototype.bind){Function.prototype.bind=function bind(that){var target=this;if(typeof target!="function"){throw new TypeError}var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var F=function(){};F.prototype=target.prototype;var self=new F;var result=target.apply(self,args.concat(slice.call(arguments)));if(Object(result)===result){return result}return self}else{return target.apply(that,args.concat(slice.call(arguments)))}};return bound}}function setCss(str){mStyle.cssText=str}function setCssAll(str1,str2){return setCss(prefixes.join(str1+";")+(str2||""))}function is(obj,type){return typeof obj===type}function contains(str,substr){return!!~(""+str).indexOf(substr)}function testProps(props,prefixed){for(var i in props){var prop=props[i];if(!contains(prop,"-")&&mStyle[prop]!==undefined){return prefixed=="pfx"?prop:true}}return false}function testDOMProps(props,obj,elem){for(var i in props){var item=obj[props[i]];if(item!==undefined){if(elem===false)return props[i];if(is(item,"function")){return item.bind(elem||obj)}return item}}return false}function testPropsAll(prop,prefixed,elem){var ucProp=prop.charAt(0).toUpperCase()+prop.slice(1),props=(prop+" "+cssomPrefixes.join(ucProp+" ")+ucProp).split(" ");if(is(prefixed,"string")||is(prefixed,"undefined")){return testProps(props,prefixed)}else{props=(prop+" "+domPrefixes.join(ucProp+" ")+ucProp).split(" ");return testDOMProps(props,prefixed,elem)}}tests["flexbox"]=function(){return testPropsAll("flexWrap")};tests["flexboxlegacy"]=function(){return testPropsAll("boxDirection")};tests["canvas"]=function(){var elem=document.createElement("canvas");return!!(elem.getContext&&elem.getContext("2d"))};tests["canvastext"]=function(){return!!(Modernizr["canvas"]&&is(document.createElement("canvas").getContext("2d").fillText,"function"))};tests["webgl"]=function(){return!!window.WebGLRenderingContext};tests["touch"]=function(){var bool;if("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch){bool=true}else{injectElementWithStyles(["@media (",prefixes.join("touch-enabled),("),mod,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(node){bool=node.offsetTop===9})}return bool};tests["geolocation"]=function(){return"geolocation"in navigator};tests["postmessage"]=function(){return!!window.postMessage};tests["websqldatabase"]=function(){return!!window.openDatabase};tests["indexedDB"]=function(){return!!testPropsAll("indexedDB",window)};tests["hashchange"]=function(){return isEventSupported("hashchange",window)&&(document.documentMode===undefined||document.documentMode>7)};tests["history"]=function(){return!!(window.history&&history.pushState)};tests["draganddrop"]=function(){var div=document.createElement("div");return"draggable"in div||"ondragstart"in div&&"ondrop"in div};tests["websockets"]=function(){return"WebSocket"in window||"MozWebSocket"in window};tests["rgba"]=function(){setCss("background-color:rgba(150,255,150,.5)");return contains(mStyle.backgroundColor,"rgba")};tests["hsla"]=function(){setCss("background-color:hsla(120,40%,100%,.5)");return contains(mStyle.backgroundColor,"rgba")||contains(mStyle.backgroundColor,"hsla")};tests["multiplebgs"]=function(){setCss("background:url(https://),url(https://),red url(https://)");return/(url\s*\(.*?){3}/.test(mStyle.background)};tests["backgroundsize"]=function(){return testPropsAll("backgroundSize")};tests["borderimage"]=function(){return testPropsAll("borderImage")};tests["borderradius"]=function(){return testPropsAll("borderRadius")};tests["boxshadow"]=function(){return testPropsAll("boxShadow")};tests["textshadow"]=function(){return document.createElement("div").style.textShadow===""};tests["opacity"]=function(){setCssAll("opacity:.55");return/^0.55$/.test(mStyle.opacity)};tests["cssanimations"]=function(){return testPropsAll("animationName")};tests["csscolumns"]=function(){return testPropsAll("columnCount")};tests["cssgradients"]=function(){var str1="background-image:",str2="gradient(linear,left top,right bottom,from(#9f9),to(white));",str3="linear-gradient(left top,#9f9, white);";setCss((str1+"-webkit- ".split(" ").join(str2+str1)+prefixes.join(str3+str1)).slice(0,-str1.length));return contains(mStyle.backgroundImage,"gradient")};tests["cssreflections"]=function(){return testPropsAll("boxReflect")};tests["csstransforms"]=function(){return!!testPropsAll("transform")};tests["csstransforms3d"]=function(){var ret=!!testPropsAll("perspective");if(ret&&"webkitPerspective"in docElement.style){injectElementWithStyles("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(node,rule){ret=node.offsetLeft===9&&node.offsetHeight===3})}return ret};tests["csstransitions"]=function(){return testPropsAll("transition")};tests["fontface"]=function(){var bool;injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}',function(node,rule){var style=document.getElementById("smodernizr"),sheet=style.sheet||style.styleSheet,cssText=sheet?sheet.cssRules&&sheet.cssRules[0]?sheet.cssRules[0].cssText:sheet.cssText||"":"";bool=/src/i.test(cssText)&&cssText.indexOf(rule.split(" ")[0])===0});return bool};tests["generatedcontent"]=function(){var bool;injectElementWithStyles(["#",mod,"{font:0/0 a}#",mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(""),function(node){bool=node.offsetHeight>=3});return bool};tests["video"]=function(){var elem=document.createElement("video"),bool=false;try{if(bool=!!elem.canPlayType){bool=new Boolean(bool);bool.ogg=elem.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"");bool.h264=elem.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"");bool.webm=elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}}catch(e){}return bool};tests["audio"]=function(){var elem=document.createElement("audio"),bool=false;try{if(bool=!!elem.canPlayType){bool=new Boolean(bool);bool.ogg=elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"");bool.mp3=elem.canPlayType("audio/mpeg;").replace(/^no$/,"");bool.wav=elem.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"");bool.m4a=(elem.canPlayType("audio/x-m4a;")||elem.canPlayType("audio/aac;")).replace(/^no$/,"")}}catch(e){}return bool};tests["localstorage"]=function(){try{localStorage.setItem(mod,mod);localStorage.removeItem(mod);return true}catch(e){return false}};tests["sessionstorage"]=function(){try{sessionStorage.setItem(mod,mod);sessionStorage.removeItem(mod);return true}catch(e){return false}};tests["webworkers"]=function(){return!!window.Worker};tests["applicationcache"]=function(){return!!window.applicationCache};tests["svg"]=function(){return!!document.createElementNS&&!!document.createElementNS(ns.svg,"svg").createSVGRect};tests["inlinesvg"]=function(){var div=document.createElement("div");div.innerHTML="";return(div.firstChild&&div.firstChild.namespaceURI)==ns.svg};tests["smil"]=function(){return!!document.createElementNS&&/SVGAnimate/.test(toString.call(document.createElementNS(ns.svg,"animate")))};tests["svgclippaths"]=function(){return!!document.createElementNS&&/SVGClipPath/.test(toString.call(document.createElementNS(ns.svg,"clipPath")))};function webforms(){Modernizr["input"]=function(props){for(var i=0,len=props.length;i";supportsHtml5Styles="hidden"in a;supportsUnknownElements=a.childNodes.length==1||function(){document.createElement("a");var frag=document.createDocumentFragment();return typeof frag.cloneNode=="undefined"||typeof frag.createDocumentFragment=="undefined"||typeof frag.createElement=="undefined"}()}catch(e){supportsHtml5Styles=true;supportsUnknownElements=true}})();function addStyleSheet(ownerDocument,cssText){var p=ownerDocument.createElement("p"),parent=ownerDocument.getElementsByTagName("head")[0]||ownerDocument.documentElement;p.innerHTML="x";return parent.insertBefore(p.lastChild,parent.firstChild)}function getElements(){var elements=html5.elements;return typeof elements=="string"?elements.split(" "):elements}function getExpandoData(ownerDocument){var data=expandoData[ownerDocument[expando]];if(!data){data={};expanID++;ownerDocument[expando]=expanID;expandoData[expanID]=data}return data}function createElement(nodeName,ownerDocument,data){if(!ownerDocument){ownerDocument=document}if(supportsUnknownElements){return ownerDocument.createElement(nodeName)}if(!data){data=getExpandoData(ownerDocument)}var node;if(data.cache[nodeName]){node=data.cache[nodeName].cloneNode()}else if(saveClones.test(nodeName)){node=(data.cache[nodeName]=data.createElem(nodeName)).cloneNode()}else{node=data.createElem(nodeName)}return node.canHaveChildren&&!reSkip.test(nodeName)&&!node.tagUrn?data.frag.appendChild(node):node}function createDocumentFragment(ownerDocument,data){if(!ownerDocument){ownerDocument=document}if(supportsUnknownElements){return ownerDocument.createDocumentFragment()}data=data||getExpandoData(ownerDocument);var clone=data.frag.cloneNode(),i=0,elems=getElements(),l=elems.length;for(;itextarea.clientHeight&&textarea.rows<30){textarea.rows+=3;$(textarea).css("min-height",textarea.rows*15);bGrew=true}if(bGrew&&window.ie6){textarea.scrollTop=0;redraw(textarea);setTimeout(function(){safeFocus(textarea)},1)}}else{var rgLines=textarea.value.split("\n");var nRows=1;var nCols=textarea.cols;for(var i=0;inCols)nRows+=Math.ceil(rgLines[i].length/nCols)}nRows+=rgLines.length;if(nRows>nRowsOrig){textarea.rows=Math.min(nRows,30)}$(textarea).css("min-height",textarea.rows*15)}if(textarea.fxnResize&&textarea.rows!=nRowsOrig){textarea.fxnResize.call()}}function getKeyCode(keyStroke){if(document.all&&!keyStroke)return event.keyCode;else if(0!=keyStroke.which&&typeof keyStroke.which!="undefined")return keyStroke.which;else return keyStroke.keyCode}function isKey(keyStroke,iKey){return getKeyCode(keyStroke)==iKey}function trim(s){if(!s||!s.replace)return"";if(!trim.re)trim.re=/^[\s]+|[\s]+$/g;return s.replace(trim.re,"")}window.Trim=trim;function moveToHold(oElem){if(oElem&&oElem.parentNode){oElem.oldParent=oElem.parentNode;oElem.oldSibling=oElem.nextSibling;oElem.parentNode.removeChild(oElem)}}function restoreFromHold(oElem){if(oElem&&oElem.oldParent){oElem.oldParent.insertBefore(oElem,oElem.oldSibling)}}function jsToVbNewLines(s){return s.replace(/(\n)/g,String.fromCharCode(document.all?10:13))}function x(e){return cancel(e)}function cancel(e,oParentWindow){if(document.all){if(oParentWindow)oParentWindow.event.returnValue=false;else if(event)event.returnValue=false}else if(e)e.preventDefault();return false}function stopFormSubmission(e){return getKeyCode(e)==13}function hide(el){if(!el||!el.style)return;el.style.display="none"}function show(el){if(!el||!el.style)return;el.style.display=""}function toggleVisible(el){if(!el)return;el.style.display=el.style.display=="none"?"":"none"}function toggleVisibleById(id){var el=elById(id);if(el)toggleVisible(el)}function removeChildren(el){if(!el||!el.childNodes)return;while(el.childNodes.length){el.removeChild(el.childNodes[0])}}function removeTextSelections(){if(window.getSelection&&window.getSelection().removeAllRanges)window.getSelection().removeAllRanges();if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(e){}}function ourAttachEvent(oElem,sType,fxn,fUseCapture){if(!oElem)return;if(!oElem.hashEvents)oElem.hashEvents={};if(!oElem.hashEvents[sType])oElem.hashEvents[sType]=[fxn];else oElem.hashEvents[sType].push(fxn);if(oElem.addEventListener){oElem.addEventListener(sType,fxn,fUseCapture)}else if(oElem.attachEvent){return oElem.attachEvent("on"+sType,fxn)}else{oElem["on"+sType]=fxn}return true}function ourDispatchEvent(oElem,sType){if(!oElem||!oElem.hashEvents||!oElem.hashEvents[sType])return;var rg=oElem.hashEvents[sType];for(var ix=0;ix/g,">")}function horizontalScrollBarPadding(){return scrollWidth()>windowWidth()?18:0}function verticalScrollBarPadding(){return!(window.ie||window.opera)||scrollHeight()>windowHeight()?18:0}function documentHeight(){return Math.max(window.opera?document.documentElement.clientHeight:document.body.offsetHeight,windowHeight())}function documentWidth(){return window.opera?document.documentElement.clientWidth:document.body.offsetWidth}function windowHeight(){return window.innerHeight?window.innerHeight:document.documentElement.clientHeight}function windowWidth(){return window.innerWidth?window.innerWidth:document.documentElement.clientWidth}function windowHeightCorrected(){return windowHeight()-horizontalScrollBarPadding()}function windowWidthCorrected(){return windowWidth()-verticalScrollBarPadding()}function windowRight(){return windowWidthCorrected()+scrollLeft()}function setOpacity(oElem,dFade){if(dFade==null){oElem.style.opacity="";oElem.style.filter=""}else{oElem.style.opacity=dFade;oElem.style.filter="alpha(opacity="+dFade*100+")"}}function enableInputsWithin(sId,bEnabled){setTimeout("doEnableInputsWithin('"+sId+"', "+bEnabled+")",1)}function doEnableInputsWithin(sId,bEnabled){var oElem=elById(sId);if(!oElem||!isDisplayed(oElem))return;if(oElem.tagName.toLowerCase()=="input"){oElem.disabled=!bEnabled;return}$("input",oElem).map(function(){this.disabled=!bEnabled})}function coverElement(oElem,oTarget,pxX,pxY){if(!oElem||!oTarget)return;if(pxX==null)pxX=calculateOffset(oTarget,"offsetLeft");if(pxY==null)pxY=calculateOffset(oTarget,"offsetTop");oElem.style.top=pxY+"px";oElem.style.left=pxX+"px";oElem.style.width=oTarget.offsetWidth+"px";oElem.style.height=oTarget.offsetHeight+"px"}function positionElement(oElem,pxX,pxY){if(!oElem||!oElem.style)return;if(pxX!=null)oElem.style.left=pxX+"px";if(pxY!=null)oElem.style.top=pxY+"px"}function sizeElement(oElem,pxWidth,pxHeight){if(!oElem||!oElem.style)return;if(pxWidth!=null)oElem.style.width=pxWidth+"px";if(pxHeight!=null)oElem.style.height=pxHeight+"px"}function centerInTarget(oElem,oTarget,oHorizontalOverride){return positionInTarget(oElem,oTarget,oHorizontalOverride,.5,.5)}function positionInTarget(oElem,oTarget,oHorizontalOverride,dblHPos,dblVPos){if(!oElem)return null;if(!oTarget||oTarget.style.display.toLowerCase()=="none")return positionInWindow(oElem,dblHPos,dblVPos);var oHorizontalTarget=oHorizontalOverride&&oHorizontalOverride.style.display!="none"?oHorizontalOverride:oTarget;var pxX=calculateOffset(oHorizontalTarget,"offsetLeft")+oHorizontalTarget.offsetWidth*dblHPos-oElem.offsetWidth/2;var pxY=calculateOffset(oTarget,"offsetTop")+oTarget.offsetHeight*dblVPos-oElem.offsetHeight/2;positionElement(oElem,pxX,pxY);return{x:pxX,y:pxY}}function getRelativeCoordinates(oElem,oTarget,fxnX,fxnY){if(!oElem||!oTarget||!fxnX||!fxnY)return{x:0,y:0};var sDisplay=oElem.style.display;var sVisibility=oElem.style.visibility;oElem.style.visibility="hidden";oElem.style.display="";var pxX=fxnX(oElem,oTarget);var pxY=fxnY(oElem,oTarget);oElem.style.visibility=sVisibility;oElem.style.display=sDisplay;return{x:pxX,y:pxY}}function getCenteredCoordinates(oElem,oTarget){return getRelativeCoordinates(oElem,oTarget,function(oE,oT){return calculateOffset(oT,"offsetLeft")+oT.offsetWidth/2-oE.offsetWidth/2},function(oE,oT){return calculateOffset(oT,"offsetTop")+oT.offsetHeight/2-oE.offsetHeight/2})}function getRightCoordinates(oElem,oTarget){var PX_PADDING=5;return getRelativeCoordinates(oElem,oTarget,function(oE,oT){return calculateOffset(oT,"offsetLeft")+oT.offsetWidth+PX_PADDING},function(oE,oT){return calculateOffset(oT,"offsetTop")})}function getLeftCoordinates(oElem,oTarget){var PX_PADDING=5;return getRelativeCoordinates(oElem,oTarget,function(oE,oT){return calculateOffset(oT,"offsetLeft")-oElem.offsetWidth-PX_PADDING},function(oE,oT){return calculateOffset(oT,"offsetTop")})}function getBelowCoordinates(oElem,oTarget){var PX_PADDING=5;return getRelativeCoordinates(oElem,oTarget,function(oE,oT){return calculateOffset(oT,"offsetLeft")},function(oE,oT){return calculateOffset(oT,"offsetTop")+oT.offsetHeight+PX_PADDING})}function getUpperCenteredCoordinates(oElem,oTarget){return getRelativeCoordinates(oElem,oTarget,function(oE,oT){return calculateOffset(oT,"offsetLeft")+oT.offsetWidth/2-oE.offsetWidth/2},function(oE,oT){var pxT=calculateOffset(oT,"offsetTop");return Math.max(pxT,pxT+oT.offsetHeight/5-oE.offsetHeight/2)})}function getLowerCenteredCoordinates(oElem,oTarget){var PX_PADDING=5;return getRelativeCoordinates(oElem,oTarget,function(oE,oT){return calculateOffset(oT,"offsetLeft")+oT.offsetWidth/2-oE.offsetWidth/2},function(oE,oT){return calculateOffset(oT,"offsetTop")+oT.offsetHeight+PX_PADDING})}function getInWindowCoordinates(oElem,pxLeft,pxTop,oTarget,pxOffset,pxOffsetSecondary,fVerticalOnly){if(!oElem)return;var fHidden=!isVisible(oElem);var sVis=oElem.style.visibility;var sDis=oElem.style.display;if(fHidden){oElem.style.visibility="hidden";oElem.style.display=""}var pxTargetWidth=oTarget?oTarget.offsetWidth:0;var pxTargetHeight=oTarget?oTarget.offsetHeight:0;if(pxOffset==null)pxOffset=0;if(pxOffsetSecondary==null)pxOffsetSecondary=0;var pxScrollLeft=scrollLeft();var pxLeftTemp=inBounds(pxLeft,pxScrollLeft+pxOffset,windowWidthCorrected()+pxScrollLeft-oElem.offsetWidth-pxOffset);var pxTopTemp=inBounds(pxTop-2*pxOffsetSecondary,scrollTop()+pxOffset,windowHeightCorrected()+scrollTop()-oElem.offsetHeight-pxOffset);var pxOffsetTotal=pxOffset+pxOffsetSecondary;if(!fVerticalOnly&&hasRoom("right",oElem,pxLeft,pxTop,pxOffsetTotal,pxScrollLeft)){pxLeftTemp=pxLeft+pxTargetWidth+pxOffsetTotal}else if(!fVerticalOnly&&hasRoom("left",oElem,pxLeft,pxTop,pxOffsetTotal,pxScrollLeft)){pxLeftTemp=pxLeft-oElem.offsetWidth-pxOffsetTotal}else if(hasRoom("bottom",oElem,pxLeft,pxTop,pxOffsetTotal,pxScrollLeft)){pxTopTemp=pxTop+pxTargetHeight+pxOffsetTotal}else if(hasRoom("top",oElem,pxLeft,pxTop,pxOffsetTotal,pxScrollLeft)){pxTopTemp=pxTop-oElem.offsetHeight-pxOffsetTotal}else{if(!fVerticalOnly){pxLeftTemp=pxLeft}pxTopTemp=pxTop+pxTargetHeight+pxOffsetTotal}if(fHidden){oElem.style.display=sDis;oElem.style.visibility=sVis}return{x:pxLeftTemp,y:pxTopTemp}}function centerInWindow(oElem){return positionInWindow(oElem,.5,.5)}function positionInWindow(oElem,dblHPos,dblVPos){if(!oElem)return null;var pxX=scrollLeft()+windowWidthCorrected()*dblHPos-oElem.offsetWidth/2;var pxY=scrollTop()+windowHeightCorrected()*dblVPos-oElem.offsetHeight/2;positionElement(oElem,pxX,pxY);return{x:pxX,y:pxY}}function moveWithinWindow(oElem,pxPadding){if(!oElem||!oElem.style||oElem.style.display.toLowerCase()=="none")return null;if(null==pxPadding)pxPadding=25;var x1=calculateOffset(oElem,"offsetLeft");var y1=calculateOffset(oElem,"offsetTop");var x2=x1+oElem.offsetWidth;var y2=y1+oElem.offsetHeight;var pxPaddedLeft=scrollLeft()+pxPadding;var pxPaddedRight=scrollLeft()+windowWidthCorrected()-pxPadding;var pxPaddedTop=scrollTop()+pxPadding;var pxPaddedBottom=scrollTop()+windowHeightCorrected()-pxPadding;if(x2>pxPaddedRight){x1=x1-(x2-pxPaddedRight)}if(y2>pxPaddedBottom){y1=y1-(y2-pxPaddedBottom)}if(x1")}function encodeLTGT(s){if(!s)return"";if(!encodeLTGT.reGT){encodeLTGT.reGT=new RegExp(">","gi");encodeLTGT.reLT=new RegExp("<","gi")}return s&&s.replace(encodeLTGT.reLT,"<").replace(encodeLTGT.reGT,">")}function encodeAmp(s){if(!s)return"";if(!encodeAmp.re)encodeAmp.re=new RegExp("&","gi");return s.replace(encodeAmp.re,"&")}function decodeAmp(s){if(!s)return"";if(!decodeAmp.re)decodeAmp.re=new RegExp("&","gi");return s.replace(decodeAmp.re,"&")}function paintRow(oRow,sColor){if(!oRow||!oRow.cells)return;var rgTD=oRow.cells;for(var i=0;i=0}function sToPx(s){if(!s||!s.replace)return 0;s=s.replace(/[^\d]/g,"");return isNaN(parseInt(s,10))?0:parseInt(s,10)}function isInDOM(oNode){while(oNode){if(isTagName(oNode,"body"))return true;oNode=oNode.parentNode}return false}function isChildOf(elChild,elParent){while(elChild&&elChild.parentNode){if(elChild.parentNode==elParent)return true;elChild=elChild.parentNode}return false}function forAll(elParent,sNodeName,fxn){if(!elParent||!sNodeName||!fxn)return;var oSelf=this;$(sNodeName,elParent).map(function(){fxn.apply(oSelf,[this])})}function queueForDom(fxn){if(!window.fDomLoaded){setTimeout(function(){queueForDom(fxn)},500);return}fxn()}function isSSL(){return"https:"==document.location.protocol}function urlencode(str){var v;try{v=encodeURIComponent(str)}catch(e){v=escape(str)}return v.replace(/%20/g,"+")}function objIsEmpty(o){for(var field in o)return false;return true}function GetBrowserDecimalDelimiter(){return Number(1.25).toLocaleString().charAt(1)}function parseLocaleFloat(s){var sBrowserDelimiter=GetBrowserDecimalDelimiter();var sLocaleDelimiter=GetLocaleDecimalDelimiter();if(sBrowserDelimiter!=sLocaleDelimiter)s=s.replace(sLocaleDelimiter,sBrowserDelimiter);return parseFloat(s)}function floatToLocaleString(x){var s=new Number(x).toLocaleString();var sBrowserDelimiter=GetBrowserDecimalDelimiter();var sLocaleDelimiter=GetLocaleDecimalDelimiter();if(sBrowserDelimiter!=sLocaleDelimiter)s=s.replace(sBrowserDelimiter,sLocaleDelimiter);return s}function locationURLBase(){return window.location.protocol+"//"+window.location.host+window.location.pathname}function getOkButtonLink(){var oImagePreload=new Image;oImagePreload.src=StaticContentUrl("images/ok.png");var sStyleImg="height:16px;width:16px;vertical-align:middle;border:0;";var elOK=DOM.a({href:"javascript: void 0;"},DOM.img({src:StaticContentUrl("images/ok.png"),style:sStyleImg}));return elOK}function getCancelButtonLink(){var oImagePreload=new Image;oImagePreload.src=StaticContentUrl("images/cancel.png");var sStyleImg="height:16px;width:16px;vertical-align:middle;border:0;";var elCancel=DOM.a({href:"javascript: void 0;"},DOM.img({src:StaticContentUrl("images/cancel.png"),style:sStyleImg}));return elCancel}function plainTextToHtml(s){if(s===""){return""}return"

    "+s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/(?:\r?\n){2,}/g,"

    ").replace(/\r?\n/g,"
    ")+"

    "}window.navigation=window.navigation||{navigate:function navigate(url,type){window.location[type||"href"]=url},redirect:function redirect(url){window.location.replace(url)},reload:function reload(force){window.location.reload(force)},submit:function submit(form){form.submit()}};DomBuilder=function(){var fLegacyIE=window.fLegacyIE;return{IE_TRANSLATIONS:{"class":"className","for":"htmlFor",maxlength:"maxLength"},ieAttrSet:function(a,i,el){var trans;if(trans=this.IE_TRANSLATIONS[i])el[trans]=a[i];else if(i=="style")el.style.cssText=a[i];else el.setAttribute(i,a[i])},apply:function(o){o=o||{};var els=("p|div|span|strong|em|i|img|table|tr|td|th|thead|tbody|tfoot|pre|code|"+"h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|"+"select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|"+"script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|"+"label|dfn|kbd|samp|var|nbsp|iframe|nobr").split("|");var el,i=0;while(el=els[i++])o[el.toLowerCase()]=DomBuilder.tagFunc(el);return o},tagFunc:function(tag){return function(){var a=arguments,at,ch;a.slice=[].slice;if(a.length>0){if(a[0].nodeName||typeof a[0]=="string")ch=a;else{at=a[0];ch=a.slice(1)}}return DomBuilder.elem(tag,at,ch)}},elem:function(e,a,c){a=a||{};c=c||[];var el;if(e=="nbsp")return DOM.span({}," ");else el=document.createElement(fLegacyIE&&a.name?"<"+e+" name="+a.name+">":e);for(var i in a){if(typeof a[i]!="function"){if(fLegacyIE)this.ieAttrSet(a,i,el);else el.setAttribute(i,a[i])}else{el[i]=a[i]}}for(var i=0;ithis.length)n=this.length;if(n<0)n=0;for(var i=0;i=0;i--)this[i]=this[i-n]};Array.prototype.pop=function(){if(!this.length)return undefined;var o=this[this.length-1];this.length=this.length-1;return o};Number.prototype.times=function(f){if(!f||!f.apply||this<=0)return;for(var ix=0;ix"==keyToDisp){keyToDisp=">"}keyHelper.innerHTML=keyToDisp;this.positionKeyHelper(keyHelper,pt,elHelper,oKey.pos);keyHelpers.appendChild(keyHelper);bMadeAtLeastOne=true}}if(null!=oKey.nLevelAnchor&&this.nHotKeysLevel!=oKey.nLevelAnchor&&oTopmost==null){var sel=oKey.selector||"#"+oKey.id;var elHelper=$(sel).get(0);var keyHelper=null;if(null!=elHelper&&isDisplayed(elHelper)&&!elHelper.getAttribute("keydisabled")&&(null==elHelper.className||"actionButtonDisabled"!=elHelper.className)){var pt=getAbsolutePosition(elHelper);keyHelper=document.createElement("DIV");keyHelper.id="keyHelper_"+i;keyHelper.className="hotkeyHelper";var keyToDisp=oKey.nLevelAnchor;keyHelper.innerHTML=keyToDisp;this.positionKeyHelper(keyHelper,pt,elHelper,oKey.levelAnchorPos);keyHelpers.appendChild(keyHelper)}}if(null!=oKey.nLevelAnchor&&this.nHotKeysLevel==oKey.nLevelAnchor&&isDisplayed(oKey.id)){idLevelContainer=oKey.idLevelContainer}}if(bMadeAtLeastOne){document.body.appendChild(keyHelpers);this.browseMenus(idLevelContainer)}if(window.opera){safeFocus(window)}return bMadeAtLeastOne};this.positionKeyHelper=function(keyHelper,pt,elHelper,pos){var x=0;var y=0;if(keyHelper){if(pos&&"center"==pos){x=pt.x+elHelper.offsetWidth/2-5;y=pt.y+2}else if(pos&&"homelogo"==pos){if(elHelper.firstChild==elHelper.lastChild&&isTagName(elHelper.firstChild,"img")){elHelper=elHelper.firstChild;pt=getAbsolutePosition(elHelper)}x=pt.x+elHelper.offsetWidth/2-5;y=pt.y-elHelper.offsetHeight/4}else if(pos&&"below"==pos){x=pt.x+this.nHelperOffsetX;y=pt.y+this.nHelperOffsetBelowY}else if(pos&&"left"==pos){x=pt.x+this.nHelperOffsetLeftX;y=pt.y+this.nHelperOffsetLeftY}else{x=pt.x+this.nHelperOffsetX;y=pt.y+this.nHelperOffsetY}if(x<1)x=1;if(y<1)y=1;keyHelper.style.left=x+"px";keyHelper.style.top=y+"px"}};this.deactivateHotKeys=function(){this.nHotKeysLevel=0;this.hideHotKeys()};this.cleanupOnClick=function(){this.deactivateHotKeys();this.oMenuBrowser=null;this.bBrowsingGrid=false;if(this.oGridBrowser)this.oGridBrowser.cleanup();var elCursor=this.getElCursor();if(elCursor)elCursor.style.display="none";return true};this.hideHotKeys=function(){var keyHelpers=elById("keyHelpers");if(keyHelpers!=null&&keyHelpers.parentNode!=null){keyHelpers.parentNode.removeChild(keyHelpers)}};this.giveFocus=function(el){if(null==el){return false}if(true==this.hkMap[el.id].bMenu&&el.onclick){this.simulateClick(el);safeFocus(el)}else{theMgr.maskClicks();safeFocus(el)}return true};this.keystroke=function(e,oWindow){if(!oWindow)oWindow=window;var keyCode=getKeyCode(e);if(keyCode>=16&&keyCode<=18)return true;if(!window.webkit&&keyCode==191&&!document.all&&this.nHotKeysLevel&&e.shiftKey)return false;var sKey=String.fromCharCode(KeyboardMap.fix(keyCode,false,oWindow));var sTypeFocused="";var elFocused=null;var nActionLevel=this.nHotKeysLevel;if(e&&e.target&&e.target.type){sTypeFocused=e.target.type.toLowerCase();elFocused=e.target}else if(oWindow.event&&oWindow.event.srcElement&&oWindow.event.srcElement.tagName){elFocused=oWindow.event.srcElement;sTypeFocused=elFocused.tagName.toLowerCase();if(elFocused.type){sTypeFocused=elFocused.type.toLowerCase()}e=oWindow.event}if(0==sKey.length&&(e.altKey||e.ctrlKey)){return true}if(this.nHotKeysLevel>0){this.hideHotKeys()}if(this.fxActivationKey(e,String.fromCharCode(KeyboardMap.fix(keyCode,true,oWindow)))){IdPop.hideNow();do{this.nHotKeysLevel=(this.nHotKeysLevel+1)%(this.nHotKeysLevelMax+1)}while(!this.activateHotKeys());return cancel(e)}this.nHotKeysLevel=0;if(27==keyCode){Info.hide();theMgr.hideAllPopups();if(theMgr.getTopmostPopup()!=null)return;if(nActionLevel==0){EditableTableManager.hideAllPanes()}if(this.oMenuBrowser){this.stopBrowsingMenus()}if(this.bBrowsingGrid){this.oGridBrowser.cleanup();this.bBrowsingGrid=false;this.getElCursor().style.display="none"}return cancel(e)}if(0==nActionLevel){if(this.rgReleaseKeys.firstMatch(function(_){return _==sTypeFocused})){if(27==keyCode&&elFocused!=null&&elFocused.blur){elFocused.blur();return cancel(e)}return true}}if(!e.altKey&&!e.ctrlKey&&!e.metaKey&&(!window.opera&&(33<=keyCode&&40>=keyCode)||106==keyCode||107==keyCode||74==keyCode||75==keyCode||45==keyCode||43==keyCode)){if(0!=nActionLevel&&this.oGridBrowser&&(33==keyCode||34==keyCode||35==keyCode||36==keyCode||38==keyCode||40==keyCode)){var bMove=false;if(this.oGridBrowser.elCurrent)bMove=true;this.browseGridRows();if(40==keyCode&&!bMove)return cancel(e)}var oListBrowser=null;if(null!=this.oPopupBrowser&&isDisplayed(this.oPopupBrowser.elContainer)){oListBrowser=this.oPopupBrowser}else if(this.bBrowsingGrid&&null==this.oMenuBrowser&&null!=this.oGridBrowser&&null!=this.oGridBrowser.elContainer){oListBrowser=this.oGridBrowser}if(33==keyCode&&this.oGridBrowser&&oListBrowser==this.oGridBrowser&&this.oGridBrowser.goNPrevious(this.getGridScrollNum())||34==keyCode&&this.oGridBrowser&&oListBrowser==this.oGridBrowser&&this.oGridBrowser.goNNext(this.getGridScrollNum())||35==keyCode&&oListBrowser&&oListBrowser.goToLast()||36==keyCode&&oListBrowser&&oListBrowser.goToFirst()||37==keyCode&&this.oMenuBrowser&&this.oMenuBrowser.goToPrevious()||(38==keyCode||107==keyCode||75==keyCode)&&oListBrowser&&oListBrowser.goToPrevious()||39==keyCode&&this.oMenuBrowser&&this.oMenuBrowser.goToNext()||(40==keyCode||106==keyCode||74==keyCode)&&oListBrowser&&oListBrowser.goToNext()||(38==keyCode||40==keyCode)&&this.oMenuBrowser&&this.oMenuBrowser.elCurrent&&this.oMenuBrowser.elCurrent.onclick&&this.oMenuBrowser.elCurrent.onclick()){return cancel(e)}else if(this.oMenuBrowser){if(this.oPopupBrowser&&this.oPopupBrowser.elCurrent&&(45==keyCode||43==keyCode)){var sNameRefine=null;var oFilterRefine=null;sNameRefine=this.oPopupBrowser.elCurrent.getAttribute("sNameRefine");if(sNameRefine)oFilterRefine=elById("idRefineFilter"+sNameRefine);if(oFilterRefine&&43==keyCode&&oFilterRefine.style.display=="none")this.simulateClick(this.oPopupBrowser.elCurrent);else if(oFilterRefine&&45==keyCode&&oFilterRefine.style.display!="none")this.simulateClick(this.oPopupBrowser.elCurrent)}if(0==nActionLevel){return cancel(e)}else{this.stopBrowsingMenus()}}}if(!e.metaKey&&0!=nActionLevel){if(keyCode>48&&keyCode<=48+this.nHotKeysLevelMax&&!e.shiftKey){this.nHotKeysLevel=keyCode-48;if(this.activateHotKeys()){return cancel(e)}}this.oMenuBrowser=null;var oTopmost=theMgr.getTopmostObject();if(!oTopmost||!oTopmost.id||!this.rgHotKeyPopups[oTopmost.id])oTopmost=null;var sKeyLower=sKey.toLowerCase();var sKeyUpper=sKey.toUpperCase();fb.stats.record("hotkeys",{sKey:sKeyUpper,nActionLevel:nActionLevel});var elem;var key=this.rgHotKeys.firstMatch(function(_){var sel=_.selector||"#"+_.id;elem=$(sel).get(0);return nActionLevel==_.nLevel&&oTopmost==_.oPopup&&(_.cKey==sKeyLower||_.cKey==sKeyUpper)&&isDisplayed(elem)&&!elem.getAttribute("keydisabled")});if(key){var elToClick=elem;if(!key.bNeverFocus)try{if(isDisplayed(elToClick))safeFocus(elToClick)}catch(err){}if(this.simulateClick(elToClick)){return cancel(e)}}return cancel(e)}return true};this.simulateClick=function(elToClick){if(elToClick!=null){if(isDisplayed(elToClick)){if(document.selection&&elToClick.click){try{elToClick.click()}catch(err){}return true}else{var clicked=false;try{elToClick.click();clicked=true}catch(err){}if(!clicked){try{if((!elToClick.onclick||elToClick.onclick())&&(!ourHasEvent(elToClick,"click")||ourDispatchEvent(elToClick,"click"))&&elToClick.href)window.navigation.navigate(elToClick.href)}catch(err){}}return true}}}return false};this.browseMenus=function(idContainerInit){this.oMenuBrowser=new ListBrowser(elById(idContainerInit),function(el){return el.id&&KeyManager.hkMap[el.id]},function(el){KeyManager.giveFocus(el)},function(el){theMgr.hideAllPopups()},null,null,null);return false};this.stopBrowsingMenus=function(){if(this.oMenuBrowser){this.oMenuBrowser.cleanup();this.oMenuBrowser=null}};this.browsePopup=function(idContainerInit){this.oPopupBrowser=new ListBrowser(elById(idContainerInit),function(el){return null!=el.tagName&&"a"==el.tagName.toLowerCase()&&!(1==el.getAttribute("fKbSkip"))},function(el){if(el&&el.focus)safeFocus(el)},function(el){},null,function(el){el.onfocus=function(){null!=KeyManager.oPopupBrowser&&KeyManager.oPopupBrowser.setElCurrent(this)};el.onmouseover=function(){var onmouseoverOld=this.getAttribute("onmouseover");if(onmouseoverOld&&typeof onmouseoverOld=="string")this.onmouseoverOld=function(){return eval(onmouseoverOld)};if(this.onmouseoverOld&&this.onmouseoverOld.apply)this.onmouseoverOld.apply(this);if(!window.opera)safeFocus(this)}},null);return false};this.browseCheckboxPopup=function(idContainerInit){this.oPopupBrowser=new ListBrowser(elById(idContainerInit),function(el){return null!=el.type&&"checkbox"==el.type()},function(el){safeFocus(el)},function(el){},null,function(el){el.onfocus=function(){null!=KeyManager.oPopupBrowser&&KeyManager.oPopupBrowser.setElCurrent(this)};el.onmouseover=function(){if(!window.opera)safeFocus(this)}},null);return false};this.browseTimesheetGrid=function(idContainerInit){this.oPopupBrowser=new ListBrowser(elById(idContainerInit),function(el){return null!=el.tagName&&"img"==el.tagName.toLowerCase()&&"a"==el.parentNode.tagName.toLowerCase()},function(el){safeFocus(el.parentNode);KeyManager.gridBrowserPositionCursor(el)},function(el){return},function(el){return false},null,function(el){return});if(!this.oPopupBrowser.elCurrent)this.oPopupBrowser.goToNext();return false};this.browseGridRows=function(){if(!this.oGridBrowser){this.setupGridBrowser()}if(this.oGridBrowser){this.oMenuBrowser=null;theMgr.maskClicks();this.bBrowsingGrid=true;if(this.oGridBrowser.elCurrent){setTimeout("KeyManager.oGridBrowser.fxEnter(KeyManager.oGridBrowser.elCurrent);",1)}else{this.oGridBrowser.goToNext()}return false}else{return true}};this.getElCursor=function(){return elById("kbCursor")};this.gridBrowserGetElPos=function(el){if(el.parentNode&&el.parentNode.parentNode&&el.parentNode.parentNode.tagName&&"tr"==el.parentNode.parentNode.tagName.toLowerCase()){el=el.parentNode.parentNode;while(window.webkit&&!el.offsetWidth&&el.firstChild){el=el.firstChild}return el}else{return el}};this.gridBrowserPositionCursor=function(el){var elPos=this.gridBrowserGetElPos(el);var elCursor=KeyManager.getElCursor();var pt=getAbsolutePosition(elPos);elCursor.style.display="block";elCursor.style.zIndex=10;elCursor.style.left=pt.x-elCursor.offsetWidth-3+"px";elCursor.style.top=pt.y+(elPos.offsetHeight-elCursor.offsetHeight)/2+"px"};this.getGridScrollNum=function(){var elPos=this.gridBrowserGetElPos(this.oGridBrowser.elCurrent);return(window.innerHeight?window.innerHeight:document.documentElement.clientHeight)/elPos.offsetHeight-4};this.setupGridBrowser=function(){var elGrid=elById("bugGrid");if(elGrid){this.oGridBrowser=new ListBrowser(elGrid,function(el){return null!=el.type&&"checkbox"==el.type||isTagName(el,"a")&&isTagName(el.firstChild,"img")&&el.firstChild.alt==FB_ICON_NEW},function(el){ourDispatchEvent(getParentRow(el),"mouseover");safeFocus(el);KeyManager.gridBrowserPositionCursor(el)},function(el){ourDispatchEvent(getParentRow(el),"mouseout")},function(el){return false},null,function(el){})}else if(elById("dlgGrid")){this.oGridBrowser=new ListBrowser(elById("dlgGrid"),function(el){return null!=el.tagName&&"a"==el.tagName.toLowerCase()&&(el.title&&FB_ICON_EDIT==el.title||FB_ICON_NEW==el.title||el.className&&el.className.indexOf("discuss")==0)},function(el){safeFocus(el);KeyManager.gridBrowserPositionCursor(el.parentNode)},function(el){return},function(el){return false},function(el){ourAttachEvent(el,"keypress",function(e){keypressDiscussList(e,el)})},function(el){return})}return false}};function ListBrowser(elContainerInit,fxTestInit,fxEnterInit,fxLeaveInit,fxDeadEndInit,fxDoToEachInit,fxOnCleanInit){this.fxTest=fxTestInit;this.fxEnter=fxEnterInit;this.fxLeave=fxLeaveInit;this.fxDoToEach=fxDoToEachInit;this.fxDeadEnd=fxDeadEndInit;this.fxOnClean=fxOnCleanInit;this.fxOnLeave=null;this.elContainer=elContainerInit;this.elCurrent=null;this.setElCurrent=function(el){if(isUnderNode(el,this.elContainer)){this.elCurrent=el}};this.doFxToEach=function(){if(null==this.fxDoToEach){return}var elSet=this.findNextUnder(null);var elNext=null;while(null!=elSet){this.fxDoToEach(elSet);elNext=this.findNextUnder(elSet);if(elSet==elNext){elSet=null}else{elSet=elNext}}};this.traverse=function(bForward,n){var elToLeave=this.elCurrent;var elNew;for(var i=0;i0){var sPre=rgsPre[rgsPre.length-1].slice(5);var sActionToken=this.getToken(sPre);if(sActionToken){sRequest=sRequest.replace(sPre,sPre+"&"+ACTION_TOKEN_NAME+"="+sActionToken)}}}}return sRequest};this.injectURLTokenInObject=function(oData){if(oData&&oData.pre){var sPre=oData["pre"];var sActionToken=this.getToken(sPre);if(sActionToken){oData[ACTION_TOKEN_NAME]=sActionToken}}}};$.ajaxSetup({url:sDefaultURI,cache:false,timeout:3e5});$(document).ajaxError(ajaxShowError);function ajaxStatus(oHttpRequest){var nStatus=0;try{nStatus=oHttpRequest.status}catch(e){}return nStatus}function ajaxResponseText(oHttpRequest){var sResp="";try{sResp=oHttpRequest.responseText}catch(e){}return sResp}function ajaxIsBusy(oHttpRequest){if(!oHttpRequest)return false;return oHttpRequest.readyState!=4&&oHttpRequest.readyState!=0}function ajaxAbort(oHttpRequest){if(!oHttpRequest)return;if(oHttpRequest.readyState!=0&&oHttpRequest.readyState!=4){oHttpRequest.onreadystatechange=function(){return false};oHttpRequest.abort()}}function ajaxShowError(e,oHttpRequest,ajaxOptions,ignore,sJQStatus){var nStatus=ajaxStatus(oHttpRequest);if(nStatus==0||nStatus==200)return;if(ajaxOptions.fIgnoreDefaultError)return;if(sJQStatus=="timeout"){ajaxDefaultFailure();return}if(!oHttpRequest||!ajaxResponseText(oHttpRequest))return;var oForm=document.createElement("form");var oTextArea=document.createElement("textarea");oForm.appendChild(oTextArea);oForm.name="formWithError";oForm.action=FB_DEFAULT_URL;oForm.method="POST";oTextArea.name="sAjaxError";oTextArea.style.display="none";oTextArea.value=ajaxResponseText(oHttpRequest);document.body.appendChild(oForm);window.navigation.submit(oForm)}function ajaxDefaultFailure(){Info.showBriefly(FB_NO_RESPONSE);EditableTableManager.hideAllPanes()}function ajaxApproveSimultaneous(settings){var lock=settings?settings.lock:null;function wrapCallback(fxn){return function(jXML){lock.fRequestOutbound=false;if(fxn){fxn(jXML)}}}if(lock){if(lock.fRequestOutbound){return false}settings.success=wrapCallback(settings.success);settings.error=wrapCallback(settings.error);lock.fRequestOutbound=true}return true}var Process=new function(){var rgProcess=[];var sCurrentProcess="";this.start=function(oCompleteFxnOwner,sFxnComplete,fxnCleanup,sInfo){rgProcess[sFxnComplete]={fxnCleanup:fxnCleanup,fInfo:sInfo!=null};if(!oCompleteFxnOwner)oCompleteFxnOwner=window;if(oCompleteFxnOwner[sFxnComplete]&&oCompleteFxnOwner[sFxnComplete].call){if(!oCompleteFxnOwner[sFxnComplete+"_original"])oCompleteFxnOwner[sFxnComplete+"_original"]=oCompleteFxnOwner[sFxnComplete];oCompleteFxnOwner[sFxnComplete]=function(){var sPrevious=sCurrentProcess;sCurrentProcess=sFxnComplete;try{oCompleteFxnOwner[sFxnComplete+"_original"].apply(oCompleteFxnOwner,arguments)}finally{sCurrentProcess=sPrevious;Process.stop(sFxnComplete)}}}if(sInfo)Info.show(sInfo)};this.cancelInfoHide=function(){if(!rgProcess[sCurrentProcess])return;rgProcess[sCurrentProcess].fInfo=false};this.stop=function(sFxnComplete){if(!rgProcess[sFxnComplete])return;if(rgProcess[sFxnComplete].fInfo){Info.hide();rgProcess[sFxnComplete].fInfo=false}rgProcess[sFxnComplete]=null};this.haltAll=function(){for(var sKey in rgProcess){if(!rgProcess[sKey])continue;{if(rgProcess[sKey].fxnCleanup&&rgProcess[sKey].fxnCleanup.call)rgProcess[sKey].fxnCleanup.call();if(rgProcess[sKey].fInfo){Info.hide();rgProcess[sKey].fInfo=false}if(!(window.ie||window.opera||window.webkit)){rgProcess[sKey]=null}}}}};var RequestQueue=new function(){var queue=new Array;var fExecuting=false;this.enqueuePost=function(sUrl,data,fxnCallback,fxnFailCallback){var oSelf=this;var fCanceled=false;var fxnCancel=function(){fCanceled=true;if(fxnFailCallback){fxnFailCallback()}oSelf.startNext()};var timeoutVar;var fxnFinish=function(jXml){if(!fCanceled){clearTimeout(timeoutVar);fxnCallback(jXml);oSelf.startNext()}};var fxnPost=function(){Process.start(oSelf,"RequestQueueDummy",null,FB_SUBMITTING);timeoutVar=setTimeout(fxnCancel,5e3);$.post(sUrl,data,fxnFinish)};if(!fExecuting){fExecuting=true;fxnPost()}else{queue.push(fxnPost)}};this.startNext=function(){Process.stop("RequestQueueDummy");if(queue.length==0){fExecuting=false;return}var fxnNext=queue.shift();fxnNext()}};var ClockCalBinding=new function(){this.dictClockFromCalMap={};this.rgPairs=[];this.add=function(sIdCalField,sIdClockField){if(!sIdCalField||!sIdClockField)return;this.rgPairs.push({idCal:sIdCalField,idClock:sIdClockField});this.dictClockFromCalMap[sIdCalField]=sIdClockField;if(window.fDomLoaded)this.associate(this.rgPairs.length-1)};this.init=function(){for(var ix=0;ix30)dtRound.setMinutes(30);var sctzDt=this.getPrintableTime(CTZFromUTC(dtRound));for(var i=0;i0&&nHours<8)return nHours+12;else return nHours};Clock.prototype.guessTime=function(ctzsTime){return UTCFromCTZ(this.CTZguessTime(ctzsTime))};Clock.prototype.CTZguessTime=function(sTime){var dt=CTZNow();dt.setSeconds(0);dt.setMinutes(0);var re=/^\s*([012]?\d)[:\.]?([012345]\d)[:\.]?([012345]?\d?)\s*$/;var matches=re.exec(sTime);if(matches){if(typeof matches[1]!="undefined"){var f24h=matches[1].length===2&&matches[1][0]==="0";dt.setHours(this.guessAMPM(parseInt(matches[1],10),!f24h&&undefined))}if(typeof matches[2]!="undefined")dt.setMinutes(matches[2]);if(typeof matches[3]!="undefined"){if(!isNaN(parseInt(matches[3],10)))dt.setSeconds(parseInt(matches[3],10))}return dt}re=/^\s*([012]?\d)[:\.]?(\d\d)?[:\.]?(\d\d)?\s?([ap])\.?m?\.?\s*$/i;matches=re.exec(sTime);if(matches){if(matches[4].toLowerCase()=="p"&&parseInt(matches[1],10)<12){var hrs=matches[1];if(hrs.length>1&&hrs.substr(0,1)=="0")hrs=hrs.substr(1);dt.setHours(parseInt(hrs,10)+12)}else if(matches[4].toLowerCase()=="a"&&parseInt(matches[1],10)==12)dt.setHours(0);else dt.setHours(matches[1]);if(!isNaN(parseInt(matches[2],10)))dt.setMinutes(matches[2]);return dt}sTime=trim(sTime.toLowerCase());if(sTime=="noon"){dt.setHours(12);return dt}if(sTime=="midnight"){dt.setHours(0);return dt}if(sTime=="now")return CTZNow();re=/^\s*(\d+)\s*$/;matches=re.exec(sTime);if(matches!=null&&typeof matches[1]!="undefined"){dt.setHours(this.guessAMPM(parseInt(matches[1],10)));return dt}dt=CTZNow();if(sTime.indexOf("minute")!=-1||sTime.indexOf("hour")!=-1){re=/(\d+)/;matches=re.exec(sTime);if(matches!=null&&typeof matches[1]!="undefined"){n=parseInt(matches[1],10)}else{for(var i=0;ithis.iFirstDayOfWeek)iDaysToRollBack=ctzdtFirst.getDay()-this.iFirstDayOfWeek;else if(ctzdtFirst.getDay()ctzdtToday};Calendar.prototype.sameDate=function(dt1,dt2){return dt1.getYear()==dt2.getYear()&&dt1.getMonth()==dt2.getMonth()&&dt1.getDate()==dt2.getDate()};Calendar.prototype.fwdMonth=function(){if(this.dtShowing.getDate()>28){this.dtShowing.setDate(1)}this.dtShowing.setMonth(this.dtShowing.getMonth()+1);this.drawMe()};Calendar.prototype.backMonth=function(){if(this.dtShowing.getDate()>28){this.dtShowing.setDate(1)}this.dtShowing.setMonth(this.dtShowing.getMonth()-1);this.drawMe()};Calendar.prototype.setDay=function(id){elById(id).blur();var rg=id.split(",",2);var dt=this.layout[rg[0]][rg[1]];if(!this.dateInRange(dt))return;this.dt=dt;this.dtShowing=CTZFromUTC(this.dt);this.drawMe();this.hide()};Calendar.prototype.show=function(id,positionID){this.txtID=id;this.txtTimeID=ClockCalBinding.dictClockFromCalMap[id];this.dtToday=new UTCDate;this.drawMe();if(positionID!=null){id=positionID}var elTip=elById("idCalendarTextBar");if(elTip)elTip.style.display=this.fTextBar?"":"none";var offset=window.fLegacyIE?0:1;theMgr.showPopup("tblCalendar",elById(id),offset,elById(id).offsetHeight+offset,false)};Calendar.prototype.showTips=function(){if(trim(elById("calTips").innerHTML)=="")elById("calTips").innerHTML=GetCalendarTip();else elById("calTips").innerHTML=""};Calendar.prototype.hide=function(){var o=elById(this.txtID);if(o){o.value=CTZsDateRawFromUTC(this.dt);$(o).trigger("change")}o=elById("calTips");if(o)o.innerHTML="";theMgr.hidePopup("tblCalendar")};Calendar.prototype.setDate=function(dtDate){this.dt=new UTCDate(dtDate);this.dtShowing=new UTCDate(this.dt)};Calendar.prototype.guessDate=function(ctzsDate){return UTCFromCTZ(this.CTZguessDate(ctzsDate))};Calendar.prototype.CTZguessDate=function(ctzsDate){var dt=new BrowserDate(ctzsDate);dt.setHours(12,0,1);var dtToday=CTZNoon();var re,matches,theYear;if(ctzsDate.match(/^\d?\d$/)){var theDay=parseInt(ctzsDate,10);var theMonth=dtToday.getMonth();theYear=dtToday.getFullYear();if(theDay=12){theMonth-=12;theYear++}}dt=new BrowserDate(theYear,theMonth,theDay,12,0,1);if(!isNaN(dt))return dt}if(ctzsDate.match(/^\d\d\d\d[\:\-\.\/]\d?\d[\:\-\.\/]\d?\d$/)){re=/^(\d\d\d\d)[\:\-\.\/](\d?\d)[\:\-\.\/](\d?\d)$/;matches=re.exec(ctzsDate);dt=new BrowserDate(parseInt(matches[1],10),parseInt(matches[2],10)-1,parseInt(matches[3],10),12,0,1);if(!this.bPastOK&&dtiDayOfWeekToday)dtGuess.setDate(dtGuess.getDate()+(i-iDayOfWeekToday));else if(iiMonthToday)dtGuess.setMonth(dtGuess.getMonth()+(i-iMonthToday));else if(i=5)window.document.onkeydown=handleDocumentKeydown;else window.document.onkeypress=handleDocumentKeydown;window.document.onkeyup=handleDocumentKeyup;window.document.onmouseup=mouseupDocument;window.document.onmousemove=mousemoveDocument;window.onunload=bodyUnload;window.document.onselectstart=function(){return!bCancelEvents};window.onresize=resizeWindow;setFocusToWindow();if(window.TabManager)TabManager.setWindowTitle();setTimeout(function(){if(window.initializeListView)initializeListView();if(window.TabManager)TabManager.addBugEditToolTips();updateStarsOnLoad();loadPopupContent()},1)}function bodyLoad(){if(typeof window.oProxy!="undefined")oProxy.ping();shrinkImagesToFit()}function bodyUnload(){if(window.ie6)cleanupIE6MemoryLeaks();if(window.SelectionManager)SelectionManager.reset()}function cleanupIE6MemoryLeaks(){DropListControl.unload()}function handleFilterChangeKeydown(elem,e){if(getKeyCode(e)==13){theMgr.hideAllPopups();navigation.submit(elem.form);if(e)e.returnValue=false;return false}else if(getKeyCode(e)==27){theMgr.hideAllPopups()}return true}function loadPopupContent(){if(!window.IsLoggedIn||!IsLoggedIn())return;if(typeof g_ixBugSelectedInit!="undefined"&&!g_ixBugSelected)g_ixBugSelected=g_ixBugSelectedInit;var oData={fAlaCarte:1,pg:"pgAlaCartePopupContent",fPgFavorites:IntFromBool($("#pgFavorites").length>0),fList:IntFromBool(window.ListControl),fPlatformChrome:IntFromBool(window.fPlatformChrome),sSearchString:SearchString()};if(g_ixBugSelected){oData["ixBug"]=g_ixBugSelected}$.get(sDefaultURI,oData,resultPopupContent)}function resultPopupContent(jXML){setFavoritesContent($("sHTML_favoritesPopup",jXML).text(),$("sAllFavorites",jXML).text(),$("sHTML_pgFavorites",jXML).text(),true);setPopupContent("workingOnPopup",$("sHTML_workingOnPopup",jXML).text(),elById("Menu_Working_On"));setPopupContent("adminPopup",$("sHTML_adminPopup",jXML).text(),elById("Menu_Admin"));setPopupContent("settingsPopup",$("sHTML_settingsPopup",jXML).text(),elById("Menu_Settings"));setPopupContent("extrasPopup",$("sHTML_extrasPopup",jXML).text(),elById("Menu_Extras"));if(window.ListControl){ListControl.setFilterRefinePopupContent($("sHTML_filterRefinePopup",jXML).text(),jXML);setPopupContent("columnPopup",$("sHTML_columnPopup",jXML).text(),elById("mainColumnPopupLink"));setPopupContent("gridViewPopup",$("sHTML_gridViewPopup",jXML).text(),elById("idViewLink"))}if(window.GridBoxManager){GridBoxManager.loadBoxes(jXML)}}function resizeWindow(e){if(window.editor&&editor.resizeHeight){editor.resizeHeight()}if(window.ie6){if(!resizeWindow.elTB)resizeWindow.elTB=elById("tbFull");if(!resizeWindow.elTB)return;resizeWindow.elTB.style.width=Math.max(windowWidth(),800)+"px"}}function mouseupDocument(e){if(window.SelectionManager)SelectionManager.stopDragging();if(window.GridControl)GridControl.stopActions();if(window.EditableTableManager)EditableTableManager.stopDragging();if(window.FavoritesList)FavoritesList.stopDrag();if(window.Sliders)Sliders.stopDrag()}function mousemoveDocument(e){if(!e)e=window.event;if(e.pageX!=null){xMouse=e.pageX;yMouse=e.pageY}else if(e.clientX!=null){xMouse=e.clientX;yMouse=e.clientY;var doc=document.documentElement;var body=document.body;if(doc.scrollLeft)xMouse+=doc.scrollLeft;else if(body.scrollLeft)xMouse+=body.scrollLeft;if(doc.scrollTop)yMouse+=doc.scrollTop;else if(body.scrollTop)yMouse+=body.scrollTop}notifyMouseMovement()}function notifyMouseMovement(){if(window.GridControl)GridControl.notifyMovement();if(window.SelectionManager)SelectionManager.notifyMovement();if(window.EditableTableManager)EditableTableManager.notifyMovement();if(window.FavoritesList)FavoritesList.notifyMovement();if(window.Sliders)Sliders.notifyMovement()}function hideMiniReports(){if(!window.g_fMiniReports)return;var jrgAs=$("a[id^='link_mini']");if(jrgAs.length<2)return;jrgAs.map(function(){toggleReport(this)})}function toggleReport(el){if(!el)return;var id=el.id.substring(5);var fVis=getCookie("fb_"+id)!="0";var elImg=el.getElementsByTagName("img")[0];if(fVis){show(elById(id));elImg.setAttribute("alt","-");elImg.src=StaticContentUrl("images/minus.gif")}else{hide(elById(id));elImg.setAttribute("alt","+");elImg.src=StaticContentUrl("images/plus.gif")}}function handleFormKeyup(oForm,e){if(!isTagName(oForm,"form"))return false;if(oForm.getAttribute("disableCtrlEnter"))return false;var fClick=false;$("input:visible[type='submit']",oForm).each(function(){if(isDisplayed(this)){this.click();fClick=true;return false}});if(!fClick)oForm.submit(e);return true}function handleDocumentKeydown(e,oWindow){if(!e&&oWindow)e=oWindow.event;if(!e)e=window.event;if(!e)return;bUserTyped=true;var keyCode=getKeyCode(e);if(window.SelectionManager)SelectionManager.checkboxDown(keyCode);KeyManager.keystroke(e,oWindow);if(keyCode==27){Process.haltAll();if(window.GridControl)GridControl.cancelActions()}if(e.ctrlKey&&keyCode==13){var oForm=getEventTarget(e);if(oForm&&oForm.form)oForm=oForm.form;if(handleFormKeyup(oForm,e))return false}return true}function isTab(keyStroke){var keyCode=getKeyCode(keyStroke);return keyCode==9||window.webkit&&keyCode==25}function handleDocumentKeyup(e){if(!e)e=window.event;if(!e)return;var keyCode=getKeyCode(e);if(window.SelectionManager)SelectionManager.checkboxUp(null,e);return true}function handleHistoryChange(newLocation,historyData){if(window.ViewHistoryManager){ViewHistoryManager.addViewHistory(true);ViewHistoryManager.handleHistoryChange(newLocation,historyData)}if(window.GraphHistory)GraphHistory.handleHistoryChange(newLocation,historyData)}function getOverflowAbove(o){var oParent=o.parentNode;while(oParent)if(oParent.scrollWidth>oParent.offsetWidth)return oParent;else oParent=oParent.parentNode;return null}function shrinkImagesToFit(fForceSmall){if(window.GridControl)return;$("img").each(function(){shrinkImageToFit(this,fForceSmall)})}function shrinkImageToFit(img,fForceSmall){if(!img)return;if(!img.complete){setTimeout(function(){shrinkImageToFit(img,fForceSmall)},200);return}var jImg=$(img);if(!jImg.is(":visible"))return;var pxMaxWidth=fForceSmall?300:720;var pxMaxHeight=fForceSmall?300:1e3;if(fForceSmall||img.getAttribute("inline")!=null&&img.getAttribute("noshrink")==null){var oContainer=getOverflowAbove(img);img.xwidth=jImg.width();img.xheight=jImg.height();var widthNext=img.xwidth;var heightNext=img.xheight;if(widthNext==0)return;if(oContainer&&!isTagName(oContainer,"html")){var ixContainerRight=calculateOffset(oContainer,"offsetLeft")+oContainer.offsetWidth;var ixRight=calculateOffset(img,"offsetLeft")+img.offsetWidth;var nExtra=!window.ie6?10:25;if(ixRight+nExtra>ixContainerRight){widthNext=img.offsetWidth-(ixRight-ixContainerRight)-nExtra;heightNext=img.xheight*(widthNext/img.xwidth)}}if(widthNext>pxMaxWidth){heightNext=img.xheight*(pxMaxWidth/img.xwidth);widthNext=pxMaxWidth;if(heightNext>pxMaxHeight){widthNext=widthNext*(pxMaxHeight/heightNext);heightNext=pxMaxHeight}}else if(heightNext>pxMaxHeight){widthNext=img.xwidth*(pxMaxHeight/img.xheight);heightNext=pxMaxHeight}if(widthNext!=img.xwidth)img.style.width=widthNext+"px";if(heightNext!=img.xheight)img.style.height=heightNext+"px";img.processed=true}}function showSearchingInfo(e,oSource){if(e&&(e.metaKey||e.ctrlKey)){return}if(oSource&&oSource.form&&oSource.form.searchFor){if(oSource.form.searchFor.value.length>0){Info.show(FB_SEARCHING)}}}function restoreSubscriptionState(){var elState=elById("idSubscriptionState");if(elState)updateSubscriptionState(parseInt(elState.value,10))}function updateSubscriptionState(fSubscribed){$("#containerSubscribe #subscribe").css("display",fSubscribed?"none":"");$("#containerSubscribe #unsubscribe").css("display",fSubscribed?"":"none");$("#containerSubscribe #idSubscriptionState").attr("value",fSubscribed?1:0);if(window.goBug)goBug.fSubscribed=fSubscribed}function quickSubscription(elLink,fSubscribe){updateSubscriptionState(fSubscribe);sendNewSubscriptionRequest(elLink.href.replace("?","?fAlaCarte=1&"))}function sendNewSubscriptionRequest(sHref){sHref=sHref.replace(/&/g,"&");$.get(sHref)}function quickDiscussModerate(oLink,ixDiscussTopic,fDelete){$("#containerDiscussAdmin"+ixDiscussTopic+" span[id]").map(function(){var sDisplay="none";if(fDelete&&$(this).attr("id")=="adminDeleting"||!fDelete&&$(this).attr("id")=="adminApproving")sDisplay="";$(this).css("display",sDisplay)});$.get(oLink.href.replace("?","?fAlaCarte=1&"),null,function(jXML){var ixDiscussTopic=$("ixDiscussTopic",jXML).text();var sHTML=$("sHTML",jXML).text();if(ixDiscussTopic!=null&&sHTML&&sHTML.length)$("#containerDiscussTopic"+ixDiscussTopic).html(sHTML)})}function DeleteFixFor(sTableId,elLink,ixFixFor,ixProject,fAnyProject){$.post(sDefaultURI,{fAlaCarte:1,ixFixForEditing:ixFixFor,ixProjectEditing:ixProject,fAnyProject:fAnyProject,pre:"preDeleteFixFor"},function(jXML){EditableTableManager.result(sTableId,jXML)})}function UndeleteFixFor(sTableId,elLink,ixFixFor,ixProject,fAnyProject){$.post(sDefaultURI,{fAlaCarte:1,ixFixForEditing:ixFixFor,ixProjectEditing:ixProject,fAnyProject:fAnyProject,pre:"preUndeleteFixFor"},function(jXML){EditableTableManager.result(sTableId,jXML)})}function quickEditArea(ixProject,oElem){if(!oElem)return;$.post(sDefaultURI,{fAlaCarte:1,ixProject:ixProject,pre:oElem.form.preToEdit?oElem.form.preToEdit.value:"",ixArea:oElem.form.ixToEdit?oElem.form.ixToEdit.value:"",sArea:oElem.form.sToEdit?oElem.form.sToEdit.value:"",ixPersonOwner:oElem.form.ixPersonOwnerToEdit?oElem.form.ixPersonOwnerToEdit.value:-1},function(jXML){EditableTableManager.result("AreaTable",jXML)})}function quickEditSnippets(oElem){if(!oElem)return;$.post(sDefaultURI,{fAlaCarte:1,pre:oElem.form.preToEdit?oElem.form.preToEdit.value:"",ixSnippet:oElem.form.ixToEdit?oElem.form.ixToEdit.value:"",sName:oElem.form.sNameToEdit?oElem.form.sNameToEdit.value:"",ixPerson:oElem.form.ixPersonToEdit?oElem.form.ixPersonToEdit.value:"",fGlobal:oElem.form.fGlobalToEdit?oElem.form.fGlobalToEdit.value:"",s:oElem.form.sToEdit?jsToVbNewLines(oElem.form.sToEdit.value):"",sComment:oElem.form.sCommentToEdit?oElem.form.sCommentToEdit.value:""},resultChangeSnippet)}function quickDeleteSnippet(ixSnippet){$.get(sDefaultURI+"?fAlaCarte=1&pre=preDeleteSnippet&ixSnippet="+ixSnippet,null,resultChangeSnippet)}function quickDeleteAttachment(oElem){if(!oElem)return;var oParams={fAlaCarte:1,pre:"preDeleteFile",pg:"pgAlaCarteAttachmentList",ixAttachment:oElem.form.ixToDelete?oElem.form.ixToDelete.value:""};var ixBugEvent=null;if(oElem.form.sOwner.value=="Bug"){ixBugEvent=oElem.form.ixBugEventToEdit.value;oParams["ixBugEvent"]=ixBugEvent;oParams["ixBug"]=oElem.form.ixOwner.value;oParams["command"]="edit"}else{oParams["sOwner"]=oElem.form.sOwner.value;oParams["ixOwner"]=oElem.form.ixOwner.value}$.get(sDefaultURI,oParams,function(jXML){var sHTMLBugEvents=$("BugEventsHTML",jXML).text();if(sHTMLBugEvents)doReplaceBugEvents(sHTMLBugEvents);var ixBugEventLatestPre=$("ixBugEventLatestPre",jXML).text();var ixBugEventLatestPost=$("ixBugEventLatestPost",jXML).text();if(typeof updateBugEventLatest!="undefined"&&updateBugEventLatest(ixBugEventLatestPre,ixBugEventLatestPost)){updateActionButtons(jXML)}if(window.goBug){goBug.rgCachedViews={}}var sId="containerAttachmentList"+(null==ixBugEvent?"":"_"+ixBugEvent);EditableTableManager.result("DeleteAttachment",jXML,sId);shrinkImagesToFit()})}function quickEditReleaseNotes(oElem,sTableId){if(!oElem)return;var sContainerId=oElem.form.sContainerId?oElem.form.sContainerId.value:"";var sReleaseNotes=oElem.form.sReleaseNotesToEdit?jsToVbNewLines(oElem.form.sReleaseNotesToEdit.value):"";$.post(sDefaultURI,{fAlaCarte:1,pre:oElem.form.preToEdit?oElem.form.preToEdit.value:"",pg:oElem.form.pgToEdit?oElem.form.pgToEdit.value:"",ixBug:oElem.form.ixToEdit?oElem.form.ixToEdit.value:"",sReleaseNotes:sReleaseNotes},function(jXML){resultChangeReleaseNotes(jXML,sReleaseNotes,sContainerId,sTableId)})}function quickDeleteArea(ixProject,ixArea){$.get(sDefaultURI+"?fAlaCarte=1&pre=preDeleteArea&ixProject="+ixProject+"&ixArea="+ixArea,null,function(jXML){EditableTableManager.result("AreaTable",jXML)})}function quickDeleteFilter(ixFilter){$.get(sDefaultURI+"?fAlaCarte=1&pre=preDeleteFilter&ixFilter="+ixFilter,null,function(jXML){EditableTableManager.result("FilterTable",jXML)})}function resultChangeSnippet(jXML){var sSnippetJS=$("sSnippetJS",jXML).text();if(sSnippetJS){rgSnippet=eval(sSnippetJS);$.each(rgSnippet,function(ix,snip){snip.ixSnippet=ix});fb.snippet.populateSnippetSelect(rgSnippet);fb.snippet.refreshSnippetHelper()}EditableTableManager.result("SnippetTable",jXML)}function resultChangeReleaseNotes(jXML,sNotes,sContainerId,sTableId){if(sContainerId){EditableTableManager.result(sTableId,$("NoteLink",jXML),sContainerId+"Link");EditableTableManager.result(sTableId,$("Note",jXML),sContainerId)}else{var sHTMLBugEvents=$("BugEventsHTML",jXML).text();if(sHTMLBugEvents)doReplaceBugEvents(sHTMLBugEvents);var ixBugEventLatestPre=$("ixBugEventLatestPre",jXML).text();var ixBugEventLatestPost=$("ixBugEventLatestPost",jXML).text();if(updateBugEventLatest(ixBugEventLatestPre,ixBugEventLatestPost)){updateActionButtons(jXML)}if(window.goBug){goBug.sReleaseNotes=sNotes;goBug.rgCachedViews={}}EditableTableManager.result(sTableId,jXML)}}function showDeleteAttachment(oElem,ixToDelete,sToDelete,ixOwner,sOwner,ixBugEvent){if(!showDeleteAttachment.oPop)showDeleteAttachment.oPop=FancyPopupManager.create("DeleteAttachment");showDeleteAttachment.oPop.oDiv.innerHTML=pictureOf(EditableAttachmentPane,ixToDelete,sToDelete,ixOwner,sOwner,ixBugEvent);showDeleteAttachment.oPop.show(oElem.id,POPUP_POSITION_CENTER)}function mouseoverCaseId(ixBug,oLink,cMillis){cMillis=cMillis||500;IdPop.startTimer(ixBug,oLink,cMillis);if(!oLink.fAttached){ourAttachEvent(oLink,"mouseout",mouseoutCaseId);oLink.fAttached=true}}function mouseoutCaseId(){IdPop.hide()}function keypressDiscussList(e,el){if("*"==String.fromCharCode(KeyboardMap.fix(getKeyCode(e),false)).toLowerCase()){new ListBrowser(el.parentNode,function(el){return null!=el.tagName&&"a"==el.tagName.toLowerCase()&&("starEmpty"==el.className||"starFull"==el.className)},null,null,null,function(el){KeyManager.simulateClick(el)},null);return cancel(e)}}function internalRowEvent(e){var idParentSrc;var idParentTo;if(document.all){if(window.event&&window.event.fromElement&&window.event.toElement){idParentSrc=getidParentRow(window.event.fromElement);idParentTo=getidParentRow(window.event.toElement)}}else{if(e&&e.target&&e.relatedTarget){idParentSrc=getidParentRow(e.target);idParentTo=getidParentRow(e.relatedTarget)}}return idParentSrc&&idParentTo&&idParentSrc==idParentTo}function getidParentRow(el){while(el){try{el.parentNode}catch(e){return""}if(isTagName(el,"tr")&&el.id&&el.id!="row_spam")return el.id;el=el.parentNode}return null}function setFocusToWindow(){if(bUserTyped)return;if(!bUserTyped&&typeof oFocusStart!="undefined"&&oFocusStart){safeFocus(oFocusStart);return}if(window.TabManager&&TabManager.focusCorrectFormElement())return;if(elById("bugerror")!=null)return;var el=$("#mainArea table.biglist input:visible").not(":checkbox").get(0);if(el&&el.style.display!="none")safeFocus(el)}function Book(){this.idVisible=null;this.ids=[];this.hashTies={};this.addPage=function(id){this.ids.push(id)};this.addTie=function(idsTab,idEl){if(!this.hashTies[idEl])this.hashTies[idEl]=[];var rg=idsTab.split(",");for(var ix=0;ix0||this.ids.grep(_equal).length>0}}PopupMgr.prototype.isNoHideId=function(id){for(var i=0;i0){this.showSmallMask(this.rgVisiblePopups[this.rgVisiblePopups.length-1]); }};PopupMgr.prototype.populateDelayedContent=function(elPopup){if(elPopup&&typeof elPopup.newContent!="undefined"){setInnerHTML(elPopup,elPopup.newContent);elPopup.newContent=undefined}};PopupMgr.prototype.showPopup=function(id,elPlacement,xOffset,yOffset,fHideOthers,fShadow,fFixedWidth){var popEl=elById(id);this.populateDelayedContent(popEl);KeyManager.registerElPopupKeys(popEl);if(fHideOthers||fHideOthers==null){this.hideAllPopups(true)}this.showTopSmallMask();this.rgVisiblePopups.push(id);this.hashVisible[id]=true;popEl.fChildOfPane=EditableTableManager.isVisible();if(window.ie6){$("select",popEl).attr("idOwner",id)}var nMaskWidth=documentWidth();if(popEl&&(popEl.style.display=="none"||popEl.style.visibility=="hidden")){this.hideSelects();popEl.style.visibility="hidden";popEl.style.display="";var pt={x:xOffset,y:yOffset};if(elPlacement!=null){pt=getAbsolutePosition(elPlacement);pt.y=pt.y+yOffset;if(pt.x+xOffset+popEl.offsetWidth>windowRight()){pt.x=pt.x-xOffset-popEl.offsetWidth+elPlacement.offsetWidth}else{pt.x=pt.x+xOffset}}if(pt.x!=null&&pt.y!=null){popEl.style.left=pt.x+"px";popEl.style.top=pt.y+"px"}popEl.style.visibility="visible";if(fShadow){ApplyShadow(popEl)}if(elPlacement!=null){var y1=calculateOffset(popEl,"offsetTop");var y2=calculateOffset(elPlacement,"offsetTop");var x1=calculateOffset(popEl,"offsetLeft");var x2=calculateOffset(elPlacement,"offsetLeft");var diffY=y1-(y2+yOffset);var diffX=x1-(x2+xOffset);if(diffY>0){popEl.style.top=y2+yOffset-diffY+"px"}if(diffX>0){popEl.style.left=x2+xOffset-diffX+"px"}}var oSelf=this;setTimeout(function(){oSelf.maskClicks(nMaskWidth)},1)}return false};PopupMgr.prototype.showSmallMask=function(id){var oMask=elById(this.getMaskId(id));var oPopup=elById(id);if(!oMask){if(!oPopup)return;if(window.ie){oMask=DOM.img({src:StaticContentUrl("images/spacer.gif"),id:this.getMaskId(id),style:CSSClickMask(),alt:"",galleryimg:"no"})}else{oMask=DOM.div({id:this.getMaskId(id),style:CSSClickMask()},DOM.nbsp())}oMask.onmousedown=function(){theMgr.hideAllHigherPopups(id)};oPopup.appendChild(oMask)}if(!oMask)return;coverElement(oMask,oPopup,0,0);oMask.style.display=""};PopupMgr.prototype.hidePopup=function(id){if(!this.hashVisible[id])return false;var popEl=elById(id);if(!popEl||popEl.style.display=="none"){this.hashVisible[id]=false;return false}if(this.hashOnHideHandlers[id]&&this.hashOnHideHandlers[id].apply){if(!this.hashOnHideHandlers[id].apply(window,jQuery.makeArray(arguments).splice(1))){return true}}if(popEl.style.display=="")popEl.style.display="none";this.hashVisible[id]=false;KeyManager.removePopupKeys(popEl);var rgToHide=[];for(var ix=0;ix=0;i--){var sId=this.ids[i];if(!this.hashVisible[sId])continue;if(theMgr.hidePopup(sId)){fAllPopupsHidden=false}}if(fAllPopupsHidden){if((bPreShowPopup==null||!bPreShowPopup)&&!EditableTableManager.isVisible()){this.showSelects();this.unmaskClicks()}}else{this.unmaskTopmostPopup()}return false};PopupMgr.prototype.hideSelects=function(){if(!window.ie6)return;var rgEl=document.getElementsByTagName("select");var idTopmostPopup=theMgr.getTopmostPopup();var oTopmostPopup=elById(idTopmostPopup);var fUnderPane=EditableTableManager.isVisible()&&oTopmostPopup!=null&&!oTopmostPopup.fChildOfPane;var rgcSelects={};var pt;for(var i=0;i=0)el.value=" "+trim(rgEl[i].options[rgEl[i].selectedIndex].innerHTML);else if(rgEl[i].options.length>0)el.value=" "+trim(rgEl[i].options[0].innerHTML);el.value=decodeLTGT(el.value);el.className=rgEl[i].className+"_pseudo";if(rgEl[i].style.width.length)el.style.width=rgEl[i].style.width;if(rgEl[i].style.fontSize.length)el.style.fontSize=rgEl[i].style.fontSize;if(rgEl[i].style.fontFamily.length)el.style.fontFamily=rgEl[i].style.fontFamily;if(el.style.width!="")el.style.width=parseInt(el.style.width,10)-6+"px";if(rgEl[i].offsetHeight)el.style.height=rgEl[i].offsetHeight-4+"px";if(!oHider)rgEl[i].parentNode.insertBefore(el,rgEl[i]);rgEl[i].style.visibility="hidden"}}};PopupMgr.prototype.showSelects=function(id){if(!window.ie6)return;var oPopup=elById(id);if(EditableTableManager.isVisible()&&oPopup&&!oPopup.fChildOfPane){return}var rgEl;if(id)rgEl=elById(id).getElementsByTagName("select");else rgEl=document.getElementsByTagName("select");for(var i=0;i").text(sErr+"  ");$("#idWorkOnError").empty().append(nobr).show()};KeyManager.browsePopup("workingOnPopup");switch($("nCanWorkOn",jXML).text()){case"1":if(fxnCallbackSuccess&&fxnCallbackSuccess.call){fxnCallbackSuccess.call()}loadWorkingOnPopup();break;case"-1":var ixBug=$("ixBugIn",jXML).text();if(!ixBug)return;fxErr(swap1(FB_INVALID_CASE,ixBug));break;case"-2":fxErr(swap1(FB_INVALID_CASE,FB_CLOSED));break;case"-3":var ixBug=$("ixBugIn",jXML).text();if(!ixBug)return;fxErr(swap1(FB_CASE_HAS_NO_ESTIMATE_SHORT,ixBug));EstimatePopup.show("workingOnPopup",ixBug,changeIxWorkingOn,changeIxWorkingOn,null);break;case"-4":fxErr(swap1(FB_INVALID_CASE,FB_NO_PERMISSION));break;case"-5":var ixBug=$("ixBugIn",jXML).text();if(!ixBug)return;fxErr(FB_AFTERHOURS);AfterHoursPopup.show("workingOnPopup",ixBug,null);break}}var g_ixBugSelected;var g_workingOn_fSelected;function setWorkOnLink(ixBugSelected){if(ixBugSelected==g_ixBugSelected)return;if(0==ixBugSelected){setInnerHTML("idThisCaseSpan","",true);g_ixBugSelected=0;return}$.get(sDefaultURI+"?fAlaCarte=1&"+"pg=pgWorkOnThisLink&ixBug="+ixBugSelected+"&fSelected=1",null,setWorkOnLinkCallback)}function setWorkOnLinkCallback(jXML){var sHTML=$("sHTMLWorkOnThis",jXML).text();if(!sHTML||sHTML&&sHTML.length==1)sHTML="";theMgr.populateDelayedContent(elById("workingOnPopup"));var oSpan=setInnerHTML("idThisCaseSpan",sHTML,true);if(oSpan){preserveOnMouseover(oSpan);KeyManager.browsePopup("workingOnPopup");var ixBugSelected=$("ixBugSelected",jXML).text();if(ixBugSelected&&ixBugSelected!="")g_ixBugSelected=Number(ixBugSelected);var fSelected=$("fSelected",jXML).text();if(fSelected!=undefined&&fSelected!="")g_workingOn_fSelected=Number(g_workingOn_fSelected)!=0}}function resetWorkingOnMenu(){KeyManager.stopBrowsingMenus();hideWorkingOnError();$("#idWorkOnScheduleItemDiv").hide();$("#idWorkOnOtherDiv").hide();return true}function hideWorkingOnError(){$("#idWorkOnError").hide()}function doDlgConfirmation(ix){enableInputsWithin("dlgConfirmation_"+ix,false);Info.show(FB_SUBMITTING)}function addColumnDropdown(){var i=0;var o;for(i=0;true;i++){o=elById("gridCol_"+i);if(!o){disableElementById("addColumnButton");return}if(o.style.display=="none")break}o.style.display="";DropListControl.refresh($("select",o)[0]);o=elById("gridCol_"+(i+1));if(!o)disableElementById("addColumnButton")}function statusChange(fChangeFocus,fInitialLoad){if(!document.formWithProject||!document.formWithProject.command)return;var command=document.formWithProject.command.value;var oStatus=elById("ixStatus");var oDupes=elById("elDuplicatesEdit");var sEdit=elById("sDuplicatesEdit");if(!oStatus)return;var ixStatus=$(oStatus).val();if(oDupes){var status=new CStatus;if(status.Load(ixStatus)&&status.fDuplicate){oDupes.style.display="";if(fChangeFocus){setTimeout(function(){safeFocus(sEdit)},1)}var el=elById("bugviewContainerSide");if(!fInitialLoad&&el){el.style.display="none";setTimeout(function(){el.style.display=""},1)}}else{var oEventEdit=elById("sEventEdit");if(oDupes.style.display!="none")sEdit.blur();if(fChangeFocus){safeFocus(oEventEdit);setTimeout(function(){safeFocus(oEventEdit)},1)}if(typeof goDup=="undefined"||goDup.ixBug<=0)oDupes.style.display="none"}}updateAssignedToDropdown();return false}function toggleSnippetPlaceholderTip(){var o=elById("snippetPlaceholdersTip");if(o)toggleVisible(o)}function flipCheckbox(oBox){if(oBox)oBox.checked=!oBox.checked}function verifyPermissions(elInit){var rgCheckboxes=[elById("fReadCommunity"),elById("fReadPublic"),elById("fWriteCommunity"),elById("fWritePublic")];var rgRadios=[elById("nPermissionTypeNormal"),elById("nPermissionTypeGroup")];var ix;if(rgRadios[0].checked){elById("ixGroup").disabled=true;for(ix=0;ix=0;ix--){if(!rgCheckboxes[ix])continue;if(rgCheckboxes[ix].id==elInit.id)break;if(ix==2&&rgCheckboxes[1]&&rgCheckboxes[1].id==elInit.id)continue;rgCheckboxes[ix].checked=false}}}}else{elById("ixGroup").disabled=false;for(ix=0;ix=0){if(ix==s.length-1||s[ix+1]!="\\"&&s[ix+1]!='"')s=s.slice(0,ix)+"\\"+s.slice(ix);ixSearchOffset=ix+2}ixSearchOffset=0;while((ix=s.indexOf('"',ixSearchOffset))>=0){if(ix==0||s[ix-1]!="\\")s=s.slice(0,ix)+"\\"+s.slice(ix);else ixSearchOffset=ix+1}return s}window.getQuotedText=function(){function quoteSpan(el){return $(el).parent().next("span")[0]}function resultInsertQuotedText(jXML,elTarget){var sQuoted=$("QuotedText",jXML).text();if(sQuoted){var elSpan=quoteSpan(elTarget);if(elSpan){elSpan.innerHTML=sQuoted;var elOnclickTarget=elTarget;elOnclickTarget.onclick=function(){toggleReply(elOnclickTarget);return false};elOnclickTarget.onclick()}}}function toggleReply(el){var elToggle=quoteSpan(el);$(elToggle).toggle();var fCollapsed=elToggle.style.display==="none";$(el).text(fCollapsed?FB_SHOW_QUOTED_TEXT:FB_HIDE_QUOTED_TEXT);$(el).parent().toggleClass("expanded",!fCollapsed)}return function getQuotedText(el,ixBugEvent){el.onclick=function(){return false};$(el).text(FB_FETCHING);var params={fAlaCarte:1,pg:"pgQuotedEmail",ixBugEvent:ixBugEvent,sTicket:sTicket||""};$.get(sDefaultURI,params,function(jXML){resultInsertQuotedText(jXML,el)});return true}}();function cautionFBUserEmail(sEmailDroplistValue){var sEmail=ExtractEmail(sEmailDroplistValue).toLowerCase();if(!(DB&&DB.Person&&sEmail)){return""}var fCaution=DB.Person.match(function(p){if(p.fDeleted||!p.sEmail){return false}var rgs=p.sEmail.toLowerCase().split(/[,;]/);return rgs.match(function(s){return ExtractEmail(s)===sEmail})});return fCaution?FB_USER_EMAIL_WARNING:""}var fb=fb||{};fb.stats=function(){"use strict";return{enabled:false,record:function(sAction,data){if(!this.enabled){return}var params=$.extend({sAction:sAction,sDomain:document.location.hostname,cacheValidator:Math.random()},data);$("").attr({src:StaticContentUrl("images/stats.png?"+$.param(params)),style:"display: none"}).appendTo(document.body)}}}();$(function(){$(".dismissMessageBar").click(function(e){var me=$(this);e.preventDefault();$.get(me.attr("href"));me.parentsUntil("div.messageBar").remove()})});jQuery.fn.yft=function(){var dictFading={};function highlight(jTargetCollection,dictOptions,fxnCallback){var dictDefaultOptions={sYftId:null,color:"#FFFF99",complete:function(){},fadeInMillis:100,fadeOutMillis:750,alphaMax:.5,boundingbox:false,zOffset:1,easing:"swing",queue:true};dictOptions=$.extend({},dictDefaultOptions,dictOptions,{complete:fxnCallback});var nFaded=0;var jParent=$(document.body);function getZIndex(jEle){return parseInt(jEle.css("z-index"),10)||0}function buildOffsetFromCollection(rgEl){var dictBounds={};function updateBounds(cmp){return function(k,v){var prev=dictBounds[k];if(prev===undefined||cmp(v,prev)){dictBounds[k]=v}}}function lt(a,b){return ab}$.each(rgEl,function(i,el){var offsets=buildOffsetFromElement($(el));$.each({nTop:offsets.nTop,nLeft:offsets.nLeft},updateBounds(lt));$.each({nRight:offsets.nRight,nBottom:offsets.nBottom},updateBounds(gt))});return dictBounds}function buildOffsetFromElement(jEle){var dictOffset=jEle.offset();return{nTop:dictOffset.top,nLeft:dictOffset.left,nRight:dictOffset.left+jEle.outerWidth(),nBottom:dictOffset.top+jEle.outerHeight()}}function generateStyles(dictTargetOffset,options,zIndex){var outerWidth=dictTargetOffset.nRight-dictTargetOffset.nLeft;var outerHeight=dictTargetOffset.nBottom-dictTargetOffset.nTop;var nTop=dictTargetOffset.nTop;var nLeft=dictTargetOffset.nLeft;return{position:"absolute",opacity:0,margin:"0px",height:outerHeight+"px",width:outerWidth+"px","background-color":options.color,"z-index":zIndex+parseInt(options.zOffset,10),top:nTop+"px",left:nLeft+"px"}}function buildYellowPanel(dictStyle){var jYellow=$("
    ");jYellow.css(dictStyle);jParent.append(jYellow);return jYellow}function fadeFromOffset(jTarget,dictOffset){var dictStyle=generateStyles(dictOffset,dictOptions,getZIndex(jTarget));var jYellow=buildYellowPanel(dictStyle);var dictDefaultAnimationOptions={easing:dictOptions.easing,queue:dictOptions.queue};function animationStep2(){var dictAnimationOptions=$.extend({},dictDefaultAnimationOptions,{duration:parseInt(dictOptions.fadeOutMillis,10),complete:endAnimationCallBack});jYellow.animate({opacity:0},dictAnimationOptions)}function endAnimationCallBack(){$(this).remove();nFaded++;if(nFaded==jTargetCollection.size()||dictOptions.boundingbox){if(dictOptions.sYftId){delete dictFading[dictOptions.sYftId]}dictOptions.complete()}}jYellow.animate({opacity:dictOptions.alphaMax},$.extend({},dictDefaultAnimationOptions,{duration:parseInt(dictOptions.fadeInMillis,10),complete:animationStep2}))}if(dictOptions.sYftId!==null){if(dictFading[dictOptions.sYftId]){return}dictFading[dictOptions.sYftId]=true}if(dictOptions.boundingbox){fadeFromOffset(jTargetCollection,buildOffsetFromCollection(jTargetCollection))}else{$.each(jTargetCollection,function(i,ele){var jTarget=$(ele);var dictOffset=buildOffsetFromElement(jTarget);fadeFromOffset(jTarget,dictOffset)})}}return function(options,fxnCallback){return highlight($(this),options,fxnCallback)}}();var FadeManager=new function(){var rgFaders=[];this.startFadeIn=function(sFader,oToFade,fxnHelper,bFadeDark,fxnHelperEndInit){this.create(sFader);rgFaders[sFader].startFadeIn(oToFade,fxnHelper,bFadeDark,fxnHelperEndInit)};this.startFadeOut=function(sFader,oToFade,fxnHelper,bSlowFade){this.create(sFader);rgFaders[sFader].startFadeOut(oToFade,fxnHelper,bSlowFade)};this.fadeIn=function(sFader){this.create(sFader);rgFaders[sFader].fadeIn()};this.fadeOut=function(sFader){this.create(sFader);rgFaders[sFader].fadeOut()};this.create=function(sFader){if(!rgFaders[sFader])rgFaders[sFader]=new Fader(sFader)}};var YFTManager=new function(){var rgYFTs=[];this.showYellow=function(sYFT,oTarget){this.create(sYFT);rgYFTs[sYFT].showYellow(oTarget)};this.hideYellow=function(sYFT){this.create(sYFT);rgYFTs[sYFT].hideYellow()};this.create=function(sYFT){if(!rgYFTs[sYFT])rgYFTs[sYFT]=new YFT(sYFT)}};var BlinkManager=new function(){var rgBlinks=[];this.startBlink=function(sBlink,oTarget,sColor,cBlinks,cMsPerBlink,dblOpacity){if(cMsPerBlink==null)cMsPerBlink=75;if(dblOpacity==null)dblOpacity=.5;this.create(sBlink);rgBlinks[sBlink].startBlink(oTarget,sColor,cBlinks,cMsPerBlink,dblOpacity)};this.stopBlink=function(sBlink){this.create(sBlink);rgBlinks[sBlink].stopBlink()};this.create=function(sBlink){if(!rgBlinks[sBlink])rgBlinks[sBlink]=new Blink(sBlink)};this.toggleBlink=function(sBlink){this.create(sBlink);rgBlinks[sBlink].toggleBlink()}};function Blink(sNameTemp){var sBlinkName=sNameTemp;var oBlinkPane=document.createElement("div");var cBlinks=0;var cMsPerBlink=-1;oBlinkPane.style.position="absolute";oBlinkPane.style.overflow="hidden";oBlinkPane.style.display="none";oBlinkPane.style.zIndex=15;document.body.appendChild(oBlinkPane);this.startBlink=function(oTarget,sColor,cBlinksIn,cMsPerBlinkIn,dblOpacity){if(cBlinksIn<=0||cMsPerBlinkIn<=0)return;var pxHeight=oTarget.offsetHeight;var pxWidth=oTarget.offsetWidth;var pxTop=calculateOffset(oTarget,"offsetTop");var pxLeft=calculateOffset(oTarget,"offsetLeft");if(!pxHeight&&!pxWidth&&oTarget.tagName.toLowerCase()=="tr"){var rgTDs=oTarget.cells;if(rgTDs.length){pxLeft=calculateOffset(rgTDs[0],"offsetLeft");for(var ix=0;ixpxHeight){pxHeight=rgTDs[ix].offsetHeight;pxTop=calculateOffset(rgTDs[ix],"offsetTop")}}}}oBlinkPane.style.top=pxTop+"px";oBlinkPane.style.left=pxLeft+"px";oBlinkPane.style.height=pxHeight+"px";oBlinkPane.style.width=pxWidth+"px";oBlinkPane.style.backgroundColor=sColor;setOpacity(oBlinkPane,dblOpacity);this.cMsPerBlink=cMsPerBlinkIn;this.cBlinks=cBlinksIn;this.toggleBlink()};this.toggleBlink=function(){if(this.cBlinks<=0){this.stopBlink();return}if(oBlinkPane.style.display=="none"){oBlinkPane.style.display="inline";this.cBlinks--}else oBlinkPane.style.display="none";setTimeout('BlinkManager.toggleBlink("'+sBlinkName+'")',this.cMsPerBlink)};this.stopBlink=function(){cBlinks=0;cMsPerBlink=-1;oBlinkPane.style.display="none"}}function YFT(sNameTemp){var sName=sNameTemp+"YFT";var oYellowPane=document.createElement("div");oYellowPane.style.position="absolute";oYellowPane.style.overflow="hidden";oYellowPane.style.padding="0px";oYellowPane.style.backgroundColor="#FFFF99";oYellowPane.style.display="none";this.showYellow=function(oTarget){var pxHeight=oTarget.offsetHeight;var pxWidth=oTarget.offsetWidth;var pxTop=calculateOffset(oTarget,"offsetTop",true);var pxLeft=calculateOffset(oTarget,"offsetLeft",true);var elInsertTarget=oTarget;while(matchesTagName(elInsertTarget,"(tr)|(td)|(tbody)")&&elInsertTarget.parentNode){elInsertTarget=elInsertTarget.parentNode}if(!pxHeight&&!pxWidth&&oTarget.tagName.toLowerCase()=="tr"){var rgTDs=oTarget.cells;if(rgTDs.length){pxLeft=calculateOffset(rgTDs[0],"offsetLeft",true);for(var ix=0;ixpxHeight){pxHeight=rgTDs[ix].offsetHeight;pxTop=calculateOffset(rgTDs[ix],"offsetTop",true)}}}}oYellowPane.style.top=pxTop+"px";oYellowPane.style.left=pxLeft+"px";oYellowPane.style.height=pxHeight+"px";oYellowPane.style.width=pxWidth+"px";if(elInsertTarget.parentNode&&!isInDOM(oYellowPane))elInsertTarget.parentNode.insertBefore(oYellowPane,elInsertTarget);FadeManager.startFadeOut(sName,oYellowPane,null,true)};this.hideYellow=function(){oYellowPane.style.display="none"}}function ApplyShadow(el){var sCssShadow="0px 1px 5px #cccccc";$(el).css({"-webkit-box-shadow":sCssShadow,"-moz-box-shadow":sCssShadow,"box-shadow":sCssShadow,border:"1px solid #D6D6D6"})}function Fader(sNameInit){var sName=sNameInit;var fxnHelper=null;var fxnHelperEnd=null;var oToFade=null;var bFadeIn=false;var dFadeAlpha=0;var dFadeAlphaStep=.1;var dFadeAlphaMax=.4;var dFadeAlphaMin=.01;var msFadeSpeed=1;var msInitialWait=250;this.startFadeIn=function(oToFadeInit,fxnHelperInit,bFadeDark,fxnHelperEndInit){if(!oToFadeInit)return;if(bFadeDark){dFadeAlphaMax=window.webkit?1:.99;dFadeAlphaStep=window.ie?1:window.webkit&&window.versionMajorWebKit>=5?.1:.33}oToFade=oToFadeInit;fxnHelper=fxnHelperInit;fxnHelperEnd=fxnHelperEndInit;if(fxnHelper){oToFade.style.visibility="hidden";oToFade.style.display="";fxnHelper.call();oToFade.style.visibility="visible"}setOpacity(oToFade,dFadeAlphaMin);oToFade.style.display="";bFadeIn=true;dFadeAlpha=0;setTimeout("FadeManager.fadeIn('"+sName+"')",msFadeSpeed)};this.startFadeOut=function(oToFadeInit,fxnHelperInit,bSlowFade){ if(window.opera){oToFadeInit.style.display="none";if(fxnHelperInit)fxnHelperInit.call();return}oToFade=oToFadeInit;fxnHelper=fxnHelperInit;fxnHelperEnd=null;bFadeIn=false;dFadeAlpha=oToFade.style.opacity?oToFade.style.opacity:dFadeAlphaMax;if(bSlowFade){dFadeAlphaMax=.5;msFadeSpeed=75;dFadeAlphaStep=.05;this.showFaded()}setTimeout("FadeManager.fadeOut('"+sName+"')",bSlowFade?msInitialWait:msFadeSpeed)};this.fadeIn=function(){if(fxnHelper)fxnHelper.call();dFadeAlpha+=dFadeAlphaStep;if(dFadeAlpha>dFadeAlphaMax)dFadeAlpha=dFadeAlphaMax;setOpacity(oToFade,dFadeAlpha);if(dFadeAlphadFadeAlphaMin){setTimeout("FadeManager.fadeOut('"+sName+"')",msFadeSpeed)}else{oToFade.style.display="none";if(fxnHelper)fxnHelper.call()}}}var Info=new function(){var jLoadingBar;var fInited=false;var pxWidth=100;var pxMarginLeft=-50;var fWaiting=false;var fHideAfterWait=false;var self=this;this.init=function(){if(fInited)return;jLoadingBar=$('
    ');$("body").prepend(jLoadingBar);fInited=true};this.finishWait=function(){fWaiting=false;if(fHideAfterWait){fHideAfterWait=false;self.hide()}};this.show=function(sInfo,fRetried){this.init();jLoadingBar.text(sInfo);pxWidth=jLoadingBar.width();pxMarginLeft=!pxWidth?50:pxWidth/2*-1;jLoadingBar.css("margin-left",pxMarginLeft).slideDown("fast");fWaiting=true;setTimeout(self.finishWait,500)};this.showBriefly=function(sInfo){this.show(sInfo);setTimeout("Info.hide()",4500)};this.hide=function(){this.init();if(!jLoadingBar)return;if(fWaiting){fHideAfterWait=true;return}$(jLoadingBar).hide()};this.queue=function(sInfo){if(!window.fDomLoaded){setTimeout(function(){Info.queue(sInfo)},500);return}this.showBriefly(sInfo)}};var ToolTipper_oContents;var ToolTipper_oTip;function ToolTipper(){var oContents;var oTip;var oSelf=this;var oTipTarget=null;var fTipImmediate=false;var fVisible=false;this.init=function(){if(oSelf.fInit)return;oSelf.fInit=true;if(typeof ToolTipper_oTip=="undefined"){ToolTipper_oContents=DOM.nobr();ToolTipper_oTip=DOM.div({"class":"hoverBugTip",style:"display:none;"},ToolTipper_oContents);document.body.insertBefore(ToolTipper_oTip,document.body.firstChild)}oContents=ToolTipper_oContents;oTip=ToolTipper_oTip;ourAttachEvent(document.body,"keyup",function(){if(oSelf.fVisible&&oTipTarget)oSelf.cancelTip()})};this.fxnEventCancel=function(){oSelf.cancelTip()};this.getFxnEventShowTip=function(sTip,sNodeNameTarget){return function(e){if(window.ie){if(event&&event.fromElement==event.toElement)return;var elTarget=getEventTarget(event);if(elTarget&&!isTagName(elTarget,sNodeNameTarget))return}oSelf.showTip(this,sTip)}};this.getFxnEventIntercept=function(fxnOrig,fxnIntercept){return function(){fxnIntercept.apply(this);if(fxnOrig)return fxnOrig.apply(this,arguments)}};this.addTip=function(oTarget,sTip){if(!oTarget||!sTip)return;if(!oTarget.attributes)return;if(oTarget.fTipAdded)return;function Intercept(sEvent,fxn){var e=oTarget[sEvent];oTarget[sEvent]=oSelf.getFxnEventIntercept(e,fxn)}Intercept("onmousedown",this.fxnEventCancel);Intercept("onmouseover",this.getFxnEventShowTip(sTip,oTarget.nodeName));Intercept("onmouseout",this.fxnEventCancel);oTarget.fTipAdded=true};this.showTip=function(oTarget,sTip){if(!oTarget||!sTip)return;this.init();if(oTarget.tagName=="LABEL"){var oNewTarget=elById(oTarget.htmlFor);if(!oNewTarget&&oTarget.htmlFor)oNewTarget=$("[name='"+oTarget.htmlFor+"']")[0];if(oNewTarget)oTarget=oNewTarget}if(oTarget.tagName=="SELECT"){var oNewTarget=elById("idDropList_"+oTarget.id+"_oText");if(oNewTarget)oTarget=oNewTarget}if(oTarget.titleId){var oNewTarget=elById(oTarget.titleId);if(oNewTarget)oTarget=oNewTarget}oTipTarget=oTarget;if(fTipImmediate)this.doShowTip(oTarget,sTip);else setTimeout(function(){oSelf.doShowTip(oTarget,sTip)},750)};this.doShowTip=function(oTarget,sTip){this.init();if(!oTipTarget||oTipTarget!=oTarget||oTip.style.display==""||!isVisible(oTarget))return;fTipImmediate=true;oTip.style.visibility="hidden";oTip.style.display="";oContents.innerHTML=sTip;try{var pxIconTop=calculateOffset(oTipTarget,"offsetTop");var pxIconLeft=calculateOffset(oTipTarget,"offsetLeft")}catch(e){return}var pxTipLeft=pxIconLeft+oTipTarget.offsetWidth/2-oTip.offsetWidth/2;pxTipLeft=Math.min(pxTipLeft,windowRight()-oTip.offsetWidth-20);pxTipLeft=Math.max(pxTipLeft,scrollLeft()+20);oTip.style.left=pxTipLeft+"px";oTip.style.top=pxIconTop+oTipTarget.offsetHeight+10+"px";oTip.style.visibility="visible";this.fVisible=true};this.cancelTip=function(){this.init();oTip.style.display="none";oTipTarget=null;this.fVisible=false;setTimeout(oSelf.stopImmediateTip,750)};this.stopImmediateTip=function(){if(oTipTarget==null)fTipImmediate=false}}function DynamicUpdate(elContainer,fxnQueryString){this.el=elContainer;this.fxnQS=fxnQueryString;this.oAjaxRequest=null;this.dtLastQueue=null;this.sLastQS=null}DynamicUpdate.prototype.queueUpdate=function(){var oSelf=this;var dt=new UTCDate;setTimeout(function(){oSelf.dequeueUpdate(dt)},250);this.dtLastQueue=dt};DynamicUpdate.prototype.dequeueUpdate=function(dt){if(dt!=this.dtLastQueue)return;this.update()};DynamicUpdate.prototype.update=function(fForceRequery){var sQS=this.fxnQS();if(sQS==this.sLastQS&&!fForceRequery)return;if(ajaxIsBusy(this.oAjaxRequest)){this.queueUpdate();return}var oSelf=this;this.oAjaxRequest=$.ajax({type:"GET",url:sDefaultURI+"?fAlaCarte=1&"+sQS,success:function(jXML){oSelf.finishUpdate(jXML)},fIgnoreDefaultError:true});this.sLastQS=sQS};DynamicUpdate.prototype.finishUpdate=function(jXML){if($("sError",jXML).text())return;var sHTML=$("sHTML",jXML).text();if(!sHTML)return;this.el.innerHTML=sHTML};var DynamicOptions=new function(){var hashOptions={};this.add=function(sName){if(!elById("idText"+sName))return;hashOptions[sName]=new DynamicOption(sName)}};function DynamicOption(sName){this.sName=sName;this.elText=elById("idText"+sName);this.elPop=elById("idPopup"+sName);this.jrg=$("input",this.elPop);this.fxnAsText=window[sName+"AsText"];var oSelf=this;this.init=function(){if(!this.elText||!this.elPop)return;this.elPop.style.display="none";this.elPop.style.position="absolute";this.elPop.style.zIndex="1";this.elPop.className="popupMenu popFilterOpt dynamicOpt";theMgr.add(this.elPop.id);this.jrg.map(function(){if(this.value==FB_DONE){$(this).css("display","");ourAttachEvent(this,"click",function(){oSelf.hide()})}else{ourAttachEvent(this,"click",function(){oSelf.update()})}});setTimeout(function(){oSelf.update()},1)};this.findLink=function(){$("a",this.elText).each(function(){if(this.fAttached)return;ourAttachEvent(this,"click",function(e){oSelf.show();return cancel(e)});this.fAttached=true})};this.show=function(){theMgr.showPopup(this.elPop.id,this.elText,0,this.elText.offsetHeight+2,null,true)};this.hide=function(){theMgr.hideAllPopups()};this.update=function(){if(!this.fxnAsText)return;var s=pictureOf(this.fxnAsText,this.getParamArray());this.elText.innerHTML=s;this.findLink()};this.getParamArray=function(){var rgParams=[];this.jrg.map(function(){if(this.type=="text")rgParams[rgParams.length]=this.value;else if(this.type=="checkbox"||this.type=="radio")rgParams[rgParams.length]=this.checked});return rgParams};this.init()}function flash(el){el.nFlash=4;if(el.timerFlash)clearInterval(el.timerFlash);el.timerFlash=setInterval(function(){doFlash(el)},50)}function doFlash(el){if(el.fFlashOff){setOpacity(el,.99);el.fFlashOff=false}else{setOpacity(el,.1);el.fFlashOff=true}el.nFlash--;if(el.nFlash<=0){setOpacity(el,.99);clearInterval(el.timerFlash)}}var fb=fb||{};fb.person=function(){"use strict";function getMe(){if(typeof CPerson==="undefined"){return null}if(!g_me){g_me=new CPerson;g_me.Load(GetPersonID())}return g_me}function getLanguage(){var person=getMe()||{};return person.sLanguage||"*"}return{getMe:getMe,getLanguage:getLanguage}}();var GetMe=fb.person.getMe;(function(){"use strict";jQuery.extend({ajax_orig:jQuery.ajax,ajax:function(settings){if(g_ActionTokens){g_ActionTokens.injectURLToken(settings)}if(!ajaxApproveSimultaneous(settings)){return}return jQuery.ajax_orig(settings)}});jQuery.extend({handleError:function(s,xml,status,e){if(s.error){s.error(xml,status,e)}if(s.global){jQuery.event.trigger("ajaxError",[xml,s,e,status])}}});jQuery.fn.extend({serializeObject:function(){var data={};jQuery(jQuery(this).serializeArray()).map(function(){data[this.name]=this.value});return data}});jQuery.fn.extend({htmlEval:jQuery.fn.html,html:function(s){if(s===null||s===undefined){return this.length?this[0].innerHTML:null}else{return this.each(function(){this.innerHTML=s})}}});jQuery.fn.extend({customTag:function(sTag){if(jQuery.browser.msie&&window.versionMajorIE<9){var ix=sTag.indexOf(":");if(ix>=0){sTag=sTag.substring(ix+1)}}else{sTag=sTag.replace(":","\\:")}return jQuery.unique(jQuery(sTag,this))}});$(window).load(function(){$("#idTimingAjax").ajaxComplete(function(_,oReq){if(oReq&&oReq.responseXML&&oReq.responseXML.documentElement){this.innerHTML=$("FBTiming",oReq.responseXML).text()}})});$(document).ready(function(){$("#idPageNotifications").ajaxComplete(function(_,oReq){if(oReq&&oReq.responseXML&&oReq.responseXML.documentElement){var jrg=$("PageNotifications PageNotification",oReq.responseXML);var rgsHTML=[];var ix;for(ix=0;ix0){this.innerHTML+=rgsHTML.join("")}}})});$.fn.selectRange=function(start,end){return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(start,end)}else if(this.createTextRange){var range=this.createTextRange();range.collapse(true);range.moveEnd("character",end);range.moveStart("character",start);range.select()}})}})();var POPUP_POSITION_CENTER=0;var POPUP_POSITION_RIGHT=1;var POPUP_POSITION_BELOW=2;var POPUP_POSITION_UPPER_CENTER=3;var POPUP_POSITION_LEFT=4;var POPUP_POSITION_CENTER_SCREEN=5;var POPUP_POSITION_LOWER_CENTER=6;var EditableTableManager=new function(){var rgTables=[];var sTableBeingDragged="";this.getTable=function(sTableName){if(this.create(sTableName))return rgTables[sTableName];else return null};this.hideAllPanes=function(){for(var sKey in rgTables){if(rgTables[sKey]&&rgTables[sKey].hidePane)rgTables[sKey].hidePane({closeAll:true})}};this.hidePane=function(sTableName){if(!this.create(sTableName))return false;rgTables[sTableName].hidePane();return true};this.unmaskPanes=function(){for(var sKey in rgTables){if(rgTables[sKey]&&rgTables[sKey].isVisible&&rgTables[sKey].isVisible()){rgTables[sKey].unmaskSmall()}}};this.maskPanes=function(){for(var sKey in rgTables){if(rgTables[sKey]&&rgTables[sKey].isVisible&&rgTables[sKey].isVisible()){rgTables[sKey].maskSmall()}}};this.fixShadow=function(sTableName){this.doSetShadow(sTableName)};this.doSetShadow=function(sTableName){this.create(sTableName);rgTables[sTableName].doSetShadow()};this.registerHotKeys=function(sTableName){this.create(sTableName);rgTables[sTableName].registerHotKeys()};this.getVisiblePane=function(){for(var sKey in rgTables){if(rgTables[sKey]&&rgTables[sKey].isVisible&&rgTables[sKey].isVisible())return rgTables[sKey].getVisiblePane()}return null};this.isVisible=function(){for(var sKey in rgTables){if(rgTables[sKey]&&rgTables[sKey].isVisible&&rgTables[sKey].isVisible())return true}return false};this.getMaxZIndex=function(){var nMax=0;for(var sKey in rgTables){if(rgTables[sKey]&&rgTables[sKey].isVisible&&rgTables[sKey].isVisible()){var nZ=rgTables[sKey].getZIndex();if(nZ>nMax)nMax=nZ}}return nMax};this.setShadow=function(sTableName){this.create(sTableName);rgTables[sTableName].setShadow()};this.setWidth=function(sTableName,pxWidth){this.create(sTableName);rgTables[sTableName].setWidth(pxWidth)};this.setInlineForm=function(sTableName,sFormId,sHtml){this.create(sTableName);rgTables[sTableName].setInlineForm(sFormId,sHtml)};this.showInlineForm=function(sTableName,sCellId,sFormId){this.create(sTableName);rgTables[sTableName].showInlineForm(sCellId,sFormId)};this.showDeletePane=function(sTableName,oElem,ixToDelete,sToDelete,oPosition,iPositionType){if(typeof oPosition==="string"){oPosition=elById(oPosition)}this.create(sTableName);rgTables[sTableName].showDeletePane(oElem,ixToDelete,sToDelete,oPosition?oPosition:oElem,iPositionType)};this.showDetailedDeletePane=function(sTableName,oElem,ixToDelete,sInfo1,sInfo2,sInfo3){this.create(sTableName);rgTables[sTableName].showDetailedDeletePane(oElem,ixToDelete,sInfo1,sInfo2,sInfo3)};this.showEditPane=function(sTableName,oElem,mapValsToElems,fxnShow,oPosition,iPositionType,srcOverride){if(typeof oPosition=="string")oPosition=elById(oPosition);this.create(sTableName);rgTables[sTableName].showEditPane(oElem,mapValsToElems,fxnShow,oPosition,iPositionType,srcOverride)};this.setDialogTemplate=function(sTableName,sDialogId,template){this.create(sTableName);rgTables[sTableName].setDialogTemplate(sDialogId,template)};this.showDialog=function(sTableName,el,sDialogId,sDataId){this.create(sTableName);rgTables[sTableName].showDialog(el,sDialogId,sDataId)};this.submitRequest=function(sTableName,sGetUri){this.create(sTableName);rgTables[sTableName].submitRequest(sGetUri)};this.showNormalPane=function(sTableName,oPositioning,iPositionType,fFocusOnFadeIn,fxnShow){this.create(sTableName);rgTables[sTableName].showNormalPane(oPositioning,iPositionType,fFocusOnFadeIn,fxnShow)};this.repairCaret=function(sTableName){this.create(sTableName);rgTables[sTableName].repairCaret()};this.disablePaneForSubmit=function(sTableName){this.create(sTableName);rgTables[sTableName].startSubmit();rgTables[sTableName].enablePane(false)};this.submitDialog=function(sTableName){if(!this.create(sTableName))return false;rgTables[sTableName].submitDialog();return true};this.result=function(sTableName,jXML,sIdContainer){this.create(sTableName);rgTables[sTableName].result(jXML,sIdContainer)};this.mousedownTopBar=function(oTopBar){var sTableName=oTopBar.id.replace(/topbar/,"");this.create(sTableName);rgTables[sTableName].startDragging();sTableBeingDragged=sTableName};this.stopDragging=function(){if(sTableBeingDragged&&sTableBeingDragged.length){this.create(sTableBeingDragged);rgTables[sTableBeingDragged].stopDragging();sTableBeingDragged=""}};this.notifyMovement=function(){if(!sTableBeingDragged||!sTableBeingDragged.length)return;this.create(sTableBeingDragged);rgTables[sTableBeingDragged].notifyMovement()};this.setFocus=function(sTableName){this.create(sTableName);rgTables[sTableName].setFocus()};this.enablePane=function(sTableName,bEnable){this.create(sTableName);rgTables[sTableName].enablePane(bEnable)};this.create=function(sTableName){if(!rgTables[sTableName])rgTables[sTableName]=new EditableTable(sTableName);return rgTables[sTableName].init()}};function EditableTable(sName){var oTable=elById("static"+sName);var oPane=elById("edit"+sName);var oMask=elById("panemask"+sName+maskType());var oMaskSmall=elById("panemaskSmall"+sName+maskType());var oTopBar=elById("topbar"+sName);var oDelete=$("div#delete",oPane).get(0);var oEditable=$("div#editable",oPane).get(0);var oError=$("div#error",oPane).get(0);var rgErrorsShown=[];var fxnOnShow=null;var pxLeftCurrent;var pxTopCurrent;var bPositioned=false;var bShadowAdded=false;var bShrunk=false;var bDragging=false;var pxLeftDragOffset;var pxTopDragOffset;var bVisible=false;this.oEditDialogData={};this.oDeleteDialogData={};this.init=function(){oPane=elById("edit"+sName);if(oPane&&!oPane.bInitialized){oTable=elById("static"+sName);oMask=elById("panemask"+sName+maskType());oDelete=$("div#delete",oPane).get(0);oEditable=$("div#editable",oPane).get(0);oError=$("div#error",oPane).get(0);rgErrorsShown=[];if(oPane){var oTextArea=$("textarea",oPane).get(0);var pxMin=oTextArea?450:350;var pxWidth;var oWidthSpan=$(".pxWidthTable",oPane).get(0);if(oWidthSpan)pxWidth=oWidthSpan.innerHTML;if(pxWidth!=null){if(pxWidth!=0)oPane.style.width=pxWidth+"px";else oPane.style.width=pxMin+"px"}else{oPane.style.width=(oTable?Math.max(oTable.offsetWidth,pxMin):pxMin)+"px"}if(window.opera){oPane.style.border="1px solid #333333"}}this.disableAllAutoComplete();oPane.bInitialized=true}return oPane&&oPane.bInitialized};this.getEditPane=function(){return oEditable};this.getDeletePane=function(){return oDelete};this.getZIndex=function(){if(oPane&&oPane.style){var nZ=Number(oPane.style.zIndex);return isNaN(nZ)?0:nZ}return 0};this.repairCaret=function(){if(window.ie||window.webkit||window.opera)return;var rgVersion=Split($.browser.version,".");if(rgVersion.length>0&&rgVersion[0]>1||rgVersion.length>1&&rgVersion[0]==1&&rgVersion[1]>=9)return;if(typeof editor=="undefined")return;preCalc(oPane);preCalc(oEditable);var wrap=function(){var oD=DOM.div({style:"overflow-y:auto;overflow-x:hidden"});this.parentNode.insertBefore(oD,this);var oSib=this.nextSibling;oD.appendChild(this);while(oSib){if(isTagName(this.nextSibling,"br")){this.parentNode.removeChild(this.nextSibling);break}var oNext=oSib.nextSibling;oD.appendChild(oSib);oSib=oNext}if(oD.scrollWidth&&oD.scrollWidth>oD.offsetWidth)this.style.width=oD.offsetWidth-10+"px"};$("input[type='text']",oPane).map(wrap);$("textarea",oPane).map(wrap);postCalc(oPane);postCalc(oEditable)};this.setWidth=function(pxWidth){oPane.style.width=pxWidth+"px"};this.disableAllAutoComplete=function(){$("input",oPane).attr("autocomplete","off")};this.result=function(jXML,sIdContainer){Info.hide();this.enablePane(true);if(!this.parseAndShowErrors(jXML)){var oContainer=elById(sIdContainer?sIdContainer:"container"+sName);var sHTML=$("sHTML:first",jXML).text();var sIdRow=$("idEditableRow:first",jXML).text();if(oContainer&&sHTML)oContainer.innerHTML=sHTML;oTable=elById("static"+sName);if(!this.parseAndShowWarning(jXML)){this.hidePane()}else{this.doSetShadow()}oElemLastSrc=null;window.jXML=jXML;var jelTemplates=$("DialogTemplates",jXML);var jrgXMLTemplate=$("DialogTemplate",jelTemplates);if(jrgXMLTemplate.length){this.dictDialogs={};var oSelf=this;jrgXMLTemplate.map(function(){var sDialogId=$("Id",this).text();var dlgTemplate=eval("("+$("Template",this).text()+")");if(sDialogId&&dlgTemplate)oSelf.setDialogTemplate(sDialogId,dlgTemplate)})}var jXMLInlineForms=$("InlineForm",$("InlineForms",jXML));if(jXMLInlineForms.length){this.dictInlineForms={};var oSelf=this;jXMLInlineForms.map(function(){var sInlineFormId=$("Id",this).text();var sInlineFormContent=$("Html",this).text();if(sInlineFormId&&sInlineFormContent){oSelf.setInlineForm(sInlineFormId,sInlineFormContent)}})}KeyManager.cleanupOnClick();KeyManager.setupGridBrowser();var sfxResultCallback=sName+"ResultCallback";if(window[sfxResultCallback])window[sfxResultCallback](sIdRow,jXML);this.yellowFade(sIdRow)}else{this.doSetShadow()}};this.isVisible=function(){return bVisible};this.maskSmall=function(){oMaskSmall.style.height="100%";oMaskSmall.style.width="100%";oMaskSmall.style.display=""};this.unmaskSmall=function(){if(oMaskSmall){oMaskSmall.style.display="none"}};this.unmask=function(){oMask.style.display="none"};this.yellowFade=function(idRow){YFTManager.hideYellow(sName);var sId=sName+"_"+idRow;var oRow=elById(sId);if(oRow)YFTManager.showYellow(sName,oRow)};this.showErrorDialog=function(sErr){this.fillDialog('
    '+pictureOf(ErrorPaneContents,sName,sErr)+"
    ")};this.parseAndShowErrTag=function(jXML,sTag){var sErr=$("FogBugzXML > "+sTag,jXML).text();if(sErr&&sErr.length){if(this.isUsingTemplates()){this.showErrorDialog(sErr)}else{if(!this.showErrorPane(sErr)){alert(sErr)}}return true}return false};this.parseAndShowWarning=function(jXML){return this.parseAndShowErrTag(jXML,"sWarning")};this.parseAndShowErrors=function(jXML){this.hideAllErrors();if(this.parseAndShowErrTag(jXML,"sError"))return true;var bShowingError=false;var bFocusSet=false;var oSelf=this;$("Error",jXML).map(function(){var sError=$("sError",$(this)).text();var sId=$("sId",$(this)).text();if(sError&&sId){oSelf.showErrorElement(sError,sId);bShowingError=true;if(!bFocusSet){var oElem=$("input#"+sId,oPane).get(0);if(oElem)try{safeFocus(oElem);bFocusSet=true}catch(err){}}}});var elDialog=$("Dialog",jXML);var sDialogHtml=$("sHtml",elDialog).text();if(sDialogHtml){this.fillDialog(sDialogHtml);this.autosizePane(true);$("input[type='text']",oPane).attr("autocomplete","off");DropListControl.refreshWithin(oPane);bShowingError=true}if(this.dictInlineForms){var oSelf=this;$("InlineError",jXML).map(function(){var sId=$("sId",this).text();var sMessage=$("sMessage",this).text();if(sId&&sMessage&&oSelf.dictInlineForms[sId]&&oSelf.dictInlineForms[sId].rErrorDiv){oSelf.dictInlineForms[sId].rErrorDiv.html(sMessage);oSelf.dictInlineForms[sId].rErrorDiv.show();bShowingError=true;oSelf.setEnabledInlineForm(sId,true)}})}if(!bFocusSet)this.setFocus();return bShowingError};this.showErrorElement=function(sError,sId){var jElem=$("input#"+sId,oPane);if(jElem.attr("className")=="dlg")jElem.attr("className","dlgError");$("div#error_"+sId,oPane).html(sError).css("display","");rgErrorsShown[rgErrorsShown.length]=sId};this.hideErrorElement=function(sId){var jElem=$("input#"+sId,oPane);if(jElem.attr("className")=="dlgError")jElem.attr("className","dlg");$("div#error_"+sId,oPane).css("display","none")};this.hideAllErrors=function(sId){if(!rgErrorsShown)return;for(var ix=0;ix0){nFocusRetries-=1;nFocusTimeout*=2;setTimeout(fxnFocus,nFocusTimeout)}};fxnFocus();var rErrorDiv=$("#"+sCellId+"_error");this.dictInlineForms[sFormId].rErrorDiv=rErrorDiv};this.showDetailedDeletePane=function(oElem,ixToDelete,sInfo1,sInfo2,sInfo3){fxnOnShow=null;if(!oPane)return;this.fadeIn(false);this.setPaneState("delete");this.postPaneDimensions(oElem,null);$("#delete #sToDelete",oPane).html(encodeLTGT(sInfo1));$("#delete #sToDelete2",oPane).html(encodeLTGT(sInfo2));$("#delete #sToDelete3",oPane).html(encodeLTGT(sInfo3));$("input#ixToDelete",oPane).val(ixToDelete);this.setFocus();theMgr.hideSelects()};this.showNormalPane=function(oPosition,iPositionType,fFocusOnFadeIn,fxnShow){if(fFocusOnFadeIn==undefined)fFocusOnFadeIn=true;if(iPositionType==null)iPositionType=POPUP_POSITION_CENTER;this.showPane(oPosition,iPositionType,fFocusOnFadeIn,fxnShow)};this.showPane=function(oPosition,iPositionType,fFocusOnFadeIn,fxnShow){fxnOnShow=fxnShow;this.fadeIn(fFocusOnFadeIn);oPane.style.visibility="hidden";this.setPaneState("editable");$("input[type='text']",oPane).attr("autocomplete","off");this.postPaneDimensions(oPosition,iPositionType);oPane.style.visibility="visible";this.doSetShadow();theMgr.hideSelects()};this.setDialogTemplate=function(sDialogId,dlgTemplate){if(!this.dictDialogs)this.dictDialogs={};this.dictDialogs[sDialogId]=dlgTemplate};this.submitRequest=function(sGetUri){var data={fAlaCarte:1};RequestQueue.enqueuePost(sGetUri,data,function(jXML){EditableTableManager.result(sName,jXML)})};this.submitDialog=function(){if($("div#editable input[type='file']:enabled",oPane).length>0){if(this.submitDialogUpload()){EditableTableManager.disablePaneForSubmit(sName);return}}var data=$("div#editable :enabled, div#editable input:hidden",oPane).serializeObject();EditableTableManager.disablePaneForSubmit(sName);$.post(sDefaultURI,data,function(jXML){EditableTableManager.result(sName,jXML)})};this.submitDialogUpload=function(){var oIFrame=this.getUploadFrame();if(!oIFrame)return false;var form=$("div#editable form",oPane)[0];form.target=oIFrame.name;return safeSubmit(form)};this.resultDialogUpload=function(){if(!this.oIFrame)return;var oDocument=this.oIFrame.contentDocument?this.oIFrame.contentDocument:this.oIFrame.contentWindow?this.oIFrame.contentWindow.document:null;EditableTableManager.result(sName,oDocument)};this.getUploadFrame=function(){if(!this.oIFrame){var sId="idUploadFrame_"+sName;var el=DOM.span({style:"display: none;"});el.innerHTML=pictureOf(UploadFrame,sId,false);oPane.appendChild(el);this.oIFrame=elById(sId);if(this.oIFrame){var self=this;$(this.oIFrame).load(function(){self.resultDialogUpload()})}}return this.oIFrame};this.showDialog=function(el,sDialogId,sDataId){if(!oPane||!this.dictDialogs[sDialogId])return;this.showDialogFromTemplate(el,this.dictDialogs[sDialogId].template,this.dictDialogs[sDialogId].data[sDataId])};this.showDialogFromTemplate=function(el,sTemplate,data){var sHtml=this.fillTemplate(sTemplate,data);if(sHtml){this.fillDialog(sHtml);oPane.style.width="";this.showEditPane(el)}};this.fillTemplate=function(s,data){return FormatStringFromDict(s,data)};this.fillDialog=function(sContents){if(sContents)sContents='
    "+sContents+"
    ";htmlEvalWithoutDLCL($("div#editable",oPane),sContents)};this.clearDialog=function(){if(this.isUsingTemplates())this.fillDialog("")};this.isUsingTemplates=function(){return this.dictDialogs&&!objIsEmpty(this.dictDialogs)};var oElemLastSrc;this.showEditPane=function(oElem,mapValsToElems,fxnShow,oPosition,iPositionType,srcOverride){if(!oPane)return;if(oPosition==null)oPosition=oElem;var oSrc=srcOverride||oElem; if(mapValsToElems&&oElemLastSrc!=oSrc)this.replaceElements(mapValsToElems);this.showPane(oPosition,iPositionType,true,fxnShow);oElemLastSrc=srcOverride||oElem;this.enablePane(false)};this.replaceElements=function(mapValsToElems){var oDiv=$("div#editable",oPane).get(0);for(var ix=0;ixwindowHeight())this.shrinkPane();else if(bShrunk)this.unShrinkPane();if(iPositionType!=null){var pt;if(iPositionType==POPUP_POSITION_RIGHT){pt=getRightCoordinates(oPane,oElem)}else if(iPositionType==POPUP_POSITION_BELOW){pt=getBelowCoordinates(oPane,oElem)}else if(iPositionType==POPUP_POSITION_UPPER_CENTER){pt=getUpperCenteredCoordinates(oPane,oElem)}else if(iPositionType==POPUP_POSITION_LOWER_CENTER){pt=getLowerCenteredCoordinates(oPane,oElem)}else if(iPositionType==POPUP_POSITION_LEFT){pt=getLeftCoordinates(oPane,oElem)}else if(iPositionType==POPUP_POSITION_CENTER_SCREEN){pt=centerInWindow(oPane)}else{pt=getCenteredCoordinates(oPane,oElem)}pxTopCurrent=pt.y;pxLeftCurrent=pt.x}else{var pxTop=calculateOffset(oElem,"offsetTop")-25;if(pxTop+oPane.offsetHeight>scrollTop()+windowHeight()){pxTop=Math.max(2,scrollTop()+windowHeight()-oPane.offsetHeight-25)}pxTopCurrent=pxTop;pxLeftCurrent=calculateOffset(oTable,"offsetLeft")+15}this.autosizePane();oPane.style.top=pxTopCurrent+"px";oPane.style.left=pxLeftCurrent+"px";var pt=moveWithinWindow(oPane);pxTopCurrent=pt.y;pxLeftCurrent=pt.x;bPositioned=true;oPane.style.zIndex=4;oPane.style.zIndex=EditableTableManager.getMaxZIndex()+1};this.autosizePane=function(fForce){if(!oPane||!oPane.scrollWidth)return;oTopBar.style.width="1px";if(fForce)oPane.style.width="1px";if(fForce||oPane.scrollWidth>oPane.offsetWidth){var sWidth=oPane.scrollWidth+15+"px";oPane.style.width=sWidth}oTopBar.style.width=oPane.offsetWidth+"px"};this.shrinkPane=function(){$("textarea",oPane).map(function(){while(oPane.offsetHeight>windowHeight()&&this.rows>4){this.rows--}this.bRowLock=true});bShrunk=true};this.unShrinkPane=function(){$("textarea",oPane).map(function(){this.bRowLock=false;if(this)adjustRows(this)});bShrunk=false};this.setFocus=function(){var oToFocus;var oDiv=isVisible(oDelete)?oDelete:isVisible(oEditable)?oEditable:oError;if(oDiv){oToFocus=$("button",oDiv).get(0);var jrg=$("input[type!='hidden']:visible",oDiv);if(jrg.length>0)oToFocus=jrg.get(0);if(oToFocus&&!(oToFocus.tagName.toLowerCase()=="input"&&oToFocus.value.length==0)&&$("textarea",oDiv).length>0){oToFocus=$("textarea",oDiv).get(0)}}if(!oToFocus)return;if((oToFocus.tagName.toLowerCase()=="textarea"||oToFocus.type.toLowerCase()=="text")&&oToFocus.id){giveTextBoxFocus(oToFocus.id);adjustRows(oToFocus)}else safeFocus(oToFocus)};this.startDragging=function(){pxLeftDragOffset=xMouse-calculateOffset(oPane,"offsetLeft");pxTopDragOffset=yMouse-calculateOffset(oPane,"offsetTop");bDragging=true;bCancelEvents=true};this.stopDragging=function(fHiding){bDragging=false;pxLeftDragOffset=0;pxTopDragOffset=0;bCancelEvents=false;if(!fHiding)this.setFocus()};this.notifyMovement=function(){if(bDragging){pxLeftCurrent=xMouse-pxLeftDragOffset;pxTopCurrent=yMouse-pxTopDragOffset;oPane.style.left=pxLeftCurrent+"px";oPane.style.top=pxTopCurrent+"px";removeTextSelections()}}}var FancyPopupManager=new function(){this.oPrototype=null;this.hashRepairCaret={};this.fxnOnCloseHandler=null;this.create=function(sId){if(!this.oPrototype)this.oPrototype=elById("containerPopupWikiPrototype");if(!this.oPrototype)return;var oCopy=this.oPrototype.cloneNode(true);applyToSelfAndChildren(oCopy,function(_){if(_&&_.id)_.id=_.id.replace(/popupWikiPrototype/i,sId)});var oMainArea=elById("mainAreaContinued");if(!oMainArea)oMainArea=elById("mainArea");if(oMainArea){oMainArea.appendChild(oCopy);return new FancyPopup(sId,$("div#editable",oCopy).get(0))}else{return null}};this.disableForSubmit=function(sId){EditableTableManager.disablePaneForSubmit(sId)};this.enable=function(sId){EditableTableManager.enablePane(sId,true);Info.hide();this.fixShadow(sId)};this.show=function(sId,idPosition,iPositionType,fFocusOnFadeIn,fxnShow){if(!idPosition&&iPositionType!=POPUP_POSITION_CENTER_SCREEN)iPositionType=null;if(theMgr.exists(sId)){theMgr.showPopup(sId)}else{if(!this.hashRepairCaret[sId]){EditableTableManager.repairCaret(sId);this.hashRepairCaret[sId]=true}var fWysiwyg=typeof editor!="undefined";var oCenter=idPosition?elById(idPosition):fWysiwyg?editor.ck.container.$:document.body;if(fWysiwyg&&oCenter==editor.ck.container.$)iPositionType=POPUP_POSITION_UPPER_CENTER;EditableTableManager.showNormalPane(sId,oCenter,iPositionType,fFocusOnFadeIn,fxnShow)}};this.hide=function(){theMgr.hideAllPopups();EditableTableManager.hideAllPanes()};this.hidePane=function(sTableName){EditableTableManager.hidePane(sTableName)};this.fixShadow=function(sId){EditableTableManager.doSetShadow(sId)};this.setWidth=function(sId,pxWidth){EditableTableManager.setWidth(sId,pxWidth)}};function FancyPopup(sIdInit,oDivInit){this.oDiv=oDivInit;this.id=sIdInit;this.show=function(idPosition,iPositionType,fFocusOnFadeIn,fxnShow){FancyPopupManager.show(this.id,idPosition,iPositionType,fFocusOnFadeIn,fxnShow)};this.hide=function(){FancyPopupManager.hidePane(this.id)};this.enable=function(){FancyPopupManager.enable(this.id)};this.disableForSubmit=function(){FancyPopupManager.disableForSubmit(this.id)};this.fixShadow=function(){EditableTableManager.doSetShadow(this.id)};this.setWidth=function(pxWidth){EditableTableManager.setWidth(this.id,pxWidth)};this.setFocus=function(){EditableTableManager.setFocus(this.id)};this.noHideSelects=function(){if(!window.ie6||!this.oDiv)return;$("select",this.oDiv).map(function(){theMgr.addNoHide(this.id)})};this.autosizePane=function(fForce){EditableTableManager.getTable(this.id).autosizePane(fForce);this.fixShadow()};this.isVisible=function(){return EditableTableManager.getTable(this.id).isVisible()};this.getVisiblePane=function(){return EditableTableManager.getTable(this.id).getVisiblePane()}}var g_fDropListsEnabled=!window.opera&&!window.webkitPre31&&!window.webkitMobile;var oDropListAjaxRequest;var HTMLOption=function(elParent,s,sValue){var self=this;this.selected=function(){return elParent.options[elParent.selectedIndex]==self};this.value=sValue;this.innerHTML=s;this.textContent=DecodeHTMLEnt(s);this.getAttribute=function(s){return this[s]}};function DropList(oSelInit,options){if(!oSelInit||!oSelInit.options||!oSelInit.parentNode)return null;this.options=options;this.oSel=oSelInit;this.id="idDropList_"+this.oSel.id+"_";this.rgOpts=null;this.oText=null;this.oDropButton=null;this.oDropList=null;this.dtLastTyped=null;this.dtLastKeyboardScroll=null;this.sLastKeydown=null;this.ixSelected=-1;this.reMatch=null;this.reQuote=null;this.fAboveText=false;this.fOffsetText=false;this.cVisibleLast=0;this.pxWidthLast=0;this.sHTMLLast="";this.fTextFocused=false;this.fInitialRestore=true;this.fDisabled=false;this.fCancelOnEnter=true;this.pxLeftText=null;this.pxTopText=null;this.pxHeightText=null;this.fTextBox=this.oSel.fTextBox;this.fDeferred=false;this.sDelimiters=null;this.ajaxLast=null;this.oSurround=null;this.cChunks=0;this.hashChunkTokens={};this.fWriteBack=false;this.nShortTokenLength=20;this.fDontFilterResults=false;if(this.fTextBox){this.pgSrc=oSelInit.getAttribute("pgSrc");this.fValueIsUserInput=false;this.fIgnoreInputTracking=oSelInit.getAttribute("fIgnoreInputTracking");this.sDelimiters=oSelInit.getAttribute("delimiters");this.fChunky=oSelInit.getAttribute("fChunky");this.fWriteBack=oSelInit.getAttribute("fWriteBack");this.fEscapeInitialQuotes=oSelInit.getAttribute("fEscapeInitialQuotes");this.nShortTokenLength=parseInt(oSelInit.getAttribute("nShortTokenLength"))||this.nShortTokenLength;this.fDontFilterResults=oSelInit.getAttribute("fDontFilterResults");if(this.pgSrc){this.fxnConfirmLookup=eval(oSelInit.getAttribute("fxnConfirmLookup"))}if(this.fChunky){this.fxnChunkDisplay=eval(oSelInit.getAttribute("fxnChunkDisplay"));this.fxnValidate=eval(oSelInit.getAttribute("fxnValidate"));this.fxnCaution=eval(oSelInit.getAttribute("fxnCaution"));this.fxnClean=eval(oSelInit.getAttribute("fxnClean"));this.fIgnoreDoubleQuotes=oSelInit.getAttribute("fIgnoreDoubleQuotes")}}this.fFillParentWidth=!window.ie6&&(oSelInit.getAttribute("fFillParentWidth")||$(oSelInit).parents(".droplistsFillParent").length>0);var oSelf=this;this.init=function(){if(this.fInited)return;this.createSkeleton();this.createBehaviors();this.refresh(true);this.fInited=true;if(this.fChunky)this.chunkCurrentTokens(true);theMgr.addWithHandler(this.oDropList.id,function(fQuietHide){if(!fQuietHide){oSelf.preHide();oSelf.showChosenValue()}return true});if(this.oSel.fFocusDelayAttached&&this.oSel.fFocused){this.focus()}};this.isLegit=function(){return isInDOM(this.oText)&&isInDOM(this.oSel)&&isInDOM(this.oDropList)};this.destroy=function(){var fxnInnerDestroy=function(sKey){if(oSelf[sKey]){if(!isInDOM(oSelf[sKey]))oSelf[sKey]=elById(oSelf[sKey].id);if(oSelf[sKey]&&oSelf[sKey].parentNode)oSelf[sKey].parentNode.removeChild(oSelf[sKey]);oSelf[sKey]=null}};fxnInnerDestroy("oText");fxnInnerDestroy("oDropList");fxnInnerDestroy("oDropButton");fxnInnerDestroy("oSurround")};this.refresh=function(fRestoreLastValue){if(this.oSel.getAttribute("fDeferDrop")){if(!this.fDeferred&&(!window.fDomLoaded||!g_setInnerHTMLComplete)){this.fDeferred=true;return}}if(this.needsRefresh()){this.setEnabled(!this.oSel.disabled);this.createRgOpts()}if(fRestoreLastValue){if(this.fTextBox){if(this.fEscapeInitialQuotes){this.oText.value=this.escapeQuotes(this.oSel.value)}else{this.oText.value=this.oSel.value}if(this.fChunky)this.chunkCurrentTokens(true)}this.restoreLastValue()}this.refreshDropButton()};this.fixButtonBarVerticalPosition=function(){var oBtn=this.oDropButton;var oText=this.oText;var fListButton=$(oBtn).closest(".bugList").length>0;if(window.webkit&&oBtn.parentNode.parentNode&&oBtn.parentNode.parentNode.style.verticalAlign=="middle"){if(fListButton)oBtn.style.top="-2px";else oBtn.style.top="0px";oBtn.style.verticalAlign="top";return true}return false};this.refreshDropButton=function(cTry){if(this.fTextBox)return;var oBtn=this.oDropButton;var oText=this.oText;if(!oBtn||!oText)return;if(this.fixButtonBarVerticalPosition())return;var pxHeight=oText.offsetHeight;if(!pxHeight){cTry=cTry||0;if(cTry<5){setTimeout(function(){oSelf.refreshDropButton(cTry+1)},50);return}else{pxHeight=20}}var oStyle=oBtn.style;if(this.fTextBox)oStyle.display="none";else if(pxHeight!=oBtn.offsetHeight)oStyle.height=pxHeight+"px";var pxTopText=oText.offsetTop;var pxTopButton=oBtn.offsetTop-sToPx(oBtn.style.top);if(pxTopText!=pxTopButton)oStyle.top=pxTopText-pxTopButton+"px"};this.optionsUnequal=function(){if(this.fTextBox){var rg1=this.oSel.options;var rg2=this.rgOpts;if(rg1.length!=rg2.length)return true;for(var ix=0;ix0){if(fCurrentValueSelected){oSelf.chunkCurrentTokens();oSelf.focus();if(fShown)oSelf.hideList()}return cancel(e)}var fEventCancelled=!fShown&&(jelSel.triggerHandler("keypress",e)===false||jelSel.triggerHandler("keydown",e)===false||this.oSel.onkeypress&&this.oSel.onkeypress.apply(this.oSel,[e])===false);if(!fEventCancelled&&fCurrentValueSelected&&keycode==13){if(this.oSel.form&&!this.oSel.form.getAttribute("disableCtrlEnter")){return jelSel.triggerHandler("keypress",e)===false||jelSel.triggerHandler("keydown",e)===false||this.submitForm()}}}if(fShown&&this.sDelimiters&&keycode==9&&this.fTextBox)return cancel(e);return keycode==13&&this.fCancelOnEnter?cancel(e):fEventCancelled}if(keycode==8){e.stopPropagation();if(this.fChunky&&this.oText.value.length==0){oSelf.selectPreviousChunk();return cancel(e)}if(window.ie||window.opera||window.webkit){this.handleKeypress(e);return true}}if(keycode>=16&&keycode<=18){return true}if(keycode==27){this.cancelLookupRequest()}var arrowCode=getArrowKeyCode(e);var fListVisible=isVisible(this.oDropList);if(!fListVisible&&keycode!=27&&!this.pgSrc){setTimeout(function(){if(oSelf.fTextFocused){if(arrowCode!=null)oSelf.unFilterList();oSelf.showList();oSelf.refreshSize();oSelf.selectOpt(oSelf.trueSelection());if(window.ie6)oSelf.repairFocus()}},1)}if(arrowCode!=null){if(e.altKey){return true}if(this.fTextBox&&(arrowCode==KEY_ARROW_LEFT||arrowCode==KEY_ARROW_RIGHT)){return true}if(fListVisible){if(arrowCode==KEY_ARROW_UP||arrowCode==KEY_ARROW_LEFT){this.selectNeighborVisibleOpt(false)}else if(arrowCode==KEY_ARROW_DOWN||arrowCode==KEY_ARROW_RIGHT){this.selectNeighborVisibleOpt(true)}else if(arrowCode==KEY_PG_UP){this.selectPgVisibleOpt(false)}else if(arrowCode==KEY_PG_DOWN){this.selectPgVisibleOpt(true)}this.scrollIntoView(this.rgOpts[this.ixSelected].oOpt)}this.dtLastKeyboardScroll=new BrowserDate;return cancel(e)}return true};this.handleKeypress=function(e){var keycode=getKeyCode(e);if(keycode==13)return cancel(e);if(keycode==27)return cancel(e);if(keycode==9)return true;if(this.fChunky&&this.sDelimiters){var sKey=String.fromCharCode(KeyboardMap.fix(keycode,false));if(sKey.length&&this.sDelimiters.indexOf(sKey)>-1&&this.oText.value&&(this.fIgnoreDoubleQuotes||this.isCursorOutsideDoubleQuotes())){this.chunkCurrentTokens();this.focus();return cancel(e)}}var dtTemp;this.dtLastTyped=dtTemp=new BrowserDate;setTimeout(function(){if(oSelf.oText.value!=oSelf.sLastKeydown){oSelf.filterList(dtTemp)}},35);if(this.pgSrc&&getArrowKeyCode(e)==null){setTimeout(function(){if(oSelf.oText.value!=oSelf.sLastKeydown)oSelf.sendLookupRequest(dtTemp)},500)}};this.isCursorOutsideDoubleQuotes=function(){if(this.oText.value.indexOf('"')==-1)return true;var ixCursor=this.getCursorPosition();var sLeft=this.oText.value.substring(0,ixCursor);var cDiff=sLeft.length-sLeft.replace(/"/g,"").length;return cDiff%2==0};this.showThrobber=function(){if(!this.options.fShowThrobber){return}if(!this.elThrobber){this.elThrobber=DOM.img({src:StaticContentUrl("/images/throbber.gif"),style:"position:absolute;display:none;z-index:1000;"});document.body.appendChild(this.elThrobber)}this.getPosition(true);$(this.elThrobber).css({left:this.pxLeftText-12,top:this.pxTopText+this.pxHeightText-15,display:""})};this.hideThrobber=function(){if(!this.options.fShowThrobber){return}$(this.elThrobber).css("display","none")};this.sendLookupRequest=function(dt){if(!this.pgSrc)return;if(dt!=this.dtLastTyped)return;if(!this.fTextFocused)return;if(!IsNormalUser())return;var sParam=this.currentTokenValue();if(!sParam||!this.fIgnoreDoubleQuotes&&sParam.indexOf('"')>-1||this.fxnConfirmLookup&&!this.fxnConfirmLookup(sParam)){this.resultLookupRequest(null);return}this.cancelLookupRequest();this.ajaxLast=$.ajax({type:"GET",url:sDefaultURI,data:{pg:this.pgSrc,fAlaCarte:1,sParam:sParam},fIgnoreDefaultError:true,success:function(jXML){oSelf.resultLookupRequest(jXML)}});this.showThrobber()};this.cancelLookupRequest=function(){this.hideThrobber();if(ajaxIsBusy(this.ajaxLast))ajaxAbort(this.ajaxLast)};this.resultLookupRequest=function(jXML){if(!this.fTextFocused)return;var oSel=oSelf.oSel;this.rgOpts=[];oSel.options=[];if(jXML){if(!this.fIgnoreInputTracking){var oOptTracking=new HTMLOption(this.oSel,UnicodeClean(this.currentTokenValue()));oOptTracking.fTracksInput=true;this.rgOpts=[{}];oSel.options=[oOptTracking]}moveToHold(oSel);var fxnAppend=function(sValue,sHTML){oSel.options.push(new HTMLOption(oSel,sHTML,sValue,true))};$("option",jXML).each(function(){fxnAppend($("sValue",this).text(),$("sHTML",this).text())});restoreFromHold(oSel)}oSelf.refresh(false);oSelf.dtLastTyped=new BrowserDate;oSelf.filterList(oSelf.dtLastTyped);this.cancelLookupRequest()};this.createRgOpts=function(){this.rgOpts=[];var rg=this.oSel.options;if(!rg.length){var o=this.rgOpts[0]={};o.s=o.sText="";o.fVisible=false;o.ixLoc=-1;o.ixOriginal=0;o.elOption=null;o.sImg=""}else{var fImg=this.oSel.getAttribute("img");for(var ix=0;ix0;o.sText=trim(el.textContent||el.innerText||DecodeHTMLEnt(el.innerHTML));o.ixLoc=-1;o.ixOriginal=ix;o.elOption=el;if(fImg)o.sImg=el.getAttribute("img");o.fTracksInput=el.getAttribute("fTracksInput")}}this.sHTMLLast=this.oSel.innerHTML};this.createBehaviors=function(){this.oDropButton.onmouseover=this.fxnIfEnabled(function(){this.src=StaticContentUrl("/images/dropHover.png")});this.oDropButton.onmouseout=this.fxnIfEnabled(function(){this.src=StaticContentUrl("/images/dropNormal.png")});this.oDropButton.onmousedown=this.fxnIfEnabled(function(e){oSelf.fIgnoreNextBlur=true;if(isVisible(oSelf.oDropList)){oSelf.hideList();return cancel(e)}oSelf.unFilterList();oSelf.showList();safeFocus(oSelf.oText);return cancel(e)});this.oText.onmouseover=this.fxnIfEnabled(function(){oSelf.oDropButton.onmouseover.apply(oSelf.oDropButton)});this.oText.onmouseout=this.fxnIfEnabled(function(){oSelf.oDropButton.onmouseout.apply(oSelf.oDropButton)});$(this.oText).mousedown(this.fxnIfEnabled(function(e){if(oSelf.fChunky&&oSelf.fTextFocused){e.stopPropagation()}if(oSelf.pgSrc)return;if(!isVisible(oSelf.oDropList)){oSelf.unFilterList();oSelf.showList();oSelf.refreshSize()}}));$(this.oText).blur(this.fxnIfEnabled(function(){if(!oSelf.fIgnoreNextBlur){oSelf.cancelLookupRequest();oSelf.hideList();if(oSelf.fTextBox)oSelf.commit();else oSelf.showChosenValue();if(oSelf.fChunky){oSelf.chunkCurrentTokens();setTimeout(function(){if(!oSelf.fTextFocused){oSelf.moveInputToEnd()}},10)}}oSelf.fIgnoreNextBlur=false;oSelf.fTextFocused=false}));window.g_o=this;if(window.opera){$(this.oText).keypress(this.fxnIfEnabled(function(e){if(oSelf.handleKeydown(e))oSelf.handleKeypress(e)}))}else{$(this.oText).keydown(this.fxnIfEnabled(function(e){oSelf.handleKeydown(e)}));$(this.oText).keypress(this.fxnIfEnabled(function(e){oSelf.handleKeypress(e)}))}this.oText.onfocus=this.fxnIfEnabled(function(e){oSelf.refreshDropButton();if(!oSelf.fIgnoreNextFocus){if(!isVisible(oSelf.oDropList))oSelf.unFilterList();oSelf.fTextFocused=true;if(!oSelf.fTextBox)setTimeout(function(){if(oSelf.fTextFocused)selectContents(oSelf.oText)},50)}oSelf.fIgnoreNextFocus=false});this.oDropList.onmousedown=this.fxnIfEnabled(function(e){oSelf.fIgnoreNextBlur=true;if(window.webkit)return false;return cancel(e)});$(this.oSel).bind("synch",function(){if(oSelf.fTextBox)oSelf.oText.value=oSelf.oSel.value});this.associateLabel();if(this.fChunky){$(this.oSurround).mousedown(function(e){oSelf.deselectChunk();if($(oSelf.oText).val().length>0){oSelf.chunkCurrentTokens()}oSelf.moveInputToEnd();setTimeout(function(){oSelf.fIgnoreNextBlur=true;$(oSelf.oText).focus()},1);e.stopPropagation()});$(document).mousedown(function(){oSelf.deselectChunk()});$(document).keydown(function(e){var keyCode=getKeyCode(e);if(keyCode==8||keyCode==46){if(oSelf.removeSelectedChunk()){$(oSelf.oText).focus();return cancel(e)}}else if(keyCode==13||keyCode==9){if(isChildOf(DropListControl.elChunkSelected,oSelf.oSurround)){oSelf.deselectChunk();oSelf.focus();return cancel(e)}}else{var arrowCode=null;if(DropListControl.elChunkSelected||oSelf.fTextFocused)arrowCode=getArrowKeyCode(e);if(oSelf.fTextFocused&&(!(arrowCode==KEY_ARROW_LEFT||arrowCode==KEY_ARROW_UP)||oSelf.getCursorPosition()!=0)&&(!(arrowCode==KEY_ARROW_RIGHT||arrowCode==KEY_ARROW_DOWN)||oSelf.getCursorPosition()!=$(oSelf.oText).val().length)){arrowCode=null}if(arrowCode==KEY_ARROW_LEFT||arrowCode==KEY_ARROW_UP){if(oSelf.fTextFocused){oSelf.selectChunkBeforeInput()}else{oSelf.selectPreviousChunk()}return cancel(e)}if(arrowCode==KEY_ARROW_RIGHT||arrowCode==KEY_ARROW_DOWN){if(oSelf.fTextFocused){oSelf.selectChunkAfterInput()}else{oSelf.selectNextChunk()}return cancel(e)}else{if(isChildOf(DropListControl.elChunkSelected,oSelf.oSurround))oSelf.focus();oSelf.deselectChunk()}}return true})}};this.associateLabel=function(){var rgLabels=document.getElementsByTagName("label");if(!rgLabels||!rgLabels.length)return;var oLast=rgLabels[rgLabels.length-1];var sFor=oLast.getAttribute("for")||oLast.getAttribute("htmlFor");if(sFor==this.oSel.id){oLast.onclick=this.oDropButton.onmousedown}};this.fxnIfEnabled=function(fxn){return function(e){if(oSelf.rgOpts&&!oSelf.fDisabled)fxn.apply(this,[e])}};this.disable=function(){this.setEnabled(false)};this.enable=function(){this.setEnabled(true)};this.setEnabled=function(fEnabled){this.fDisabled=!fEnabled;this.oText.disabled=!fEnabled;this.oDropButton.src=fEnabled?StaticContentUrl("/images/dropNormal.png"):StaticContentUrl("/images/dropDisabled.png")};this.oSizeTester=null;this.autoSizeChunkInput=function(){if(this.oSizeTester)return;this.oSizeTester=$("
    ").css({position:"absolute",left:-1e4,top:-1e4,width:"auto","font-size":$(this.oText).css("font-size"),"font-family":$(this.oText).css("font-family"),"font-weight":$(this.oText).css("font-weight"),whitespace:"nowrap"}).appendTo(this.oSurround);$(this.oText).bind("keyup keydown blur update",function(){oSelf.oSizeTester.text($(this).val());var oChinput=$(this).parents("a.chinput:first");oChinput.width(Math.max(oChinput.width(),oSelf.oSizeTester.width()+24)).scrollLeft(0).scrollTop(0);$(this).width(oSelf.oSizeTester.width()+64);oSelf.fixShadow()})};this.fixShadow=function(){};this.createSkeleton=function(){var oShell=this.fChunky?DOM.span():DOM.nobr();this.oSel.parentNode.insertBefore(oShell,this.oSel);var sFontSize=getActualStyle(this.oSel,"fontSize");var sFontFamily=getActualStyle(this.oSel,"fontFamily");if(!sFontFamily.length)sFontFamily="Tahoma,Arial,Helvetica,sans-serif";if(!sFontSize||sFontSize=="0px")sFontSize="12px";var elText,elBtn,elList;elText=document.createElement("input");elText.type="text";elText.className="droplist-text";elText.style.fontSize=sFontSize;elText.style.fontFamily=sFontFamily;elText.style.position="relative";elText.setAttribute("autocomplete","off");elText.id=this.id+"oText";elText.title=this.oSel.title;elText.tabIndex=this.oSel.tabIndex;elText.placeholder=this.oSel.placeholder||"";elText.setAttribute("maxlength",this.oSel.getAttribute("maxlength"));$(elText).attr("spellcheck","false");if(!this.fFillParentWidth){if(!this.fTextBox){var pxWidth=this.getSelWidth();if(pxWidth>26){elText.style.width=pxWidth-22+"px"}}else{var sSz=this.oSel.getAttribute("size");if(sSz)elText.size=sSz;var width=getActualStyle(this.oSel,"width");if(width&&width!=="0px"){elText.style.width=width}}}if(this.fTextBox){elText.className=this.oSel.className;if(!this.fChunky){var elWrapper=DOM.div();elWrapper.className="wideInputWrapper";elWrapper.appendChild(elText)}}this.oSel.style.display="none";this.oText=elText;oShell.appendChild(elWrapper||this.oText);if(DropList.oDropButtonProto){elBtn=DropList.oDropButtonProto.cloneNode(false)}else{elBtn=document.createElement("img");elBtn.src=StaticContentUrl("/images/dropNormal.png");elBtn.style.width="18px";elBtn.style.height="18px";elBtn.style.top=window.ie?"2px":"3px";elBtn.style.position="relative";DropList.oDropButtonProto=elBtn.cloneNode(false)}elBtn.id=this.id+"oButton";elBtn.titleId=this.oText.id;$(elBtn).addClass("droplist-button");this.oDropButton=elBtn;if(!this.fTextBox)oShell.appendChild(this.oDropButton);if(DropList.oDropListProto){elList=DropList.oDropListProto.cloneNode(false)}else{elList=document.createElement("div");elList.style.position="absolute";elList.style.backgroundColor="rgb(255,255,255)";elList.style.textAlign="left";this.setFourBorderStyles(elList);DropList.oDropListProto=elList.cloneNode(false)}elList.style.fontFamily=sFontFamily;elList.style.fontSize=sFontSize;elList.id=this.id+"oDropList";if(this.fTextBox){if(this.fEscapeInitialQuotes){this.oText.value=this.escapeQuotes(this.oSel.value)}else{this.oText.value=this.oSel.value}this.oText.style.margin="";this.oText.style.padding="";this.oText.style.top="";this.oText.style.fontSize=this.oSel.style.fontSize}elList.style.maxHeight="225px";elList.style.overflowY="auto";elList.style.overflowX="hidden";elList.style.display="none";elList.tabIndex=-1;this.oDropList=elList;$("body").prepend(this.oDropList);this.oSel.onfocus=function(){oSelf.focus()};this.fDisabled=this.oSel.disabled;if(this.fDisabled)this.disable();if(this.fChunky){$(this.oText).css({border:"0px",outline:"none","padding-left":"0px","min-width":"4px"});this.oSurround=DOM.div({id:"idSurroundTemp_"+this.oSel.id,"class":"droplistSurround droplistSurroundEmpty"});if(this.fFillParentWidth){$(this.oSurround).css({left:"0px",right:"0px"})}else{if(this.oText.offsetWidth>0){this.oSurround.style.width=this.oText.offsetWidth-1+"px"}}this.oText.parentNode.insertBefore(this.oSurround,this.oText);this.oSurround.appendChild(DOM.a({"class":"chinput"},this.oText));this.oSurround.appendChild(DOM.div({"class":"clear"},DOM.nbsp()));this.autoSizeChunkInput()}if(this.fFillParentWidth){$(this.oSurround).css("position","relative");var div=$("
    ").css({width:"100%",position:"relative","min-height":"24px"});$(oShell).wrapInner(div);div=$(oShell).find(">div");if(this.fTextBox){div.find("input").css({width:"100%"})}else{var inputDiv=$("
    ").css({left:"0px",right:"24px"});inputDiv.css("position","absolute");div.find("input").wrap(inputDiv).css({width:"100%",top:"3px"});div.find("img").css({position:"absolute",top:window.fLegacyIE?"4px":"3px",right:"0px"})}}};this.escapeQuotes=function(val){var values=[];var matches=val.match(new RegExp('("[^"]*"|[^'+this.sDelimiters+"])+","g"));if(!matches||!matches.length)return"";for(var i=0;i0){return Number(sWidth.substring(0,ix))}else{return o.offsetWidth||300}};this.fxnMouseoverOpt=function(){if(new BrowserDate-oSelf.dtLastKeyboardScroll>20)oSelf.selectOpt(this.ix)};this.fxnMouseupOpt=function(){oSelf.chooseValue(this.ix)};this.createOpt=function(oFromOpt){var oOpt;if(!this.createOpt.oProto){oOpt=document.createElement("div");var oStyle=oOpt.style;oStyle.padding="0 0 0 4px";oStyle.margin="0";oStyle.cursor="default";oStyle.zIndex="2";this.createOpt.oProto=oOpt.cloneNode(false)}else{oOpt=this.createOpt.oProto.cloneNode(false)}oOpt.onmouseover=this.fxnMouseoverOpt;oOpt.onmouseup=this.fxnMouseupOpt;return oOpt};this.setOptInnerHTML=function(ix){var s=this.rgOpts[ix].sText;var sDisplay=this.reMatch!=null?s.replace(this.reMatch,"{BOLDSTART}$1{BOLDEND}"):s;sDisplay=UnicodeClean(sDisplay).replace("{BOLDSTART}","").replace("{BOLDEND}","");this.rgOpts[ix].oOpt.innerHTML=""+(this.rgOpts[ix].sImg?'':"")+sDisplay+""};this.restoreLastValue=function(){if(this.fTextBox&&!this.fInitialRestore)return;if(!(this.fInitialRestore&&this.oText.value.length))this.chooseValue(this.trueSelection(),true);this.fInitialRestore=false};this.currentSelectionValid=function(){return this.optIsSelectable(this.rgOpts[this.ixSelected])};this.chooseValue=function(ix,fInitialChoice){if(!this.fTextBox&&(ix==null||ix<0)){this.restoreLastValue();return}if(ix!=null&&!this.optIsSelectable(this.rgOpts[ix])){ix=this.trueSelection()}if(this.fTextBox){this.commit()}else if(this.rgOpts[ix].elOption)this.rgOpts[ix].elOption.selected=true;if(!fInitialChoice){this.deselectOpt(this.ixSelected);this.hideList();this.selectOpt(ix)}this.showChosenValue(ix!=null?this.rgOpts[ix].sText:null);if(!fInitialChoice){$(this.oSel).trigger("change",{ixSelectedOption:ix})}};this.showChosenValue=function(sText){setTimeout(function(){if(oSelf.oText){if(!sText){if(oSelf.fTextBox)sText=oSelf.currentTokenValue();else sText=oSelf.rgOpts[oSelf.trueSelection()].sText}else if(oSelf.fTextBox){oSelf.commit()}oSelf.setCurrentTokenValue(sText);oSelf.fValueIsUserInput=false}},1)};this.selectNeighborVisibleOpt=function(bNext,ixStartAt){if(ixStartAt==null)ixStartAt=this.ixSelected;for(var ix=bNext?ixStartAt+1:ixStartAt-1;bNext?ix=0;bNext?ix++:ix--){if(this.optIsSelectable(this.rgOpts[ix])){this.selectOpt(ix);return}}};this.selectPgVisibleOpt=function(bPgDown){var pxTarget=this.rgOpts[this.ixSelected].oOpt.offsetTop+(bPgDown?this.oDropList.offsetHeight-20:-1*this.oDropList.offsetHeight+20);for(var ix=this.ixSelected;bPgDown?ix=0;bPgDown?ix++:ix--){if(bPgDown&&(this.rgOpts[ix].oOpt.offsetTop>=pxTarget||ix==this.rgOpts.length-1)||!bPgDown&&(this.rgOpts[ix].oOpt.offsetTop<=pxTarget||ix==0)){this.selectOpt(ix);return}}};this.optIsSelectable=function(oOpt){return this.fTextBox||oOpt.fVisible};this.selectOpt=function(ix){if(!this.rgOpts[ix])return;if(!this.optIsSelectable(this.rgOpts[ix])){this.selectNeighborVisibleOpt(true,ix);return}this.deselectOpt(this.ixSelected);this.styleOptSelected(ix);this.ixSelected=ix;if(!window.ie&&!window.webkit)removeTextSelections()};this.deselectOpt=function(ix){if(!this.rgOpts[ix])return;this.styleOptNormal(ix)};this.styleOptSelected=function(ix){var o=this.rgOpts[ix].oOpt;if(!o)return;o.style.backgroundColor="rgb(49,105,198)";o.style.color="rgb(255,255,255)"};this.styleOptNormal=function(ix){var o=this.rgOpts[ix].oOpt;if(!o)return;o.style.backgroundColor="rgb(255,255,255)";o.style.color="rgb(0,0,0)"};this.hasSelectionStartEnd=function(){if(window.ie)return false;try{return this.oText.selectionStart!=null}catch(e){return false}};this.setCursorPosition=function(ix){if(!this.oText)return;if(this.hasSelectionStartEnd()){this.oText.selectionStart=this.oText.selectionEnd=ix}else if(document.selection&&document.selection.createRange){ var oR=document.selection.createRange();oR.moveStart("character",-1*this.oText.value.length);oR.moveStart("character",ix);oR.collapse(true);oR.select()}};this.getCursorPosition=function(){if(!this.oText)return-1;var ixStart=-1;var ixEnd=-1;if(this.hasSelectionStartEnd()){ixStart=this.oText.selectionStart;ixEnd=this.oText.selectionEnd}else if(document.selection&&document.selection.createRange){try{ixStart=Math.abs(document.selection.createRange().moveStart("character",-1*this.oText.value.length));ixEnd=Math.abs(document.selection.createRange().moveEnd("character",-1*this.oText.value.length))}catch(e){}}if(ixStart==ixEnd)return ixStart;else return-1};this.getRgTokens=function(fInitialChunk){if(!this.oText||!this.sDelimiters)return null;var rg=[];var rgTokens=SplitTokens(this.fEscapeInitialQuotes?this.escapeQuotes(this.oText.value):this.oText.value,this.sDelimiters,!fInitialChunk&&this.fIgnoreDoubleQuotes);for(var ix=0;ix=ixCursor){loc={ixStart:ixStart,ixEnd:ixEnd,fLast:ixEnd>=trim(this.oText.value).length}}}return loc};this.currentTokenValue=function(){if(!this.oText)return"";if(!this.sDelimiters)return trim(this.oText.value);var loc=this.currentTokenLocation();if(!loc||loc.ixStart<0||loc.ixEnd<0||loc.ixEnd>this.oText.value.length)return"";return trim(this.oText.value.substring(loc.ixStart,loc.ixEnd))};this.setCurrentTokenValue=function(sToken,fForce){if(!this.oText)return;this.cancelLookupRequest();if(!this.fTextBox){this.oText.value=sToken;return}if(!this.sDelimiters){this.oText.value=sToken;this.commit();return}if(!fForce){if(this.currentTokenValue()==sToken)return;var loc=this.currentTokenLocation();if(!loc)return;if(!this.fChunky){var cDelim=this.sDelimiters.charAt(0);if(loc.fLast){sToken+=cDelim;if(cDelim!=" ")sToken+=" "}if(loc.ixStart&&cDelim!=" ")sToken=" "+sToken}var s=sToken;if(!this.fChunky){s=this.oText.value;s=s.substring(0,loc.ixStart)+sToken+s.substring(loc.ixEnd,s.length)}if(this.fChunky&&this.getRgTokens().length>1){this.oText.value=s;this.chunkCurrentTokens();return}this.oText.value=s}if(this.fChunky){this.addChunk();this.oText.value="";this.commit()}else{this.commit();this.setCursorPosition(loc.ixStart+sToken.length+1)}};this.shortToken=function(s){return s.length<=this.nShortTokenLength?s:s.substring(0,this.nShortTokenLength-3)+"..."};this.refreshOptsAfterChunk=function(){if(this.pgSrc)this.resultLookupRequest()};this.addChunk=function(){var sToken=this.fTextBox?this.oText.value:this.oSel.value;var sReplacedQuotes=sToken.replace(/""/g,'"');var sStoredValue=this.fxnClean?this.fxnClean(sReplacedQuotes):sReplacedQuotes;var sTokenHash="tok_"+sStoredValue;if(this.hashChunkTokens[sTokenHash]){this.refreshOptsAfterChunk();return}var sDisplay=this.fxnChunkDisplay?this.fxnChunkDisplay(sToken):sToken.replace(/""/g,'"');var nodeDisplay=this.fxnChunkDisplay?this.fxnChunkDisplay(sToken,true):sToken.replace(/""/g,'"');if(sDisplay.length==0)return;if(!this.cChunks)$(this.oSurround).removeClass("droplistSurroundEmpty");var fValid=this.fxnValidate?this.fxnValidate(sStoredValue):true;var sCaution=this.fxnCaution?this.fxnCaution(sStoredValue):"";var cIdChunk=this.cChunks++;var srcImageX=StaticContentUrl("/images/icon-blue-x.gif");if(!fValid){srcImageX=StaticContentUrl("/images/icon-red-x.png")}else if(sCaution){srcImageX=StaticContentUrl("/images/icon-orange-x.png")}var elImg=DOM.img({src:srcImageX,"class":"chunkX"});if(typeof nodeDisplay=="string")nodeDisplay=this.shortToken(nodeDisplay);var elChunk=DOM.a({"class":"chunk"},DOM.nobr(nodeDisplay,elImg),DOM.input({type:"hidden",name:this.oSel.name+"_"+cIdChunk,value:sStoredValue,fieldValue:1}));elChunk.sTokenHash=sTokenHash;var jChunk=$(elChunk);jChunk.addClass(fValid?"valid":"invalid");jChunk.attr("title",fValid?sDisplay:FB_VALUE_NOT_VALID);if(fValid&&sCaution){jChunk.addClass("caution").attr("title",sCaution)}jChunk.mousedown(function(e){if($(oSelf.oText).val().length){oSelf.addChunk()}$(oSelf.oText).parents("a.chinput:first").width(jChunk.width()+21).insertAfter(elChunk);jChunk.hide();$(oSelf.oText).val(jChunk.find("input[type='hidden']").val());$(oSelf.oText).triggerHandler("update");setTimeout(function(){$(oSelf.oText).focus().select();oSelf.removeChunk(elChunk,true)},75);e.stopPropagation()}).mouseenter(function(){if(DropListControl.elChunkSelected!=this)$(this).addClass("hover")}).mouseleave(function(){if(DropListControl.elChunkSelected!=this)$(this).removeClass("hover")});$(elImg).mousedown(function(e){e.stopPropagation()}).click(function(e){oSelf.removeChunk(elChunk);return cancel(e)});this.oSurround.insertBefore(elChunk,this.oText.parentNode);this.refreshOptsAfterChunk();this.hashChunkTokens[sTokenHash]=true;this.fixChunkNames();$(this.oText).val("").triggerHandler("update");this.collapseInput();if(this.oSel.onchange)this.oSel.onchange.apply(this.oSel)};this.fixChunkNames=function(){var c=0;$("a.chunk",this.oSurround).each(function(){$("input[type='hidden']",this).each(function(){this.name=oSelf.oSel.name+"_"+c;c++})});this.cChunks=c};this.removeChunk=function(elChunk,fKeepFocus){if(!elChunk||!elChunk.parentNode)return;elChunk.parentNode.removeChild(elChunk);this.fixChunkNames();this.fixShadow();if(!this.cChunks)$(this.oSurround).addClass("droplistSurroundEmpty");this.refreshOptsAfterChunk();if(fKeepFocus){this.deselectChunk();this.focus()}this.hashChunkTokens[elChunk.sTokenHash]=null;if(this.oSel.onchange)this.oSel.onchange.apply(this.oSel);this.commit()};this.selectChunkBeforeInput=function(){var jChunkBefore=$(this.oSurround).find("a.chinput").prevAll("a.chunk:first");if(jChunkBefore.length){this.selectChunk(jChunkBefore.get(0));$(this.oSurround).find("a.chinput").insertAfter($(this.oSurround).find("a.chunk:last"))}};this.selectChunkAfterInput=function(){var jChunkAfter=$(this.oSurround).find("a.chinput").nextAll("a.chunk:first");if(jChunkAfter.length){this.selectChunk(jChunkAfter.get(0));$(this.oSurround).find("a.chinput").insertAfter($(this.oSurround).find("a.chunk:last"))}};this.moveInputToEnd=function(){var jChunkLast=$(this.oSurround).find("a.chunk:last");if(jChunkLast.length){$(this.oSurround).find("a.chinput").insertAfter(jChunkLast)}};this.removeSelectedChunk=function(){if(DropListControl.elChunkSelected&&isChildOf(DropListControl.elChunkSelected,this.oSurround)){this.removeChunk(DropListControl.elChunkSelected);DropListControl.elChunkSelected=null;return true}return false};this.selectChunk=function(elChunk){this.deselectChunk();if(!elChunk)return;$(elChunk).addClass("selected");safeFocus(elChunk);DropListControl.elChunkSelected=elChunk;this.oText.blur()};this.deselectChunk=function(){if(DropListControl.elChunkSelected){$(DropListControl.elChunkSelected).removeClass("selected").removeClass("hover");DropListControl.elChunkSelected=null}};this.selectPreviousChunk=function(){if(!isChildOf(DropListControl.elChunkSelected,this.oSurround)&&!this.fTextFocused)return;if(this.fTextFocused){this.selectChunkBeforeInput()}else{var el=DropListControl.elChunkSelected.previousSibling;if(isTagName(el,"a")&&hasClassName(el,"chunk"))this.selectChunk(el)}};this.selectNextChunk=function(){if(!isChildOf(DropListControl.elChunkSelected,this.oSurround))return;var el=DropListControl.elChunkSelected.nextSibling;if(isTagName(el,"a")&&hasClassName(el,"chunk"))this.selectChunk(el);else{this.deselectChunk();this.focus()}};this.filterList=function(dt){if(!this.oText)return;if(dt!=this.dtLastTyped)return;var sToken=this.currentTokenValue();var s=sToken.toLowerCase();var sUserInputDisplayed;this.cVisibleLast=0;for(var ix=0;ix0;if(o.fVisible)sUserInputDisplayed=o.s}else{if(o.s&&o.s!=sUserInputDisplayed){if(this.fDontFilterResults){o.fVisible=true}else{o.ixLoc=o.sLower.indexOf(s);o.fVisible=o.ixLoc!=-1}}else{o.fVisible=false}}if(o.fVisible)this.cVisibleLast++}this.updateList(true)};this.unFilterList=function(){this.deselectOpt(this.ixSelected);this.ixSelected=this.trueSelection();this.cVisibleLast=0;for(var ix=0;ix0;if(o.fVisible)this.cVisibleLast++}this.updateList()};this.sortHelper=function(a,b){if(a.fTracksInput)return a.ixOriginal==0?-1:1;if(b.fTracksInput)return b.ixOriginal==0?1:-1;return b.ixLoc<0&&a.ixLoc>=0?-1:a.ixLoc<0&&b.ixLoc>=0?1:a.ixLoc=0){this.scrollIntoView(this.rgOpts[this.ixSelected].oOpt,true)}};this.getPosition=function(fLookupInProgress){var oTarget=this.fChunky?this.oSurround:this.oText;var offset=$(oTarget).offset();this.pxLeftText=offset.left;this.pxTopText=offset.top;this.pxHeightText=oTarget.offsetHeight;if(!fLookupInProgress){var pt=getInWindowCoordinates(this.oDropList,this.pxLeftText,this.pxTopText,oTarget,0,0,true);this.fAboveText=pt.ythis.oDropList.scrollTop+this.oDropList.offsetHeight-4){this.oDropList.scrollTop=o.offsetTop-this.oDropList.offsetHeight+o.offsetHeight+4}};this.repairFocus=function(){if(!window.ie6)return;var oR=this.oText.createTextRange();var offsetEnd=oR.moveEnd("character",-1*this.oText.value.length);this.fIgnoreNextBlur=true;this.fIgnoreNextFocus=true;this.oText.blur();this.oText.focus();oR=this.oText.createTextRange();oR.moveEnd("character",-1*offsetEnd);oR.moveStart("character",-1*offsetEnd);oR.collapse();oR.select()};this.focus=function(){$(this.oText).focus()};this.blur=function(){$(this.oText).blur()};this.refreshSize=function(){var fWasHidden=false;if(this.oDropList.style.display=="none"){fWasHidden=true;this.oDropList.style.visibility="hidden";this.oDropList.style.display=""}var pxWidth=!window.ie6?this.oText.offsetWidth+this.oDropButton.offsetWidth-3:this.oText.offsetWidth-2;var c=this.rgOpts.length;this.oDropList.style.width="1px";if(this.oDropList.scrollWidth+20>pxWidth)pxWidth=this.oDropList.scrollWidth+20;pxWidth=Math.min(pxWidth,windowWidthCorrected()-50);this.oDropList.style.width=pxWidth+"px";if(this.fOffsetText&&this.pxWidthLast!=pxWidth){this.getPosition();positionElement(this.oDropList,this.x,this.y)}this.pxWidthLast=pxWidth;if(this.fAboveText)positionElement(this.oDropList,null,this.pxTopText-this.oDropList.offsetHeight);this.oDropList.scrollTop=0;this.oDropList.scrollLeft=0;if(fWasHidden){this.oDropList.style.display="none";this.oDropList.style.visibility="visible"}else{var oSelected=this.rgOpts[this.ixSelected];if(oSelected)this.scrollIntoView(oSelected.oOpt)}};this.updateList=function(fPostTyping){this.deselectOpt(this.ixSelected);this.oDropList.innerHTML="";if(fPostTyping){try{this.reMatch=new RegExp("("+EscapeForRegExp(this.currentTokenValue())+")","i")}catch(e){this.reMatch=null}}else{this.reMatch=null}var oPre=this.rgOpts[this.ixSelected];var ixSelectedNew=this.ixSelected;this.rgOpts.sort(this.sortHelper);for(var ix=0;ix0&&!fVisible)this.showList();else if(this.cVisibleLast<=0&&fVisible)this.hideList(true)}};this.trueSelection=function(){if(this.oSel){this.oSel.selectedIndex}var ixLowestActualOption;var ixLowestSelectedOption;for(var ix=0;ix0&&!(oSelect.offsetWidth||oSelect.style.width)){oSelect.nTimeout=oSelect.nTimeout?oSelect.nTimeout*2:10;if(oSelect.nTimeout<=160){setTimeout(function(){DropListControl.refresh(oSelect,options)},oSelect.nTimeout);return}}}if(hash[oSelect.id]&&hash[oSelect.id].isLegit()){hash[oSelect.id].refresh(true)}else if(!hash[oSelect.id]||hash[oSelect.id].fInited){if(hash[oSelect.id]){hash[oSelect.id].destroy();this.unloadSingle(hash[oSelect.id])}hash[oSelect.id]=new DropList(oSelect,options);if(!hash[oSelect.id].init)hash[oSelect.id]=null}return hash[oSelect.id]};this.restoreLastValue=function(oSelect){if(!oSelect||!oSelect.id||!hash[oSelect.id])return;hash[oSelect.id].restoreLastValue()};this.resetChunks=function(oSelect){if(!oSelect||!oSelect.id||!hash[oSelect.id])return;hash[oSelect.id].resetChunks()};this.serialize=function(oSelect){if(!oSelect||!oSelect.id||!hash[oSelect.id])return null;return hash[oSelect.id].serialize()};this.unload=function(){if(!window.ie6)return;for(var sKey in hash){this.unloadSingle(hash[sKey])}};this.unloadSingle=function(o){if(!window.ie6)return;if(!o||!o.oSel)return;o.oSel.onfocus=null;o.oSel=null}};$(function(){DropListControl.refreshWithin(document.body,false);window.searchBox.initialize()});function htmlEvalWithoutDLCL(el,html){el.htmlEval(html)}function TimeInterval(){this.properties=["ixInterval","ixBug","ixPerson","dtStart","dtEnd","fToDelete","fToChange","sBugTitle","sLinkClass"];this.serializeProperties=["ixInterval","ixBug","dtStart","dtEnd","fToDelete","fToChange"];var o=this;this.properties.foreach(function(s){o[s]=null});this.ixInterval=-1;this.fToDelete=false;this.sBugTitle="";this.sLinkClass=""}TimeInterval.prototype.setChanged=function(f){this.fToChange=f;Timesheet.rgixBugChanged.push(this.ixBug)};TimeInterval.prototype.compare=function(ti){if(this.dtStart>ti.dtStart)return 1;if(ti.dtStart>this.dtStart)return-1;if(!this.Ends())return 1;if(!ti.Ends())return-1;if(this.dtEnd>ti.dtEnd)return 1;if(ti.dtEnd>this.dtEnd)return-1;return 0};TimeInterval.prototype.fromSJS=function(sJS){var oSer=eval("("+sJS+")");var o=this;this.properties.foreach(function(s){o[s]=oSer[s]});if(this.ixInterval<0)this.ixInterval=Timesheet.getNextRowNumber();this.idRow=IdTimesheetRow(this)};TimeInterval.prototype.fromPopup=function(){this.dtStart=Timesheet.getUTCDateFromCTZsTime(elById("dtStartTime").value);if(this.ixInterval<1||IsDate(this.dtEnd))this.dtEnd=Timesheet.getUTCDateFromCTZsTime(elById("dtEndTime").value);this.ixBug=elById("ixBugEdit").value;this.setChanged(true);return true};TimeInterval.prototype.checkBug=function(ixBug,fxOk,fxNoBug,fxNoEst,fxNoPermission){$.get(sDefaultURI+"?fAlaCarte=1&"+"pg=pgCanWorkOn&ixBug="+ixBug,null,function(jXML){TimeInterval.checkBugResponse(jXML,fxOk,fxNoBug,fxNoEst,fxNoPermission)})};TimeInterval.checkBugResponse=function(jXML,fxOk,fxNoBug,fxNoEst,fxNoPermission){switch($("nCanWorkOn",jXML).text()){case"1":fxOk();break;case"-1":fxNoBug();break;case"-2":fxOk();break;case"-3":fxNoEst();break;case"-4":fxNoPermission();break}};TimeInterval.prototype.Ends=function(){return IsDate(this.dtEnd)};TimeInterval.prototype.getEl=function(){return elById(this.idRow)};TimeInterval.prototype.toggleDeleted=function(){this.setChanged(true);this.fToDelete=!this.fToDelete;Timesheet.display();setTimeout(function(){Timesheet.check()},1);return true};TimeInterval.prototype.close=function(){this.setChanged(true);Timesheet.fCloseInterval=true;this.dtEnd=new UTCDate;Timesheet.display();setTimeout(function(){Timesheet.check()},1);return true};TimeInterval.prototype.serialize=function(){var o=this;var rgs=this.serializeProperties.map(function(s){if(null==o[s])return"";if(s=="ixBug"){return CLng(o[s])}if(IsDate(o[s]))return SerializeDate(o[s]);return encodeURIComponent(o[s])});return rgs.join("!!!")};TimeInterval.prototype.flashChanged=function(){if(this.fToChange){YFTManager.showYellow("TimeInterval",this.getEl());this.setChanged(false)}};TimeInterval.prototype.getStartDate=function(){return this.dtStart};TimeInterval.prototype.GetBugTitle=function(){return this.sBugTitle};TimeInterval.prototype.GetLinkClass=function(){return this.sLinkClass};function DayTimesheet(dt){this.dt=dt;this.rgti=[]}DayTimesheet.prototype.tiByIx=function(ixInterval){return this.rgti.firstMatch(function(ti){return ixInterval==ti.ixInterval})};DayTimesheet.prototype.serialize=function(){return this.rgti.map(function(ti){return ti.serialize()}).join("|")};DayTimesheet.prototype.addTI=function(ti){this.rgti.push(ti);this.rgti.sort(function(ti1,ti2){return ti1.compare(ti2)})};var Timesheet=new function(){this.rgday=[];this.rgtiAdd=[];this.cNewRows=0;this.lastIntervalChanged=null;this.fChanged=false;this.fCloseInterval=false;this.dt=UTCFromCTZNoon();this.rgixBugChanged=[];this.fixShadow=function(){ClockPopup.fixShadow()};this.fixHotkeys=function(){ClockPopup.fixHotkeys()};this.getEditor=function(){if(!this.editor){this.editor=new TimeIntervalEditor}return this.editor};this.showAdder=function(elToTarget){if(!ClockPopup.isOpen())return true;this.fChanged=true;this.getEditor().showAdder(elToTarget);return false};this.showEditor=function(ixInterval){if(!ClockPopup.isOpen())return true;this.fChanged=true;this.getEditor().show(this.tiByIx(ixInterval));return false};this.submitEditor=function(){if(!ClockPopup.isOpen())return true;this.getEditor().submit();return false};this.tiByIx=function(ixInterval){return this.rgday.map(function(day){return day.tiByIx(ixInterval)}).firstMatch(function(ti){return null!=ti})};this.display=function(){this.clearDisplay();var elContainer=this.getContainer();this.showDt();this.rgday=this.rgday.sort(function(d1,d2){return new UTCDate(d1.dt)>new UTCDate(d2.dt)?1:-1});var rgtiAll=[];for(var i=0;inew UTCDate||dt==this.dt)return false;this.dt=new UTCDate(dt);this.showDt();this.dropEdits();$.get(sDefaultURI+"?fAlaCarte=1&"+"pg=pgAlaCarteLoadTimesheet&dt="+SerializeDate(CTZFromUTC(this.dt)),null,Timesheet.response);return true};this.changeDt=function(dt){return Timesheet.confirmLeaveEdits(function(){Timesheet.requestDt(dt)},FB_CONTINUE_LOSE_CHANGES)};this.shiftDate=function(nDays){var dtNew=new UTCDate(this.dt);dtNew.setDate(this.dt.getDate()+nDays);return this.changeDt(dtNew)};this.nextDt=function(){if(!ClockPopup.isOpen())return true;this.shiftDate(1);return false};this.prevDt=function(){if(!ClockPopup.isOpen())return true;this.shiftDate(-1);return false};this.showCalendar=function(){cal.bPastOK=true;cal.bFutureOK=false;cal.fTextBar=false;cal.setDate(this.dt);cal.show("dtPreviousTimesheet","prevTimesheetButton");cal.focus(false);return true};this.check=function(){return this.requestAlter(false)};this.commit=function(){return this.requestAlter(true)};this.requestAlter=function(fCommit){this.fChanged=true;Info.hide();$.post(sDefaultURI,{fAlaCarte:1,pre:"prePostTimesheet",sData:this.serialize(),fCommit:fCommit?"1":"0"},function(jXML){Timesheet.response(jXML,true,fCommit)})};this.response=function(jXML,fOverwrite,fCommit){Timesheet.rgday=[];var rgxmlInterval=$("TimeInterval",jXML);if(rgxmlInterval){if(fOverwrite){Timesheet.clearData()}if(fCommit){if("undefined"!=typeof requestUpdateElapsedTime)requestUpdateElapsedTime(Timesheet.rgixBugChanged);if($("fCommitFail",jXML).text()!="1"){if(Timesheet.fCloseInterval){setIxWorkingOnNothing()}else{refreshWorkingOn()}Timesheet.dropEdits()}}rgxmlInterval.map(function(){var ti=new TimeInterval;ti.fromSJS($(this).text());var day=Timesheet.addDay(ti.dtStart);day.addTI(ti)});Timesheet.display()}var sError=$("sError",jXML).text();if(sError)Timesheet.showError(sError);Timesheet.fixShadow();Timesheet.fixHotkeys()};this.confirmNavigate=function(sUrl){Timesheet.confirmLeaveEdits(function(){ClockPopup.hide();window.navigation.navigate(sUrl);return false},FB_STILL_GO_TO_PAGE);return false};this.confirmLeaveEdits=function(fxConf,sResolveMsg){if(!Timesheet.fChanged){fxConf();return true}var oConfirmMsg=elById("idTimesheetConfirmMsg");var oResolveMsg=elById("idTimesheetResolveMsg");var oOk=elById("idTimesheetConfirmOk");var oCancel=elById("idTimesheetConfirmCancel");if(!(oConfirmMsg&&oResolveMsg&&oOk&&oCancel))return true;oConfirmMsg.innerHTML=FB_EDITS_WILL_BE_LOST;oResolveMsg.innerHTML=sResolveMsg;oOk.value=FB_YES;oOk.onclick=function(){fxConf();EditableTableManager.hidePane("TimesheetTable");return false};oCancel.value=FB_NO;EditableTableManager.showDeletePane("TimesheetTable",ClockPopup.getElPopup(),null,null,Timesheet.getContainer(),POPUP_POSITION_CENTER);return false};this.getUTCDateFromCTZsTime=function(sTime){return UTCFromCTZ(CombineDateTime(CTZFromUTC(this.dt),clo.CTZguessTime(sTime)))}};function TimeIntervalEditor(){}TimeIntervalEditor.prototype.show=function(ti){var oed=this;this.tiEdit=ti;this.hideErrors();EditableTableManager.showEditPane("TimesheetTable",ti.getEl(),this.createEditPane(ti.idRow,ti.dtStart,ti.dtEnd,ti.ixBug,FB_EDIT_INTERVAL),function(){oed.showEndTime(ti.Ends())},elById("timeclockPopup"),POPUP_POSITION_LEFT)};TimeIntervalEditor.prototype.showAdder=function(elToTarget){var oed=this;this.tiEdit=null;this.hideErrors();EditableTableManager.showEditPane("TimesheetTable",elToTarget,this.createEditPane(elToTarget.id,new UTCDate,new UTCDate,"",FB_ADD_INTERVAL),function(){oed.showEndTime(true)},elById("timeclockPopup"),POPUP_POSITION_LEFT)};TimeIntervalEditor.prototype.createEditPane=function(idRow,dtStart,dtEnd,ixBug,sTitle){return[{sId:"dtStartTime",sTag:"input",value:CTZsTimeFromUTC(dtStart)},{sId:"dtEndTime",sTag:"input",value:CTZsTimeFromUTC(dtEnd?dtEnd:new UTCDate)},{sId:"ixBugEdit",sTag:"input",style:"display:none",value:ixBug},{sId:"sTimesheetEdit",sTag:"span",value:sTitle}]};TimeIntervalEditor.prototype.showEndTime=function(fDisplay){elById("idTimesheetEditorEndTime").style.display=fDisplay?"":"none";this.fixShadow()};TimeIntervalEditor.prototype.submit=function(){var ed=this;this.hideErrors();var ti=this.tiEdit;var fAdd=false;if(!ti){fAdd=true;ti=new TimeInterval}var fxOk=function(){if(clo.guessTime(elById("dtStartTime").value)>clo.guessTime(elById("dtEndTime").value)){ed.showTimeErr(FB_END_TIME_BEFORE_START_TIME);return}ti.fromPopup();if(fAdd)Timesheet.rgtiAdd.push(ti);EditableTableManager.hidePane("TimesheetTable");Timesheet.check()};var fxNoBug=function(){ed.showEditErr(FB_INVALID_CASE)};var fxNoEst=function(){EstimatePopup.show("editTimesheetTable",elById("ixBugEdit").value,fxOk,function(ixSI){elById("ixBugEdit").value=ixSI;ti.fromPopup();ti.checkBug(elById("ixBugEdit").value,fxOk,fxNoBug,fxNoEst,fxNoPermission)},function(){EditableTableManager.hidePane("TimesheetTable")},POPUP_POSITION_CENTER)};var fxNoPermission=function(){ed.showEditErr(swap1(FB_NO_PERMISSION_ON_BUG,elById("ixBugEdit").value))};ti.checkBug(elById("ixBugEdit").value,fxOk,fxNoBug,fxNoEst,fxNoPermission)};TimeIntervalEditor.prototype.fixShadow=function(){EditableTableManager.fixShadow("TimesheetTable")};TimeIntervalEditor.prototype.showEditErr=function(sErr){var elEdit=elById("ixBugEdit");var elEditErr=elById("ixBugEditError");$("#ixBugEdit, #idDropList_ixBugEdit_oText").addClass("error");if(elEdit.value.length>0){elEditErr.innerHTML=Swap1(sErr,elById("ixBugEdit").value);elEditErr.style.display="block"}this.fixShadow()};TimeIntervalEditor.prototype.hideEditErr=function(){var elEdit=elById("ixBugEdit");var elEditErr=elById("ixBugEditError");$("#ixBugEdit, #idDropList_ixBugEdit_oText").removeClass("error");elEditErr.innerHTML="";this.fixShadow()};TimeIntervalEditor.prototype.showTimeErr=function(sErr){elById("dtStartTime").className="error";elById("dtEndTime").className="error";var elTimeErr=elById("dtEditError");elTimeErr.innerHTML=Swap1(sErr,elById("ixBugEdit").value);elTimeErr.style.display="block";this.fixShadow()};TimeIntervalEditor.prototype.hideTimeErr=function(){elById("dtEditError").style.display="none";elById("dtStartTime").className="";elById("dtEndTime").className="";this.fixShadow()};TimeIntervalEditor.prototype.hideErrors=function(){this.hideEditErr();this.hideTimeErr()};var ClockPopup=new function(){var fOpen=false;this.isOpen=function(){return fOpen};this.closeOK=function(){return!Timesheet.fChanged};this.getElPopup=function(){if(!elById("timeclockPopup")){var el=document.createElement("DIV");el.innerHTML=pictureOf(TimesheetPopup);document.body.appendChild(el);theMgr.addWithHandler("timeclockPopup",ClockPopup.theMgrHandler)}return elById("timeclockPopup")};this.show=function(dt){fOpen=true;var elWorkingOnMenu=elById("Working_On");if(elWorkingOnMenu){theMgr.showPopup(this.getElPopup().id,elWorkingOnMenu,0,20);ApplyShadow(this.getElPopup());Timesheet.changeDt(dt?dt:new UTCDate)}return false};this.fixShadow=function(){};this.fixHotkeys=function(){KeyManager.registerElPopupKeys(this.getElPopup())};this.hide=function(){Timesheet.dropEdits();theMgr.hideAllPopups()};this.theMgrHandler=function(){if(!ClockPopup.closeOK()){BlinkManager.startBlink("CloseBlinker",elById("timeclockPopup"),"#666666",3,65,.65);return false}fOpen=false;Info.hide();Timesheet.clearDisplay();if(KeyManager.getElCursor())KeyManager.getElCursor().style.display="none";return true}};var g_obts=null;function requestBugTimesheet(ixBug){$.get(sDefaultURI+"?fAlaCarte=1&"+"pg=pgAlaCarteBugTimesheet&ixBug="+ixBug,null,responseBugTimesheet);return false}function responseBugTimesheet(jXML){var sHTML=$("sHTML",jXML).text();if(sHTML){if(!g_obts){g_obts=FancyPopupManager.create("bugTimesheetPopup");g_obts.setWidth(450)}g_obts.oDiv.innerHTML=sHTML}g_obts.show("bugTimesheet",POPUP_POSITION_CENTER_SCREEN,true);autoScrollDiv(elById("idBugTimesheetOverflowDiv"),450)}var FavoritesIcons=new function(){var ixDocList=-1;var elInput;var oIcons={Bug:{},WikiPage:{},DiscussTopic:{}};var initObject=function(sType,ixItem){oIcons[sType][ixItem]={rgIcons:[],fFavorite:undefined,fAjax:undefined,fRemoveLater:false,fUserSet:false}};var updateIcons=function(sType,ixItem){ var oItem=oIcons[sType][ixItem];if(oItem.fRemoveLater)oItem.fFavorite=false;if(oItem.fFavorite==undefined)return;var sClass=oItem.fFavorite?"starFull":"starEmpty";var j=$(oItem.rgIcons).show();j.parent().not("."+sClass).removeClass().addClass(sClass)};this.setFavorite=function(sType,ixItem,fFavorite){if(oIcons[sType][ixItem]&&oIcons[sType][ixItem].fFavorite!=fFavorite){if(fFavorite){if(ixDocList>=0){if(oIcons[sType][ixItem].fRemoveLater){oIcons[sType][ixItem].fRemoveLater=false}else{FavoritesList.change("Add",ixDocList,sType,ixItem,0)}}}else{if(ixDocList>=0){if(FavoritesList.isPopupVisible()){oIcons[sType][ixItem].fRemoveLater=true}else{FavoritesList.change("Remove",ixDocList,sType,ixItem,0)}}}oIcons[sType][ixItem].fFavorite=fFavorite;updateIcons(sType,ixItem)}};this.setAllFavorites=function(sAllFavorites,fForce){var rgs=[];if(sAllFavorites&&sAllFavorites.split)rgs=sAllFavorites.split(",");var oLookup={};for(var ix=0;ix';var sTr='';oGhostDiv.innerHTML=sTable+sTr+oRow.innerHTML+"";var oGhostRow=elById("ghostRow");this.unhighlightRow(oGhostRow)};this.keypress=function(e,oRow){if(13==getKeyCode(e)){var elLink;if(oRow&&oRow.id)elLink=elById(oRow.id+"_link");this.delayedClick(elLink,e)}else if("*"==String.fromCharCode(KeyboardMap.fix(getKeyCode(e),false)).toLowerCase()){var rgs=oRow.id.split("_");var ixItem=rgs[rgs.length-1];var sType=rgs[rgs.length-2];FavoritesIcons.toggle(sType,ixItem)}};this.delayedClick=function(elLink,e){if(elLink&&FavoritesIcons.getRemoveLaterItems().length){if(e)cancel(e);FavoritesIcons.sendRemoveLaterItems(function(){KeyManager.simulateClick(elLink)},"pg=pgAlaCarteErrorOnly");return false}return true};this.clearLastHighlight=function(){if(oRowLastHighlighted)this.unhighlightRow(oRowLastHighlighted)};this.highlightRow=function(oRow){if(!oRow||!oRow.tagName||!(oRow.tagName.toLowerCase()=="tr"))return;if(null!=KeyManager.oPopupBrowser)KeyManager.oPopupBrowser.setElCurrent(oRow);var el=elById(oRow.id+"_link");if(el)safeFocus(el);if(trim(oRow.className)=="row"){paintRow(oRow,colorHoverRow)}else{paintRow(oRow,colorHoverRowAlt)}if(!window.opera)removeTextSelections();if(oRow!=oRowLastHighlighted)this.unhighlightRow(oRowLastHighlighted);oRowLastHighlighted=oRow};this.unhighlightRow=function(oRow){if(!oRow||!oRow.tagName||!(oRow.tagName.toLowerCase()=="tr"))return;if(trim(oRow.className)=="row"){paintRow(oRow,colorRow)}else{paintRow(oRow,colorRowAlt)}if(oRow==oRowLastHighlighted)oRowLastHighlighted=undefined};this.showToolbar=function(oRow){if(oRowLastHighlighted!=oRow){this.clearLastHighlight();this.highlightRow(oRow)}oRow.style.cursor="move";if(!oRow.fEventsAttached){new ListBrowser(oRow,function(el){return null!=el.tagName&&("a"==el.tagName.toLowerCase()||"img"==el.tagName.toLowerCase())},null,null,null,function(el){el.setAttribute("onmousedown","return false");el.setAttribute("ondrag","return false");el.setAttribute("ondragstart","return false");el.setAttribute("ondragend","return false")},null);oRow.fEventsAttached=true}else{}$("#"+oRow.id+"_spacer").css("display","none");$("#"+oRow.id+"_updown").css("display","")};this.hideToolbar=function(oRow){this.unhighlightRow(oRow);$("#"+oRow.id+"_spacer").css("display","");$("#"+oRow.id+"_updown").css("display","none")};this.startDrag=function(oRow,ixDocList,sType,ixItem,nPos){this.sType=sType;this.ixItem=ixItem;this.ixDocList=ixDocList;this.nPosBegin=nPos;this.nPos=0;this.ptDragBegin=undefined;this.fDragBegin=false;if(oGhostDiv==undefined)this.initGhostDiv();this.showGhostDiv(oRow);this.rgYDrag=[];elTable=oRow.parentNode;elTable=getParentNode(elTable,"table");if(!elTable||elTable.tagName.toLowerCase()!="table")return;this.elList=elTable;var rgY=this.rgYDrag;var nPos=0;var yPrev=0;new ListBrowser(this.elList,function(el){return null!=el.tagName&&"tr"==el.tagName.toLowerCase()},null,null,null,function(el){var pos=getAbsolutePosition(el);nPos=el.getAttribute("pos");rgY.push({yPrev:yPrev,y:pos.y+el.offsetHeight/2,el:el,nPos:nPos});yPrev=pos.y+el.offsetHeight/2},null);this.nPosMax=++nPos;rgY.push({yPrev:yPrev,y:Number.POSITIVE_INFINITY,el:null,nPos:this.nPosMax});this.fDragging=true;document.body.style.cursor="move";this.notifyMovement();return false};this.stopDrag=function(){if(!this.fDragging)return false;document.body.style.cursor="auto";oGhostDiv.style.display="none";removeTextSelections();this.ptDragBegin=undefined;if(this.fDragBegin&&this.nPos!=this.nPosBegin&&this.nPos!=this.nPosBegin+1){this.showLoadingDiv();this.fDragging=false;this.change("Move",this.ixDocList,this.sType,this.ixItem,this.nPos)}else{this.fDragging=false;this.unmask();if(this.elArrow)this.elArrow.style.visibility="hidden"}return false};this.placeArrow=function(x,y){if(!this.elArrow){this.elArrow=DOM.img({src:StaticContentUrl("images/rightArrow.gif"),style:"position:absolute;"});document.body.appendChild(this.elArrow)}this.elArrow.style.visibility="visible";this.elArrow.style.top=y+"px";this.elArrow.style.left=x-this.elArrow.offsetWidth+"px"};this.notifyMovement=function(){if(!this.fDragging)return;if(this.ptDragBegin==undefined){this.ptDragBegin={};this.ptDragBegin.x=xMouse;this.ptDragBegin.y=yMouse}if(!this.fDragBegin&&(Math.abs(yMouse-this.ptDragBegin.y)>DRAG_THRESHOLD||Math.abs(xMouse-this.ptDragBegin.x)>DRAG_THRESHOLD)){this.fDragBegin=true;this.mask()}removeTextSelections();document.body.style.cursor="move";if(this.fDragBegin){oGhostDiv.style.display="";oGhostDiv.style.top=yMouse-pxDragOffsetY+"px";oGhostDiv.style.left=xMouse-pxDragOffsetX+"px";this.elCurrDragPrev=this.elCurrDrag;this.elCurrDrag=null;this.nPos=this.nPosMax;var match=this.rgYDrag.firstMatch(function(_){return _.yPrev=yMouse});if(match){this.elCurrDrag=match.el;this.nPos=match.nPos}if(this.elCurrDrag!=this.elCurrDragPrev){if(null!=this.elCurrDrag){var pos=getAbsolutePosition(this.elCurrDrag);var posOuter=getAbsolutePosition(this.elList);this.placeArrow(posOuter.x-TABLE_PADDING,pos.y-ROW_PADDING)}else{var posOuter=getAbsolutePosition(this.elList);this.placeArrow(posOuter.x-TABLE_PADDING,posOuter.y+this.elList.offsetHeight-ROW_PADDING)}}}};this.sizeLoadingDiv=function(){var elPopup=elById("favoritesPopup");var pos=getAbsolutePosition(elPopup);this.elLoadingDiv.style.top=pos.y+"px";this.elLoadingDiv.style.left=pos.x+"px";this.elLoadingDiv.style.height=elPopup.offsetHeight+"px";this.elLoadingDiv.style.width=elPopup.offsetWidth+"px"};this.showLoadingDiv=function(){if(!this.elLoadingDiv){this.elLoadingDiv=DOM.div({style:"background:silver;position:absolute;opacity:0.4;filter:alpha(opacity=40);z-index:4;display:none;"});document.body.appendChild(this.elLoadingDiv)}FadeManager.startFadeIn("favoritesPopup",this.elLoadingDiv,function(){FavoritesList.sizeLoadingDiv()},false)};this.hideLoadingDiv=function(){if(elById("favoritesPopup")&&this.elLoadingDiv)FadeManager.startFadeOut("favoritesPopup",this.elLoadingDiv,null,false)};this.hideLoadingDivNow=function(){if(elById("favoritesPopup")&&this.elLoadingDiv)this.elLoadingDiv.style.display="none"};this.mask=function(){theMgr.showSmallMask("favoritesPopup")};this.unmask=function(){theMgr.unmaskClicks("favoritesPopup")};this.onPopupShow=function(){KeyManager.oPopupBrowser=new ListBrowser(elById("favoritesPopup"),function(el){return null!=el.tagName&&("a"==el.tagName.toLowerCase()&&"favoritesheadline"==el.className.toLowerCase()||"tr"==el.tagName.toLowerCase())},function(el){if("tr"==el.tagName.toLowerCase()){safeFocus(elById(el.id+"_link"))}else{safeFocus(el)}FavoritesList.highlightRow(el)},function(el){if(el&&el.blur)el.blur();FavoritesList.unhighlightRow(el)},null,function(el){if("a"==el.tagName.toLowerCase()){el.onfocus=function(){null!=KeyManager.oPopupBrowser&&KeyManager.oPopupBrowser.setElCurrent(this);FavoritesList.clearLastHighlight()};el.onmouseover=function(){if(!window.opera)safeFocus(this)};el.onmouseout=function(){if(!window.opera)this.blur()}}else{var elLink=elById(el.id+"_link");if(elLink)ourAttachEvent(elLink,"keypress",function(e){FavoritesList.keypress(e,el)})}},null);return false};this.onPopupHide=function(){document.body.style.cursor="auto";if(oGhostDiv&&oGhostDiv.style)oGhostDiv.style.display="none";this.ptDragBegin=undefined;this.fDragging=false;this.unmask();if(this.elArrow)this.elArrow.style.visibility="hidden";this.hideLoadingDivNow();if(oRowLastHighlighted)this.unhighlightRow(oRowLastHighlighted);FavoritesIcons.sendRemoveLaterItems();return true};this.isPopupVisible=function(){return isVisible(elById("favoritesPopup"))};this.change=function(sAction,ixDocList,sType,ixItem,nPos,fxnCallback,sPg){if(ajaxIsBusy(this.oAjaxRequest)){setTimeout(function(){FavoritesList.change(sAction,ixDocList,sType,ixItem,nPos)},500)}else{var fPgFavorites=false;if(elById("pgFavorites"))fPgFavorites=true;if(!fxnCallback)fxnCallback=function(jXML){FavoritesList.resultDocListChange(jXML)};var oData={fAlaCarte:1,pre:"preDocList"+sAction,ixDocList:ixDocList,sType:sType,ixItem:ixItem,nPos:nPos};if(sPg){oData["pg"]=sPg}else{oData["pg"]="pgFavoritesPopup";oData["fPgFavorites"]=IntFromBool(fPgFavorites);var rgRemoveLater=FavoritesIcons.getRemoveLaterItems();if(rgRemoveLater.length>0){oData["sTypesRemoveLater"]=$.map(rgRemoveLater,function(o){return o.sType}).join(",");oData["sItemsRemoveLater"]=$.map(rgRemoveLater,function(o){return o.ixItem}).join(",")}}this.oAjaxRequest=$.get(sDefaultURI,oData,fxnCallback);if(fPgFavorites&&!this.isPopupVisible()){if(sAction=="Move"||sAction=="MoveUp"||sAction=="MoveDown")Info.show(FB_MOVING);else Info.show(FB_UPDATING)}}return false};this.resultDocListChange=function(jXML){var sError=$("sError",jXML).text();if(sError){alert(sError);return}setFavoritesContent($("sHTML_favoritesPopup",jXML).text(),$("sAllFavorites",jXML).text(),$("sHTML_pgFavorites",jXML).text(),true);$("#idWorkOnFavorites").html($("sHTML_workingOnFavorites",jXML).text());Info.hide();this.unmask();this.hideLoadingDiv();if(this.isPopupVisible()&&KeyManager&&KeyManager.oPopupBrowser){var oRowSelected=KeyManager.oPopupBrowser.elCurrent;this.onPopupShow();if(oRowSelected&&oRowSelected.id){this.highlightRow(elById(oRowSelected.id));var el=elById(oRowSelected.id+"_link");if(el)safeFocus(el)}}if(this.elArrow)this.elArrow.style.visibility="hidden"}};var EstimatePopup=new function(){this.oPopup=null;this.show=function(idAnchorEl,ixBug,fxEstInit,fxSIInit,fxCancelInit,nPos){this.fxEst=fxEstInit;this.fxSI=fxSIInit;this.fxCancel=fxCancelInit;if(!this.oPopup){var oPopup=elById("idEnterEstimateDiv");if(oPopup){this.oPopup=FancyPopupManager.create("enterEstimatePopup");oPopup.parentNode.removeChild(oPopup);this.oPopup.oDiv.appendChild(oPopup);oPopup.style.display=""}}var elt=elById("idEnterEstimateTitle");if(elt)elt.innerHTML=swap1(FB_NO_ESTIMATE_ENTERED,ixBug);elt=elById("idIxBug");if(elt)elt.value=ixBug;this.reset();this.oPopup.show(idAnchorEl,null==nPos?POPUP_POSITION_LEFT:nPos,false);giveTextBoxFocus("idEnterEstimateInput")};this.hide=function(){this.oPopup.hide()};this.changeEstimateCallback=function(jXML){var sError=$("sError",jXML).eq(0).text();if(sError&&sError!=""){var elt=elById("idEnterEstimateError");if(elt)show(elt);giveTextBoxFocus("idEnterEstimateInput");EstimatePopup.oPopup.fixShadow();return}var BugFieldsJS=$("BugFieldsJS",jXML).text();if(BugFieldsJS){var oBug=eval("("+BugFieldsJS+")");if(window.updateGridEstimate)updateGridEstimate(oBug,parseLocaleFloat($("hrsCurrentChange",jXML).text()),parseLocaleFloat($("hrsRemainingChange",jXML).text()));if(window.updateViewEstimate)updateViewEstimate(oBug);if(EstimatePopup.fxEst&&oBug.ixBug)EstimatePopup.fxEst(oBug.ixBug)}EstimatePopup.hide()};this.submit=function(){var elt=elById("idEnterEstimateError");if(elt)hide(elt);this.oPopup.fixShadow();var ixBug;elt=elById("idIxBug");if(elt)ixBug=IntPrefix(elt.value);if(!ixBug)return;var elt=elById("idEnterEstimate");if(elt&&elt.checked){fEstimate=true}else{elt=elById("idSelectScheduleItem");if(!elt||!elt.checked)return;fEstimate=false}if(fEstimate){var sHrsEst;elt=elById("idEnterEstimateInput");if(elt)sHrsEst=elt.value;if(sHrsEst)changeEstimate(ixBug,sHrsEst,EstimatePopup.changeEstimateCallback);else $("#idEnterEstimateError").show()}else{var ixScheduleItem;elt=elById("idScheduleItemInput");if(elt)ixScheduleItem=Number(elt.value);if(ixScheduleItem){if(this.fxSI)this.fxSI(ixScheduleItem);this.hide()}}};this.cancel=function(){this.hide();if(this.fxCancel)this.fxCancel();this.reset()};this.reset=function(){var elt=elById("idEnterEstimateInput");if(elt&&elt.value)elt.value="";elt=elById("idScheduleItemInput");if(elt&&elt.selectedIndex)elt.selectedIndex=0;elt=elById("idEnterEstimate");if(elt)elt.checked=true;var elt=elById("idEnterEstimateError");if(elt)hide(elt);this.oPopup.fixShadow()}};function changeEstimate(ixBug,sHrsEst,fxnCallback){if(!ixBug||ixBug==0)return;$.get(sDefaultURI+"?fAlaCarte=1&"+"pre=preEditEstimate&pg=pgEstimate&ixBug="+ixBug+"&hrsEst="+sHrsEst,null,fxnCallback)}var AfterHoursPopup=new function(){this.oPopup=null;this.show=function(idAnchorEl,ixBug,nPos){if(!this.oPopup){var oPopup=elById("idAfterHoursDiv");if(oPopup){this.oPopup=FancyPopupManager.create("AfterHoursPopup");oPopup.parentNode.removeChild(oPopup);this.oPopup.oDiv.appendChild(oPopup);oPopup.style.display=""}}var elt=elById("idAfterHoursTitle");if(elt)elt.innerHTML=FB_AFTERHOURS;this.oPopup.show(idAnchorEl,null==nPos?POPUP_POSITION_LEFT:nPos,false);this.ixBug=ixBug};this.hide=function(){this.oPopup.hide()};this.cancel=function(){this.hide()};this.submit=function(){$.get(sDefaultURI+"?fAlaCarte=1&"+"pre=preChangeWorkOnAlaCarte&pg=pgEstimate&ixBug="+this.ixBug+"&fOpenNew=1",null,null);this.hide()}};function initTagSearchUI(fIgnoreMax){var elContainer=elById("dlgGrid");var elText=elById("sTagName");if(!elContainer||!elText)return;var sOrder="";var fxnQueryString=function(){return"pg=pgAlaCarteTagReport&fRefine=1&"+"sTagName="+encodeURIComponent(trim(elText.value))+(fIgnoreMax?"&fIgnoreMax=1":"")+sOrder};var oUpdater=new DynamicUpdate(elContainer,fxnQueryString);ourAttachEvent(elText,"keyup",function(){fIgnoreMax=false;oUpdater.queueUpdate()});var fxnFalse=function(e){if(stopFormSubmission(e))return cancel(e)};ourAttachEvent(elText,"keypress",fxnFalse);var rg=["nameAsc","nameDesc","popAsc","popDesc"];for(var ix=0;ix1){return true}}}return false}})();(function(){function log(){if(typeof console!="undefined"&&typeof console.log=="function"){Array.prototype.unshift.call(arguments,"[Ajax Upload]");console.log(Array.prototype.join.call(arguments," "))}}function addEvent(el,type,fn){if(el.addEventListener){el.addEventListener(type,fn,false)}else if(el.attachEvent){el.attachEvent("on"+type,function(){fn.call(el)})}else{throw new Error("not supported or DOM not loaded")}}function addResizeEvent(fn){var timeout;addEvent(window,"resize",function(){if(timeout){clearTimeout(timeout)}timeout=setTimeout(fn,100)})}if(document.documentElement.getBoundingClientRect){var getOffset=function(el){var box=el.getBoundingClientRect();var doc=el.ownerDocument;var body=doc.body;var docElem=doc.documentElement;var clientTop=docElem.clientTop||body.clientTop||0;var clientLeft=docElem.clientLeft||body.clientLeft||0;var zoom=1;if(body.getBoundingClientRect){var bound=body.getBoundingClientRect();zoom=(bound.right-bound.left)/body.clientWidth}if(zoom>1){clientTop=0;clientLeft=0}var top=box.top/zoom+(window.pageYOffset||docElem&&docElem.scrollTop/zoom||body.scrollTop/zoom)-clientTop,left=box.left/zoom+(window.pageXOffset||docElem&&docElem.scrollLeft/zoom||body.scrollLeft/zoom)-clientLeft;return{top:top,left:left}}}else{var getOffset=function(el){var top=0,left=0;do{top+=el.offsetTop||0;left+=el.offsetLeft||0;el=el.offsetParent}while(el);return{left:left,top:top}}}function getBox(el){var left,right,top,bottom;var offset=getOffset(el);left=offset.left;top=offset.top;right=left+el.offsetWidth;bottom=top+el.offsetHeight;return{left:left,right:right,top:top,bottom:bottom}}function addStyles(el,styles){for(var name in styles){if(styles.hasOwnProperty(name)){el.style[name]=styles[name]}}}function copyLayout(from,to){var box=getBox(from);addStyles(to,{position:"absolute",left:box.left+"px",top:box.top+"px",width:from.offsetWidth+"px",height:from.offsetHeight+"px"})}var toElement=function(){var div=document.createElement("div");return function(html){div.innerHTML=html;var el=div.firstChild;return div.removeChild(el)}}();var getUID=function(){var id=0;return function(){return"ValumsAjaxUpload"+id++}}();function fileFromPath(file){return file.replace(/.*(\/|\\)/,"")}function getExt(file){return-1!==file.indexOf(".")?file.replace(/.*[.]/,""):""}function hasClass(el,name){var re=new RegExp("\\b"+name+"\\b");return re.test(el.className)}function addClass(el,name){if(!hasClass(el,name)){el.className+=" "+name}}function removeClass(el,name){var re=new RegExp("\\b"+name+"\\b");el.className=el.className.replace(re,"")}function removeNode(el){el.parentNode.removeChild(el)}window.AjaxUpload=function(button,options){this._settings={action:"upload.php",name:"userfile",data:{},autoSubmit:true,responseType:false,hoverClass:"hover",disabledClass:"disabled",onChange:function(file,extension){},onSubmit:function(file,extension){},onComplete:function(file,response){}};for(var i in options){if(options.hasOwnProperty(i)){this._settings[i]=options[i]}}if(button.jquery){button=button[0]}else if(typeof button=="string"){if(/^#.*/.test(button)){button=button.slice(1)}button=document.getElementById(button)}if(!button||button.nodeType!==1){throw new Error("Please make sure that you're passing a valid element")}if(button.nodeName.toUpperCase()=="A"){addEvent(button,"click",function(e){if(e&&e.preventDefault){e.preventDefault()}else if(window.event){window.event.returnValue=false}})}this._button=button;this._input=null;this._disabled=false;this.enable();this._rerouteClicks()};AjaxUpload.prototype={setData:function(data){this._settings.data=data},disable:function(){addClass(this._button,this._settings.disabledClass);this._disabled=true;var nodeName=this._button.nodeName.toUpperCase();if(nodeName=="INPUT"||nodeName=="BUTTON"){this._button.setAttribute("disabled","disabled")}if(this._input){this._input.parentNode.style.visibility="hidden"}},enable:function(){removeClass(this._button,this._settings.disabledClass);this._button.removeAttribute("disabled");this._disabled=false},_createInput:function(){var self=this;var input=document.createElement("input");input.setAttribute("type","file");input.setAttribute("name",this._settings.name);addStyles(input,{position:"absolute",right:0,margin:0,padding:0,fontSize:"480px",cursor:"pointer"});var div=document.createElement("div");addStyles(div,{display:"block",position:"absolute",overflow:"hidden",margin:0,padding:0,opacity:0,cursor:"pointer !important",direction:"ltr",zIndex:2147483583});if(div.style.opacity!=="0"){if(typeof div.filters=="undefined"){throw new Error("Opacity not supported by the browser")}div.style.filter="alpha(opacity=0)"}addEvent(input,"change",function(){if(!input||input.value===""){return}var file=fileFromPath(input.value);if(false===self._settings.onChange.call(self,file,getExt(file))){self._clearInput();return}if(self._settings.autoSubmit){self.submit()}});addEvent(input,"mouseover",function(){addClass(self._button,self._settings.hoverClass)});addEvent(input,"mouseout",function(){removeClass(self._button,self._settings.hoverClass);input.parentNode&&(input.parentNode.style.visibility="hidden")});div.appendChild(input);document.body.appendChild(div);this._input=input},_clearInput:function(){if(!this._input){return}removeNode(this._input.parentNode);this._input=null;this._createInput();removeClass(this._button,this._settings.hoverClass)},_rerouteClicks:function(){var self=this;addEvent(self._button,"mouseover",function(){if(self._disabled){return}if(!self._input){self._createInput()}var div=self._input.parentNode;copyLayout(self._button,div);div.style.visibility="visible"})},_createIframe:function(){var id=getUID();var iframe=toElement('