var UiSkin = {"ALOHA":{"apiValue":"Theme3","dbValue":"4"},"WEBSTORE":{"apiValue":"Webstore","dbValue":"3"},"CLASSIC":{"apiValue":"Theme1","dbValue":"0"},"SALESFORCE":{"apiValue":"Theme2","dbValue":"1"},"TOUCH":{"apiValue":"Touch","dbValue":"5"},"PORTAL_DEFAULT":{"apiValue":"PortalDefault","dbValue":"2"}};
var LayoutItemTypeEnum = {"CUSTOM_LINK":{"apiValue":"K","dbValue":"K"},"STANDARD_RELATED_LIST":{"apiValue":"R","dbValue":"R"},"PAGE":{"apiValue":"P","dbValue":"P"},"EMPTY_SPACE":{"apiValue":"E","dbValue":"E"},"CONTROL":{"apiValue":"O","dbValue":"O"},"TAGGING":{"apiValue":"T","dbValue":"T"},"STANDARD_FIELD":{"apiValue":"F","dbValue":"F"},"DETAIL_BUTTON_BAR":{"apiValue":"B","dbValue":"B"},"CUSTOM_S_CONTROL":{"apiValue":"S","dbValue":"S"},"CUSTOM_RELATED_LIST":{"apiValue":"L","dbValue":"L"},"CUSTOM_FIELD":{"apiValue":"C","dbValue":"C"}};
var InlineEditState = {"EDIT":{"display":true,"cssClass":"inlineEditWrite"},"READONLY":{"display":true,"cssClass":"inlineEditLock"},"POSTONLY":{"display":false,"cssClass":""},"NONE":{"display":false,"cssClass":""}};
var PerfLogLevel = {"INTERNAL":{"name":"INTERNAL","value":2},"DEBUG":{"name":"DEBUG","value":1},"PRODUCTION":{"name":"PRODUCTION","value":3}};
var ColumnType = {"DUEDATE":{"inlineEditFieldObject":"DateField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return DateField;},"inlineEditExtraData":["hasTime"],"datatypeLetter":"F","comparableDatatypes":["D","F"],"isDate":true,"isNumber":false,"inlineEditable":true,"isCompond":false},"INTEGER":{"inlineEditFieldObject":"NumberField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return NumberField;},"datatypeLetter":"N","comparableDatatypes":["P","N"],"isDate":false,"isNumber":true,"inlineEditable":true,"isCompond":false},"EXTERNALID":{"inlineEditFieldObject":"ExternalIdField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return ExternalIdField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"x","comparableDatatypes":["x"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"PERSONNAME":{"inlineEditFieldObject":"PersonNameField","needsLookup":false,"inlineEditFieldConstructor":function(){return PersonNameField;},"inlineEditExtraData":["hasSalutation","reverse","picklistId","labels"],"datatypeLetter":"M","comparableDatatypes":["M"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":true},"DYNAMICENUM":{"inlineEditFieldObject":"DynamicEnumField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":true,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return DynamicEnumField;},"inlineEditExtraData":["picklistId","controller","controllerLabel"],"datatypeLetter":"L","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"BLOB":{"needsLookup":false,"datatypeLetter":"X","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"MULTIENUM":{"inlineEditFieldObject":"MultiEnumField","queryOperators":["e","n","u","x"],"needsLookup":true,"filterQueryOperators":["e","n"],"inlineEditFieldConstructor":function(){return MultiEnumField;},"inlineEditExtraData":["picklistId","controller","controllerLabel","height"],"datatypeLetter":"Q","comparableDatatypes":["Q"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"PERCENT":{"inlineEditFieldObject":"NumberField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return NumberField;},"datatypeLetter":"P","comparableDatatypes":["P","N"],"isDate":false,"isNumber":true,"inlineEditable":true,"isCompond":false},"STRINGPLUSCLOB":{"inlineEditFieldObject":"MultiLineTextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return MultiLineTextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"J","comparableDatatypes":["J"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"ADDRESSSTATE":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"S","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"DATETIME":{"inlineEditFieldObject":"DateField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return DateField;},"inlineEditExtraData":["hasTime"],"datatypeLetter":"F","comparableDatatypes":["D","F"],"isDate":true,"isNumber":false,"inlineEditable":true,"isCompond":false},"DATACATEGORYGROUPREFERENCE":{"queryOperators":["e","n"],"needsLookup":false,"filterQueryOperators":["e","n"],"datatypeLetter":"d","comparableDatatypes":["d"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"ADDRESSCOUNTRY":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"S","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"PHONE":{"inlineEditFieldObject":"PhoneField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return PhoneField;},"inlineEditExtraData":["maxLength","formatPhone","addDir"],"datatypeLetter":"H","comparableDatatypes":["L","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"SWITCHABLE_PERSONNAME":{"needsLookup":false,"inlineEditFieldConstructor":function(){return null;},"datatypeLetter":"m","comparableDatatypes":["m"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":true},"TIMEONLY":{"queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"datatypeLetter":"f","comparableDatatypes":["f"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"CONTENT":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"9","comparableDatatypes":["9"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"DATEONLY":{"inlineEditFieldObject":"DateField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return DateField;},"inlineEditExtraData":["hasTime"],"datatypeLetter":"D","comparableDatatypes":["D","F"],"isDate":true,"isNumber":false,"inlineEditable":true,"isCompond":false},"TEXT":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"S","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"FILE":{"needsLookup":false,"datatypeLetter":"l","comparableDatatypes":["l"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":true},"YEARQUARTER":{"needsLookup":false,"datatypeLetter":"O","comparableDatatypes":["O"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":true},"EMAIL":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"E","comparableDatatypes":["L","E","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"URL":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"U","comparableDatatypes":["L","U","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"FAX":{"inlineEditFieldObject":"PhoneField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return PhoneField;},"inlineEditExtraData":["maxLength","formatPhone","addDir"],"datatypeLetter":"G","comparableDatatypes":["G"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"ENCRYPTEDTEXT":{"inlineEditFieldObject":"EncryptedTextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return EncryptedTextField;},"inlineEditExtraData":["maxLength","masked"],"datatypeLetter":"6","comparableDatatypes":["6"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"HTMLMULTILINETEXT":{"inlineEditFieldObject":"HtmlMultiLineTextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return HtmlMultiLineTextField;},"inlineEditExtraData":["maxLength","isHtml"],"datatypeLetter":"5","comparableDatatypes":["5"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"BIRTHDAY":{"inlineEditFieldObject":"DateField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return DateField;},"inlineEditExtraData":["hasTime"],"datatypeLetter":"D","comparableDatatypes":["D","F"],"isDate":true,"isNumber":false,"inlineEditable":true,"isCompond":false},"ANYTYPE":{"needsLookup":false,"datatypeLetter":"K","comparableDatatypes":["K"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"RECORDTYPE":{"queryOperators":["e","n"],"needsLookup":true,"filterQueryOperators":["e","n"],"datatypeLetter":"7","comparableDatatypes":["7"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"BOOLEAN":{"inlineEditFieldObject":"BooleanField","queryOperators":["e","n"],"needsLookup":true,"filterQueryOperators":["e","n"],"inlineEditFieldConstructor":function(){return BooleanField;},"datatypeLetter":"B","comparableDatatypes":["B"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"MULTILINETEXT":{"inlineEditFieldObject":"MultiLineTextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return MultiLineTextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"X","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"ADDRESS":{"inlineEditFieldObject":"AddressField","needsLookup":false,"inlineEditFieldConstructor":function(){return AddressField;},"inlineEditExtraData":["showState","labels"],"datatypeLetter":"A","comparableDatatypes":["A"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":true},"INETADDRESS":{"queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"datatypeLetter":"W","comparableDatatypes":["W"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"ENUMORID":{"queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":true,"filterQueryOperators":["e","n","c","k","s"],"datatypeLetter":"L","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"BITVECTOR":{"queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"datatypeLetter":"8","comparableDatatypes":["8"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"DIVISION":{"inlineEditFieldObject":"StaticEnumField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":true,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return StaticEnumField;},"inlineEditExtraData":["picklistData"],"datatypeLetter":"I","comparableDatatypes":["I"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"ENTITYID":{"inlineEditFieldObject":"ForeignKeyField","queryOperators":["e","n","s"],"needsLookup":false,"filterQueryOperators":["e","n","s"],"inlineEditFieldConstructor":function(){return ForeignKeyField;},"inlineEditExtraData":["domain","useNewLookups","lookupEntityPrefix","lookupFieldEnumOrId","mruServletUri","mruAutoComplete","controllerIds","validationServletURI","matchBlanks"],"datatypeLetter":"Y","comparableDatatypes":["Y"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"AUTONUMBER":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"datatypeLetter":"V","comparableDatatypes":["V"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"DOUBLE":{"inlineEditFieldObject":"NumberField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return NumberField;},"datatypeLetter":"N","comparableDatatypes":["P","N"],"isDate":false,"isNumber":true,"inlineEditable":true,"isCompond":false},"TEXTENUM":{"inlineEditFieldObject":"TextField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return TextField;},"inlineEditExtraData":["maxLength"],"datatypeLetter":"L","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"CURRENCY":{"inlineEditFieldObject":"NumberField","queryOperators":["e","n","l","g","m","h"],"needsLookup":false,"filterQueryOperators":["e","n","l","g","m","h"],"inlineEditFieldConstructor":function(){return NumberField;},"datatypeLetter":"C","comparableDatatypes":["C"],"isDate":false,"isNumber":true,"inlineEditable":true,"isCompond":false},"FFX_BLOB":{"needsLookup":false,"datatypeLetter":"X","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false},"HTMLSTRINGPLUSCLOB":{"inlineEditFieldObject":"HtmlStringPlusClobField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return HtmlStringPlusClobField;},"inlineEditExtraData":["maxLength","numCols","numRows","isHtml","basePath","caseSafe18Id","visualforce","FCK_LIBRARY"],"datatypeLetter":"z","comparableDatatypes":["z"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"STATICENUM":{"inlineEditFieldObject":"StaticEnumField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":true,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return StaticEnumField;},"inlineEditExtraData":["picklistData"],"datatypeLetter":"L","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"CURRENCYCODE":{"inlineEditFieldObject":"StaticEnumField","queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"inlineEditFieldConstructor":function(){return StaticEnumField;},"inlineEditExtraData":["picklistData"],"datatypeLetter":"L","comparableDatatypes":["L","U","E","H","X","S"],"isDate":false,"isNumber":false,"inlineEditable":true,"isCompond":false},"SFDCENCRYPTEDTEXT":{"queryOperators":["e","n","l","g","m","h","c","k","s","i"],"needsLookup":false,"filterQueryOperators":["e","n","c","k","s"],"datatypeLetter":"T","comparableDatatypes":["T"],"isDate":false,"isNumber":false,"inlineEditable":false,"isCompond":false}};
var QueryOperator = {"INCLUDES":{"value":"u"},"STARTS_WITH":{"value":"s"},"EXACT_EQUALS":{"value":"a"},"GREATER_THAN":{"value":"g"},"RANGE_INCLUSIVE":{"value":"I"},"NOT_START_WITH":{"value":"t"},"NOT_EQUAL":{"value":"n"},"EXCLUDES":{"value":"x"},"LESS_OR_EQUAL":{"value":"m"},"GREATER_OR_EQUAL":{"value":"h"},"CONTAINS":{"value":"c"},"LESS_THAN":{"value":"l"},"NOT_LIKE":{"value":"j"},"NOT_EXACT_EQUALS":{"value":"o"},"EQUALS":{"value":"e"},"RANGE_EXCLUSIVE":{"value":"E"},"RANGE_INCL_RIGHT":{"value":"R"},"NOT_CONTAIN":{"value":"k"},"RANGE_INCL_LEFT":{"value":"L"},"LIKE":{"value":"i"}};
function copyInnerHTML(a,b){b.innerHTML=a.innerHTML}function listProperties(a){var b="",c;for(c in a)b+=c+", ";alert(b)}function getLocalOffsetTop(a){return getLocalOffset(a,"Top")}function getLocalOffsetLeft(a){return getLocalOffset(a,"Left")}function getLocalOffset(a,b){var c=a["offset"+b],d;try{d=a.offsetParent}catch(e){return c}for(;d&&getCurrentStyle(d,"position")=="static";){c+=d["offset"+b];try{d=d.offsetParent}catch(f){break}}return c}
var isIE=navigator.appName.indexOf("Microsoft")!=-1,isIE5=navigator.userAgent.indexOf("MSIE 5.0")>0,isIE7=navigator.userAgent.indexOf("MSIE 7")!=-1,isOpera=navigator.userAgent.indexOf("Opera")!=-1,isSafari=navigator.userAgent.indexOf("AppleWebKit")!=-1,isFirefox=navigator.userAgent.indexOf("Firefox/")!=-1,isNetscape=navigator.userAgent.indexOf("Netscape/")!=-1,lastMouseX,lastMouseY,curPopupWindow=null,closeOnParentUnloadWindow=null,helpWindow=null,win=null,editPage=false,currentEntityId="",currentEntityId2=
"",picklistNAMarker="_\u0001_",beenFocused=false;document.onmousedown=markFocused;function markFocused(){beenFocused=true}var textAreaTimer=null,focusedElement=null;if(document.addEventListener)document.addEventListener("focus",trackFocused,false);else document.attachEvent&&document.attachEvent("onFocus",trackFocused);function trackFocused(a){focusedElement=window.event?window.event.target:a.target}
function reFocus(){if(focusedElement&&focusedElement.focus){var a=focusedElement.id;if(a){for(var b=reFocus.arguments,c=0;c<b.length;c+=2)if(a==b[c]){a=document.getElementById(b[c+1]);hiddenOrDisabled(a)||a.focus();focusedElement=a;return}if((a=document.getElementById(a))&&a.focus&&!hiddenOrDisabled(a)){a.focus();focusedElement=a}}}}
function setEntityInformation(a,b,c,d,e,f,g){currentEntityId=d;currentEntityId2=g;g=self.getAccessibleParentWindow?getAccessibleParentWindow(self):self;editPage=e;if(f)if(g){g.sendCTIMessage&&g.sendCTIMessage("ADD_LOG_OBJECT?ID="+d+"&OBJECT_LABEL="+escape(b)+"&ENTITY_NAME="+c+"&OBJECT_NAME="+escape(a));g.cleanupClickToDial&&g.cleanupClickToDial()}}function setLastMousePosition(a){if(navigator.appName.indexOf("Microsoft")!=-1)a=window.event;lastMouseX=a.screenX;lastMouseY=a.screenY}
function openClickout(a){openClickoutWithSize(a,640,480)}function openClickoutWithSize(a,b,c){window.open(a,"_blank","width="+b+",height="+c+",dependent=no,resizable=yes,toolbar=yes,status=yes,directories=yes,menubar=yes,scrollbars=1",false)}function openIntegration(a,b,c){a=window.open(a,"_blank",b,false);if(c==2)a.moveTo(0,0);else if(c==0){a.moveTo(0,0);a.resizeTo(self.screen.width,self.screen.height)}}function openPopup(a,b,c,d,e,f){openPopupFocus(a,b,c,d,e,f,true)}
function openPopupFocusEscapePounds(a,b,c,d,e,f,g){openPopupFocus(a.replace("#","%23"),b,c,d,e,f,g)}
function openPopupFocus(a,b,c,d,e,f,g,j){closePopup();if(f){if(lastMouseX-c<0)lastMouseX=c;if(lastMouseY+d>screen.height)lastMouseY-=lastMouseY+d+50-screen.height;lastMouseX-=c;lastMouseY+=10;e+=",screenX="+lastMouseX+",left="+lastMouseX+",screenY="+lastMouseY+",top="+lastMouseY}if(g){curPopupWindow=window.open(a,b,e,false);curPopupWindow.focus()}else{win=window.open(a,b,e,false);win.focus()}if(j)closeOnParentUnloadWindow=win}
function openPopupFocusWithOffset(a,b,c,d){win=window.open(a,"",b);win.moveTo(window.pageXOffset+c,window.pageYOffset+d);win.focus()}var closetimer,ie9=navigator.userAgent.indexOf("MSIE 9")>=0;function closePopupOnBodyFocus(){if(ie9){closetimer&&clearTimeout(closetimer);closetimer=window.setTimeout(function(){closetimer=null;closePopup()},500)}else closePopup()}
function closePopup(){if(closetimer){clearTimeout(closetimer);closetimer=null}if(curPopupWindow!=null){try{if(curPopupWindow.confirmOnClose)if(curPopupWindow.confirm(curPopupWindow.confirmOnCloseLabel)){curPopupWindow.confirmOnClose=false;curPopupWindow.focus();return false}curPopupWindow.close()}catch(a){}curPopupWindow=null}}var modalWindow=null;function ignoreModalEvents(){return false}
function handleModalFocus(){if(modalWindow)if(modalWindow.closed){window.top.releaseEvents(Event.CLICK|Event.FOCUS);window.top.onclick=""}else modalWindow.focus();return false}function invokeResultFunc(){(window.dialogArguments?window.dialogArguments:window.opener.resultFunc)()}
function openPopupModal(a,b,c,d,e,f,g){if(window.showModalDialog)window.showModalDialog(a,f==null?window:f,e);else if(window.top.captureEvents){window.top.captureEvents(Event.CLICK|Event.FOCUS);window.top.onclick=ignoreModalEvents;window.top.onfocus=handleModalFocus;modalWindow=window.open(a,b,e+",modal=yes");if(f)window.resultFunc=f}else{if(g)return g();return openPopup(a,b,c,d,e,false)}}var clickedLink,warningText;
function confirmPopup(a,b,c,d,e,f){clickedLink=e.href?e.href:e;warningText=f;e=new Function("window.location = clickedLink");e.window=window;openPopupModal(a,"_blank",b,c,d,e,new Function("return confirm(warningText)"));return false}function openLookup(a,b,c,d){if(c=="1")a+=d;openPopup(a,"lookup",350,480,"width="+b+",height=480,toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no",true)}
function pick(a,b,c,d){document.getElementById(a)[b].value=c;if(d)document.getElementById(a)[b].onchange();closePopup();return false}function pickSubmit(a,b,c,d){document.getElementById(a)[b].value=c;if(d)document.getElementById(a)[b].onchange();document.getElementById(a).submit();closePopup();if(!hiddenOrDisabled(document.getElementById(a)[b])){document.getElementById(a)[b].focus();document.getElementById(a)[b].select()}return false}
function hiddenOrDisabled(a){do{if(a==null||a.type=="hidden"||a.disabled||getCurrentStyle(a,"display")=="none"||getCurrentStyle(a,"visibility")=="hidden")return true;a=a.parentNode}while(a!=null&&a.tagName!="BODY");return false}function hiddenOrDisabledOrReadOnly(a){do{if(a==null||a.type=="hidden"||a.readOnly||a.disabled||getCurrentStyle(a,"display")=="none"||getCurrentStyle(a,"visibility")=="hidden")return true;a=a.parentNode}while(a!=null&&a.tagName!="BODY");return false}
function pickcolor(a,b,c){var d=parseInt(c,16);a=document.getElementById(a)[b];if(a.setValue)a.setValue(d);else a.value=d;document.getElementById(b+"cell").style.backgroundColor="#"+c;closePopup();return false}function comboBoxPick(a,b,c,d){a=document.getElementById(a)[b];if(a!=null){c=eval(c);if(c!=null)if(d>=0&&d<c.length){a.value=c[d];if(!hiddenOrDisabled(a)){a.focus();a.select()}}}closePopup();return false}
function attachEventToElement(a,b,c){if(a.addEventListener)a.addEventListener(b,c,false);else a.attachEvent&&a.attachEvent("on"+b,c)}function navigateToUrl(a){window.location=a}
function hitUrl(a){var b=document.getElementsByTagName("body")[0],c=document.getElementById("goToUrlFrame");if(!c){c=document.createElement("div");c.style.display="none";b.appendChild(c);c.innerHTML='<iframe src="javascript:false" style="display:none;" id="goToUrlFrame" name="goToUrlFrame"></iframe>';c=document.getElementById("goToUrlFrame");c.title="blank - ignore"}c=document.createElement("form");b.appendChild(c);c.target="goToUrlFrame";c.method="POST";c.action=a;c.submit();b.removeChild(c)}
function doLookupPick(a,b,c,d,e,f,g,j,l){var h=b.parentIdElement,k=b.parentEditElement,m=k.name,n=b.parentEditOldValueElement;if(h.type=="select-one"){e=false;for(i=0;i<h.options.length;i++)if(h.options[i].value==c){h.selectedIndex=i;e=true;break}if(!e){h.options[h.options.length]=new Option(d,c);h.selectedIndex=h.options.length-1}k.value=d;n.value=d;if(!hiddenOrDisabled(h)&&typeof h.onchange=="function"){c=h.value;XBrowser.fireEvent&&XBrowser.fireEvent(h,"change");h.value=c;k.value=d}}else{if(b.extraNameElement)if(f){if(typeof b.extraNameElement.value!==
"undefined"&&(b.extraNameElement.value.length==0||b.extraNameElement.value==k.value))b.extraNameElement.value=d}else if(e||b.extraNameElement.value==null||b.extraNameElement.value=="")if(j!=null&&j!=""){b.extraNameElement.value=j;if(b.extraIdElement)b.extraIdElement.value=l;if(b.extraEditOldValueElement)b.extraEditOldValueElement.value=j}h.value=c;k.value=d;n.value=d;window.ForeignKeyInputElement&&ForeignKeyInputElement.dispatchLookupChange(k.name);if(window.sfdcPage&&sfdcPage.getFieldById)(n=sfdcPage.getFieldById(k.name))&&
n.lookupPickCalled();if(!hiddenOrDisabled(k)&&typeof k.onchange=="function"){window.XBrowser.fireEvent&&XBrowser.fireEvent(k,"change");h.value=c;k.value=d}}if(b.relatedFieldElement)b.relatedFieldElement.value=g;var o=getElementByIdCS(m+"_onpk");o&&o.value!=""&&setTimeout(function(){eval(o.value)},1);if((d=getElementsByNameCS(m+"_lspf")[0])&&d.value=="1"){if(m=getElementsByNameCS(m+"_lspfsub")[0])m.value="1";document[a].submit()}if(b.modElement)b.modElement.value="1";closePopup();if(!hiddenOrDisabled(k)){k.focus();
k.select()}return false}function lookupPick(a,b,c,d,e,f,g,j){b={parentIdElement:getElementsByNameCS(b)[0],parentEditElement:getElementsByNameCS(c)[0],parentEditOldValueElement:getElementsByNameCS(c+"_lkold")[0],relatedFieldElement:getElementsByNameCS(d)[0],extraNameElement:getElementsByNameCS(j)[0],modElement:getElementsByNameCS(c+"_mod")[0]};return doLookupPick(a,b,e,f,false,true,g)}
function lookupPick2(a,b,c,d,e,f,g,j,l,h){b={parentIdElement:getElementsByNameCS(b)[0],parentEditElement:getElementsByNameCS(c)[0],parentEditOldValueElement:getElementsByNameCS(c+"_lkold")[0],extraNameElement:getElementsByNameCS(f)[0],extraIdElement:getElementsByNameCS(j)[0],extraEditOldValueElement:getElementsByNameCS(f+"_lkold")[0],modElement:getElementsByNameCS(c+"_mod")[0]};return doLookupPick(a,b,d,e,h,false,null,g,l)}
function searchEntityTwo(a,b,c){b=document.getElementById(b);if(a){b.checked=true;if(a=document.getElementsByName(c))for(i=0;i<a.length;++i)if(a[i]!=b)a[i].checked=false}else b.checked=false}function lookupPhonePick(a,b){var c=document.getElementById(a);c.value=b;closePopup();c.focus();c.select()}function setFocusOnLoad(){beenFocused||setFocus()}function elementFocus(a){hiddenOrDisabled(a)||a.focus()}function elementSelect(a){hiddenOrDisabled(a)||a.select()}
function setFocus(){for(var a=1;a<5;a++)for(var b=a,c=0;c<document.forms.length;c++)for(var d=0;d<document.forms[c].elements.length;d++){var e=document.forms[c].elements[d];if(e.tabIndex==b)if((e.type=="text"||e.type=="textarea"||e.type=="password")&&!hiddenOrDisabledOrReadOnly(e)&&e.name!="sbstr"&&e.name.indexOf("owner")!=0&&e.name.indexOf("tsk1")!=0&&e.name.indexOf("evt1")!=0){e.focus();e.type=="text"&&!hiddenOrDisabledOrReadOnly(e)&&e.select();return true}else{b++;d=0}}for(c=0;c<document.forms.length;c++)if(document.forms[c].name!=
"sbsearch"&&document.forms[c].name!="srch_solution_sbar"&&document.forms[c].name!="srch_product_sbar"&&document.forms[c].name!="srch_document_sbar"&&document.forms[c].name!="srch_article_sbar")for(d=0;d<document.forms[c].elements.length;d++){e=document.forms[c].elements[d];if((e.type=="text"||e.type=="textarea"||e.type=="password")&&!hiddenOrDisabledOrReadOnly(e)&&e.name.indexOf("owner")!=0&&!hiddenOrDisabledOrReadOnly(e)){e.focus();e.type=="text"&&!hiddenOrDisabledOrReadOnly(e)&&e.select();return true}}return true}
function setNamedFocus(a){for(var b=0;b<document.forms.length;b++)for(var c=0;c<document.forms[b].elements.length;c++){var d=document.forms[b].elements[c];if(d.name==a&&!hiddenOrDisabled(d)){d.focus();d.type=="text"&&!hiddenOrDisabled(d)&&d.select();return true}}return true}function formatPhoneOnEnter(a,b){getEvent(b).keyCode==KEY_ENTER&&formatPhone(a)}
function formatPhone(a){a.value=trim(a.value);var b=a.value,c="",d=-1;if(0<b.length&&"+"!=b.charAt(0)){var e=0;if("1"==b.charAt(0))b=b.substring(1,b.length);for(i=0;i<b.length;i++){var f=b.charAt(i);if(f>="0"&&f<="9"){if(e==0)c+="(";else if(e==3)c+=") ";else if(e==6)c+="-";c+=f;e++}if(!(f>="0"&&f<="9")&&f!=" "&&f!="-"&&f!="."&&f!="("&&f!=")"){d=i;break}}if(d>=0)c+=" "+b.substring(d,b.length);if(e==10&&c.length<=40)a.value=c}return true}
function clearcols(){for(var a=0;a<document.forms.length;a++)for(var b=0;b<document.forms[a].elements.length;b++){var c=document.forms[a].elements[b];if(c.name=="c"||c.name.substring(0,2)=="c_")c.checked=false}}function setcols(){for(var a=0;a<document.forms.length;a++)for(var b=0;b<document.forms[a].elements.length;b++){var c=document.forms[a].elements[b];if(c.name=="c"||c.name.substring(0,2)=="c_")c.checked=true}}
function setUsername(a,b,c,d){if(a.value.length==0)a.value=b.value.substring(0,1).toLowerCase()+c.value.toLowerCase()+"@"+d.value}function setAlias(a,b,c){if(a.value.length==0)a.value=b.value.substring(0,1).toLowerCase()+c.value.substring(0,4).toLowerCase()}function popWin(a){closePopup();curPopupWindow=window.open(a,"win","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=550,height=300",false)}
function popWin2(a){win=window.open(a,"win","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=720,height=500",false)}function adminWin(a){win=window.open(a,"win","toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600",false)}function printWin(a){popWin=window.open(a,"win","dependent=no,toolbar=1,directories=0,location=0,status=1,menubar=1,scrollbars=1,resizable=1,width=705,height=400",false);popWin.focus()}
function moveSelectElement3(a,b,c,d,e){if(a.selectedIndex>-1){for(i=0;i<a.length;++i){var f=a.options[i];if(f.selected)if(f.text!=c){var g=new Option(f.text,f.value);g.title=f.title;if(b.options.length>0&&b.options[0].text==d){b.options[0]=g;b.selectedIndex=0}else{b.options[b.options.length]=g;b.selectedIndex=b.options.length-1}}else a.selectedIndex=-1}e||removeSelectElement3(a,c)}}function sortOrderNumeric(a,b){return a-b}function sortOrderNumericReverse(a,b){return b-a}
function moveSelectElementIds(a,b,c,d,e){if(c){b=b.options;for(i=0;i<c.length;i++){var f=a.options[c[i]],g=new Option(f.text,f.value);g.title=f.title;if(b.length==1&&b[0].text==e){b[0]=g;b[0].selected=true}else b[b.length]=g}if(!d){c=c.sort(sortOrderNumericReverse);for(i=0;i<c.length;i++)a.options[c[i]]=null;if(a.length==0){c=new Option(e,e);a.options[0]=c}}}}function moveOption(a,b,c,d,e,f,g,j,l){DuelingListBoxesElement.moveOption(a,b,c,d,e,f,g,j,l)}
function removeSelectElement3(a,b){if(a.selectedIndex>-1){for(i=a.length-1;i>-1;i--)if(a.options[i].selected)a.options[i]=null;if(a.length==0){var c=new Option(b,b);a.options[0]=c}}}function moveUp(a,b,c,d,e){return DuelingListBoxesElement.moveUp(a,b,c,d,e)}function moveDown(a,b,c,d,e){return DuelingListBoxesElement.moveDown(a,b,c,d,e)}function moveTop(a,b){return DuelingListBoxesElement.moveTop(a,b)}function moveBottom(a,b){DuelingListBoxesElement.moveBottom(a,b)}
function saveAllSelected(a,b,c,d,e){DuelingListBoxesElement.saveAllSelected(a,b,c,d,e)}function ddChangeAllElements(a,b){var c=a.selectedIndex;if(c>0)for(var d=0;d<b.length;d++){var e=getElementByIdCS(b[d]);if(e)e.selectedIndex=c-1}}function ddElementChange(a,b,c){a=getElementByIdCS(b[0]).selectedIndex;for(var d=1;d<b.length;d++)if(getElementByIdCS(b[d]).selectedIndex!=a){a=-1;break}getElementByIdCS(c).selectedIndex=a+1}
function ddRadioClicked(a,b,c){a=a.value=="all";document.getElementById(c).disabled=!a;for(var d=0;d<b.length;d++){var e=getElementByIdCS(b[d]);if(e)e.disabled=a;if(a){var f=getElementByIdCS(c).selectedIndex;if(f>0)e.selectedIndex=f-1}}}
function openwizard(a,b,c){b=window.open("",b,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable="+c+",width=700,height=550,screenx=50,screeny=10,left=50,top=10",false);if(b.document.URL==""||b.document.URL=="about:blank")b.location=a;b.focus()}function openwizard2(a,b,c){window.open(a,b,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable="+c+",width=700,height=550,screenx=50,screeny=10,left=50,top=10",false)}
function escapeUTF(a){var b="";for(i=0;i<a.length;i++){var c=a.charCodeAt(i);if(c<=127)b+=escape(a.charAt(i));else if(c<=2047)b+="%"+(c>>6|192).toString(16)+"%"+(c&63|128).toString(16);else if(c>=2048)b+="%"+(c>>12|224).toString(16)+"%"+(c>>6&63|128).toString(16)+"%"+(c&63|128).toString(16)}return b}function openRefer(a){window.open(a,"referv2","resizable=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=420,height=500",false)}
function changeOpenerWindowLocation(a){if(window.top.opener==null||window.top.opener.closed)window.top.open(a);else{window.top.opener.location.href=a;window.top.opener.focus()}}function verifyUnderLimit(a,b,c,d){var e=0;for(i=0;i<a.elements.length;i++)if(a.elements[i].name==b&&a.elements[i].checked)if(++e>c){alert(d);return false}return true}function verifyChecked(a,b,c){for(i=0;i<a.elements.length;i++)if(a.elements[i].name==b&&a.elements[i].checked)return true;alert(c);return false}
function verifyCheckedByPrefix(a,b,c){for(i=0;i<a.elements.length;i++)if(a.elements[i].name.indexOf(b)==0&&a.elements[i].checked)return true;alert(c);return false}function verifySingleCheckedByPrefix(a,b,c){var d=0;for(i=0;i<a.elements.length;i++)a.elements[i].name.indexOf(b)==0&&a.elements[i].checked&&d++;if(d==1)return true;alert(c);return false}
function verifyCheckedWarning(a,b,c){var d=false;for(i=0;i<a.elements.length;i++)if(a.elements[i].name==b&&a.elements[i].checked)d=true;if(d)return window.confirm(c);return true}function submitFormActionURL(a,b){a.action=b;a.submit()}function updateToggleAllBox(a,b,c){var d=null;if(typeof c!="undefined")d=document.getElementById(c);else if(a.allBox)d=a.allBox;if(d!=null)d.checked=allChecked(a,b)}
function allChecked(a,b){var c=0;for(c=0;c<a.elements.length;c++){var d=a.elements[c];if(d.name==b&&d.type=="checkbox"&&d.checked==false)return false}return true}function SelectChecked(a,b,c){var d=0;for(d=0;d<a.elements.length;d++)if(a.elements[d].name==b&&a.elements[d].disabled==false)a.elements[d].checked=c}function SelectAllOrNoneByCheckbox(a,b,c){for(var d=c.parentNode;d&&d.tagName!=="form";)d=d.parentNode;if(d!=null)a=d;SelectChecked(a,b,c.checked)}
function getLoginCookieValue(){var a=document.cookie,b=a.indexOf("login=");if(b==-1)return"";b+=6;var c=a.indexOf(";",b);if(c==-1)c=a.length;return a.substring(b,c)}function loader(){var a=getLoginCookieValue();if(a.length>0){document.login_noop.un_noop.value=a;document.login.un.value=a;document.login.pw.focus()}else document.login_noop.un_noop.focus();document.login.width.value=screen.width;document.login.height.value=screen.height}
function handleSelectAllNoneCheckboxClick(a,b){for(var c=0;c<b.length;c++){var d=document.getElementById(b[c]);if(d)d.checked=a.checked}}function getObjX(a){for(var b=0;a!=null;){b+=a.offsetLeft;a=a.offsetParent}return b}function getObjY(a){for(var b=0;a!=null;){b+=a.offsetTop;a=a.offsetParent}return b}
function getScrollX(){if(window.pageXOffset)return window.pageXOffset;if(document.documentElement&&document.documentElement.scrollLeft)return document.documentElement.scrollLeft;if(document.body.scrollHeight)return document.body.scrollLeft}function getScrollY(){if(window.pageYOffset)return window.pageYOffset;if(document.documentElement&&document.documentElement.scrollTop)return document.documentElement.scrollTop;if(document.body.scrollWidth)return document.body.scrollTop}
function getMouseX(a){if(a.pageX)return a.pageX;return getScrollX()+a.clientX}function getMouseY(a){if(a.pageY)return a.pageY;return getScrollY()+a.clientY}function getSrcElement(a){a=getEvent(a);if(a.srcElement)return a.srcElement;return a.currentTarget}function ltrim(a){return a.replace(/^\s*/,"")}function rtrim(a){return a.replace(/\s*$/,"")}function trim(a){return rtrim(ltrim(a))}
function escapeHTML(a){if(a&&a.replace){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;")}return a}function unescapeHTML(a){if(a&&a.replace){a=a.replace(/\&amp;/g,"&");a=a.replace(/&lt;/g,"<");a=a.replace(/&gt;/g,">")}return a}function unescapeJsInHtml(a){if(a&&a.replace){a=a.replace(/\\\\/g,"\\");a=a.replace(/\\'/g,"'");a=a.replace(/\\n/g,"\n");a=a.replace(/&quot;/g,'"')}return a}
function unescapeXML(a){if(a&&a.replace){a=a.replace(/\&amp;/g,"&");a=a.replace(/&lt;/g,"<");a=a.replace(/&gt;/g,">");a=a.replace(/&quot;/g,'"');a=a.replace(/&apos;/g,"'")}return a}
function isValidEmail(a,b){if(!a)return false;a=a.toLowerCase();var c=a.split("@");if(c.length!=2)return false;if(c[1].indexOf(".")<0)return false;if(b){for(var d=b.split(","),e=0;e<d.length;e++){var f=d[e];if(c[1]==f)return true;if(c[1].indexOf(f,c[1].length-f.length)>0&&c[1].charAt(c[1].length-f.length-1)==".")return true}return false}return true}function setCookie(a,b,c,d,e){document.cookie=a+"="+(e?encodeURIComponent:escape)(b)+(c?"; expires="+c.toGMTString():"")+(d?"; path="+d:"; path=/")}
function getCookie(a){var b=document.cookie;a+="=";var c=b.indexOf("; "+a);if(c==-1){c=b.indexOf(a);if(c!=0)return null}else c+=2;var d=document.cookie.indexOf(";",c);if(d==-1)d=b.length;return unescape(b.substring(c+a.length,d))}function deleteCookie(a,b){if(getCookie(a)){var c=new Date((new Date).getTime()+-1E4);document.cookie=a+"=-deleted-"+(b?"; path="+b:"; path=/")+"; expires="+c.toGMTString()}}
function addTwistCookie(a,b,c){var d=getCookie(a);c=b+":"+(c?"1":"0")+",";if(d){for(var e=d.indexOf(b);e>-1;){var f=e+18;d.substring(e,f);d=d.substring(0,e)+d.substring(f,d.length);e=d.indexOf(b)}c=d+c}setCookie(a,c)}
function handleTextAreaElementChange(a,b,c,d){textAreaTimer&&clearTimeout(textAreaTimer);textAreaTimer=setTimeout(function(){var e=document.getElementById(a),f=document.getElementById(a+"_counter");if(!e||!f)return b;var g=e.value.length;if(g>0&&!(isIE||isIE5))if(e=e.value.match(/\n/g))g+=e.length;g=b-g;if(g<0){f.parentNode.className="textCounterMiddle over";f.innerHTML=-1*g+" "+d}else if(g<50){f.parentNode.className="textCounterMiddle warn";f.innerHTML=g+" "+c}else f.parentNode.className="textCounterMiddle"},
500)}var filterLookupValueElem;
function openFilterLookupWindow(a,b,c,d){filterLookupValueElem=d;c=document.getElementById(c);c=typeof c.selectedIndex=="number"?c.options[c.selectedIndex]:c;if(a!=null||b==null){a=document.getElementById(a);d=a.action;var e=a.target,f=a.lookup.value;if(b!=null)a.action=b;a.target="filter_lookup";a.lookup.value=c.value;a.submit();a.action=d;a.target=e;a.lookup.value=f}else{a=b.indexOf("?")>=0?"&":"?";curPopupWindow.location.href=b+a+"lookup="+c.value+"&workflow=1"}}
function submitCalcAgg(a,b){var c=document.report;if(!c)c=opener.document.report;c.target="aggcalc_popup";c.calcagg_request.value=a;c.calcagg_index.value=b;if(a=="new")clearCalcAgg(c,"_v");else if(a=="edit")copyCalcaggParams(c,b,c,"_v");else if(a=="done"||a=="validate"){var d=document.getElementById("calcagg_form");copyCalcaggParams(d,"_v",c,"_v")}c.nav.value="agg";c.submit();c.calcagg_request.value="";c.target=""}
function finishValidCalcAgg(a){var b=opener.document.getElementById("report"),c=document.getElementById("calcagg_form");b.calcagg_index.value=a;copyCalcaggParams(c,"_v",b,a);b.calcagg_active_v.value=c.calcagg_name_v.value;b.nav.value="agg";b.submit();self.close()}var calcagg_params=["calcagg_label","calcagg_name","calcagg_formula","calcagg_type","calcagg_desc","calcagg_scale"];function clearCalcAgg(a,b){for(var c in calcagg_params)a[calcagg_params[c]+b].value=""}
function deleteCalcAgg(a){var b=document.getElementById("report");clearCalcAgg(b,a);b.nav.value="agg";b.submit()}function copyCalcaggParams(a,b,c,d){for(var e in calcagg_params)c[calcagg_params[e]+d].value=a[calcagg_params[e]+b].value}function getIframeContents(a){return(a.contentDocument||a.contentWindow.document).body.innerHTML}
function adjustIFrameSize(a){if(a){var b;if(a.contentDocument)b=a.contentDocument.body.offsetHeight;else{b=document.frames&&document.frames(a.id)?document.frames(a.id).document.body:a.document.body;b=b.children.length<=0?0:b.scrollHeight}var c=a.height-b;if(c<0)c=-c;if(c>15)a.height=b}}function showTextStateField(a,b){a.style.display="";b.style.display="none"}
function showPicklistStateField(a,b,c){var d=a[0];a=a[1];c.options.length=1;for(i=0;i<d.length;i++)c.options[i+1]=new Option(d[i],a[i]);b.style.display="none";c.style.display=""}function showStateListForCountry(a,b,c,d){a=b[a];c.value="";a?showPicklistStateField(a,c,d):showTextStateField(c,d)}
function scaleImage(a,b,c){if(XBrowser.userAgent.isIE7)if(a.width===0){setTimeout(function(){scaleImage(a,b,c)},10);return}var d=a.width*b/a.height,e=b;if(d>c){d=c;e=a.height*c/a.width}if(d<a.width||e<a.height){a.width=d;a.height=e}if(XBrowser.userAgent.isIE7)a.style.visibility="visible"}function refreshWizardPage(a){var b=document.getElementById("goRefresh");if(b.value!="goRefresh"){b.value="goRefresh";b=document.getElementById("stageForm");b.action+=a;b.submit()}}
function getOffsetLeft(a){if(!a)return 0;for(var b=a.offsetLeft;a.offsetParent;){a=a.offsetParent;b+=a.offsetLeft}return b}function getWindowWidth(){if(typeof window.innerWidth=="number")return window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)return document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)return document.body.clientWidth}
function getWindowHeight(){if(typeof window.innerHeight=="number")return window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)return document.body.clientHeight}
function getScrollTop(){if(self.pageYOffset)return self.pageYOffset;else if(document.documentElement&&document.documentElement.scrollTop)return document.documentElement.scrollTop;else if(document.body)return document.body.scrollTop}function getScrollLeft(){if(self.pageXOffset)return self.pageYOffset;else if(document.documentElement&&document.documentElement.scrollLeft)return document.documentElement.scrollLeft;else if(document.body)return document.body.scrollLeft}
function hasStyleClass(a,b){return(" "+a.className+" ").indexOf(" "+b+" ")>=0}function addStyleClass(a,b){if((" "+a.className+" ").indexOf(" "+b+" ")<0)a.className+=a.className&&a.className.length>0?" "+b:b}function delStyleClass(a,b){var c=" "+a.className+" ",d=b.length,e=c.indexOf(" "+b+" ");if(e>=0){d=e+d+1;a.className=trim(c.substring(0,e)+c.substring(d,c.length))}}function hiOn(a){a!=null&&addStyleClass(a,"highlight")}function hiOff(a){a!=null&&delStyleClass(a,"highlight")}
function toggleVis(a){a.style.visibility=a.style.visibility=="hidden"?"visible":"hidden"}function toggleVisWithPositionAbsolute(a){if(a=document.getElementById(a)){toggleVis(a);a.style.position=a.style.position=="absolute"?"static":"absolute"}}function setVis(a,b){a.style.visibility=b?"visible":"hidden"}
function toggleVisWIframe(a){var b=document.getElementById(a.id+"_iframe");if(typeof b!="undefined")if(a.style.visibility=="hidden"){b.style.left=a.offsetLeft;if(b.style.left==a.offsetLeft+"px"){b.style.top=a.offsetTop;b.style.width=a.offsetWidth;b.style.height=a.offsetHeight;b.style.display="block"}}else b.style.display="none";toggleVis(a)}function formatMessage(a){var b=arguments;return a.replace(/\{([0-9]*)\}/g,function(c,d){return b[parseInt(d)+1]})}
function highlightToc(a,b){top.frames.frames.body&&top.frames.body.frames.toc&&top.frames.body.frames.toc.document.getElementById("fullyLoadedDiv")&&top.frames.body.frames.toc.HTMLTreeNode.prototype.openHTMLTree(a,b)}function loadToc(a){var b=top.frames.body.frames.content.location.href;b=b.substring(b.lastIndexOf("/")+1,b.indexOf(".htm"));top.frames.body.frames.toc.location.href=a+"?item="+b+"&section=none"}
function deepCopy(a,b){var c=b.createElement(a.tagName);if(typeof a.attributes!="undefined"&&a.attributes!=null)for(var d=0;d<a.attributes.length;d++)c.setAttribute(a.attributes[d].name,a.attributes[d].value);a.nodeValue!=null&&c.appendChild(b.createTextNode(a.nodeValue));if(typeof a.childNodes!="undefined"&&a.childNodes!=null)for(d=0;d<a.childNodes.length;d++)c.appendChild(deepCopy(a.childNodes[d],b));return c}
function borrowForm(a,b,c){a=document.getElementById(a);var d=a.action,e=a.target;if(b!=null)a.action=b;if(c!=null)a.target=c;if(a.onsubmit)a.onsubmit();a.submit();a.action=d;a.target=e}function toggleRow(a,b){var c=document.getElementById(a);if(c!=null){for(;c!=null&&c.tagName!="TR";)c=c.parentNode;toggleDisplay(c,b)}}function setRowVis(a,b){var c=document.getElementById(a);if(c!=null){for(;c!=null&&c.tagName!="TR";)c=c.parentNode;c!=null&&setVis(c,b)}}
function toggleDisplay(a,b){if(a!=null)a.style.display=isIE&&!isOpera?b?"block":"none":b?"table-row":"none"}function toggleDisplayWithDisplayType(a,b,c){var d=document.getElementById(a);if(d){b||(b="block");if(c)d.style.display=="none"?Animation.rollIn(d,function(){d.style.display=b}):Animation.rollOut(d);else d.style.display=d.style.display=="none"?b:"none"}}function getElementsByNameCS(a){for(var b=document.getElementsByName(a),c=[],d=0;d<b.length;d++)b[d].name==a&&c.push(b[d]);return c}
function getElementByIdCS(a){return getElementByIdCSWithDoc(document,a)}function getElementByIdCSWithDoc(a,b){var c=a.getElementById(b);if(c==null||c.id==b)return c;if(a.all)return a.all[b];return null}
function getElementsByClassName(a,b,c){if(!b)b=document.body;if(b.getElementsByClassName){var d=b.getElementsByClassName(a);if(strTagNameUpper=c?c.toUpperCase():null)if(Array.filter)return Array.filter(d,function(f){return f.nodeName==strTagNameUpper});else{c=[];a=d.length;for(b=0;b<a;b++)d[b].nodeName==strTagNameUpper&&c.push(d[b]);return c}else return d}c||(c="*");d=c=="*"&&b==document.body&&document.all?document.all:b.getElementsByTagName(c);c=[];a=a.replace(/\-/g,"\\-");var e=RegExp("\\b"+a+"\\b");
a=d.length;for(b=0;b<a;b++)e.test(d[b].className)&&c.push(d[b]);return c}function EventData(a,b,c,d){this.element=a;this.type=b;this.handler=c;this.useCapture=d}
var eventRegistry,addEvent=function(){if(window.addEventListener)return function(a,b,c,d){a.addEventListener(b,c,d);if(!eventRegistry){eventRegistry=[];window.addEventListener("unload",cleanupEvents,false)}eventRegistry.push(new EventData(a,b,c,d))};else if(window.attachEvent)return function(a,b,c){var d=a.attachEvent("on"+b,c);if(!eventRegistry){eventRegistry=[];window.attachEvent("onunload",cleanupEvents)}eventRegistry.push(new EventData(a,b,c));return d};return function(){return null}}(),removeEvent=
function(){if(window.removeEventListener)return function(a,b,c,d){a.removeEventListener(b,c,d)};else if(window.detachEvent)return function(a,b,c){a.detachEvent("on"+b,c)};return function(){return null}}();function cleanupEvents(){if(eventRegistry){for(var a=0;a<eventRegistry.length;a++){var b=eventRegistry[a];removeEvent(b.element,b.type,b.handler,b.useCapture)}eventRegistry=null;removeEvent(window,"unload",cleanupEvents,false)}}
function mouseExited(a,b){for(var c=getEventToElement(a);c&&c!=document.body;){if(c==b)return false;c=c.parentNode}return true}function getEvent(a){return a||window.event}function getEventTarget(a){return window.event?a.srcElement:a.target}function getEventToElement(a){return a.relatedTarget?a.relatedTarget:a.toElement}function eventCancelBubble(a){a.cancelBubble=true;a.stopPropagation&&a.stopPropagation()}function dashify(a){return a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}
function getCurrentStyle(a,b){var c;if(a.currentStyle)c=a.currentStyle[b];else if(document.defaultView&&document.defaultView.getComputedStyle)c=(c=document.defaultView.getComputedStyle(a,null))?c.getPropertyValue(dashify(b)):null;else c=null;return c}
function copyAddr(a,b,c,d,e,f,g,j,l,h,k,m){document.getElementById(f).value=document.getElementById(a).value;document.getElementById(g).value=document.getElementById(b).value;document.getElementById(j).value=document.getElementById(c).value;document.getElementById(l).value=document.getElementById(d).value;if(k&&m)document.getElementById(h).value=document.getElementById(e).value}
function showMoreList(a,b,c){Sfdc.warn("Legacy Function showMoreList was called, use RelatedList.get(listId).showMoreList() instead.");RelatedList.get(c).showMoreList(a,b)}function callRelatedListAction(a,b,c,d,e,f){Sfdc.warn("Legacy Function callRelatedListAction was called, use RelatedList.get(listId).callRelatedListAction() instead.");RelatedList.get(d).callRelatedListAction(a,b,c,null,null,e,f)}
function makeAjaxRequest(a,b){if(window.XMLHttpRequest)xmlhttp=new XMLHttpRequest;else if(window.ActiveXObject)xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");else return false;xmlhttp.open("GET",a,true);xmlhttp.onreadystatechange=function(){xmlhttp.readyState==4&&b&&b(xmlhttp.responseText)};xmlhttp.send(null)}function assureInt(a){var b;return isNaN(b=parseInt(a))?0:b}
function setElementsEnabledBasedOnCheckbox(a,b){function c(f,g){var j=document.getElementById(g);if(j)j.style.display=f.checked?"":"none"}var d=document.getElementById(a);if(d!=null&&b!=null)for(var e=0;e<b.length;e++)c(d,b[e])}
function registerClickToDial(a,b){var c;if(self.getAccessibleParentWindow)c=getAccessibleParentWindow(self);else if(self.location.pathname==="/"+IFrameElement.EmptyRelatedListDoc)try{c=self.parent}catch(d){c=null}else c=self;if(c&&c.registerClickToDialEnabled)b?c.registerClickToDialEnabled(a):c.registerClickToDialDisabled(a)}function stripDomainFromUrl(a){var b=a.indexOf("://");if(-1!=b){a=a.substring(b+3);a=a.substring(a.indexOf("/"))}return a}function bodyOnFocus(){}
function showDebugLog(a,b){if(a){setCookie("showDebugLog","PROFILING");setCookie("showExecute",b);XBrowser.createDynamicScript("/apexdebug/log4javascript.js",function(){XBrowser.createDynamicScript("/apexdebug/apexdebuglog.js",function(){initSystemLogUi(true)})})}else{deleteCookie("showDebugLog");b||deleteCookie("showExecute")}}var debugLogWindow;function getDebugLogWindow(){return debugLogWindow&&!debugLogWindow.closed?debugLogWindow:null}function setDebugLogWindow(a){debugLogWindow=a}
function checkDebugLogWindowExists(){var a=debugLogWindow&&debugLogWindow.open&&!debugLogWindow.closed;if(!a&&getCookie("showDebugLog")){deleteCookie("showDebugLog");deleteCookie("showExecute")}return a}isIE7&&window.attachEvent("onunload",function(){for(var a=document.body.getElementsByTagName("iframe"),b=0;b<a.length;b++)if(a[b].id&&a[b].id.substring(0,3)==="066"){a[b].src="javascript:false";a[b].parentNode.removeChild(a[b])}});
var ScheduleElement={pFreq:"freq",pStartDate:"start",pMonthlyOnDayN:"mdom",pEndDate:"end",pDailyEveryNDays:"dn",pMonthlyRec:"mr",pMonthlyOnNDayOfWeek:"mdn",pMonthlyOnNthDay:"mond",pPrefTimeLoadingDiv:"prefTimeLoad",pPrefTimeLabelDiv:"prefTimeLabel",pOuterBox:"outerBox",pDailyRec:"dr",pOtherPrefTimeLabelDiv:"otherPrefTimeLabel",pDayOfWeek:"ww",pPrefTime:"pst",pPrefTimeDiv:"prefTime"},VisualforceConstants={SHOW_BUTTONS:"visualforce_showbuttons",CURRENT_VALUE:"currentValue",CHANGED_STYLE_CLASS:"visualforce_changedStyleClass",
RESET_FUNCTION:"visualforce_resetFunction",PICKLIST_INFO:"visualforce_picklist",ERROR:"visualforce_error",LABEL:"visualforce_label",HIDE_BUTTONS:"visualforce_hidebuttons",UPDATE_VALUE:"UV",FCK_LIBRARY:"",IFRAME_SUFFIX:"___Frame",EDITOR_NAME:"SFDC_INTERNAL_EDITOR"},ReportChartMetadataServlet={SERVLETURL:"analytics.reporting.chart.ReportChartMetadataServlet",REPORT_CHART_AGGS:"chartAggs",SUCCESS:"success",HAS_CHART:"hasChart",TOPN:"topN",REPORT_CHART_DIMS:"chartDims",REPORT_ID:"reportId"},BlowoutServlet=
{SERVLETURL:"/_ui/system/scheduler/cron/ScheduleBlowoutServlet",SUCCESS:"success",BLOWOUT:"blowout",SUFFIX:"suf"},RuleFilterPageConstants={NO_REASSIGN_SUFFIX:"_noReassign"},UnifiedSearchUI={GLOBAL_SEARCH_CLEAR_BUTTON_DEFAULT_CLASS:"headerSearchClearButton",CSS_CLASS_SUMMARY_VIEW_SHOW_MORE_LINK:"summaryShowMoreLink",HEADER_SEARCH_SCOPE_LINK_ID:"phChangeScopeLink",GLOBAL_SEARCH_SUGGESTED_SCOPES:"suggestedScopes",GLOBAL_SEARCH_CLEAR_BUTTON_ID:"phSearchClearButton",GLOBAL_SEARCH_BUTTON_ID:"phSearchButton",
MAX_VALID_MRU_SUGGESTIONS:10,SEARCH_SCOPE_DIALOG_WIDTH:655,HEADER_SEARCH_OPTIONS_CONTAINER_ID:"searchOptionsContainer",GLOBAL_SEARCH_P1_ENHANCEMENTS:"globalSearchP1Enhancements",GLOBAL_SEARCH_P2_ENHANCEMENTS:"globalSearchP2Enhancements",GLOBAL_NAV_HEADER_SEARCH_BOX_LENGTH:100,GLOBAL_SEARCH_INPUT_ID:"phSearchInput",GLOBAL_SEARCH_CONTAINER_ID:"phSearchContainer",SEARCH_ALL_ID:"searchAll",SEARCH_ALL_SUMMARY_VIEW_ID:"searchAllSummaryView",SEARCHRESULT_HOLDER_DIV_ID:"searchResultsHolderDiv",SEARCH_LOGGING_HANDLER:"search",
SECOND_SEARCH_DIV_ID:"secondSearchDiv",SECOND_SEARCH_FORM_ID:"secondSearchForm",SECOND_SEARCH_TEXT_ID:"secondSearchText",SECOND_SEARCH_BUTTON_ID:"secondSearchButton",SEARCH_MORE_OBJECTS_ID:"searchMoreObjects",SIDETABS_RECORD_RESULTS_ID:"recordToggle",SIDETABS_FEED_RESULTS_ID:"feedToggle",SIDETABS_EDIT_ID:"sidetabsSearchOptionsTop",SELECTED_OBJECTS_ID:"selectedObjects",SIDETABS_SELECTED_SUMMARY_ID:"selectedSummary",SIDETABS_SELECTED_DRILLDOWN_ID:"selectedDrilldown",SIDETABS_ID:"searchSidetabs",INITIAL_VIEW_MODE:"initialViewMode",
INITIAL_VIEW_MODE_SUMMARY:"summary",INITIAL_VIEW_MODE_DETAIL:"detail",INITIAL_VIEW_MODE_FEEDS:"feeds",SIDETABS_RECORDS_SLIDE_ID:"records",SIDETABS_LEFTNAV_WRAPPER_ID:"leftnavwrapper",FIRST_PAGE_QUERY_ID_OVERRIDE:"firstPageQueryIdOverride",SMART_SEARCH_TOGGLE_ON_ID:"smartSearchOn",SMART_SEARCH_TOGGLE_OFF_ID:"smartSearchOff",SMART_SEARCH_REDIRECT_CSRF_TOKEN:"smartSearchCSRFToken",SMART_SEARCH_TOGGLE_ID:"smartSearchToggle",GUIDED_TOUR_LINK_ID:"guidedTourLink",FOCUSED_ENTITY_PARAM_NAME:"fen",CACHE_TIMEOUT_MILLIS:3E5,
MAC_REDIRECT_FLAG_PARAM_NAME:"macRedirectFlag",MAC_RECORD_ID_PARAM_NAME:"macRecordId",MAC_RECORD_NAME_PARAM_NAME:"macRecordName",MAC_POSITION_PARAM_NAME:"macPosition",MAC_SEARCH_STRING_PARAM_NAME:"macSearchString",MAC_SEARCH_AREA_PARAM_NAME:"macSearchArea"},UnifiedSearchComponents={COMPONENT_TRACKING_FEEDS_TOGGLE:"FeedsToggle",COMPONENT_TRACKING_RECORDS_TOGGLE:"RecordsToggle",COMPONENT_TRACKING_DRILL_DOWN_SIDETAB:"DrillDownFromSidetab",COMPONENT_TRACKING_DRILL_DOWN_SUMMARY:"DrillDownFromSummary",
COMPONENT_TRACKING_SECONDARY_SEARCH:"SecondarySearch",COMPONENT_TRACKING_SEARCH_ALL:"SearchAll",SUB_COMPONENT_FROM_SIDETABS:"FromSidetabs",SUB_COMPONENT_FROM_SUMMARY_VIEW:"FromSummaryView"},SoftphoneLayoutEditorConstants={XSLT_INFO_FIELDS_CSS:"infoFields",FLIPPY_PREFIX:"flippy_",LISTING_PREFIX:"listing_",FLIPPY_CONTROL_PREFIX:"control_",RESULT_FIELDS_KEY:"resultFields",HIDDEN_IFRAME_ID:"previewIframe",CALL_TYPE_PREVIEW_PREFIX:"callTypePreview_",XSLT_RELATED_OBJS_CSS:"relatedObjects",FIRST_FLIPPY_CSS:"firstFlippy",
CALL_TYPE_PREFIX:"callType_"},RtaImageServlet={RTA_IMAGE_SERVLET_URL:"/servlet/rtaImage?"},ActivityReminderRefreshPage={pCLASS_NAME:"ui.core.activity.ActivityReminderRefreshPage"},EmailAttachmentManagementConstants={START_DATE_ID:"start_date",FILE_NAME_ID:"file_name",SEARCH_BY_DATA:"data",END_DATE_ID:"end_date",SENDER_LOOKUP_ID:"sender",SEARCH_BY_URL:"url",LOOKUP_URL_ID:"lookup_url"},CaptchaVerifierServlet={CLIENT_ERROR_PARAM:"error",CHALLENGE_PARAM:"chal",SERVLET_NAME:"common.html.captcha.CaptchaVerifierServlet",
RESPONSE_PARAM:"resp",VALID_KEY:"valid"},MenuButtonElement={BUTTON:"Button",MENU:"Menu",LABEL:"Label",SELECT:"Select",GO_BUTTON:"Go"},EventDescriptionServlet={EVENT_ID_PARAM_KEY:"eid"},FindSimilarOppsFilter={MAX_DISPLAY_ROWS:300},AjaxLoadPLAServlet={PAGE_SIZE:"pageSize",TYPE:"type"},ActivityReminderPage={pCLASS_NAME:"ui.core.activity.ActivityReminderPage"},EmailAddrEditConstants={pPASS_IN_EMAIL_ADDRESS:"pass_in_email_address",pSAVE_CANCEL:"saveCancel"},SummaryLayoutEditor={SUMMARY_LAYOUT_MIN_COL:1,
SUMMARY_LAYOUT_MAX_COL:4},MultiSelectList={availableRowPrefix:"row_",deselectLabelId:"deselectLabel",selectLabelId:"selectLabel",pTOTAL_ROW_COUNT:"msl_totalRowCount",allOrNoneCheckbox:"allOrNone",pUNSAVED_IDS:"unsavedIds",selectedFrameId:"selected",pIDS:"selectedIds",pTOTAL_ROW_COUNT_FILTER:"msl_totalRowCountFilter",pSELECT_ALL:"msl_selectAll",availableTableId:"availableTable",availableFrameId:"available",listEmptyLabelId:"listEmptyLabel",nameCellPrefix:"name_",availableCheckboxPrefix:"chk_",selectionsTableId:"selections",
selectedRowPrefix:"sel_",pFILTER_TYPE:"filterType",selectedCheckboxPrefix:"uch_"},EmailTemplatePreviewConstants={REQUIRED_BLOCK_CLASS:"requiredBlock",ID_REQUIRED_BLOCK_ID:"_id_required_block",LOOKUP_REQUIRED_BLOCK_ID:"_lookup_required_block"},SlaProcessUi={TIMELINE_DIV:"entitlement_timeline",ENTRY_DATE_FIELD_DIV:"edfield",EXIT_CRITERIA_DIV:"exitcrt"},HomeCalendarAjaxServlet={SERVLET_NAME:"core.activity.scheduling.HomeCalendarAjaxServlet",HOME_CALENDAR_ID:"homeCalendarSection",PROPOSED_EVENT_TAB_PARAM:"pe",
HTML_PAYLOAD_PARAM:"htmlPayload",ACTIVE_TAB_ID:"activeTabId"},ProfileListInlineEditConstants={DISABLE_PERMISSION:"disabledPermissionHtml",ENABLE_PERMISSION:"enabledPermissionHtml"},DashboardConstants={CHART_RANGE_MIN_ELEMENT_NAME:"p19",DASHBOARD_COMPONENT_TYPE_ELEMENT_NAME:"p3",CHART_RADIO_BUTTON_VALUE:"0",TABLE_COLUMN2_ELEMENT_NAME:"pCol2",LEGEND_POSITION_ELEMENT_NAME:"p17",DRILLTYPE_REPORT_VALUE:"Report",TABLE_COLUMN_SORT_DESCENDING_VALUE:"DSC",USE_MULTI_COLUMN:"useMultiColumnTable",SORT_BY_ELEMENT_NAME:"p8",
TABLE_COLUMN3_LABEL_NAME:"pCol3Lbl",TABLE_COLUMN_GROUP_NAME:"tcColGrp",CHART_RANGE_MAX_ELEMENT_NAME:"p20",DRILLTYPE_DETAIL_VALUE:"Detail",TABLE_COLUMN1_LABEL_NAME:"pCol1Lbl",TABLE_COLUMN4_ELEMENT_NAME:"pCol4",USE_MULTI_COLUMN_LABEL_NAME:"umcLbl",TABLE_COLUMN_SORT_LBL_ID:"tcSortByLbl",DRILL_TYPE:"p25",CUSTOM_REPORT_ELEMENT_NAME:"p2",NUMBER_ROWS_ELEMENT_NAME:"p9",TABLE_SORT_BY_PICKLIST:"tcSbp",TABLE_COLUMN2_LABEL_NAME:"pCol2Lbl",TABLE_COLUMN1_ELEMENT_NAME:"pCol1",TABLE_COLUMN4_LABEL_NAME:"pCol4Lbl",
CHART_RANGE_MANUAL_ELEMENT_NAME:"p21",NUMBER_OF_TABLE_COLUMNS:"4",TABLE_SORT_RADIO_ELEMENT_NAME:"tcSbr",TABLE_COLUMN3_ELEMENT_NAME:"pCol3",TABLE_COLUMN_SORT_ASCENDING_VALUE:"ASC",TABLE_SORT_COLUMN_ELEMENT_NAME:"pSortCol",DRILLTYPE_FILTER_VALUE:"FilterReport",DRILLTYPE_URL_VALUE:"URL"},EmailSyncConfigConstants={ALLOW_USER_MODIFY:"_usrMod",OVERRIDE_MAPPINGS_SUFFIX:"ofm",OVERRIDE_ENT_SUFFIX:"oes",OVERRIDE_SYNCDIR_SUFFIX:"osd",MATCH_PREF_DIV:"_matchPrefDiv",CONFLICT_RES_STATIC_SUFFIX:"_conf_res_static",
LAST_MODIFIED:"lastModified",LAST_ACTIVITY:"lastActivity",FM_HIDE_SUFFIX:"_fmHideLink",FM_ROW_SUFFIX:"_fmRow",CONFLICT_RES_SUFFIX:"_conf_res",MATCH_PREF:"_matchPref",ADVANCED_SETTINGS_PARAM:"advanced_settings",ADVANCED_SETTINGS_ROW_PREFIX:"adv_row_",OWNERSHIP_ALL:"ownership_all",FM_SHOW_SUFFIX:"_fmShowLink",OLDEST:"oldest",OVERRIDE_CONFLICT_SUFFIX:"ocr",OWNERSHIP_SELECTED:"ownership_selected",SYNC_DIR_SUFFIX:"_sync_dir",MATCH_PREF_LABEL:"_matchPrefLabel",ADVANCED_SETTINGS_TABLE_ID:"advSettingsTable"},
OrganizerPage={PROPOSE_TIME_MODE_MANUAL:"MANUAL",PROPOSE_TIME_MODE_AUTO:"AUTO",MAX_TOTAL_ATTENDEES:50},AbstractAutoCompleteServlet={AUTOCOMPLETE_USED_SUFFIX:"_acused",SUGGESTIONS:"suggestions",pINPUT:"inputString"},ForecastSharingPrefPopup={DISABLE_CHECKBOX:"disableCheckbox",pIS_FCT_SHARE_ENABLED:"isFctShareEnabled",CAN_SHARE_RADIO:"enableRadio"},CrtLookupConstants={LOOKUP_DEPTH_LIMIT:4,LOOKUP_ELEM:"lookupBox",PATH_ELEM:"pathBox",CONTROL_ELEM_1:"controlLinks1",LOOKUP_HEADER:"lookupInnerHeader"},ForecastingViewingIsoServlet=
{ISO:"iso",NAME:"name"},ForecastingTabPage={CURRENCY_INDICATOR:"currencyIndicator",CURRENCY_INDICATOR_NAME:"currencyIndicatorName",CURRENCY_SELECT_ID:"currencySelect",CURRENCY_SELECT_ERROR_ID:"currencySelectError",CORP_CONVERSION_SPAN_ID:"corpConvert",CURRENCY_OVERLAY_CONTENT_DIV_ID:"currencyOverlayContent"},UiData={pRET_URL:"retURL",pID:"id",pCANCEL_URL:"cancelURL",pSAVE_URL:"saveURL",pFAIL_RET_URL:"failRetURL"},DynamicContent={pERROR_DESC:"errorDesc",pERROR_TITLE:"errorTitle",pTYME:"tyme",pCOOKIE_PARAM:"cookieParam"},
NonUddKeyConstants={SUBKEY_SEPARATOR:"___"},SearchResultClickTracking={COOKIE_NAME:"searchResultClickCookie"},LookupsUi={FIELD:"field",PATH:"path",LOOKUPS:"lookups"},ChatterFilesConstants={MAX_VISIBLE_COUNT:5,DOC_VIEWER_CONTAINER_CLASS:"docViewerContainer",FILE_CONFIG_KEY_DOCID:"docId",FILE_SHARE_PERM:"share",FILE_VIEW_PERM:"view",FILE_VIEW_JS:"viewJS",FILE_VIEW_URL_POPUP_WINDOW:"viewUrlWindow",FILE_DOWNLOAD_CONFIG:"downloadCfg",FILE_VIEW_URL:"viewUrl",FILE_CONFIG_KEY_DESC:"desc",OVERLAY_ID:"docViewerOverlay",
FILE_TITLE_SMALL_FONT_CLASS:"fileTitleSmallFont",FILE_SIZE:"fileSize",EDIT_FILE_CONFIG_KEY_TYPE_DESCRIPTION:"editDescription",FILE_DELETE_PERM:"delete",FILE_DOWNLOAD_URL:"downloadUrl",FILE_FIELD_CONFIG:"fieldCfg",FILE_EDIT_PERM:"edit",EDIT_FILE_CONFIG_KEY_TYPE:"editType",DOC_VIEWER_OVERLAY_CLASS:"docViewerOverlay",EDIT_FILE_CONFIG_KEY_TYPE_FILE_DETAIL:"editFileDetail",FILE_TITLE_ID:"fileTitle",FILE_CONFIG_KEY_FILENAME:"fileName",FILE_VIEW_CONFIG:"viewCfg",CONTAINER_ID:"docViewerContainer",FILE_ADD_NEW_VERSION_PERM:"addNewVersion",
DOC_VIEWER_CONTAINER_PARENT_CLASS:"docViewerContainerParent",DOCUMENT_ID:"documentid",FILE_PERM_CONFIG:"permCfg",SHAREDWITH_PARAM:"sw",SHAREDWITH_PEOPLE:"p",SHAREDWITH_GROUPS:"g",SHARING_TYPE:"sharingType",ENTITY_ID:"entityId",SHARING_TYPE_LABEL:"label",SHARING_TYPE_LABEL_KEY:"labelKey",SHARING_TYPE_IS_CURRENT:"isCurrrent",SHARING_OPTION:"sharingOption",SHARING_CURRENT_TYPE:"currentType",UPLOAD_DIALOG_APPENDIX:"_upload",FEED_ACTION_PARAM_NAME:"fa",SHARE_OPTION_PARAM_NAME:"so"},Activity={pATT_WARNING:"attWarning",
DAY_OF_WEEK_TUESDAY:"4",MAX_RECURRENCE_SPAN_ID:"maxRecurrence",WHO_BUTTON_ID:"whobtn",DAY_OF_WEEK_MONDAY:"2",REMINDER_LEAD_DAYS_TIME_ID:"reminder_ldt",DAY_OF_WEEK_FRIDAY:"32",MAX_RECURRENCE_END_DATE:"maxRecurrenceEndDate",pYEARLY_MONTHOFYEAR:"ymoy",DAY_OF_WEEK_SATURDAY:"64",DAY_OF_WEEK_SUNDAY:"1",REMINDER_DATE_TIME_ID:"reminder_dt",MAX_RECURRENCE_ERRORS:"maxRecurrenceErrors",REMINDER_SET_ID:"reminder_select_check",REMINDER_SELECT_ID:"reminder_lt",DAY_OF_WEEK_WEDNESDAY:"8",DAY_OF_WEEK_THURSDAY:"16",
pYEARLY_DAYOFMONTH:"ydom",pNEW_ATTACHMENTS:"newatt",ACTIVITY_TYPE:"activityType"},SetupSearchElement={SETUP_SEARCH_PARAM:"setupSearch",ATT_SEARCH_TEXT:"searchText"},HoverTooltipElement={DEFAULT_CLASS_TEXT:"mouseOverText"},TaskDescriptionServlet={TASK_ID_PARAM_KEY:"tid"},WhoWhatQueue={WHAT_LOOKUP_NAME_PREFIX:"qselkupwhat_",ARROW_IMG:"aqarrow_",WHO_LOOKUP_NAME_PREFIX:"qselkupwho_",LEFT_ARROW:"/img/twistyRoundLeft.png",RIGHT_ARROW:"/img/twistyRoundRight.jpeg",DONT_ASSIGN_MESSAGE_PREFIX:"da_msg_",TR_PREFIX:"aqtr_",
NO_DESC_TEXT_ID:"qNoDescTextId",TURN_RECOMMENDER_OFF_LINK_ID:"whatRecommenderOffId",TURN_RECOMMENDER_ON_LINK_ID:"whatRecommenderOnId",WHAT_RECOMMENDER_CONTROL_PREFIX:"whatRecommender_",WHAT_RECOMMENDER_INPUT_TEXT_SUFFIX:"_input",HIDDEN_WHO_DISAMBIGUATION_SELECTOR_INPUT_NAME:"whoDisambiguationSelectId"},BaseAssociationConstants={MASS_ASSOCIATION_MODE_PARAM:"massAssociationMode",SOURCE_PARAM_NAME:"src",VIDEO_LINK_ID:"queue_tutorial_video",HELP_LINK_ID:"queue_help"},TagConstants={TAG_SEARCH_FIELD:"tagsSearch",
EDIT_TAGS_PAGE:"/ui/tag/TagsEditPage",PUBLIC_TAG_NAMES_ELEM:"pTagNames",TAG_HEADER:"tag_header",TAG_SUMMARY_ID:"tagSummary",HIDDEN_TAG_ID_LIST:"hidden_tag_id_list",ERROR_DIV_ID:"tagHomeErrorDiv",BROWSER_TAG_TABLE_ID:"browseTagsTable",LOOKUP_TAGS_PAGE:"/ui/tag/LookupTagsPage",ROLODEX_SEARCH_VALUE:"-10",HIDING_SECTION_ID:"layoutEditSection",TAG_EDIT_ID:"tag_edit",TAG_RESULTS_BODY_ID:"tagListBody",BROWSER_SEARCH_HEADER_CLASS:"pbTagBrowserSearch",TAG_RESULTS_ID:"tagResults",TAG_IDS_ELEM:"tagIds",CHANGE_TAGS_IDS:"changeTagsIds",
NOTIFY_MSG_ID:"successNotifyId",TAG_EDIT_LIST:"tag_edit_list",TAG_ROLODEX_ID:"tagRolodexId",SAVE_TAGS_PAGE:"/ui/tag/SaveTagsPage",EDIT_AREA_ID:"tag_edit_area",TAG_ID_LIST:"tIdList",TAG_NAMES_ELEM:"tagNames",IS_DELETE:"isDelete",TAG_UPDATE_STRING:"tagUpdate",SAVED_TAG_SEARCH:"savedTagSearch",TAG_DISPLAY_CONTAINER:"tag_display_container",pTAG_SCOPE_MODE:"scopeMode",EDIT_SECTION_ID:"editSectionId",TAG_DISPLAY_LIST:"tag_display_list",TAG_EDIT_ERROR_ID:"tag_edit_error",TAG_MERGE_CHECK:"/ui/tag/TagMergeCheckServlet",
TAG_VALUE_FOR_UPDATE:"tValForUpdate",TAG_SAVE_ID:"tag_save",TAG_EDIT_TEXT_ID:"tag_edit_text",BROWSER_LIST_ID:"browseTags",HIDING_PUBLIC_SECTION_ID:"layoutPublicEditSection",PUBLIC_TAG_IDS_ELEM:"pTagIds",CHANGE_TAGS_NAMES:"changeTagsNames",TAG_CANCEL_ID:"tag_cancel",TAG_DROP_DOWN_CONTENTS_ID:"tag_drop_down_contents",TAG_SEARCH_RESULTS_URL:"/search/TagSearchResults",TAG_SET_HAS_RECORDS:"tagSetHasRecords",TAG_DROP_DOWN_ID:"tag_drop_down",HIDDEN_TAG_LIST:"hidden_tag_list"},NewLayoutEditor={STD_BTN_PREFIX:"BTN__",
BLANK_ID:"__BLANK"},InviterLookup={EMAIL_ADDRESS_REQUIRED:"emailreq",RETURN_INVITEE_DATA:"returnmore",HIDE_SEARCH_TYPES:"hidetype",MAX_TOTAL_ATTENDEES:"maxtotalattendees"},HTPortal={pSECTION:"section",pCLASS_DAY:"R_DAY",pBODY:"body",pID:"id",pLOCATION:"loc",pFEATURE:"feature",pORG_ID:"orgId",pSELECT_LOCATION:"sel_loc",pCLASS_NAME:"cname",pTRACK:"track",pTARGET:"target"},ChangePasswordConstants={WANT_LOWERCASE_LABELS:"wantLowercaseLabels",SECRET_DESC_BOX:"secretDescBox",pNEW_PASSWORD_STRENGTH_PROMPT:"passStrengthPrompt",
pANSWER_ELEM:"p3",pNEW_PASSWORD_STRENGTH_INFO_ELEM:"passStrengthInfo",IS_ALPHANUMERIC_REQ:"isAlphanumericRequired",PASSWORD_POLICY:"passwordPolicy",pANSWER_ICON_ELEM:"answerVerify",pNEW_PASSWORD_ELEM:"p5",MIN_PASSWORD_LENGTH:"minPasswordLength",pQUESTION_ELEM:"p2",CHANGE_PASSWORD_PARAMS:"changePasswordParams",pNEW_PASSWORD_STRENGTH_ELEM:"passStrength",pNEW_PASSWORD_CONFIRMATION_ICON_ELEM:"passVerify",pANSWER_ERROR_ELEM:"answerContainsPassword",LAST_PW_CHANGE_BOX:"lastPWChangeBox",pOLD_PASSWORD_ELEM:"p4",
IS_PASSWORD_ALLOWED_IN_ANSWER:"isPasswordAllowedInAnswer",pNEW_PASSWORD_ICON_ELEM:"strengthImage",pNEW_PASSWORD_CONFIRMATION_ELEM:"p6"},ChangeUsernameConstants={pIS_USERNAME_CHANGED_ELEM:"p101",pNEW_USERNAME_ELEM:"p102"},JigsawImport={SELECTED_IDS:"selectedIds",MESSAGE:"message",SUCCESS:"globalSuccess",RESULT:"result",IMPORT_ALL:"importAll",TOTAL_ROWS:"totalRows",IMPORT_TARGET_TYPE:"targetType",METHOD:"method",ERRORS:"globalErrors",IMPORT_SELECTED:"importSelected",EI:"ei"},vaSelectElementConst={DOWN_CLASS:"down",
UP_CLASS:"up"},SoftphoneScreenPopTypeEnum={POP_TO_SEARCH:"PopToSearch",POP_TO_VISUALFORCE:"PopToVisualforce",POP_TO_ENTITY:"PopToEntity",DO_NOT_POP:"DoNotPop"},UserDeactivate={pREMOVE_FROM_CLOSED_OPP_TEAMS:2,pREMOVE_FROM_ACCOUNT_TEAMS:1,pREMOVE_FROM_ADHOC_CASE_TEAMS:6,pREMOVE_FROM_OPEN_OPP_TEAMS:3,pREMOVE_FROM_PREDEFINED_CASE_TEAMS:5,pSPLITS_REMOVAL_NOTE:4},AjaxLoadPLAForPageServlet={PAGE_NUM:"pageNum"},CrtConstants={MAX_OBJECTS:4,OBJECT_PREFIX:"o",PICKLIST_VALUE_ID_SEPARATOR:"|",PICKLIST_VALUE_TABLE_FIELD_SEPARATOR:"."},
AjaxScanFieldsForShrinkage={pENTITY_NAME:"entityName",pFIELD_ID:"fieldId",pLENGTH_SPECIFIED:"lengthSpecified"},CustomObjectTeamMemberUiConstants={pMEMBER_PREFIX:"tm_",REMOVED_TEAMS_CONTAINER:"rtc",pCSP_PORTAL_PREFIX:"csp_",pTEAM_RECORD_PREFIX:"tt_",pREMOVED_TEAMS_PREFIX:"rt_",TEAMS_TABLE_ROW_PREFIX:"tt_t_r_",MEMBERS_TABLE_ROW_PREFIX:"tm_t_r_",pREMOVED_MEMBERS_PREFIX:"rm_",pTEAM_RECORDS_COUNT:"ttc",pMEMBERS_COUNT:"tmc",pSHARE_ACCESS_PREFIX:"sa_",REMOVED_MEMBERS_CONTAINER:"rmc",pROLE_PREFIX:"tmr_",
MEMBERS_TABLE:"tm_t",TEAMS_TABLE:"tt_t"},ServiceDeskPage={SERVICE_DESK_TAB_STATES_VALID:"sdtsvalid"},ChatterService={QA_MAX_LENGTH:1E3,pFEEDTYPE:"feedtype",pFEEDCRITERIA:"criteria",pDATACATEGORY:"dc",pID:"id",pVoteTargetId:"v1",pVoteType:"v2",pIsFollow:"v3",SEARCH_MIN_LENGTH:3,AFTER_DISLIKE_CLASS:"cxafterdislike",AFTER_LIKE_CLASS:"cxafterlike",DISLIKE_CLASS:"cxdislike",LIKE_CLASS:"cxlike",UP_VOTE_COUNT_CLASS:"upVoteCount",DOWN_VOTE_COUNT_CLASS:"downVoteCount",pSearchAskState:"s",pEMAIL_INFO_BUBBLE_CLASS:"emailInfoBubble"},
ColorInputConstants={ERROR_COLOR_BOX_CSS:"errorColorBox",COLOR_BOX_CSS:"colorBox"},SidetabConstants={SIDETAB_ID_PREFIX:"st:",DEALVIEW_FEED_PANEL_DIV_ID:"dvFeedPanelDiv",ITEM_FLYOUT_ID:"RLPanelShadow",SIDE_TABS_ID:"st:SideTabs",HIDDEN_LIST_SHOW_LINK_ID:"st:HiddenListShowLink",DETAIL_SIDETAB_NAME:"DetailTab",GENIUS_SIDETAB_NAME:"GeniusTab",DEALVIEW_LOADING_IMG_ID:"dvLoadingImg",DETAIL_SIDETAB_ID:"st:DetailTab",DEALVIEW_DETAIL_PANEL_DIV_ID:"dvDetailsPanelDiv",DEALVIEW_SIDETABS_DIV_ID:"dvSidetabsDiv",
HIDE_BUCKET_ID:"st:HideBucket",FEED_SIDETAB_NAME:"FeedTab",SIDETAB_ITEM_ID_SUFFIX:":item",DEALVIEW_GENIUS_PANEL_DIV_ID:"dvGeniusPanelDiv",HIDDEN_LIST_ID:"st:HiddenList",FEED_SIDETAB_ID:"st:FeedTab",DEALVIEW_MAIN_CELL_ID:"sales-main-content-cell",HIDDEN_LIST_PANEL_DROP_COVER_ID:"st:HiddenListPanelDropCover",DEALVIEW_SIDETABS_CELL_CLASS:"sales-sidetabs-cell",HIDDEN_LIST_PANE_ID:"st:HiddenListPane",HIDDEN_LIST_TOGGLE_LINK_ID:"st:HiddenListToggleLink",HIDDEN_LIST_PANEL_ID:"st:HiddenListPanel",CANVAS_BODY_PANEL_ID:"st:CanvasBodyPanel",
BACK_TO_TOP_BTN_ID:"st:BackToTopBtn",ITEM_PROXY_ID:"st:ItemProxy",DEALVIEW_LOADING_MESSAGE_PANE_ID:"dvLoadingMessagePane",GENIUS_SIDETAB_ID:"st:GeniusTab"},ChartConstants={pCHART_SUMMARY:"cs",pCHART_SHOW_AS:"chsa",pCHART_USE_MULTI:"chum",pCHART_SHOW_PLOT_BY_VALUES:"chspv",pCHART_SHOW_VALUES:"chsv",MORE_BARS:"mbars",pCHART_SHOW_PERCENTAGE:"chsp",pCOMBINE_OTHERS:"chco",ONLY_LINE:"ol",pCHART_SHOW_TOTAL:"chst",pCHART_DIFF_AXIS:"chda",pCHART_SUMMARY_3:"cs3",pCHART_SUMMARY_2:"cs2",pCHART_SUMMARY_4:"cs4"},
ActivityUi={RECURRENCE_PATTERN_DIV:"recpat",ALL_SUBGROUP_DIVS:"dwmy"},FilterSelectionElement={pFILTER_VALUE:"fval",pOPERATOR:"oper",ON_LOAD_CRITERIA:"onLoadCriteria",pCOLUMN:"col"},SoftphoneMatchTypeEnum={SINGLE_MATCH:"SingleMatch",MULTIPLE_MATCHES:"MultipleMatches",NO_MATCH:"NoMatch"},InviterLookupMatch={NAME:"name",ID:"id",TYPE_USER:"user",EMAIL:"email",TYPE_LEAD:"lead",TYPE_CONTACT:"contact",TYPE:"type"},RelatedListServlet={pParentId:"parentId",pRlId:"rlId"},SummaryFieldConstants={OPERATION_CONTAINER_ID:"operationCtr"},
CustomObjectTeamTemplateUiConstants={pMEMBER_PREFIX:"tm_",REMOVED_CONTAINER:"rmc",pMEMBERS_COUNT:"tmc",pCSP_PORTAL_PREFIX:"csp_",pSHARE_ACCESS_PREFIX:"sa_",pROLE_PREFIX:"tmr_",pREMOVED_PREFIX:"rm_"},PersonalSetupConstants={HELP_URL:"helpUrl"},CustomMotifDefinitionPageConst={COLOR_ELEMENT:"ce",MOTIF_ICON_PARAM:"file_id"},CrtLayoutElement={cFIELD_UNUSED:"#CCCCAA",CSS_CLASS_LAYOUT_ITEM_SEPARATOR:"sepCell",cFIELD_USED_FONT:"#B0B0B0",ITEM_SHOWLABEL:"showLabel",NUM_LAYOUT_COLS:4,SECTION_AVAIL_WRAPPER_ID:"availableSectionWrapper",
ACTIONREF_ORDER:"order",COLUMN_ID:"columnId",SECTION_EDIT_HEADING:"editHeading",ACTIONREF_NAME:"name",FIELD_TYPE_SELECT_NAME:"availableDropDown",cSEPARATOR_ON:"#000000",ITEM_POS_X:"xPos",ITEM_DEFAULT_CHECKED:"defaultChecked",SECTION_TABLE_ID_PREFIX:"table",SECTION_DETAIL_HEADING:"detailHeading",ROOT_CONTAINER:"root",ITEM_BEHAVIOR:"behavior",LEFT_SECTION_ID:"layoutdndLeft",AVAIL_CELL:"availCell",COLUMN:"column",ITEM_LAYOUT_IDS:"lIds",SECTION_DIV_SUFFIX:"availSectionDiv",ITEM_NAME:"name",LAYOUT_NAME:"name",
LAST_SEC_SEP_DIV:"LAST_SEC_SEP_DIV",SCROLL_BUFFER_ID:"scrollBuffer",ITEM_HEIGHT:"height",cFIELD_EMPTY:"#FFFFFF",cFIELD_IN_SECTION:"#CCCCCC",pVALUE:"val",ITEM:"item",SECTION:"section",XML_FORM_NAME:"submitForm",cFIELD_SELECTED:"#6699CC",ITEM_TYPE:"itemType",ITEM_ID:"itemId",cAVAILABLE_HIGHLIGHT:"#000000",SECTION_ID:"sectionId",CSS_CLASS_LAYOUT_ITEM:"itemCell",ITEM_CUSTOMLABEL:"customLabel",SECTION_CAN_EDIT_LABEL:"canEditLabel",pSAVE_AND_CLOSE:"saveAndClose",cFIELD_USED:"#EEEEEE",SEPARATOR_PREFIX:"rp_",
SECTION_NUM_COLUMNS:"numColumns",SECTION_HEADER_ID_PREFIX:"sec_",SECTION_SEP_DIV_PREFIX:"LayoutSectionSeparator_",DEFAULT_NUM_COLS:"defaultNumCols",HOVER_DIV:"MOUSE_HOVER_DIV",MAX_DISPLAY_FIELD_LENGTH:15,SECTION_SORT_ORDER:"sortOrder",CSS_CLASS_LAYOUT_CELL:"layoutCell",SECTION_SORT_ORDER_HORIZONTAL:"h",ITEM_SHOWSCROLLBARS:"showScrollbars",SECTION_NAME:"name",COLUMN_NAME:"columnName",SECTION_MASTER_LABEL:"masterLabel",MAIN_TABLE_DIV_ID:"mainTableDiv",LAYOUT_FIELDS_LIMIT:1E3,ACTIONREF:"actionRef",ITEM_WIDTH:"width"},
AdvancedCurrencyEnable={enableButton:"enableButton",pENABLE:"enable"},MCXHRParams={pQSTestResults:"qsTestResults",pLoadObjId:"LOI",pFilterItemCount:"itemCount",pSaveObjRelField:"SORF",pCollisionParam:"LMT",pSaveObjType:"SOT",pIsSuccess:"isSuccess",pTestResultRecordCount:"recordCount",pTotalsElement:"totalsElement",pData:"data",pScope:"scope",pTestResultDataSize:"dataSize",pLoadObjType:"LOT",pSaveObjId:"SOI",pTestResultQSID:"id",pLoadObjRelField:"LORF",pTestResultConfigError:"configError",pAction:"ACT",
pSaveObjParentId:"SPI"},DurationInputElement={pMINUTES_NAME:"mi",pHOURS_NAME:"hh"},RoleTreeCookieConstants={COOKIE_KEY:"roleopen"},CriteriaInputConstants={pVAL:"pVAL",HAS_ERROR_OR_WARNING:"HasErrorOrWarning",pCOL:"critfld",RESET_ERROR_MESSAGE:"rstErrMsg",INVALID_PREFIX:"fk__",INVALID_FIELD_VALUE:"invalid__",pLOOKUP:"pLOOKUP",INFO_MESSAGE:"InfoMessage",IS_OPTIONAL:"IsOptional",LOOKUP_FILTER_SECTION_ID:"lookupFilterSection",INSERT_DEP_BUTTON_ID:"insertDepButton",CLEAR_FILTERS_LINK:"clrFiltersLnk",ERROR_CLS:"FAErrorCell",
MAX_ROWS_ID:"maxRowsReached",pFLD:"pFLD",BOOL_FILTER_NAME:"bool_filter",IS_DEFAULT_MESSAGE:"isDefaultMsg",INSERT_DEP_ID_PREFIX:"dep_",pFIELD_VAL:"critfld_val",ERROR_MESSAGE:"ErrorMessage",IS_ACTIVE:"Active",SHOW_SUMMARY_FILTER:"filterControl",pOP:"critop",RESET_ERROR_MESSAGE_LINK:"rstErrMsgLnk",pIS_FLD:"pIS_FLD",FILTER_SECTION_ID:"filterSection",LABEL_PREFIX:"labelFor",F_ROW:"frow"},GoogleDocCreator={DOC_NAME:"docName",CREATE:0,FORM_NAME:"googleDocForm",DOC_UPLOAD:"docUpload",DIALOG_ID:"DocNameInputId",
DOC_TYPE:"docType",METHOD:"method",DOC_UPLOAD_NAME:"docUploadName",PARENT_ID:"parentId",UPLOAD:1},HolidayUi={START_TIME_PARAM:"sttime",END_TIME_PARAM:"endtime"},EmailRelayConstants={RESTRICT_TO_DOMAINS_ID:"restrict_to_domains",EMAIL_HOST_ID:"email_host",EMAIL_HOST_PORT_ID:"email_host_port",ACTIVATE_RESTRICT_TO_DOMAINS_ID:"activate_restrict_to_domains",ACTIVATE_EMAIL_RELAY_ID:"activate_email_relay",RESTRICT_TO_DOMAINS_HIDDEN_ID:"restrict_to_domains_hidden",EMAIL_RELAY_TLS_SETTING_ID:"email_relay_tls_setting"},
MRUAutoCompleteServlet={DEPDATA_PARAM:"aclkdata"},TaskMassAction={ROW_LIMIT:200},RequestInfo={pSID:"sid"},InlineHelp={ORB:"helpOrb",DISPLAY_DIV_CLASS:"helpText",CLASS_NAME_HOVER:"helpButtonOn",CLASS_NAME:"helpButton",ID_SUFFIX:"-_help",SUFFIX_DELIMITER:"-_"},findSimilarQueryPage={SEARCH_QUERY_STRING:"srch",FIND_PROVIDER:"findSimilarProvider"},FieldTreeConstants={SELECT_ID:"FieldTreeSelect",DB_NAME:"dbName",TYPE:"type",COLUMN_TYPE:"columnType"},FilterEditConstants={pDEV_NAME:"devname",pSCOPE:"fscope",
pNAME:"fname"},AjaxLoadFieldsForEntity={pPARENT_ENTITY_NAME:"parentEntity",pENTITY_NAME:"entity",pFIELD_LIST:"fieldList"},AjaxGetUsersInGroups={pNUM_USERS:"numUsers",pOWNER_NAME_LIST:"ownerNameList",pINVALID_GROUPS_MESSAGE:"invalidGroups",pOWNER_ID_LIST:"ownerIdList",pCLASS_NAME:"common.ownership.group.AjaxGetUsersInGroups"},DesktopSidebarComponents={GOOGLETALK_CONTAINER_ID:"googleTalk",SOFTPHONE_CONTAINER_ID:"softphoneContainer",MRU_LIST_CONTAINER_ID:"mruList"},EmailAuthorConstants={EMAIL_ADDR_DELIM:"; "},
AjaxServlet={ERROR_MSG_KEY:"errMsg",SESSION_TIMEOUT:"sessionTimeout",CSRF_PROTECT:"while(1);\n"},IFrameElement={EmptyRelatedListDoc:"emptyHtmlDoc.html",BLANK_SRC:"javascript: ''"},SynonymConstants={SYNONYM_NAME_FILTER_PARAM_VALUE:"synonymFilterValue",SORT_DIRECTION_PARAM_NAME:"sortDirection",SYNONYM_PAGE_PARAM:"page",SORT_COLUMN_PARAM_NAME:"sortColumn",SYNONYM_GROUP_DISPLAY_STRING_PARAM:"synGroupDispStr"},EmailCCBccLookupConstants={BCC_ADDR_ID:"bcc_addr",ADDITIONAL_TO_ID:"additional_to",CC_NAME_ID:"cc_name",
BCC_NAME_ID:"bcc_name",ADDITIONAL_TO_ADDR_ID:"additional_to_addr",BCC_ID:"bcc",CC_ID:"cc",CC_ADDR_ID:"cc_addr",ADDITIONAL_TO_NAME_ID:"additional_to_name",REF_ID:"ref"},SuggestedTimeProvider={TARGET_SUGGESTION_NUMBER:5},AccountAssociationSuggestionsServlet={pASSOCIATION_DATA_PARAM:"adp",SEARCH:"SEARCH",pCONTACT_ID_PARAM:"adpc",DEFAULT:"DEFAULT",ACTION_COUNT:3},ProfileEditConstants={CRUD_READ:"crudRead",CRUD_VIEW_ALL:"crudViewAll",CRUD_UPDATE:"crudUpdate",CRUD_MODIFY_ALL:"crudModifyAll",CRUD_CREATE:"crudCreate",
CRUD_DELETE:"crudDelete"},CampaignManageMembers={MEMBERS_UPDATED:"membersUpdated",NOTICE_DIV_ID:"notice",ERROR_TEXT_ID:"save_error_text",pLOOKUP_ID:"lookup",pCOLUMN:"col",ERROR_DIV_ID:"save_error",ACCOUNT:"a",CONTACT:"c",FILTER_ID_PREFIX:"mm_filters_",MEMBERS_TOTAL:"membersTotal",EXISTING_TAB:1,pFILTER_VALUE:"fval",DEFAULT_FILTER_ROW_COUNT:5,pOPERATOR:"oper",ERROR_MSG:"membersError",LEAD:"l",ADD_TAB:0,CAMPAIGN_MEMBER:"CampaignMember",MEMBERS_REMOVED:"membersRemoved",MEMBERS_ADDED:"membersAdded"},
EventPage={CALENDAR_IFRAME_ID:"calendarIFrame",MINI_EDIT_PAGE_LINK_ID:"miniEditPageLink",MINI_CANCEL_SAVE_ID:"miniSave",MINI_CANCEL_BUTTON_ID:"miniCancel"},BusinessHoursPageConstants={p24X7_CHECKBOX:"has24x7"},PersonalSetup={PERSONAL_SETUP_MODERATORS:"Moderators",PERSONAL_SETUP_MODERATOR_INFO_VIDEO:"ModeratorVideoLink",PERSONAL_SETUP_NODE_STR:"PersonalSetup"},DatePickerIds={DOM_ID:"datePicker",TABLE_ID:"datePickerCalendar",YEAR_PICKER:"calYearPicker",MONTH_PICKER:"calMonthPicker"},JSPDispatcher={NONSTANDARD_PACKAGE_PREFIX:"_ui/",
PACKAGE_MARKER:"p/",STANDARD_PACKAGE:"ui"},AutoCompleteComboElement={LIST_CLASS:"acList",JS_COMBO_CONTAINER_ID_VAR:"acComboContainer",ITEM_CLASS:"acItem",JS_COMBO_VAR_PREFIX:"acCombo",ITEM_SELECTOR_CLASS:"acItemSelector",JS_ON_SELECT_VAR:"acOnSelect",TOOLBAR_PAGE_SIZE:"acPagingToolbarPageSize",JS_ERROR_NOT_FOUND_VAR:"acErrorNotFound",FOLDER_CLASS:"acFolder",JS_PAGING_TOOLBAR_ID:"accomboPgToolbar",JS_INITIAL_TEXT_VAR:"acInitialText",JS_DATA_VAR:"acData",JS_PAGING_TOOLBAR_NEXT_TEXT_VAR:"acPagingToolbarNext",
CONTAINER_CLASS:"acContainer",JS_WIDTH_VAR:"acWidth",JS_PAGING_TOOLBAR_MESSAGE_VAR:"acPagingToolbarText",JS_PAGING_TOOLBAR_PREVIOUS_TEXT_VAR:"acPagingToolbarPrevious",EDIT_FIELD_CLASS:"acCombo",JS_COMBO_TEMPLATE_VAR:"acComboTemplate",EMPTY_TEXT_CLASS:"acEmptyText",JS_APPLY_TO_VAR:"acApplyTo",TRIGGER_CLASS:"acTrigger",JS_STORE_VAR_PREFIX:"acStore",JS_DROPDOWN_CONTAINER_ID:"accomboDropdownContainer",JS_DROPDOWN_SELECTED_ITEM:"acSelectedItem"},FilterEditPageConstants={pSEARCH_ANCHOR:"searchAnchor"},
ForecastRoleUser={FORECAST_SHARE_RADIO:"forecastSharingRadios",pCAN_SHARE:"allowMgrFctSharing",pUSER:"user"},InlineScontrolElement={DEFAULT_HEIGHT:200,DEFAULT_WIDTH:-100},Desktop={VIEW:"vw",CLOSETAB_ACTION:"closeTab",JIFFY_AUTOMEASURE:"Complete",pGOTO_ID:"goToId",pGOTO_URL:"goToUrl",SIDEBAR_NORMAL_WIDTH_STYLE_PX:"200",BROWSER_MAX_URL:"2048",AgentConsoleFE:"AgentConsoleFE",AgentConsoleX:"AgentConsoleX",AgentConsoleY:"AgentConsoleY",RESIZE_WIDTH:"resizeWidth",NAVIGATOR:"nv",LOCK:"lk",IS_DESKTOP:"isdtp",
AgentConsoleS:"AgentConsoleS",ENCLOSING_VIEW_ENTITY_ID:"id",IS_IN_CONTEXT_PANE:"inContextPane",VIEW_WIDTH_MIN_RATIO:0.5,VIEW_HEIGHT_MIN_RATIO:0.5,CUSTOM_SIDEBAR_COMPONENTS:"sidebarCts",VIEW_LAYOUT_ID:"layoutId"},TabSetPageConstants={WORKSPACE_MAPPING_ROW_CLASS:"workspaceMappingRow",WORKSPACE_MAPPING_TABLE_ID:"workspaceMappingTable",ROW_PREFIX:"row"},TagMode={PUBLIC:"public",PERSONAL:"personal"},SearchRelatedList={ERROR_DIV_ID_PREFIX:"srchErrorDiv_",ShouldNotLookUp:"noLookUp",COLUMN_PARAMETER:"columns",
FILTER_FIELDS_SAVE_PREFIX:"save_filter_",FILTER_FIELD_FORM_PREFIX:"field_name_form_",pSEARCH:"search",COLUMN_SELECTOR_PREFIX:"selector_",SearchUserLayoutServletName:"UserSearchListLayout",SEARCH_IDENTIFIER_PARAM:"searchId",ENTITY_PARAMETER:"entity",pENTITY_ALL:"0",COMBO_BUTTON_ID:"comboButton",SEARCH_ACTION_IDENTIFIER_PARAM:"aId",ALL_STATES_PREFIX:"allStates_",LIST_LAYOUT_TYPE_PARAMETER:"layoutType",FILTER_FIELDS_PARAM:"sFltrFields",SearchFilterInfoServletName:"SearchFilterInfo",FILTER_FIELDS_PREFIX:"field_name_",
PER_ENTITY_VALUE:"perEntityValue",pSEARCH_STR:"str",SHOW_FILTERS_ID:"showFiltersId",HIDE_FILTERS_ID:"hideFiltersId"},CaseUi={TIMELINE_DIV:"entitlement_timeline"},AjaxGetFieldTreeChildren={NODE_LIST:"nodeList",FORMULA_TYPE:"formulaType",NODE_KEY:"nodeKey"},TaskOwnerLookup={pTABBED_TMU_LOOKUP:"tabbedTmuLookup",pLOOKUP_UROG_SUFFIX:"_lkurogid",DONE_BUTTON_ID:"doneButton"},MailmergeTemplateSelectElementConst={TEMPLATE_DESCRIPTION:"mmtse_description",TEMPLATE_TITLE:"mmtse_title",TEMPLATE_VIEW_BUTTON:"mmtse_preview",
TEMPLATE_ID:"mmtse_id"},RelatedListPrioritizationServlet={pPOSITION:"position",pRELATIVE:"relative",pMOVED:"moved",pCONFIG_KEY:"configKey"},MotifInputElementConst={MOTIF_ELEMENT_SUFFIX:"motifElement",FIELD_NAME_MOTIF:"motifName",FIELD_NAME_ICON:"motifIcon",FIELD_NAME_DESCRIPTION:"motifClass"},BusyTimesAjaxServlet={SERVLET_NAME:"core.activity.scheduling.BusyTimesAjaxServlet",TIME_ZONE_PARAM:"timezone",USER_ID_PARAM:"userid",DATE_OF_THE_WEEK_PARAM:"date"},EditPageConstants={pQUICK_SAVE:"quick_save",
pSAVE_NEW:"save_new",pCANCEL:"cancel",NOSAVE:"nosave",pSAVE_NEW_URL:"save_new_url",pSAVE:"save",pSAVE_CLOSE:"save_close",pSAVE_ATTACH:"save_attach",pEDIT_PAGE:"editPage"},EventUi={START_TIME_PARAM_NAME:"startTimeId",WHO_NAME_PARAM_NAME:"whoNameId",ALL_DAY_PARAM_NAME:"allDayId",LEAD_PREFIX_PARAM_NAME:"leadPrefix",REMINDER_DATE_TIME_PARAM_NAME:"reminderDateTimeTimeId",WHAT_ID_PARAM_NAME:"whatIdId",WHO_ID_PARAM_NAME:"whoId",RECURRING_EVENT_PARAM_NAME:"isRecurringId",PRIVATE_CHECKBOX_PARAM_NAME:"privateCheckboxId",
WHO_LINK_PARAM_NAME:"whoLinkId",VISIBLE_IN_SS_PARAM_NAME:"isVisibleInSelfServiceId",EVENT_CONVERT:"convert",START_DATE_PARAM_NAME:"startDateId",pISPERSONACCOUNT:"pip",WHAT_LINK_PARAM_NAME:"whatLinkId",WHAT_NAME_PARAM_NAME:"whatNameId",pADD_INVITEE_ID:"addInvId",WHAT_TYPE_PARAM_NAME:"whatTypeId",END_TIME_PARAM_NAME:"endTimeId",WHO_TYPE_PARAM_NAME:"whoTypeId",END_DATE_PARAM_NAME:"endDateId"},SideTabPreferenceServlet={pTAB_NAME_PARAM:"tabName",pIS_COLLAPSED_PARAM:"isCollapsed",pSAVE:"save",pCONFIG_LIST:"configList",
pCONFIG_KEY:"configKey",pQUERY_ORDER_PARAM:"tabIndex"},Udd={EMPTY_KEY:"000000000000000"},UserInterfaceUI={pALOHA_CHATTER_MSG:"alohaChatterMsg",pINLINE_SCHEDULING_NAME:"inlineScheduling",pALOHA_SKIN:"alohaSkin",pSPELL_CHECKER_ACTIVITIES_NAME:"spellcheckerActivities",pCLICK_AND_CREATE_ON_CALENDAR_NAME:"clickAndCreateOnCalendar",pSPELL_CHECKER_ENABLED_NAME:"spellchecker",pINLINE_SCHEDULING_NAME_MESSAGE:"inlineSchedulingMessage",pDRAG_AND_DROP_ON_CALENDAR_NAME:"dragAndDropOnCalendar",pNEW_LIST_VIEW_NAME:"newListView"},
CreateNewElement={DOM_ID:"createNew"},ViralInviteSignupConstants={STAGE_ACCOUNT:"ACCOUNT",LOGIN_ID:"p1",PAGE_BLOCK_STAGE:"PageBlockStage",ORG_NAME_ID:"org_name",SPINNER_IMAGE_ID:"finishSpinnerImgId",VIRAL_INVITE_SIGNUP_PAGE_ID:"ViralInviteSignup",READONLY_ORG_NAME_ID:"org_name_readonly",PREVIOUS_BUTTON_DOM_ID:"goPrevious",DEFAULT_PAGE_BLOCK_STAGE:"DefaultPageBlockStage",NEXT_BUTTON_DOM_ID:"goNext"},LookupInputElement={pLOOKUP_WIDGET:"_lkwgt",DIALOG_ID:"LookupOverlayDialog",LOOKUP_IFRAME:"lookupIFrame"},
OppSalesTeamRowEdit={SPLIT_AMOUNT_LABEL:"splitAmount_row",SPLIT_PERCENTAGE_LABEL:"splitPercentage_row",SUMMARY_ROW_ID:"stt_summaryRow",ROW_TYPE_LABEL:"rowType_row",ROW_ID_LABEL:"salesTeam_row",IS_SPLIT_LABEL:"isSplit_row",SPLIT_NOTE_LABEL:"splitNote_row",USER_LOOKUP_ID_LABEL:"userLookup_row"},BodyLayout={BODY_CELL_ID:"bodyCell",SIDEBAR_CELL:"sidebarCell",BODY_TABLE_ID:"bodyTable",NO_TABLE_BODY_ID:"noTableContainer",PAGE_HEADER_ID:"AppBodyHeader",FOOTER_DIV_ID:"bodyFooter"},CSRFConstants={CSRF_TOKEN:"_CONFIRMATIONTOKEN"},
PortalStyleConfigEditorConstants={PARAM_PREFIX:"p_"},SearchSettingsConstants={OPTIMIZE_SEARCH_FOR_CJK_WARNING:"optimizeSearchForCJKWarning",OPTIMIZE_SEARCH_FOR_CJK_NAME:"optimizeSearchForCJK",SIDEBAR_SEARCH_ENTITY_PICKER_ID:"enableSidebarSearchEntityPicker",DEFAULT_SEARCH_ENTITY_CHECKBOX_ID:"defaultSearchEntityCheckbox",DEFAULT_SEARCH_ENTITY_PICKLIST_ID:"defaultSearchEntityPicklist"},SalesTeamRowTypeEnum={NEW:"New",EXISTING_DELETED:"Existing_Deleted",NEW_DELETED:"New_Deleted",EXISTING_INACTIVE:"Existing_Inactive",
EXISTING:"Existing"},OpportunitySalesTeamEdit={SALES_TEAM_MEMBER_TABLE_ID:"stt",SPLIT_TOTAL_PER_ID:"splitTotPer",SPLIT_TOTAL_ID:"splitTotal",SPLIT_AMOUNT_TOTAL_ID:"splitAmtPer"},DetailElement={DEFAULT_ERROR_DIV_ID:"errorDiv_ep",TOP_BUTTON_ROW:"topButtonRow",DEFAULT_DETAIL_ELEMENT_ID:"ep",BOTTOM_BUTTON_ROW:"bottomButtonRow"},MouseOverElement={DEFAULT_CLASS:"mouseOverInfoOuter",DEFAULT_CLASS_INNER:"mouseOverInfo"},AjaxValidateFormula={VALID_KEY:"valid",RANGE_KEY:"range"},AssociationSelectElement={ASSOCIATION_DATA_PREFIX:"aasead_",
SERVLET_NAME:"sync.association.actions.AccountAssociationSuggestionsServlet",PARENT_ID_NAME_PREFIX:"aasepid_",SELECT_NAME_PREFIX:"aasesel_",LOOKUP_NAME_PREFIX:"aaselkup_"},GoogleTalkConstants={COLLAPSED_HEIGHT:0,MIN_EXPANDED_HEIGHT:22,HEIGHT_COOKIE:"gTalkHeight",COLLAPSED_COOKIE:"gTalkCollapsed",EXPANDED_HEIGHT:400},AjaxInNumericRange={pTO_TEST:"toTest",pHIGH:"high",pLOW:"low",pRESULT:"result"},LookupUi={pSEARCH_VALUE:"lksrch"},SetupTreeNodeConstants={COOKIE_KEY:"setupopen"},ForecastSettings={pALLOW_FM_SHARING:"allowFMSharing",
pFORECAST_SHARING:"forecastSharing"},JigsawSearch={CONTACT_SEARCH_OPTIONS:"contactSearchOptions",COMPANY_SEARCH_OPTIONS:"companySearchOptions",ST:"st",EI:"ei"},ListView={ACTION_COLUMN:"ACTION_COLUMN",CHECKBOX_ID:"ids",SELECT_ALL_BOX_ID:"allBox",ID_COLUMN:"LIST_RECORD_ID",DEFAULT_ROWS_PER_PAGE:25,ACTION_COLUMN_LABELS:"ACTION_COLUMN_LABELS"},ColumnTypeConstants={FILE_CONTENTTYPE_LENGTH:120,ADDRESS_POSTAL_CODE_OFFSET:3,DEFAULT_TEXTNAME_LENGTH:255,DEFAULT_LASTNAME_LENGTH:80,FILE_LENGTH_OFFSET:3,PERSONNAME_SALUTATION_OFFSET:0,
PERSONNAME_LASTNAME_OFFSET:2,DEFAULT_FIRSTNAME_LENGTH:40,DEFAULT_COUNTRY_LENGTH:40,ADDRESS_CITY_OFFSET:1,ADDRESS_COUNTRY_OFFSET:4,DEFAULT_STREET_LENGTH:255,PERSONNAME_FIRSTNAME_OFFSET:1,FILE_NAME_LENGTH:40,ADDRESS_STATE_OFFSET:2,DEFAULT_ZIP_LENGTH:20,ADDRESS_STREET_OFFSET:0,FILE_BODY_OFFSET:4,FILE_NAME_OFFSET:1,FILE_CONTENTTYPE_OFFSET:2,DEFAULT_STATE_LENGTH:20,FILE_FIELDDATA_OFFSET:0,DEFAULT_SALUTATION_LENGTH:40,DEFAULT_CITY_LENGTH:40},MCFilterPaneParams={pNO_LIMIT:"noLimit",pSCOPE:"ofscope",pORDER_BY_DIV:"orderBySection",
pSET_LIMIT:"setLimit",NONE_SCOPE_VALUE:"-1",pMAX_RECORD_RADIO:"maxRecordRadio"},SoftphoneConstants={MODULE_CLASS:"softphoneModule",SOFTPHONE_ID:"softphone",SIDEBAR_SOFTPHONE_WIDTH_STYLE_PX:"220"},CSNWelcomeMessage={DOM_ID:"CSNWelcomeMessage"},ReportConstants={pDELREP:"delrep",YES:"yes",pDRILLDOWN_VAL:"drillval",pDRILLDOWN:"drilldown",pEDIT:"edit",pDRILLDOWN_BREAK:"drillbreak",pSubTotalBy0:"subtotalBy0",pDRILLDOWN_COL:"drillcol"},MultiLookupInputElement={MULTI_LOOKUP_SELECT_SUFFIX:"_mlktp"},CompactLayoutUiConst=
{hideItemsRight:"hideItemsRight",saveButtonId:"saveButton",switchColumnToRight:"switchColumnRight",hideItemsLeft:"hideItemsLeft",showItemsLeft:"showItemsLeft",switchColumnToLeft:"switchColumnLeft",showItemsRight:"showItemsRight"},TaskUi={pNOTIFY_PREFERENCE_GROUP_ELEMENT:"prefEl",pSHOW_PREFERENCE:"show_pref",pMAX_ASSIGNEE_TEXT_LENGTH:200,pLOOKUP_SUMMARY_SUFFIX:"_sum",pLOOKUP_BUTTON_MULTI_OWNER_SUFFIX:"m",ASSIGNEE_SEPARATOR:",",pLOOKUP_DISPLAY_SUFFIX:"_dsp",MAX_TMU_ASSIGNEES:100},AjaxLoadRelatedListItem=
{pRELATED_LIST_ID:"RelatedListId"},SchedulingUtils={SCHEDULING_URL_KEY:"sched",OVERLAY_DIALOG_WIDTH:"877"},ActivityReminderConstants={DUE_TIME_ATTR:"due_time",DUE_MINUTES_ID:"minutes",SNOOZE_TIME_ID:"snooze_time",pAT:"at",pSNOOZED_AT:"snoozed_at",SNOOZE_ID:"snooze",REMINDERS_OK:"reminders_ready",REMINDERS_NONE:"reminders_none_active",REMINDER_ID:"reminder",DISMISS_ID:"dismiss",pTEST:"test",DISMISS_ALL_ID:"dismiss_all",SUMMARY_ID:"summary",ALL_DAY_ATTR:"all_day"},AjaxLoadPLAForRecordTypeServlet={RECORD_TYPE_ID:"rtId"},
ActivityPage={DISABLED_RECURRENCE_MSG_DIV:"DisabledRecurrenceMsgDiv"},EventObject={ONE_DAY_IN_MINUTES:1440},BounceEmailConstants={HIDDEN_BOUNCE_REASON:"hidden_bounce_reason",HIDDEN_EMAIL_ADDRESS:"hidden_email_address",HIDDEN_BOUNCE_DATE:"hidden_bounce_date"},ReportsFch={FLOATING_HEADER:"floatingHeader",FCH_AREA:"fchArea",HEADER_ROW:"headerRow"},RelatedListSuppressionServlet={pSUPPRESS:"suppress",pCONFIG_KEY:"configKey"},SidebarConstants={pSEARCH_SIDEBAR_STR:"sbstr",SIDEBAR_DIV_ID:"sidebarDiv",HANDLE_ID:"handle",
SIDEBAR_COLLAPSED_CLASS:"sidebarCollapsed",HANDLEBAR_CONTAINER:"handlebarContainer",PIN_INDICATOR_ID:"pinIndicator",SIDEBAR_PINNED_COOKIE:"sidebarPinned",PIN2_INDICATOR_ID:"pinIndicator2"},MultiUserCalendar={SHOW_NAMES_RIGHT:"2",SHOW_NAMES_BOTH:"0",SHOW_NAMES_LEFT:"1",SHOW_NAMES_NONE:"3"},LookupValidationServlet={pENTITY_NAME:"acent",pFILTER_RESULTS:"filterresults",pLKFIELD_NAME:"aclkfield",pDEPDATA_NAME:"aclkdata",pLKID_NAME:"aclkid",pLKENTITY_NAME:"aclkent"},TimePickerInputElementConstants={EMPTY_TIME_STANDIN:"HH:MM"},
HighlightsPanelConstants={HOVER_ICON_CONTAINER_CLASS:"hp_hover_icons",HOVER_LABEL_CLASS:"hp_hover_label",HIGHLIGHTS_PANEL_ID:"highlights_panel",VALUE_ELLIPSIS_CLASS:"hp_value_ellipsis",VALUE_CLASS:"hp_value",ROW_PREFIX_CLASS:"hp_row",LABEL_CLASS:"hp_label",HOVER_VALUE_CLASS:"hp_hover_value",HOVER_CLASS:"hp_hover",LABEL_ELLIPSIS_CLASS:"hp_label_ellipsis",DRAWER_ID:"highlights_panel_drawer",SINGLE_ITEM_COLUMN_CLASS:"hp_single_item_col",CELL_DIV_CLASS:"hp_cell"},ColorPickerConstants={DOM_ID:"colorPicker",
COLOR_VIEW_ID:"colorPickerColorView",HEX_VIEW_ID:"colorPickerHexView"},CrtObjectElement={JOIN_RADIO:"radio",MAX_OBJECTS_WARNING:"warning",LEVEL:"level",INNER_JOIN_SELECT:"inner_select",ELBOW_OUTER:"elbow_outer",INNER_JOIN_OPTION:"inner_join_option",OUTER_JOIN_SELECT:"outer_select",REMOVE_OBJECT_LINK:"remove",GHOST_ELBOW:"ghost_elbow",EST_OBJECT_LABEL:"estObjLabel",ELBOW_INNER:"elbow_inner",GHOST0:"ghost0",TERMINAL_OBJECT_WARNING:"endWarning",GHOST1:"ghost1"},EditEventMultiUserCalendarElementConstants=
{EDIT_PAGE_CALENDAR:"editEventCalendar"},DeveloperSettings={LICENSE_MGR_CHOICE_STR:"licenseMgr"},SectionElement={LEFT_TABLE_CLASS:"detailList"},KnowledgeSettingsUI={pASSIGNEE_PREFIX:"da_",pMAX_LANG_ROW_INDEX:"mlangri",pEXISTING_LANG_COUNT:"oldlangc",pLANG_SELECT_PREFIX:"las_",LANG_CONFIG_TABLE:"langtbl",pSTATUS_PREFIX:"st_",LANG_CONFIG_ADDER_ROW:-1,pREVIEW_PREFIX:"dr_",pLANG_PREFIX:"la_",pREMOVE_PREFIX:"rm_",WRAPPING_NEWROW_DIV:"newLanguageSetting"},EditElement={FIELD_NAME_CITY:"city",pID_SUFFIX:"_lkid",
FIELD_NAME_STATE:"state",FIELD_NAME_FIRST:"name_first",FIELD_NAME_COUNTRY:"country",FIELD_NAME_ZIP:"zip",FIELD_NAME_STREET:"street",ERROR_CLASS:"error",pTYPE_SUFFIX:"_lktp",FIELD_NAME_LAST:"name_last",pMOD_SUFFIX:"_mod",SELECTED_ID_SUFFIX:"_selected",FIELD_NAME_SALUTATION:"name_salutation",pBASE_NAME:"lknm",STREET_NUM_ROWS:2,pOLD_NAME_SUFFIX:"_lkold",UNSELECTED_ID_SUFFIX:"_unselected",STREET_NUM_COLS:27,CHECKBOX_SUFFIX:"_chkbox"},ForecastSummaryPage={pLOOKUP_INPUT_ENTERED:"lookupEntered"},StageManager=
{pWIZARD_RET_URL:"wizardRetUrl"},SchedulePage={pDuelOuter:"duelOuter",pIsOffPeak:"isoffpeak",pNotifyMe:"nm",pNotifyOthers:"no",pBlowout:"bout",pJobType:"jt",pEmailUrog:"eurog"},InlineEditConstants={SAVED:"saved",LAST_MOD:"sysMod",FIELD_DATA:"fields",COLUMN_ID:"columnId",FIELD_VALUE:"initialValue",SAVE_BUTTON:"inlineEditSave",FIELD_TYPE:"fieldType",VALIDATION_ERRORS:"validationErrors",IDS:"recordIds",FIELD_REQUIRED:"required",MAX_SAVE:200,FIELD_STATE:"state",COLUMN_LABEL:"label",INIT_HOOK:"initHook",
DYNAMIC_DATA:"dynamicData",SAVE_URL:"saveUrl",OVERRIDE_TYPE:"overrideType",IS_PERSON:"isPerson",NON_SPECIFIC_ERRORS:"nonSpecificErrors",SUCCESS:"success",EDITABLE:"editable",FIELD_ID:"fieldId",NULLABLE:"nullable",AFTER_SAVE_REDIRECT_URL:"afterSaveUrl",VF_ENABLED:"visualforce",ENTITY_ID:"entityId",SORTABLE:"isSortable",ENTITY_TYPE:"entityType",CELL_ID:"_ilecell",COLUMN_NAME:"columnName",LAYOUT_INFO:"layoutInfo",ROLODEXABLE:"useRolodex",MASS_EDITABLE:"massEditable",CANCEL_BUTTON:"inlineEditCancel",
IS_TASK:"isTask",INNER_ID:"_ileinner",NAME_LABEL:"nameLabel"},ManageableInfo={MORE_INFO_CLASS:"manageableMoreInfo",DHTML_ID:"manageableInfo"},CreateNewList={DHTML_ID:"newEntityList"},SchemaBuilder={pLABEL:"l",pID:"id",pOBJECTS:"objs",pURL:"u",pREQUIRED:"r",pTOP:"to",pLEFT:"le",pFIELDS:"flds",pTYPE:"t",pNAME:"n",pENTITYID:"eid",pHIDDEN:"h",pFILTER_OPTIONS:"filter_opts",pLAYOUT_ITEM_ID:"sblitemid",pLAYOUTID:"sblid",pSBLAYOUT:"sbl",FILTER_ALL:"all",FILTER_SELECTED:"sel",FILTER_STANDARD:"std",FILTER_CUSTOM:"cus",
FILTER_SYSTEM:"sys",pSHOW_RELATIONSHIP_FLAG:"srf",pSHOW_LABELS_FLAG:"slf",pHIDE_LEGEND_FLAG:"hlf",pALL_FLDS_LOADED:"afl"},SchemaBuilderConfig={MAX_OBJECTS:200,MAX_FIELDS:50},BrandingColor={TRANSPARENT_NAME:"Transparent",DEFAULT_NAME:"Default"},MyCustomObjectConstants={TABLE_CONFIG_KEY_MCOID:"mcoId",TABLE_CONFIG_KEY_TABLENAME:"tableName",TABLE_CONFIG_KEY_TABLE_DESCRIPTION:"tableDescription",EDIT_TABLE_CONFIG_KEY_TYPE:"editType",EDIT_TABLE_CONFIG_KEY_TYPE_DESCRIPTION:"editTableDescription",EDIT_TABLE_CONFIG_KEY_TYPE_TABLE_DETAI:"editTableDetail"},
HelpBubbleConstants={CLASS_ADD_PHOTO_HELP_BUBBLE:"profilePhotoHelpBubble",CLASS_CONTACT_INFO_HELP_BUBBLE:"contactInfoHelpBubble",CLASS_ABOUT_ME_HELP_BUBBLE:"aboutMeHelpBubble",CLASS_FOLLOW_PEOPLE_HELP_BUBBLE:"followPeopleHelpBubble",CLASS_INVITE_PEOPLE_BUBBLE:"invitePeopleHelpBubble",CLASS_CHATTER_INVITE_HELP_BUBBLE:"chatterInviteHelpBubble",CLASS_JOIN_GROUP_HELP_BUBBLE:"joinGroupHelpBubble",CLASS_CREATE_GROUP_HELP_BUBBLE:"createGroupHelpBubble",CLASS_ADD_GROUP_MEMBERS_HELP_BUBBLE:"addGroupMembersHelpBubble",
CLASS_ADD_GROUP_PHOTO_HELP_BUBBLE:"addGroupPhotoHelpBubble",CLASS_ADD_GROUP_DESCRIPTION_HELP_BUBBLE:"groupDescriptionHelpBubble",CLASS_CHANGE_EMAIL_SETTINGS_HELP_BUBBLE:"changeGroupEmailSettingsHelpBubble"};
function GenericSfdcPage(){this.init();this.inlineHelpMap={};this.helpParentElement=this.helpFader=null;this.actionListeners={};this.personalSetupArgs=null;var a=this;this.dirtyState=GenericSfdcPage.STATE_CLEAN;this.updateDirtyState=function(b){this.dirtyState=b;this.callListeners(GenericSfdcPage.UPDATE_DIRTY_STATE_EVENT,b)};this.getDirtyState=function(){return this.dirtyState};this.handleHelpHover=function(b){b=getEventTarget(getEvent(b));if(!(!b||UserContext.isAccessibleMode))if(b.className==InlineHelp.CLASS_NAME)b.className=
InlineHelp.CLASS_NAME_HOVER;else if(b.nodeName=="LABEL"&&b.parentNode&&b.parentNode.className==InlineHelp.CLASS_NAME)b.parentNode.className=InlineHelp.CLASS_NAME_HOVER;else if(b.className==InlineHelp.ORB){for(helpSpan=b.parentNode;!(helpSpan.className==InlineHelp.CLASS_NAME||helpSpan.className==InlineHelp.CLASS_NAME_HOVER);)helpSpan=helpSpan.parentNode;b=helpSpan.id;helpSpan.className=InlineHelp.CLASS_NAME_HOVER;if(b&&b.length>InlineHelp.SUFFIX_DELIMITER.length){b=b.substring(0,b.lastIndexOf(InlineHelp.SUFFIX_DELIMITER));
a.showHelp(b,helpSpan)}}};this.handleHelpUnhover=function(b){var c=getEventTarget(getEvent(b));if(!(!c||UserContext.isAccessibleMode))if(c.className==InlineHelp.CLASS_NAME_HOVER&&mouseExited(b,c))c.className=InlineHelp.CLASS_NAME;else if(c.nodeName=="LABEL"&&c.parentNode.className==InlineHelp.CLASS_NAME_HOVER&&mouseExited(b,c.parentNode))c.parentNode.className=InlineHelp.CLASS_NAME;else if(c.className==InlineHelp.DISPLAY_DIV_CLASS&&mouseExited(b,c))(b=getEventToElement(getEvent(b)))&&b.className!=
InlineHelp.ORB&&a.helpFader&&a.helpFader.fadeOut();else if(c.className==InlineHelp.ORB&&mouseExited(b,c)){b=getEventToElement(getEvent(b));c=c.parentNode;if(UserContext.isAccessibleMode)c=c.parentNode;if(b.className!=InlineHelp.DISPLAY_DIV_CLASS){if(b!=c)c.className=InlineHelp.CLASS_NAME;a.helpFader&&a.helpFader.fadeOut()}}};this.appendToOnloadQueue(function(){addEvent(window,"resize",function(){a.executeOnResizeQueue()});addEvent(document,"mouseover",a.handleHelpHover,false);addEvent(document,"mouseout",
a.handleHelpUnhover,false);if(XBrowser.userAgent.isIE6||XBrowser.userAgent.isIE7||XBrowser.userAgent.isIE8)addEvent(document.body,"click",a.handleLabelClickIEOnly)});this.appendToOnloadQueue(GenericSfdcPage.displayAlohaWarning)}GenericSfdcPage.STATE_CLEAN=0;GenericSfdcPage.STATE_DIRTY=1;GenericSfdcPage.STATE_ERROR=2;GenericSfdcPage.STATE_SAVING=3;GenericSfdcPage.UPDATE_DIRTY_STATE_EVENT="updateDirtyState";
GenericSfdcPage.prototype.init=function(){this.onLoadQueue=[];this.onBeforeUnloadQueue=[];this.onResizeQueue=[];this.hasRun=false;this.relatedLists=[];this.relatedListsById={};this.dialogs={};this.messages={};this.appendToOnloadQueue(function(){XBrowser.turnOnBackgroundImageCache()},"Turn on CSS background image cache (IE6 only)")};
GenericSfdcPage.prototype.handleLabelClickIEOnly=function(a){var b=getEvent(a);if(b=getEventTarget(b))if(b.tagName=="LABEL"&&b.htmlFor)if(b=getElementByIdCS(b.htmlFor)){b.type&&b.type.toLowerCase()=="checkbox"&&b.click();if(b.focus){b.focus();a.returnValue=false}}};GenericSfdcPage.prototype.prependToOnloadQueue=function(a,b){if(b)a.desc=b;this.hasRun?this.execFunctionNoThrow(a):this.onLoadQueue.unshift(a)};
GenericSfdcPage.prototype.appendToOnloadQueue=function(a,b){if(b)a.desc=b;this.hasRun?this.execFunctionNoThrow(a):this.onLoadQueue.push(a)};GenericSfdcPage.prototype.executeOnloadQueue=function(){UserContext&&UserContext.uiSkin===UiSkin.ALOHA.apiValue&&AlohaSkin&&AlohaSkin.doSizing&&AlohaSkin.doSizing();for(var a=0;this.onLoadQueue&&a<this.onLoadQueue.length;a++)this.execFunctionNoThrow(this.onLoadQueue[a]);this.hasRun=true;this.onLoadQueue=[]};
GenericSfdcPage.prototype.prependToOnBeforeUnloadQueue=function(a,b){if(b)a.desc=b;this.onBeforeUnloadQueue.unshift(a)};GenericSfdcPage.prototype.appendToOnBeforeUnloadQueue=function(a,b){if(b)a.desc=b;this.onBeforeUnloadQueue.push(a)};GenericSfdcPage.prototype.executeOnBeforeUnloadQueue=function(){for(var a=0;this.onBeforeUnloadQueue&&a<this.onBeforeUnloadQueue.length;a++)this.execFunctionNoThrow(this.onBeforeUnloadQueue[a]);if(window.Jiffy&&Jiffy.onUnload)Jiffy.onUnload()};
GenericSfdcPage.prototype.prependToOnResizeQueue=function(a,b){if(b)a.desc=b;this.onResizeQueue.unshift(a)};GenericSfdcPage.prototype.appendToOnResizeQueue=function(a,b){if(b)a.desc=b;this.onResizeQueue.push(a)};GenericSfdcPage.prototype.executeOnResizeQueue=function(){for(var a=0;this.onResizeQueue&&a<this.onResizeQueue.length;a++)this.execFunctionNoThrow(this.onResizeQueue[a])};GenericSfdcPage.prototype.execFunctionNoThrow=function(a){try{a()}catch(b){if(a.desc)b.sfdcDesc=a.desc;Gack.handleException(b)}};
GenericSfdcPage.prototype.registerListener=function(a,b){this.actionListeners[a]=this.actionListeners[a]||[];this.actionListeners[a].push(b)};GenericSfdcPage.prototype.callListeners=function(a,b){var c=this.actionListeners[a];if(c)for(var d=0;d<c.length;++d)c[d](b)};GenericSfdcPage.prototype.setPrefAndHideBanner=function(a,b,c){UserContext.userPreferences.setBoolean(a,b);this.hideMessage(c)};GenericSfdcPage.prototype.getRelatedListCount=function(a){return a.relatedLists.length};
GenericSfdcPage.prototype.registerRelatedList=function(a,b,c,d,e,f,k,j,l,h){var g=sfdcPage.getRelatedListCount(this)==0;if(!this.relatedListsById[a]){this.relatedListsById[a]=new RelatedList(a,b,c,d,e,f,k,j,h);this.relatedLists.push(this.relatedListsById[a])}this.relatedListPanel&&l&&this.relatedListPanel.registerList(this.relatedListsById[a]);var i=this;g&&this.prependToOnloadQueue(function(){i.relatedListPanel&&i.relatedListPanel.addListsToPanel&&i.relatedListPanel.addListsToPanel()},"rlHovers: Initializing panel")};
GenericSfdcPage.prototype.registerDialog=function(a){this.appendToOnloadQueue(function(){a.createDialog()},"Create a dialog");this.dialogs[a.id]=a};GenericSfdcPage.prototype.unRegisterDialog=function(a){this.dialogs[a.id]=null};GenericSfdcPage.prototype.getDialogById=function(a){return this.dialogs[a]};GenericSfdcPage.prototype.getRelatedListById=function(a){return this.relatedListsById[a]};
GenericSfdcPage.prototype.getHrefAsRetURL=function(){var a=window.location.href.split("/");a.splice(0,3);return encodeURIComponent("/"+a.join("/"))};GenericSfdcPage.prototype.includeJavascriptTag=function(a){return this.embedJSTag(a,document)};GenericSfdcPage.prototype.embedJSTag=function(a,b){var c=b.getElementsByTagName("head").item(0),d=b.createElement("script");d.setAttribute("language","javascript");d.setAttribute("type","text/javascript");d.setAttribute("src",a);c.appendChild(d);return false};
GenericSfdcPage.prototype.embedExternalStyleSheet=function(a,b){var c=b.createElement("link");c.setAttribute("href",a);c.setAttribute("type","text/css");c.setAttribute("rel","stylesheet");b.body.parentNode.firstChild.appendChild(c)};GenericSfdcPage.prototype.hideEmbeddingIframe=function(a){if(a.name&&document.getElementById(a.name)){document.getElementById(a.name).style.display="none";document.getElementById(a.name).parentNode.style.border="none"}};
GenericSfdcPage.prototype.setHelp=function(a,b){this.inlineHelpMap[a]=b};GenericSfdcPage.prototype.getHelp=function(a){return this.inlineHelpMap[a]};GenericSfdcPage.prototype.setHelpParent=function(a){this.helpParentElement=a};
GenericSfdcPage.prototype.showHelp=function(a,b){var c=this.getHelp(a);if(c){if(!this.displayDiv){this.displayDiv=document.createElement("DIV");this.displayDiv.className=InlineHelp.DISPLAY_DIV_CLASS}var d=this.helpParentElement;if(!d){d=document.getElementById("bodyDiv_setup");if(!d){d=document.getElementById(BodyLayout.BODY_CELL_ID);if(!d)d=document.body}}d.appendChild(this.displayDiv);this.displayDiv.style.top=getObjY(b)+b.offsetHeight+8-getObjY(d)+"px";if(!this.helpFader)this.helpFader=new MouseOverFadeHandler(null,
this.displayDiv,false);this.displayDiv.innerHTML=c;this.helpFader.setPosition();c=document.getElementById(SidebarConstants.SIDEBAR_DIV_ID);if(LC.isRtlPage()){var e=getObjX(d)+d.offsetWidth-getObjX(b)-this.displayDiv.offsetWidth;if(c){e+=c.offsetWidth;d=getObjX(d)+d.offsetWidth-getObjX(c);if(e<d)e=d}if(e>=0)this.displayDiv.style.right=e+"px"}else{d=getObjX(b)-getObjX(d)+b.offsetWidth-this.displayDiv.offsetWidth;if(c){d+=c.offsetWidth;c=getObjX(c)+c.offsetWidth;if(d<c)d=c}if(d>=0)this.displayDiv.style.left=
d+"px"}this.helpFader.fadeIn()}};GenericSfdcPage.prototype.registerMessage=function(a){var b=document.getElementById(a);if(b&&!this.messages[a])this.messages[a]=b};GenericSfdcPage.prototype.hideMessage=function(a){if(a=this.messages[a])a.style.display="none"};GenericSfdcPage.prototype.showMessage=function(a){if(a=this.messages[a])a.style.display="block"};
GenericSfdcPage.prototype.findSimilarNavigate=function(a,b,c,d){function e(j,l){for(var h=0;h<j.length;h++){for(var g=j[h],i=false,m=0;m<6;m++){g=g.parentNode;if(!g){i=true;break}}i||!g.id||g.id==l&&f.append(findSimilarQueryPage.SEARCH_QUERY_STRING,j[h].innerHTML," ")}}a=document.getElementsByTagName(a);d=document.getElementById(d);c=document.getElementById(c);b=document.getElementById(b);var f=new QueryString(""),k=UserContext.getUrl("/_ui/common/search/similar/FindSimilarQueryPage/d");f.append(findSimilarQueryPage.SEARCH_QUERY_STRING,
b.innerHTML," ");f.append(findSimilarQueryPage.SEARCH_QUERY_STRING,c.innerHTML," ");d!=undefined&&e(a,d.id);f.add(findSimilarQueryPage.FIND_PROVIDER,"common.search.similar.IdeaFindSimilarProvider");return k+f.toString()};
GenericSfdcPage.prototype.handleDivisionOnChange=function(a,b){var c=UserContext.getUrl(a);XBrowser.postHttpResponse(c,function(){document.filter_element&&document.filter_element.submit();if(ListViewport.instances)for(var d in ListViewport.instances){var e=ListViewport.instances[d];e.refreshList&&e.refreshList()}},b.name+"="+b.value)};GenericSfdcPage.prototype.registerDependentLookup=function(){};GenericSfdcPage.prototype.getReferredDomIds=function(a){if(typeof apexDependentLookupInfo!="undefined")return apexDependentLookupInfo.lookupInfo[a]};
GenericSfdcPage.prototype.save=function(){var a=document.getElementsByName(EditPageConstants.pSAVE);a.length>0&&a[0].click()};GenericSfdcPage.prototype.getEntityId=function(a){if(typeof apexDependentLookupInfo!="undefined")return apexDependentLookupInfo.entitiesByClientId[a]};
GenericSfdcPage.prototype.getFieldValueById=function(a){var b=getElementByIdCS(a+EditElement.pID_SUFFIX);b||(b=getElementByIdCS(a));if(b){if(b.type=="checkbox")return b.checked?"1":"0";else if(hasStyleClass(b.parentNode,"dateOnlyInput")){a=b.value;if(LC.isEnglishLanguage())a=LC.isEnglishUS()?DateUtil.getCheckYearValue(b.value)||b.value:DateUtil.getEvaluateShortcutValue(b.value)||b.value;return a}return b.value}};
GenericSfdcPage.prototype.initLookups=function(){for(var a in ForeignKeyInputElement.allElements)if(ForeignKeyInputElement.allElements.hasOwnProperty(a)){var b=ForeignKeyInputElement.allElements[a];b.referredDomIds=this.getReferredDomIds(a);b.afterLoad()}for(a in ForeignKeyInputElement.allElements)ForeignKeyInputElement.allElements.hasOwnProperty(a)&&ForeignKeyInputElement.allElements[a].validateAfterLoadIfNecessary()};
GenericSfdcPage.displayAlohaWarning=function(){var a=document.getElementById("browserWarningContent");if(a&&!UserContext.userPreferences.getBoolean("HideBrowserWarning")){var b=Dialogs.types.INFO;a=Dialogs.createDialog({id:"browserWarningDialog",title:LC.getLabel("BrowserWarnings","DialogTitle"),message:a.innerHTML,backgroundClass:b.backgroundClass,contentClass:b.contentClass,iconClass:b.iconClass,iconAlt:b.getIconAlt(),actions:[function(){UserContext.userPreferences.setBoolean("HideBrowserWarning",
true)}],actionLabels:[LC.getLabel("Buttons","ok")]},false);sfdcPage.dialogs[a.id]=a;a.createDialog();a.setWidth(560);a.show()}};GenericSfdcPage.prototype.getPersonalSetupArgs=function(){return this.personalSetupArgs};GenericSfdcPage.prototype.resetPersonalSetupArgs=function(){return delete this.personalSetupArgs};
GenericSfdcPage.prototype.openPersonalSetup=function(a,b,c){window.Jiffy&&Jiffy.mark("personalSetupOpen");this.personalSetupArgs=b?[b,c]:null;b=this.getDialogById("PersonalSetup");c=false;if(!b){c=true;b=new PersonalSettingsDialog("PersonalSetup",LC.getLabel("PersonalSetup","title"),a,20,840,{extraClass:"personalSetupOverlay absolutePositionedOverlayDialog",resizable:true,movable:true});b.register()}window.Jiffy&&Jiffy.measure("dialogCreatedOrRetrieved","personalSetupOpen");b.show();if(!c)(a=b.getContentWindow())&&
a.Sfdc&&a.Sfdc.setup.PersonalSetup.instance&&a.Sfdc.setup.PersonalSetup.instance.checkNodeDataFromParent();if(window.Jiffy){window.addEventListener&&window.addEventListener("DOMFrameContentLoaded",function(){Jiffy.measure("dialogLoaded","personalSetupOpen")},false);Jiffy.measure("dialogShown","personalSetupOpen")}};
var UserContext={initialized:false,locale:"",language:"",startOfWeek:0,dateFormat:"",dateTimeFormat:"",timeFormat:"",ampm:null,today:"",isAccessibleMode:false,userPreferences:null,siteUrlPrefix:"",userId:"",uiSkin:"",initialize:function(a){a?UserContext.processValues(a):UserContext.initializeFromServlet()},initializeFromServlet:function(){var a=UserContext.getUrl("/_ui/system/context/UserContextServlet");XBrowser.getHttpResponse(a,function(b){b=Util.evalAjaxServletOutput(b.responseText);UserContext.processValues(b)})},
processValues:function(a){for(var b in a)if(typeof UserContext[b]!="undefined")UserContext[b]=b=="userPreferences"||b=="orgPreferences"?new PreferenceBits(a[b]):a[b];UserContext.initialized=true},getUrl:function(a){if(typeof a=="undefined"||typeof UserContext.siteUrlPrefix=="undefined"||!UserContext.siteUrlPrefix)return a;if(a.indexOf("/")!==0)return a;if(a.indexOf(UserContext.siteUrlPrefix)===0)return a;return UserContext.siteUrlPrefix+a}};
var DesktopContext={pageTitle:"",pageTitleIcon:"",pageTitleIconAlt:"",interactionLog:{}};DesktopContext.setCurrentDesktopParam=function(a){var b=(new QueryString(null)).get(Desktop.IS_DESKTOP);if(b)a[Desktop.IS_DESKTOP]=b;return a};DesktopContext.getDesktopParam=function(a){return(a=QueryString.createQueryString(a,true).get(Desktop.IS_DESKTOP))?a[0]:null};
DesktopContext.preserveDesktopPageParam=function(a,b){a=a||window.location.href;var c=QueryString.createQueryString(a,true).get(Desktop.IS_DESKTOP);if(c)b[Desktop.IS_DESKTOP]=c[0]};DesktopContext.preserveDesktopPageUrl=function(a,b,c){var d=QueryString.getURI(a);a=QueryString.createQueryString(a,true);if(!c||a.get(Desktop.IS_DESKTOP)===null){b||(b=(new QueryString(null)).get(Desktop.IS_DESKTOP));b&&a.add(Desktop.IS_DESKTOP,b)}return d+a.toString()};
DesktopContext.fireBeforeRedirectPage=function(a,b,c,d){if(isServiceDeskPage&&a)(a=Ext.getCmp(a))&&a.fireBeforeRedirectPage(b,d,c)};DesktopContext.fireCloseTab=function(a,b,c,d){if(typeof isServiceDeskPage!=="undefined"&&isServiceDeskPage){if(typeof a==="string")a=Ext.getCmp(a);a&&a.fireCloseTab(b,c,d)}};DesktopContext.fireAfterLoadPage=function(a){if(a)(a=Ext.getCmp(a))&&a.fireAfterLoadPage()};
var Util={makeOptionString:function(a,b,c){if(c){c.push('<option value="');c.push(b);c.push('">');c.push(a);c.push("</option>")}else return"<option value='"+b+"'>"+a+"</option>"},scriptCache:{},evalScriptsUnderElement:function(a){function b(d,f,e){var g=function(i){e[f]=i;c(e)};if(d!==""){var h=Sfdc.Url.getDomainFromUrl(d).toLowerCase();h.length&&h!==document.domain.toLowerCase()?g({url:d,isRemote:true}):Sfdc.Ajax.request(d,{success:g,failure:g})}else c(e)}function c(d){for(var f=0,e,g=d.length;f<
g;f++){e=d[f];if(!Sfdc.isDefAndNotNull(e))break;if(e!==true){if(e.isRemote===true){Sfdc.Ajax.jsonp(e.url,{onScriptLoad:function(i,j){return function(){i[j]=true;c(i)}}(d,f),cache:false});d[f]=null;break}if(e.length)try{if(window.execScript)window.execScript(e);else if(window.eval)with(window)window.eval(e);else eval(e)}catch(h){Sfdc.error(h)}d[f]=true}}}Util.evalScriptsUnderElement=function(d){var f=d.getElementsByTagName("script");d=[];for(var e=[],g=0;g<f.length;g++){var h=f[g].src;if(h){Util.scriptCache[h]||
(Util.scriptCache[h]=true);d.push(h)}else{d.push("");e[g]=f[g].innerHTML}}for(f=0;f<d.length;f++)b(d[f],f,e)};return Util.evalScriptsUnderElement(a)},stripScriptsUnderElement:function(a){a=a.getElementsByTagName("script");for(var b=[],c=0;c<a.length;c++)a[c].src?b.push(a[c].cloneNode(true)):b.push(a[c].innerHTML);for(c=a.length-1;c>=0;c--)a[c].parentNode.removeChild(a[c]);return b},evalScriptList:function(a){for(var b=0;b<a.length;b++){var c=a[b].src;if(c){if(!Util.scriptCache[c]){XBrowser.createDynamicScript(c);
Util.scriptCache[c]=true}}else eval(a[b])}},evalScriptsUnderElementWithSrc:function(a){setTimeout(function(){for(var b=a.getElementsByTagName("script"),c=document.getElementsByTagName("head")[0],d=0;d<b.length;d++){var f=document.createElement("script");f.type=b[d].type;if(b[d].src){var e=b[d].src,g=e.indexOf("://");if(g!=-1)e=e.substring(e.indexOf("/",g+3));g=XBrowser.createHttpRequest();g.open("GET",e,false);g.send(null);eval(g.responseText);f.src=e;c.appendChild(f)}else if(b[d].text){eval(b[d].text);
f.text=b[d].text;c.appendChild(f)}}},0)},evalAjaxServletOutput:function(a){if(a)if(a.substring(0,AjaxServlet.CSRF_PROTECT.length)!==AjaxServlet.CSRF_PROTECT)throw"CSRF protect string not added to servlet response.";else return eval("("+Util.stripCSRFProtect(a)+")");else return null},stripCSRFProtect:function(a){if(a.indexOf(AjaxServlet.CSRF_PROTECT)===0)return a.substring(AjaxServlet.CSRF_PROTECT.length,a.length);return a},refreshDynamicSelect:function(a,b,c,d){for(var f=0,e=["<select name='",a.name,
"' id='",a.id,"' class='",a.className,"' title='",a.title,"'"],g=["size","multiple","tabindex"],h=0;h<g.length;h++){var i=g[h];if(a[i]){e.push(" ");e.push(i);e.push("='");e.push(a[i]);e.push("'")}}if(a.attributes.tabindex){e.push(" ");e.push("tabindex");e.push("='");e.push(a.attributes.tabindex.nodeValue);e.push("'")}e.push(">");g=0;if(c){Util.makeOptionString(LC.getLabel("SelectElement","Required"),"",e);g++}for(h=0;h<b.length;h++){c=b[h][1];Util.makeOptionString(b[h][0],c,e);if(d&&c===d)f=g;g++}e.push("</select>");
b=a.parentNode;if(!b.isDynamicSelect){h=document.createElement("SPAN");h.isDynamicSelect=true;b.insertBefore(h,a);b.removeChild(a);b=h}b.innerHTML=e.join("");a=b.firstChild;if(d)a.selectedIndex=f;return a},createDynamicSelect:function(a,b,c){var d=["<select"],f;for(f in a){d.push(" ");d.push(f);d.push("='");d.push(a[f]);d.push("'")}d.push(">");c&&Util.makeOptionString(LC.getLabel("SelectElement","Required"),"",d);for(a=0;a<b.length;a++)Util.makeOptionString(b[a][0],b[a][1],d);d.push("</select>");
return d.join("")},insertOption:function(a,b,c){a.currentStyle?a.add(b,c):a.add(b,a.options[c])},convertOptionsForPicklistData:function(a){for(var b=[],c=0;c<a.length;c++){var d=escapeHTML(a[c][1]);if(d&&typeof d.replace==="function")d=d.replace(/\'/g,"&#39;");b.push(d);b.push(escapeHTML(a[c][0]))}return b},animate:function(a){var b=a.obj,c=a.prop,d=parseInt(a.start,10),f=a.target,e=a.f||function(k){return k},g=a.inc||1,h=a.maxinc||Infinity,i=a.after,j=a.aftereach;if(f<d){a=d-e(g);d=a<f?f:a}else if(f>
d){a=d+e(g);d=a>f?f:a}if(c=="opacity"){b.style[c]=d/100;b.style.filter="alpha(opacity="+d+")"}else b.style[c]=d+"px";g>=h||g++;if(d!=f){j&&j();setTimeout(function(){Util.animate({obj:b,prop:c,start:d,target:f,f:e,aftereach:j,after:i,inc:g})},20)}else{j&&j();i&&setTimeout(i,50)}},apply:function(a,b){if(a&&b&&typeof b=="object")for(var c in b)a[c]=b[c];return a},applyIf:function(a,b){if(a&&b)for(var c in b)if(typeof a[c]=="undefined")a[c]=b[c];return a},hasStyleEndsWith:function(a,b){var c=RegExp(" (\\S*"+
b+") ").exec(" "+a.className+" ");return c?c[1]:false},convertPathToTitle:function(a){if(navigator.platform&&navigator.platform.indexOf("Win")>=0){var b="\\";if(a.lastIndexOf(b)>=0)a=a.substring(a.lastIndexOf(b)+1);b="/";if(a.lastIndexOf(b)>=0)a=a.substring(a.lastIndexOf(b)+1)}else if(a.lastIndexOf("/")>=0)a=a.substring(a.lastIndexOf("/")+1);b=a.lastIndexOf(".");if(b<1)return{name:a};return{name:a.substring(0,b),extension:a.substring(b+1,a.length)}},getFileNameFromFileInputUsingJS:function(a){if(a.files&&
a.files.item(0)){var b=a.files.item(0).fileName;if(!b)b=a.files.item(0).name;return b}else return a.value},extend:function(a,b){var c=function(){};c.prototype=b.prototype;c=new c;c.constructor=a;a.prototype=c},functionMapping:{},stripCustomFunctionFromObjectPrototype:function(a){var b=this.functionMapping[a];b||(b={});for(var c in a.prototype){b[c]=a.prototype[c];delete a.prototype[c]}this.functionMapping[a]=b},restoreCustomFunctionsToObjectPrototype:function(a){var b=this.functionMapping[a];if(b){for(var c in b)if((!b.hasOwnProperty||
b.hasOwnProperty(c))&&typeof a.prototype[c]==="undefined")a.prototype[c]=b[c];this.functionMapping[a]=null}}};
function ApiUtils(){}ApiUtils.getApiURL=function(a,d){var b=window.location.href,c=b.indexOf("/",10);return b.substring(0,c)+UserContext.getUrl("/services/Soap/")+(a?"u":"c")+"/"+d};ApiUtils.getSessionId=function(){return getCookie(RequestInfo.pSID)};
ApiUtils.to18CharId=function(a){if(a==null||a.length==18)return a;a=a.replace(/\"/g,"");if(a.length!=15)return null;for(var d="",b=0;b<3;b++){for(var c=0,e=0;e<5;e++){var f=a.charAt(b*5+e);if(f>="A"&&f<="Z")c+=1<<e}d+=c<=25?"ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(c):"012345".charAt(c-26)}return a+d};ApiUtils.to15CharId=function(a){if(!a)return null;return a.substring(0,15)};
ApiUtils.getId=function(a){if(!a)return null;a=a.get("Id");if(a.splice&&a.length&&a.length>0)a=a[0];if(a)a=ApiUtils.to15CharId(a);return a};ApiUtils.soqlEncode=function(a){a=a.replace("\\","\\\\");return a=a.replace("'","\\'")};
function CustomEntityDefinition(a,b,e){if(document.getElementsByName(b)){CustomEntityDefinition.prototype.pickerPrefix=a;CustomEntityDefinition.prototype.standardHelpId=e;CustomEntityDefinition.prototype.currentSelect=null;CustomEntityDefinition.prototype.enableScontrolPicker=function(d){d=getEventTarget(getEvent(d));if(CustomEntityDefinition.prototype.currentSelect!=null){CustomEntityDefinition.prototype.currentSelect.value="";if(d.id==e)CustomEntityDefinition.prototype.currentSelect.disabled=true;
else CustomEntityDefinition.prototype.currentSelect.className="hidden"}d=document.getElementById(CustomEntityDefinition.prototype.pickerPrefix+d.value);if(d!=null){d.className="";d.disabled=false;CustomEntityDefinition.prototype.currentSelect=d}};a=document.getElementsByName(b);for(b=0;b<a.length;b++){var c=a[b];addEvent(c,"click",CustomEntityDefinition.prototype.enableScontrolPicker,false);c=document.getElementById(CustomEntityDefinition.prototype.pickerPrefix+c.value);if(c!=null&&c.className!="hidden")CustomEntityDefinition.prototype.currentSelect=
c}}}CustomEntityDefinition.handleAutoNumberSel=function(a,b,e){a=a.options[a.selectedIndex].value=="AutoNumber";toggleRow(b,a);e&&toggleRow(e,a)};CustomEntityDefinition.hasAlerted=false;CustomEntityDefinition.displayFormatChangeWarning=function(){if(!CustomEntityDefinition.hasAlerted){alert(LC.getLabel("Page_CustomEntityDefinition_Edit","DisplayFormatChangeWarning"));CustomEntityDefinition.hasAlerted=true}};
CustomEntityDefinition.setNameLabel=function(a,b){if(b.value.length==0&&a.value.length!=0){var e=b.maxLength,c=LC.getLabel("Page_CustomEntityDefinition_Edit","DefaultNameLabel",a.value);if(c.length>e)c=c.substring(0,e);b.value=c}};
function CustomSummaryFieldAttributes(a,c,e,h,i,g,j,k){this.radios=document.getElementsByName(i);this.parentEntityEnumOrId=c;this.servletUrl=a;this.entityElement=document.getElementById(e);this.fieldTarget=document.getElementById(h);if(this.entityElement)this.currentEntity=this.getEntityValue(this.entityElement.options[this.entityElement.selectedIndex].value);else for(var m in k){this.currentEntity=m;break}this.oldOpVal=null;for(a=0;a<this.radios.length;a++)if(this.radios[a].checked){this.oldOpVal=
this.radios[a].value;break}this.cache=k?k:{};this.criteriaCache={};var b=this;this.handleRadioClick=function(){for(var d,f=0;f<b.radios.length;f++)if(b.radios[f].checked){d=b.radios[f].value;break}CustomSummaryFieldAttributes.getShownFields(d)!=CustomSummaryFieldAttributes.getShownFields(b.oldOpVal)&&b.setCurrentEntity();b.oldOpVal=d};this.handleEntityChange=function(){var d=b.getEntityValue(b.entityElement.options[b.entityElement.selectedIndex].value);b.setCurrentEntity(d)};this.handleFilterViewClick=
function(d){d=getEventTarget(getEvent(d));document.getElementById(CriteriaInputConstants.FILTER_SECTION_ID).style.display=d.value=="1"?"block":"none"};this.cacheFieldsFromResponse=function(d){d=Util.evalAjaxServletOutput(d.responseText);b.cache[d[AjaxLoadFieldsForEntity.pENTITY_NAME]]=d[AjaxLoadFieldsForEntity.pFIELD_LIST];b.fillFieldsFromCache()};this.setCurrentEntity=function(d){if(typeof d!="undefined")b.currentEntity=d;if(b.currentEntity){b.setOpsEnabled(true);if(b.cache[b.currentEntity])b.fillFieldsFromCache();
else{d={};d[b.entityElement.name]=b.currentEntity;d[AjaxLoadFieldsForEntity.pPARENT_ENTITY_NAME]=b.parentEntityEnumOrId;XBrowser.postHttpResponse(b.servletUrl,b.cacheFieldsFromResponse,XBrowser.buildPost(d))}}else b.setOpsEnabled(false)};this.setOpsEnabled=function(d){if(b.radios&&b.radios.length>0)for(var f=0;f<b.radios.length;f++){b.radios[f].disabled=!d;if(!d)b.radios[f].checked=false}if(b.fieldTarget){b.fieldTarget.disabled=!d;if(!d){b.fieldTarget=Util.refreshDynamicSelect(b.fieldTarget,[],true);
b.fieldTarget.disabled=true}}};var l;if(this.currentEntity){l=new CriteriaEntityData(this.currentEntity,this.cache[this.currentEntity]);this.criteriaCache[this.currentEntity]=l}this.criteriaInput=new CriteriaInput(g,j,l);this.currentEntity?this.setCurrentEntity():this.setOpsEnabled(false);this.initEvents()}CustomSummaryFieldAttributes.prototype.getEntityValue=function(a){if(!a)return null;return a.substring(0,a.indexOf("."))};
CustomSummaryFieldAttributes.prototype.showOptions=function(a){document.getElementById(SummaryFieldConstants.OPTIONS_ID).style.display=a?"block":"none"};
CustomSummaryFieldAttributes.prototype.initEvents=function(){for(var a=0;a<this.radios.length;a++)addEvent(this.radios[a],"click",this.handleRadioClick,false);var c=document.getElementsByName(CriteriaInputConstants.SHOW_SUMMARY_FILTER);for(a=0;a<c.length;a++){addEvent(c[a],"click",this.handleFilterViewClick,false);if(c[a].value=="1"&&c[a].checked)document.getElementById(CriteriaInputConstants.FILTER_SECTION_ID).style.display="block"}this.entityElement&&addEvent(this.entityElement,"change",this.handleEntityChange,
false)};CustomSummaryFieldAttributes.prototype.setCurrentCriteria=function(a){var c=this.cache[a];c||Gack.sendGack("criteriadata set before fields loaded.  Entity: "+a);var e=this.criteriaCache[a];if(!e){e=new CriteriaEntityData(a,c);this.criteriaCache[a]=e}this.criteriaInput.setEntity(e)};
CustomSummaryFieldAttributes.prototype.fillFieldsFromCache=function(){for(var a,c=0;c<this.radios.length;c++)if(this.radios[c].checked){a=CustomSummaryFieldAttributes.getShownFields(this.radios[c].value);break}this.setCurrentCriteria(this.currentEntity);var e=false;if(this.fieldTarget){if(a){var h;if(this.fieldTarget.options&&this.fieldTarget.selectedIndex>=0)h=this.fieldTarget.options[this.fieldTarget.selectedIndex].value;var i=[],g=this.cache[this.currentEntity],j=1;for(c=0;c<g.length;c++)if(g[c].columnType in
a){e=true;i.push([g[c].label,g[c].name]);j++}this.fieldTarget=Util.refreshDynamicSelect(this.fieldTarget,i,true,h)}else this.fieldTarget=Util.refreshDynamicSelect(this.fieldTarget,[],true,"");this.fieldTarget.disabled=e?false:true}};
CustomSummaryFieldAttributes.getShownFields=function(a){switch(a){case "0":return null;case "1":a={};for(var c in ColumnType)if(ColumnType[c].isNumber)a[c]=true;return a;case "2":case "3":a={};for(c in ColumnType)if(ColumnType[c].isNumber||ColumnType[c].isDate)a[c]=true;return a}};
function MaskTypeSelector(d,e,f,g){this.targetDiv=document.getElementById(d);this.typeSelect=document.getElementById(e);this.charSelect=document.getElementById(f);this.maskData=g;var a=this;this.handleSelectChange=function(){var b=a.typeSelect.options[a.typeSelect.selectedIndex].value,c=a.charSelect.options[a.charSelect.selectedIndex].value;if(b&&c){b=a.maskData[b];b=b.replace(/X/g,c);a.targetDiv.innerHTML=b}else a.targetDiv.innerHTML=""};addEvent(this.typeSelect,"change",this.handleSelectChange,
false);addEvent(this.charSelect,"change",this.handleSelectChange,false);this.handleSelectChange()};
function CompactLayoutUi(){var b=this;this.appendToOnloadQueue(function(){b.attachEvents()})}CompactLayoutUi.prototype=new GenericSfdcPage;CompactLayoutUi.prototype.initialize=function(b,c,a){this.unusedItems=b;this.leftColItems=c;this.rightColItems=a};
CompactLayoutUi.prototype.attachEvents=function(){var b=document.getElementById(this.unusedItems),c=document.getElementById(this.leftColItems),a=document.getElementById(this.rightColItems),d=this;CompactLayoutUi.addClick(document.getElementById(CompactLayoutUiConst.switchColumnToRight),function(){moveOption(c,a,LC.getLabel("SelectElement","Required"),[],null,LC.getLabel("SelectElement","Required"))});CompactLayoutUi.addClick(document.getElementById(CompactLayoutUiConst.switchColumnToLeft),function(){moveOption(a,
c,LC.getLabel("SelectElement","Required"),[],null,LC.getLabel("SelectElement","Required"))});CompactLayoutUi.addClick(document.getElementById(CompactLayoutUiConst.hideItemsLeft),function(){moveOption(c,b,LC.getLabel("SelectElement","Required"),[],null,LC.getLabel("SelectElement","Required"))});CompactLayoutUi.addClick(document.getElementById(CompactLayoutUiConst.showItemsLeft),function(){moveOption(b,c,LC.getLabel("SelectElement","Required"),[],null,LC.getLabel("SelectElement","Required"))});CompactLayoutUi.addClick(document.getElementById(CompactLayoutUiConst.hideItemsRight),
function(){moveOption(a,b,LC.getLabel("SelectElement","Required"),[],null,LC.getLabel("SelectElement","Required"))});CompactLayoutUi.addClick(document.getElementById(CompactLayoutUiConst.showItemsRight),function(){moveOption(b,a,LC.getLabel("SelectElement","Required"),[],null,LC.getLabel("SelectElement","Required"))});CompactLayoutUi.addClick(document.getElementById(CompactLayoutUiConst.saveButtonId),function(){d.selectAll();return true})};
CompactLayoutUi.prototype.selectAll=function(){for(var b=document.getElementById(this.leftColItems),c=document.getElementById(this.rightColItems),a=0;a<b.length;a++)b.options[a].selected=true;for(a=0;a<c.length;a++)c.options[a].selected=true};CompactLayoutUi.addClick=function(b,c){addEvent(b,"click",c,false)};
var CustomFieldRelatedList={_mapCDTToComponents:{},_setupPlusGif:"",_setupMinusGif:"",registerCDT:function(b,a,c,d){this._mapCDTToComponents[b]=a;this._setupPlusGif=c;this._setupMinusGif=d;(b=document.getElementById(b+"_twisty"))&&addEvent(b,"click",this.onClickCDTTwisty,false)},onClickCDTTwisty:function(b){var a=getEventTarget(b);if(a!=null){b=false;if(a.src.indexOf(CustomFieldRelatedList._setupPlusGif)!=-1){a.src=CustomFieldRelatedList._setupMinusGif;b=true}else a.src=CustomFieldRelatedList._setupPlusGif;
a=a.id.split("_")[0];a=CustomFieldRelatedList._mapCDTToComponents[a];for(compRow=0;compRow<a.length;compRow++)document.getElementById(a[compRow])&&toggleDisplay(document.getElementById(a[compRow]),b)}}};
function ActionOverrideUi(){}ActionOverrideUi.prototype.visiblePicklist=null;ActionOverrideUi.prototype.setVisiblePicklist=function(a){if(ActionOverrideUi.prototype.visiblePicklist!=null)document.getElementById(ActionOverrideUi.prototype.visiblePicklist).className="hidden";document.getElementById(a).className=null;ActionOverrideUi.prototype.visiblePicklist=a};
function Scontrol(){}Scontrol.prototype.getSelectedRecordIdsFromForm=function(b,d){var c=[];if(b)for(i=0;i<b.elements.length;i++){var a=b.elements[i];if(a.name=="ids"&&a.checked){a=a.value;a.substr(0,3)==d&&c.push(a)}}else alert("Unable to find a form for this button");return c};
function ValidateFormula(c,f,g,e,h){this.bodyId=e;this.validTextId=g;this.fieldArray=h;this.servletUrl=c;this.isLoading=false;this.loading=new LoadingScreen(document.getElementById(e).parentNode,LC.getLabel("Scontrol","CheckingSyntax"));var a=this;this.handleCheckSyntaxResponse=function(b){response=Util.evalAjaxServletOutput(b.responseText);document.getElementById(a.validTextId).innerHTML=response[AjaxServlet.ERROR_MSG_KEY];if(!response[AjaxValidateFormula.VALID_KEY])if(b=response[AjaxValidateFormula.RANGE_KEY]){setContentWindow(window);
setSelectionInEditor(a.bodyId,b[0],b[1])}a.setLoading(false)};this.handleCheckSyntaxError=function(){document.getElementById(a.validTextId).innerHTML=LC.getLabel("Scontrol","AjaxError");a.setLoading(false)};this.handleCheckSyntaxClick=function(){a.setLoading(true);for(var b={},d=0;d<a.fieldArray.length;d++)b[a.fieldArray[d]]=document.getElementById(a.fieldArray[d]).value;b[a.bodyId]=document.getElementById(a.bodyId).value;XBrowser.postHttpResponse(a.servletUrl,a.handleCheckSyntaxResponse,XBrowser.buildPost(b),
a.handleCheckSyntaxError)};addEvent(document.getElementById(f),"click",this.handleCheckSyntaxClick,true)}ValidateFormula.prototype.setLoading=function(c){if(c!=this.isLoading)if(c){this.loading.show();this.isLoading=true}else{this.loading.hide();this.isLoading=false}};
function WebLinkUi(){}WebLinkUi.prototype.updateOpenType=function(a,b,c){a=document.getElementById(a);var d=a.options;if(a._saveOpts==null){a._saveOpts=Array(d.length);for(var e=0;e<d.length;++e)a._saveOpts[e]=d[e]}var f=d[a.selectedIndex].value;if(f==b&&!c)f=d[0].value;for(e=d.length=0;e<a._saveOpts.length;++e){var g=a._saveOpts[e];g.selected=g.value==f;if(c||g.value!=b)d[d.length]=g}WebLinkUi.prototype.updateContentValues()};
WebLinkUi.prototype.updateRequireRowSelectionVisibility=function(a,b){this.setDisplay(a,b)};WebLinkUi.prototype.setContentType=function(a,b,c,d){a=document.getElementById(a);if(a!=null)if(b)a.value=c;else if(a.value==c){b=a.options;if(b!=null){for(c=0;c<b.length;++c)if(b[c].value==d){b[c].selected=true;return}b[0].selected=true}}};WebLinkUi.prototype.currentDisplayedDiv=null;
WebLinkUi.prototype.displayDiv=function(a){if(WebLinkUi.prototype.currentDisplayedDiv)WebLinkUi.prototype.currentDisplayedDiv.style.display="none";a=document.getElementById(a);a.style.display="block";a.style.zIndex=0;WebLinkUi.prototype.currentDisplayedDiv=a};WebLinkUi.prototype.setDisplay=function(a,b){var c=document.getElementById(a);if(c)c.style.display=b?"block":"none"};
WebLinkUi.prototype.updateContentValues=function(){var a=document.getElementById("LinkType").value,b=document.getElementById("WebLinkFields_DisplayTypeM"),c=b!=null?b.checked:false;b=document.getElementById("Scontrol");if(WebLinkUi.scontrolOptions==null){WebLinkUi.scontrolOptions=[];for(n=0;n<b.options.length;n++)WebLinkUi.scontrolOptions.push(b.options[n])}if(a=="V"){a=c?vfSetOrientedOptions:vfOptions;c="066"}else{a=WebLinkUi.scontrolOptions;c="01N"}var d=b.value;if(d!=null)if(d.substring(0,3)!=
c)d=null;var e=[];for(n=0;n<a.length;n++){var f=a[n];f.value.substring(0,3)==c&&e.push([f.text,f.value])}Util.refreshDynamicSelect(b,e,false,d)};
function DefaultTabWarning(a){this.selectedTabsId=a}DefaultTabWarning.prototype.defaultIsSelectedToMove=function(){for(var a=document.getElementById(this.selectedTabsId).options,b=0;b<a.length;b++)if(a[b].selected&&this.isDefault(a[b].text))return true;return false};DefaultTabWarning.prototype.isDefault=function(a){var b=LC.getLabel("Page_My_Tabs","DefaultTabMarkerOnly");if(a.indexOf(b)>=0)return true;return false};
function TabSetPage(a,b){this.selectToUpdateId=a;this.workspaceMappingServletUrl=b}TabSetPage.prototype.update=function(a){var b=document.getElementById(a);a=document.getElementById(this.selectToUpdateId);var d=a.options[a.selectedIndex].value;b=b.options;for(var c=[],e=false,f=0;f<b.length;f++){var g=b[f];c[f]=[g.text,g.value];if(g.value==d)e=true}if(!e)d=c[0].value;Util.refreshDynamicSelect(a,c,false,d)};
TabSetPage.prototype.updateWorkspaceMapping=function(a){var b=Ext.getDom(a).options,d=[];a=[];for(var c=0;c<b.length;c++){var e=b[c].value,f=Ext.get(TabSetPageConstants.ROW_PREFIX+e);if(f===null)d.push(e);else{f.enableDisplayMode().show();a[e]=1}}if(d.length>0)Ext.Ajax.request({url:UserContext.getUrl(this.workspaceMappingServletUrl),params:{tabNames:d},method:"POST",success:this.updateWorkspaceMappingRows,scope:this});else{b=Ext.select("#"+TabSetPageConstants.WORKSPACE_MAPPING_TABLE_ID+" .dataRow");
for(c=0;c<b.getCount();c++){f=b.item(c);d=f.dom.id.substr(TabSetPageConstants.ROW_PREFIX.length);a[d]==undefined&&f.enableDisplayMode().hide()}}};TabSetPage.prototype.updateWorkspaceMappingRows=function(a){a=Util.evalAjaxServletOutput(a.responseText).html;Ext.select("#"+TabSetPageConstants.WORKSPACE_MAPPING_TABLE_ID+" .last").removeClass("last");Ext.fly(TabSetPageConstants.WORKSPACE_MAPPING_TABLE_ID).insertHtml("beforeEnd",a)};
var TabSetPageUtil={enableField:function(a){document.getElementById(a).style.display="inline";document.getElementById(a+"_fake").style.display="none"},disableField:function(a){document.getElementById(a).style.display="none";document.getElementById(a+"_fake").style.display="inline"},toggleRadioButtonGroup:function(a){a=document.getElementsByName(a);for(var b=0;b<a.length;b++)a[b].disable=!a[b].disable},selectRow:function(a,b){Ext.get(b).dom.checked=true;for(var d=Ext.get("oTable").dom.rows,c=1;c<d.length;c++){var e=
d[c];Ext.get(e).removeClass("sdSelectedRow");(e=Ext.get("size_"+e.id))&&e.hide()}Ext.get(a).addClass("sdSelectedRow");(d=Ext.get("size_"+a))&&d.show()},stopEventBubbleUp:function(){if(typeof window.event!=="undefined")window.event.cancelBubble=true}},fixUpSelectRow=function(){for(var a=Ext.query('input[name="sdOrientation"]'),b=0;b<a.length;b++)a[b].checked&&TabSetPageUtil.selectRow("oRow"+b,a[b].id)};
function SchedulePageUtil(){}SchedulePageUtil.clickExpand=function(){Animation.rollIn(document.getElementById(SchedulePage.pDuelOuter),function(){})};SchedulePageUtil.clickCollapse=function(){Animation.rollOut(document.getElementById(SchedulePage.pDuelOuter),function(){})};
SchedulePageUtil.disableTime=function(a){document.getElementById(ScheduleElement.pPrefTime+a).value="";document.getElementById(ScheduleElement.pPrefTime+a).style.display="none";document.getElementById(ScheduleElement.pPrefTime+a).disabled=true;document.getElementById(ScheduleElement.pOtherPrefTimeLabelDiv+a).style.display="none";document.getElementById(ScheduleElement.pPrefTimeLabelDiv+a).style.display="block"};
SchedulePageUtil.enableTime=function(a){document.getElementById(ScheduleElement.pPrefTimeLabelDiv+a).style.display="none";document.getElementById(ScheduleElement.pOtherPrefTimeLabelDiv+a).style.display="none";document.getElementById(ScheduleElement.pPrefTimeLoadingDiv+a).style.display="block";document.getElementById(ScheduleElement.pPrefTimeLoadingDiv+a).focus();var b=SchedulePageUtil.buildPost(a);XBrowser.postHttpResponse(UserContext.getUrl(BlowoutServlet.SERVLETURL),function(c){SchedulePageUtil.handleResponse(a,
c.responseText)},XBrowser.buildPost(b),null);return false};
SchedulePageUtil.buildPost=function(a){var b={};b[BlowoutServlet.SUFFIX]=a;b[SchedulePage.pBlowout]=document.getElementById(SchedulePage.pBlowout).value;b[SchedulePage.pIsOffPeak]=document.getElementById(SchedulePage.pIsOffPeak).value;b[ScheduleElement.pFreq+a]=SchedulePageUtil.getCheckedValue(ScheduleElement.pFreq+a);b[ScheduleElement.pStartDate+a]=document.getElementById(ScheduleElement.pStartDate+a).value;b[ScheduleElement.pEndDate+a]=document.getElementById(ScheduleElement.pEndDate+a).value;b[ScheduleElement.pDailyRec+
a]=SchedulePageUtil.getCheckedValue(ScheduleElement.pDailyRec+a);for(var c=0;c<7;c++)b[ScheduleElement.pDayOfWeek+c+a]=document.getElementById(ScheduleElement.pDayOfWeek+c+a).checked?"1":"0";b[ScheduleElement.pMonthlyRec+a]=SchedulePageUtil.getCheckedValue(ScheduleElement.pMonthlyRec+a);b[ScheduleElement.pMonthlyOnDayN+a]=document.getElementById(ScheduleElement.pMonthlyOnDayN+a).value;b[ScheduleElement.pMonthlyOnNthDay+a]=document.getElementById(ScheduleElement.pMonthlyOnNthDay+a).value;b[ScheduleElement.pMonthlyOnNDayOfWeek+
a]=document.getElementById(ScheduleElement.pMonthlyOnNDayOfWeek+a).value;b[SchedulePage.pJobType]=document.getElementById(SchedulePage.pJobType).value;return b};SchedulePageUtil.getCheckedValue=function(a){a=document.getElementsByName(a);if(a.length==null){if(a.checked)return a.value}else for(var b=0;b<a.length;b++)if(a[b].checked)return a[b].value;return""};
SchedulePageUtil.handleResponse=function(a,b){var c=null;try{c=Util.evalAjaxServletOutput(b)}catch(d){if(window.location.replace)window.location.replace(window.location);else window.location.href=window.location.href;return}document.getElementById(ScheduleElement.pPrefTimeLoadingDiv+a).style.display="none";if(c[BlowoutServlet.SUCCESS]){SchedulePageUtil.setTimePicklist(a,c[BlowoutServlet.BLOWOUT]);document.getElementById(ScheduleElement.pPrefTime+a).disabled=false;document.getElementById(ScheduleElement.pPrefTime+
a).style.display="block";document.getElementById(ScheduleElement.pPrefTime+a).focus()}else document.getElementById(ScheduleElement.pPrefTimeLabelDiv+a).style.display="block";SchedulePageUtil.handleErrors(c)};SchedulePageUtil.setTimePicklist=function(a,b){var c=document.getElementById(ScheduleElement.pPrefTime+a).options;c.length=0;if(b.length==0)c[0]=new Option(LC.getLabel("SelectElement","Required"),"");else for(var d=0;d<b.length;d++)c[d]=new Option(b[d],b[d])};
SchedulePageUtil.handleErrors=function(a){a=a[AjaxServlet.ERROR_MSG_KEY];if(a instanceof Array){if(a.length>3)document.getElementById(DetailElement.DEFAULT_ERROR_DIV_ID).style.display="block";else document.getElementById(DetailElement.DEFAULT_ERROR_DIV_ID).style.display="none";for(var b=0;b<a.length;b++){var c=SchedulePageUtil.getIdAndVal(a[b]);SchedulePageUtil.setError(c[0],c[1])}}};SchedulePageUtil.getIdAndVal=function(a){return a.split(",")};
SchedulePageUtil.setError=function(a,b){var c=null;c=document.getElementById(a).nodeName=="DIV"?document.getElementById(a).parentNode:document.getElementById(a).parentNode.parentNode;for(var d=false,f,e=0;e<c.childNodes.length;e++)if(c.childNodes[e].className!=null&&c.childNodes[e].className=="errorMsg"){d=true;f=e}if(d)if(b!=null){c.childNodes[f].innerHTML=b;c.childNodes[f].style.display="block"}else c.childNodes[f].style.display="none";else if(b!=""){d=document.createElement("div");d.className=
"errorMsg";d.innerHTML=b;c.appendChild(d)}};
SchedulePageUtil.toggleMonthlyActive=function(a,b){if(a){document.getElementById(ScheduleElement.pMonthlyOnDayN+b).disabled=false;document.getElementById(ScheduleElement.pMonthlyOnNDayOfWeek+b).disabled=true;document.getElementById(ScheduleElement.pMonthlyOnNthDay+b).disabled=true}else{document.getElementById(ScheduleElement.pMonthlyOnDayN+b).disabled=true;document.getElementById(ScheduleElement.pMonthlyOnNDayOfWeek+b).disabled=false;document.getElementById(ScheduleElement.pMonthlyOnNthDay+b).disabled=
false}};
AutoComplete=function(a){this.baseName=this.getBaseName(a);this.type=this.getLookupType(a);this.lookupInput=this.getLookupInput(a);this.lookupInput.onkeyup=AutoComplete.prototype.onKeyUp;this.lookupInput.onfocus=AutoComplete.prototype.onFocus;this.lookupInput.onblur=AutoComplete.prototype.onBlur;this.hasFocus=false;this.valQueried=null;this.selected=-1;if(this.type=="001"){this.entityName="Account";this.entityNameFields=["Name"]}else if(this.type=="003"){this.entityName="Contact";this.entityNameFields=
["FirstName","LastName"]}else if(this.type=="005"){this.entityName="User";this.entityNameFields=["FirstName","LastName","Alias"]}};AutoComplete.prototype.RECORD_HEIGHT=17;AutoComplete.prototype.MIN_LENGTH_THRESHOLD=3;AutoComplete.prototype.TYPING_THRESHOLD_MILLIS=200;AutoComplete.prototype.HIGHLIGHT_COLOR="#AACCFF";AutoComplete.prototype.IS_IE=document.all;AutoComplete.prototype.AUTOCOMPLETE_MAP=[];AutoComplete.prototype.IS_PROCESSING=false;AutoComplete.prototype.FORM_NAME="editPage";
AutoComplete.prototype.getBaseName=function(a){if(!a)return this.baseName;a=a.name;var c=a.indexOf("_");return c>-1?a.substring(0,c):a};AutoComplete.prototype.isLookup=function(a){return a.name.indexOf("_lkid")>0};AutoComplete.prototype.getLookupInput=function(a){if(!a)return this.lookupInput;a=this.getBaseName(a);return document.getElementById(a)};
AutoComplete.prototype.getLookupType=function(a){if(!a)return this.type;var c;a=this.getBaseName(a)+"_lktp";if(a=document.getElementById(a))c=a.value;return c};
AutoComplete.prototype.doLookup=function(a){if(!(!this.hasFocus||AutoComplete.prototype.IS_PROCESSING)){var c=this.parseName(a);if(!(!c||c.length==0)){AutoComplete.prototype.IS_PROCESSING=true;this.valQueried=a;for(var d="SELECT Id",b=0;b<this.entityNameFields.length;b++)d+=", "+this.entityNameFields[b];d+=" FROM "+this.entityName+" WHERE ";if(this.entityNameFields.length==1)d+=this.entityNameFields[0]+" like '"+a+"%' ";else for(b=0;b<this.entityNameFields.length;b++)for(var e=0;e<c.length;e++){var f=
c[e];if(f){d+=this.entityNameFields[b]+" like '"+f+"%' ";if(b!=this.entityNameFields.length-1||e!=c.length-1)d+=" OR "}}this.records=AutoComplete.prototype.query(d).records;this.displayResults(this.records,a);AutoComplete.prototype.IS_PROCESSING=false}}};AutoComplete.prototype.parseName=function(a){a=a?a.split(" "):[];for(var c=[],d=0;d<a.length;d++){var b=a[d];(b=b.replace(" ",""))&&c.push(b)}return c};
AutoComplete.prototype.displayResults=function(a,c){if(a&&a.length>0){var d=this.getBaseName(),b=[];b.push("<table width='100%' cellpadding='0' cellspacing='0' border='0'>");for(var e=0;e<a.length;e++){var f=a[e],g=ApiUtils.getId(f);b.push("<tr><td style='cursor: pointer;' onmouseover='AutoComplete.prototype.setSelected(\""+d+'", '+e+');this.style.backgroundColor="'+AutoComplete.prototype.HIGHLIGHT_COLOR+"\";' onmouseout='this.style.backgroundColor=\"\";'>");b.push("<div style='height:"+AutoComplete.prototype.RECORD_HEIGHT+
"px;' id='"+g+"'>");f=this.getName(f);b.push(this.highlightMatch(f,c));b.push("</div>");b.push("</td></tr>")}b.push("</table>");e=this.getBaseName();if(f=AutoComplete.prototype.getBox(e))AutoComplete.prototype.resizeBox(d,a.length*AutoComplete.prototype.RECORD_HEIGHT,200);else{f=AutoComplete.prototype.makeBox(e,a.length*AutoComplete.prototype.RECORD_HEIGHT,200);g=this.getLookupInput();d=getObjY(g)+20;g=getObjX(g);AutoComplete.prototype.moveBox(e,d,g)}f.innerHTML=b.join("");this.displaySuggestions(true)}};
AutoComplete.prototype.getName=function(a){for(var c="",d=0;d<this.entityNameFields.length;d++){var b=a.get(this.entityNameFields[d]);if(b)c+=b+" "}return c};AutoComplete.prototype.highlightMatch=function(a,c){if(!a||!c)return"";var d=a.toLowerCase(),b=c.toLowerCase(),e=d.indexOf(b);if(e==-1)return a;else{d=a.substring(0,e);b=a.substring(e,e+c.length);e=a.substring(e+c.length);return d+"<b>"+b+"</b>"+e}};
AutoComplete.prototype.doFilter=function(a){for(var c=[],d=0;d<this.records.length;d++){var b=this.records[d];this.isMatch(b,a)&&c.push(b)}c&&c.length>0?this.displayResults(c,a):this.doClear()};AutoComplete.prototype.isMatch=function(a,c){var d=null;return(d=this.entityNameFields.length==1?a.get(this.entityNameFields[0]):this.getName(a))&&d.toLowerCase().indexOf(c.toLowerCase())>-1};AutoComplete.prototype.doClear=function(){this.displaySuggestions(false);this.selected=-1};
AutoComplete.prototype.displaySuggestions=function(a){AutoComplete.prototype.showBox(this.getBaseName(),a)};
AutoComplete.prototype.selectItem=function(a){var c=this.getBaseName(),d=null,b=null,e=AutoComplete.prototype.getBox(c);if(e&&a>=0)if((e=e.childNodes[0].childNodes[0])&&e.rows&&a<e.rows.length)if(a=e.rows[a])if(a=a.cells[0].getElementsByTagName("div")[0])d=a.id;if(d)for(a=0;a<this.records.length;a++){e=this.records[a];if(d==ApiUtils.getId(e)){b=this.getName(e);break}}d&&b&&lookupPick(AutoComplete.prototype.FORM_NAME,c+"_lkid",c,"",d,b,"","");(c=AutoComplete.prototype.AUTOCOMPLETE_MAP[c])&&c.doClear()};
AutoComplete.prototype.onKeyUp=function(a){if(!a)a=window.event;var c=AutoComplete.prototype.AUTOCOMPLETE_MAP[this.name];if(c){var d=this.value,b=a&&a.keyCode;if(!AutoComplete.prototype.IS_PROCESSING)if(!(b&&AutoComplete.prototype.isEnter(a)))if(b&&AutoComplete.prototype.isNavigation(a))AutoComplete.prototype.handleNav(this.name,a);else if(!(b&&AutoComplete.prototype.isTypingFast(this.name,a)))if(!(b&&AutoComplete.prototype.isIgnore(a)))if(b&&AutoComplete.prototype.isEscape(a))c.doClear();else if(d!=
null&&d.length>=AutoComplete.prototype.MIN_LENGTH_THRESHOLD)c.valQueried==null||d.toLowerCase().indexOf(c.valQueried.toLowerCase())==-1?c.doLookup(d):c.doFilter(d);else if(d==null||d.length<=AutoComplete.prototype.MIN_LENGTH_THRESHOLD){c.valQueried=null;c.doClear()}}};AutoComplete.prototype.onFocus=function(){var a=AutoComplete.prototype.AUTOCOMPLETE_MAP[this.name];if(a)a.hasFocus=true};
AutoComplete.prototype.onBlur=function(a){if(!a)a=window.event;var c=AutoComplete.prototype.AUTOCOMPLETE_MAP[this.name];if(c){c.hasFocus=false;AutoComplete.prototype.TIMEOUT_ID&&clearTimeout(AutoComplete.prototype.TIMEOUT_ID);a&&!AutoComplete.prototype.isIgnore(a)&&!AutoComplete.prototype.isEscape(a)&&c.selected>=0?c.selectItem(c.selected):setTimeout("AutoComplete.prototype.AUTOCOMPLETE_MAP['"+this.name+"'].doClear()",200)}};
AutoComplete.prototype.setSelected=function(a,c){var d=AutoComplete.prototype.AUTOCOMPLETE_MAP[a];if(d)d.selected=c};
AutoComplete.prototype.handleNav=function(a,c){var d=AutoComplete.prototype.AUTOCOMPLETE_MAP[a];if(d){var b=c.keyCode==40,e=d.selected,f=AutoComplete.prototype.getBox(d.getBaseName());if(f)if((f=f.childNodes[0].childNodes[0])&&f.rows){if(b)d.selected<f.rows.length-1&&e++;else d.selected>0&&e--;if(d.selected>=0)if((b=f.rows[d.selected])&&b.childNodes[0])b.childNodes[0].onmouseout();if(e>=0){if((b=f.rows[e])&&b.childNodes[0])b.childNodes[0].onmouseover();d.selected=e}}}};
AutoComplete.prototype.LAST_DATE=null;AutoComplete.prototype.TIMEOUT_ID=null;
AutoComplete.prototype.isTypingFast=function(a){AutoComplete.prototype.TIMEOUT_ID&&clearTimeout(AutoComplete.prototype.TIMEOUT_ID);var c=new Date;if(AutoComplete.prototype.LAST_DATE==null){AutoComplete.prototype.LAST_DATE=c;return true}else{var d=c.getTime()-AutoComplete.prototype.LAST_DATE.getTime();AutoComplete.prototype.LAST_DATE=c;if(d<AutoComplete.prototype.TYPING_THRESHOLD_MILLIS){AutoComplete.prototype.TIMEOUT_ID=setTimeout("document.getElementById('"+a+"').onkeyup();",AutoComplete.prototype.TYPING_THRESHOLD_MILLIS);
return true}else return false}};AutoComplete.prototype.isNavigation=function(a){a=a.keyCode;return a==38||a==40};AutoComplete.prototype.isIgnore=function(a){a=a.keyCode;return a==9||a==16||a>=33&&a<=46||a>=112&&a<=123};AutoComplete.prototype.isEscape=function(a){return a.keyCode==27};AutoComplete.prototype.isEnter=function(a){return a.keyCode==13};
AutoComplete.prototype.query=function(a){try{var c=sforce.connection.query(a);a={};a.size=c.size;a.records=c.getArray("records");return a}catch(d){alert("error: "+d)}};
AutoComplete.prototype.makeBox=function(a,c,d){if(AutoComplete.prototype.IS_IE){var b=document.createElement("iframe");b.id=a+"I";b.style.display="block";b.style.position="absolute";b.style.padding="3px";b.style.height=c+"px";b.style.width=d+"px";b.style.backgroundColor="#ffffCC";document.body.appendChild(b)}b=document.createElement("div");b.id=a+"D";b.style.border="1px solid #666";b.style.display="block";b.style.position="absolute";b.style.padding="2px";b.style.height=c+"px";b.style.width=d+"px";
b.style.backgroundColor="#ffffCC";document.body.appendChild(b);return b};AutoComplete.prototype.getBox=function(a){return document.getElementById(a+"D")};AutoComplete.prototype.resizeBox=function(a,c,d){var b=document.getElementById(a+"I");if(b){b.style.height=c+"px";b.style.width=d+"px"}if(a=document.getElementById(a+"D")){a.style.height=c+"px";a.style.width=d+"px"}};
AutoComplete.prototype.moveBox=function(a,c,d){var b=document.getElementById(a+"I");if(b){b.style.top=c+"px";b.style.left=d+"px";b.style.zIndex=10}if(a=document.getElementById(a+"D")){a.style.top=c+"px";a.style.left=d+"px";a.style.zIndex=20}};AutoComplete.prototype.showBox=function(a,c){var d=c?"block":"none",b=document.getElementById(a+"I");if(b)b.style.display=d;if(b=document.getElementById(a+"D"))b.style.display=d};
AutoComplete.prototype.loadAutoComplete=function(a){if(!a)AutoComplete.prototype.FORM_NAME="editPage";a=getCookie("sid");var c=ApiUtils.getApiURL(true,"7.0");sforce.connection.init(a,c,true);a=document.getElementsByTagName("input");for(c=0;c<a.length;c++){var d=a[c];if(AutoComplete.prototype.isLookup(d)){d=new AutoComplete(d);AutoComplete.prototype.AUTOCOMPLETE_MAP[d.getBaseName()]=d}}};
function Banner(a){this.bannerDiv=document.getElementById(a);this.bannerY=Banner.BANNER_END;this.fadingOut=this.fadingIn=null;this.clicked=false;var b=this;if(getCookie("sawBanner")!=a){this.shim=new iframeShim(this.bannerDiv);addEvent(this.bannerDiv,"click",function(){b.click()},false);this.shim.setStyle("display","block");this.fadeIn()}}Banner.BANNER_END=-50;Banner.BANNER_START=0;Banner.BANNER_STEP=-5;Banner.BANNER_STEP_DELAY=40;Banner.BANNER_DELAY=4E3;Banner.COOKIE_LIFE=90;
Banner.prototype.click=function(){if(this.fadingIn){clearTimeout(this.fadingIn);this.fadingIn=null}this.clicked=true;var a=new Date;a.setDate(a.getDate()+Banner.COOKIE_LIFE);setCookie("sawBanner",this.bannerDiv.id,a);this.fadeOut()};Banner.prototype.goAway=function(){if(!this.clicked){var a=this;this.fadingOut=setTimeout(function(){a.fadeOut()},Banner.BANNER_DELAY)}};
Banner.prototype.interrupt=function(){if(!this.clicked&&this.fadingOut){var a=this;clearTimeout(this.fadingOut);this.fadingOut=null;this.fadingIn=setTimeout(function(){a.fadeIn()},0)}};Banner.prototype.fadeOut=function(){if(this.fadingOut){clearTimeout(this.fadingOut);this.fadingOut=null}if(this.bannerY>Banner.BANNER_END){var a=this;this.bannerY+=Banner.BANNER_STEP;this.shim.setStyle("top",this.bannerY+"px");this.fadingOut=setTimeout(function(){a.fadeOut()},Banner.BANNER_STEP_DELAY)}};
Banner.prototype.fadeIn=function(){if(this.fadingIn){clearTimeout(this.fadingIn);this.fadingIn=null}if(this.bannerY<Banner.BANNER_START){var a=this;this.bannerY-=Banner.BANNER_STEP;this.shim.setStyle("top",this.bannerY+"px");this.fadingIn=setTimeout(function(){a.fadeIn()},Banner.BANNER_STEP_DELAY)}};
function toggleDependentCheckboxes(d,b){for(var e=document.getElementById(d),f=b.length,a=0;a<f;a++){var c=document.getElementById(b[a]);if(c.disabled=="")c.checked=e.checked}};
function ButtonInputElement(){}ButtonInputElement.prototype.enableButton=function(e,c){var a=document.getElementsByName(e);if(a)for(var b=0;b<a.length;b++){var d=a[b];d.disabled=!c;d.className=c?"btn":"btnDisabled"}};
function CheckedMenu(a){if(this.id=a)if(this.hook_isAccessibleMode())this.initAccessibilityMode(this.id);else{this.parentDiv=document.getElementById(a);this.buttonDiv=document.getElementById(a+CheckedMenu.BUTTON);this.buttonLabel=document.getElementById(a+CheckedMenu.LABEL);this.menuDiv=document.getElementById(a+CheckedMenu.MENU);this.buttonWidth=CheckedMenu.DEFAULT_ARROW;this.shim=new iframeShim(this.menuDiv);var b=this;addEvent(document,"click",function(c){b.hideOthers(c)},false);addEvent(document,
"keydown",function(c){b.handleKeyPress(c)},false);addEvent(this.parentDiv,"click",function(c){b.handleDivClick(c)},false);addEvent(this.parentDiv,"mouseover",function(){addStyleClass(b.parentDiv,"menuButtonOver")});addEvent(this.parentDiv,"mouseout",function(){delStyleClass(b.parentDiv,"menuButtonOver")});addEvent(this.buttonLabel,"mousedown",function(c){b.removeDottedLinkOutline(c)},false);addEvent(this.buttonLabel,"mouseout",function(c){b.removeDottedLinkOutline(c)},false);addEvent(this.buttonLabel,
"keydown",function(c){c.keyCode==KEY_ENTER&&b.handleDivClick(c)},false);addEvent(this.menuDiv,"click",function(c){return b.handleMenuClick(c)},false)}}CheckedMenu.DEFAULT_ARROW=17;CheckedMenu.GO_BUTTON="Go";CheckedMenu.SELECT="Select";CheckedMenu.BUTTON="Button";CheckedMenu.MENU="Menu";CheckedMenu.LABEL="Label";CheckedMenu.prototype.handleDivClick=function(){XBrowser.getCurrentStyle(this.menuDiv,"display")=="none"?this.show():this.hide()};
CheckedMenu.prototype.handleMenuClick=function(a){this.hide();var b=Ext.get(this.parentDiv).child(".checkedMenuChecked");b.removeClass("checkedMenuChecked");b.parent().removeClass("selected");b=getEventTarget(a);b=Ext.get(b).parent().child(".checkedMenuOptionIcon");b.addClass("checkedMenuChecked");b.parent().addClass("selected");hasStyleClass(this.parentDiv,"checkedMenuActivated")&&delStyleClass(this.parentDiv,"checkedMenuActivated");eventCancelBubble(a)};
CheckedMenu.prototype.hook_isAccessibleMode=function(){return UserContext.isAccessibleMode};CheckedMenu.prototype.defaultAction=function(){var a=this.menuDiv.childNodes[0];this.hide();if(a.target){var b=document.getElementsByName(a.target);if(b&&b[0].src)b[0].src=a.href}else navigateToUrl(a.href)};CheckedMenu.prototype.show=function(){addStyleClass(this.parentDiv,"checkedMenuActivated");this.shim.setStyle("display","block");this.position()};
CheckedMenu.prototype.getMenuWidth=function(){return this.buttonDiv.offsetWidth-2};CheckedMenu.prototype.position=function(){this.menuDiv.style.width="";for(var a=this.getMenuWidth(),b=0;b<this.menuDiv.childNodes.length;b++){var c=this.menuDiv.childNodes[b];if(c.nodeType==Node.ELEMENT_NODE)if(c.offsetWidth>a)a=c.offsetWidth}this.shim.setStyle("width",a+"px")};
CheckedMenu.prototype.hide=function(){delStyleClass(this.parentDiv,"checkedMenuActivated");if(XBrowser.getCurrentStyle(this.menuDiv,"display")!="none"){this.shim.setStyle("display","none");this.parentDiv.style.position=""}};
CheckedMenu.prototype.hideOthers=function(a){a=getEventTarget(a);if(a!=this.buttonDiv&&a!=this.buttonLabel&&a!=this.parentDiv&&a.parentNode!=this.buttonDiv&&!hasStyleClass(a,"checkedMenuMenuLink")){this.hide(true);hasStyleClass(this.parentDiv,"checkedMenuActivated")&&delStyleClass(this.parentDiv,"checkedMenuActivated")}};CheckedMenu.prototype.handleKeyPress=function(a){a.keyCode==KEY_ESC&&this.hide()};
CheckedMenu.prototype.initAccessibilityMode=function(a){var b=document.getElementById(a+CheckedMenu.SELECT);addEvent(b,"change",function(){var c=b.options[b.selectedIndex];document.getElementById(a+CheckedMenu.GO_BUTTON).onclick=function(){eval(c.value)}},false)};
CheckedMenu.prototype.removeDottedLinkOutline=function(a){if(getEventTarget(a)==this.buttonLabel)if(a.type=="mousedown"){this.buttonLabel.blur();if(isIE)this.buttonLabel.hideFocus=true;else this.buttonLabel.style.outline="none"}else if(a.type=="mouseout"){this.buttonLabel.blur();if(isIE)this.buttonLabel.hideFocus=false;else this.buttonLabel.style.outline=null}};
ColorInput=function(a){this.id=a;this.box=document.createElement("div");this.box.innerHTML="<span></span>";this.input=document.getElementById(a);var b=this;this.handleChange=function(){b.formatInput();b.updateColor()};this.init()};
ColorInput.prototype.updateColor=function(){var a=this.input.value,b=true;if(a.match(/^(#[0-9a-f]{6})$/i)){delStyleClass(this.box,ColorInputConstants.ERROR_COLOR_BOX_CSS);this.box.style.backgroundColor=a}else{this.box.style.backgroundColor="#FFFFFF";addStyleClass(this.box,ColorInputConstants.ERROR_COLOR_BOX_CSS);b=false}return b};
ColorInput.prototype.formatInput=function(){var a=this.input.value;if("#"!=a.charAt(0)&&6==a.length)a="#"+a;a=a.toUpperCase();if(a.match(/^#[0-9a-f]{3}$/i)){var b=a.charAt(1),c=a.charAt(2);a=a.charAt(3);a="#"+b+b+c+c+a+a}this.input.value=a};
ColorInput.prototype.init=function(){addStyleClass(this.box,ColorInputConstants.COLOR_BOX_CSS);this.updateColor();this.input.parentNode.insertBefore(this.box,this.input);var a=this;addEvent(this.input,"change",this.handleChange,false);var b=function(c){ColorPicker.pick(a.id,c)};addEvent(this.box,"click",b,false);addEvent(this.input,"focus",b,false);addEvent(this.input,"click",ColorPicker.cancelHide,false);this.input.updateColor=function(){a.updateColor()}};
function ColorPicker(){this.pickerDiv=document.getElementById(ColorPickerConstants.DOM_ID);this.colorView=document.getElementById(ColorPickerConstants.COLOR_VIEW_ID);this.hexView=document.getElementById(ColorPickerConstants.HEX_VIEW_ID);this.shim=new iframeShim(this.pickerDiv);this.field=null;this.addedFields={};var a=this;addEvent(document,"click",function(){a.hide()},false);addEvent(this.pickerDiv,"click",function(b){ColorPicker.cancelHide(b)},false)}
ColorPicker.prototype.position=function(){for(var a=0,b=0,c=this.field;c!=null&&c!=this.pickerDiv.offsetParent;){a+=c.offsetLeft;b+=c.offsetTop;if(c.scrollLeft)a-=c.scrollLeft;if(c.scrollTop)b-=c.scrollTop;c=c.offsetParent}c=this.pickerDiv.offsetHeight;var d=this.pickerDiv.offsetWidth;if(getObjX(this.field)+d>getScrollX()+getWindowWidth())a-=d-this.field.offsetWidth;if(getObjY(this.field)+c>getScrollY()+getWindowHeight())b-=c;else b+=this.field.offsetHeight;this.shim.setStyle("left",a+"px");this.shim.setStyle("top",
b+"px")};ColorPicker.prototype.hide=function(){this.shim.setStyle("display","none")};ColorPicker.prototype.show=function(a){this.field=document.getElementById(a);this.updateView(this.field.value);this.shim.setStyle("display","block");if(!this.addedFields[a]){this.addedFields[a]=true;var b=this;addEvent(this.field,"keydown",function(c){b.handleKeyPress(c)},false)}this.position()};ColorPicker.prototype.handleKeyPress=function(a){getEvent(a).keyCode==KEY_ESC&&this.hide()};
ColorPicker.prototype.selectBasic=function(a){if(!this.field.disabled&&this.field.value!=a){this.field.value=ColorPicker.formatHex(a);if(this.field.fireEvent)this.field.fireEvent("onchange");else if(this.field.dispatchEvent){a=document.createEvent("HTMLEvents");a.initEvent("change",true,true);this.field.dispatchEvent(a)}}this.hide()};ColorPicker.prototype.updateView=function(a){a=ColorPicker.formatHex(a);this.colorView.style.backgroundColor=a;this.hexView.value=a};ColorPicker.singleton=null;
ColorPicker.cancelHide=function(a){eventCancelBubble(a);return false};ColorPicker.pick=function(a,b){if(!ColorPicker.singleton)ColorPicker.singleton=new ColorPicker;ColorPicker.singleton.show(a);b&&ColorPicker.cancelHide(b)};ColorPicker.formatHex=function(a){var b="#"==a.charAt(0)?a:"#"+a;if(b.match(/^#[0-9a-f]{3}$/i)){a=b.charAt(1);var c=b.charAt(2);b=b.charAt(3);b="#"+a+a+c+c+b+b}else b.match(/^#[0-9a-f]{6}$/i)||(b="#FFFFFF");return b};
ColorPicker.hiOn=function(a,b){hiOn(a);a.style.backgroundColor="#000000";ColorPicker.singleton.updateView(b)};ColorPicker.hiOff=function(a,b){hiOff(a);a.style.backgroundColor=ColorPicker.formatHex(b)};
function CriteriaInput(a,c,b){if(a){this.oppLabels=a;this.numFilters=c;this.hook_isPopulated=false;this.currentEntityData=b;this.entityCache={};if(b)this.entityCache[b.entityName]=b;var d=this;this.handleFieldChange=function(e){e=getEventTarget(getEvent(e));d.updateOperator(e,d.getOp(e))};this.handleClearFiltersClick=function(){document.getElementById(CriteriaInputConstants.pCOL+"1").disabled||d.clearFilters()};this.handleClearFilterRowClick=function(e){document.getElementById(CriteriaInputConstants.pCOL+
"1").disabled||d.clearFilterRow(e)};this.revealHiddenRow=function(e){var f=e.hiddenId;if(f===undefined)f=getEventTarget(getEvent(e)).id;for(var g=0;g<f.length;g++)if(e=parseInt(f.substr(g),10))if(d.isRowPopulated(e)){if(f=document.getElementById(CriteriaInputConstants.F_ROW+(e+1)))f.style.display="";if(e>=c)if(f=document.getElementById(CriteriaInputConstants.MAX_ROWS_ID))f.style.display="";break}d.hook_revealHiddenRow()};this.init()}}
CriteriaInput.prototype.init=function(){for(var a=this,c=function(e){return function(){a.handleClearFilterRowClick(e)}},b=1;b<=this.numFilters;b++){var d=document.getElementById(CriteriaInputConstants.pCOL+b);if(typeof d.selectedIndex=="number"&&d.selectedIndex>0||typeof d.selectedIndex!="number"&&d.value.length>0)this.updateOperator(d,this.getOp(d));addEvent(d,"change",this.handleFieldChange,false);addEvent(d,"blur",this.revealHiddenRow,false);addEvent(document.getElementById(CriteriaInputConstants.pVAL+
b),"blur",this.revealHiddenRow,false);addEvent(document.getElementById(CriteriaInputConstants.pOP+b),"blur",this.revealHiddenRow,false);(d=document.getElementById(CriteriaInputConstants.CLEAR_FILTERS_LINK+b))&&addEvent(d,"click",c(b),false)}(c=document.getElementById(CriteriaInputConstants.CLEAR_FILTERS_LINK))&&addEvent(c,"click",this.handleClearFiltersClick)};CriteriaInput.prototype.setEntity=function(a,c){if(a!==this.currentEntityData){this.currentEntityData=a;this.refreshElementsFromData(c)}};
CriteriaInput.prototype.setIsPopulatedHook=function(a){this.hook_isPopulated=a};CriteriaInput.prototype.isPopulated=function(){for(var a=1;a<=this.numFilters;a++)if(this.isRowPopulated(a))return true;return false};CriteriaInput.prototype.isAllPopulated=function(){for(var a=1;a<=this.numFilters;a++)if(!this.isRowPopulated(a))return false;return true};
CriteriaInput.prototype.isRowPopulated=function(a){return document.getElementById(CriteriaInputConstants.pCOL+a).value.length>0||document.getElementById(CriteriaInputConstants.pVAL+a).value.length>0||document.getElementById(CriteriaInputConstants.pOP+a).value.length>0};
CriteriaInput.prototype.refreshElementsFromData=function(){for(var a=1;a<=this.numFilters;a++){var c=Util.refreshDynamicSelect(document.getElementById(CriteriaInputConstants.pCOL+a),this.currentEntityData.getFieldOptions(),true);addEvent(c,"change",this.handleFieldChange,false);document.getElementById(CriteriaInputConstants.pOP+a).selectedIndex=0;document.getElementById(CriteriaInputConstants.pVAL+a).value="";document.getElementById(CriteriaInputConstants.pLOOKUP+a).style.display="none"}};
CriteriaInput.prototype.updateOperator=function(a,c){var b;if(c.offsetWidth>0)b=c.offsetWidth+"px";var d=null,e=typeof a.selectedIndex=="number"?a.options[a.selectedIndex].value:a.value;d=e?this.currentEntityData.getOperators(e):null;var f=c.options[c.selectedIndex].value,g=[];if(d)for(var h=0;h<d.length;h++)g.push([this.oppLabels[d[h]],d[h]]);c=Util.refreshDynamicSelect(c,g,true,f);c.style.width=b?b:"98%";this.getLookup(a).style.display=this.currentEntityData.needsLookup(e)?"block":"none"};
CriteriaInput.prototype.getLookup=function(a){a=a.id.substring(CriteriaInputConstants.pCOL.length,a.id.length);return document.getElementById(CriteriaInputConstants.pLOOKUP+a)};CriteriaInput.prototype.getOp=function(a){a=a.id.substring(CriteriaInputConstants.pLOOKUP.length,a.id.length);return document.getElementById(CriteriaInputConstants.pOP+a)};
CriteriaInput.prototype.clearFilters=function(){for(var a=1;a<=this.numFilters;a++)this.clearFilterRow(a,true);if(a=document.getElementById(CriteriaInputConstants.BOOL_FILTER_NAME))a.value="";this.hook_isPopulated&&this.hook_isPopulated(this.isPopulated())};
CriteriaInput.prototype.clearFilterRow=function(a,c){var b=document.getElementById(CriteriaInputConstants.pCOL+a);if(typeof b.selectedIndex=="number")b.selectedIndex=0;else b.value="";document.getElementById(CriteriaInputConstants.pOP+a).selectedIndex=0;b=document.getElementById(CriteriaInputConstants.pVAL+a);b.value="";document.getElementById(CriteriaInputConstants.pLOOKUP+a).style.display="none";document.getElementById(CriteriaInputConstants.ERROR_CLS+a).innerHTML="";document.getElementById(CriteriaInputConstants.pVAL+
a+"_error");if(b.nextSibling&&hasStyleClass(b.nextSibling,"errorMsg"))b.nextSibling.innerHTML="";!c&&this.hook_isPopulated&&this.hook_isPopulated(this.isPopulated())};CriteriaInput.prototype.hook_revealHiddenRow=function(){this.hook_isPopulated&&this.hook_isPopulated(this.isPopulated())};function CriteriaEntityData(a,c){this.entityName=a;this.fields=c}
CriteriaEntityData.prototype.getFieldOptions=function(){if(this.fieldOptions)return this.fieldOptions;this.fieldOptions=[];for(var a=0;a<this.fields.length;a++)this.fieldOptions.push([this.fields[a].label,this.entityName+"."+this.fields[a].name]);return this.fieldOptions};CriteriaEntityData.prototype.getColunmTypeByName=function(a){return ColumnType[this.getFieldByName(a).columnType]};
CriteriaEntityData.prototype.getOperators=function(a){a=this.getColunmTypeByName(a);return a.filterQueryOperators?a.filterQueryOperators:a.queryOperators};CriteriaEntityData.prototype.getFieldByName=function(a){var c;a=a.split(".")[1];for(var b=0;b<this.fields.length;b++)if(this.fields[b].name===a){c=this.fields[b];break}return c};
CriteriaEntityData.prototype.needsLookup=function(a){if(!a)return false;if(a=="MEMBER_STATUS"||a=="CAMPAGN_MEMBER.STATUS"||a=="Lead.CampaignMemberStatus")return false;if(a.indexOf("$Profile.Name")>=0)return true;return this.getColunmTypeByName(a).needsLookup};function FormulaFilterCriteriaEntityData(a){CriteriaEntityData.call(this,a)}FormulaFilterCriteriaEntityData.prototype=new CriteriaEntityData;
FormulaFilterCriteriaEntityData.prototype.getColunmTypeByName=function(a){if(a=sfdcPage.getDialogById("FieldTreeDialogId").controller.getNodeByDbName(a)){if(a.attributes[FieldTreeConstants.COLUMN_TYPE]=="DYNAMICENUM"||a.attributes[FieldTreeConstants.COLUMN_TYPE]=="TEXTENUM"||a.attributes[FieldTreeConstants.COLUMN_TYPE]=="STATICENUM"||a.attributes[FieldTreeConstants.COLUMN_TYPE]=="CURRENCYCODE"||a.attributes[FieldTreeConstants.COLUMN_TYPE]=="DIVISION")return{needsLookup:ColumnType[a.attributes[FieldTreeConstants.COLUMN_TYPE]].needsLookup,
filterQueryOperators:["e","n","c","k","s"]};return ColumnType[a.attributes[FieldTreeConstants.COLUMN_TYPE]]}return{needsLookup:false,queryOperators:["e","n","s","c","k","l","g","m","h","u","x"]}};
function DatePicker(){this.today=DateUtil.getDateTimeFromUserLocale(UserContext.today);this.calendarDiv=document.getElementById(DatePickerIds.DOM_ID);this.shim=new iframeShim(this.calendarDiv);this.table=document.getElementById(DatePickerIds.TABLE_ID);this.monthPicker=document.getElementById(DatePickerIds.MONTH_PICKER);this.yearPicker=document.getElementById(DatePickerIds.YEAR_PICKER);this.callOnChange=false;this.currentDate=this.myElement=this.myField=null;this.hasTime=false;this.addedFields={};
this.skipReopen=false;var a=this;this.closeHandler=function(b){a.hide(b)};addEvent(document,"click",this.closeHandler,false);addEvent(this.calendarDiv,"click",function(b){a.cancelHide(b)},false);addEvent(this.monthPicker,"change",function(){a.generateMonth()},false);addEvent(this.yearPicker,"change",function(){a.generateMonth()},false)}
DatePicker.prototype.setMyDate=function(a){var b=false,c=a.getFullYear(),e=c;if(LC.isThaiTHLocale())e+=LC.BUDDHIST_CAL_OFFSET;for(var d=0;d<this.yearPicker.options.length;d++)if(parseInt(this.yearPicker[d].value)>a.getFullYear()){Util.insertOption(this.yearPicker,new Option(e,c,false,true),d);b=true;break}else if(parseInt(this.yearPicker[d].value)==c){this.yearPicker.selectedIndex=d;b=true;break}b||(this.yearPicker.options[this.yearPicker.options.length]=new Option(e,c,false,true));this.monthPicker.selectedIndex=
a.getMonth()};DatePicker.prototype.prevMonth=function(){if(this.monthPicker.selectedIndex==0){var a=parseInt(this.yearPicker[this.yearPicker.selectedIndex].value)-1;if(this.yearPicker.selectedIndex==0||a!=this.yearPicker[this.yearPicker.selectedIndex-1].value){var b=new Date;b.setFullYear(a);b.setMonth(11);this.setMyDate(b)}else{this.yearPicker.selectedIndex--;this.monthPicker.selectedIndex=11}}else this.monthPicker.selectedIndex--;this.generateMonth()};
DatePicker.prototype.nextMonth=function(){if(this.monthPicker.selectedIndex==11){var a=parseInt(this.yearPicker[this.yearPicker.selectedIndex].value)+1;if(this.yearPicker.selectedIndex==this.yearPicker.length-1||a!=this.yearPicker[this.yearPicker.selectedIndex+1].value){var b=new Date;b.setFullYear(a);b.setMonth(0);this.setMyDate(b)}else{this.yearPicker.selectedIndex++;this.monthPicker.selectedIndex=0}}else this.monthPicker.selectedIndex++;this.generateMonth()};
DatePicker.prototype.generateMonth=function(){var a=parseInt(this.monthPicker[this.monthPicker.selectedIndex].value),b=parseInt(this.yearPicker[this.yearPicker.selectedIndex].value),c=new Date;c.setDate(1);c.setFullYear(b);c.setMonth(a);var e=UserContext.startOfWeek-c.getDay();if(e>1)e-=7;c.setDate(e);document.getElementById("calRow5").style.display="";document.getElementById("calRow6").style.display="";e=this.table.getElementsByTagName("td");for(var d=0;d<e.length;d++){var f=c.getDay();f=f==0||f==
6?"weekend":"weekday";if(c.getMonth()==a-1||c.getFullYear()==b-1)f+=" prevMonth";else if(c.getMonth()==a+1||c.getFullYear()==b+1){if(d%7==0){document.getElementById("calRow6").style.display="none";if(d/7==4)document.getElementById("calRow5").style.display="none";break}f+=" nextMonth"}if(DateUtil.equals(c,this.today))f+=" todayDate";if(DateUtil.equals(c,this.currentDate))f+=" selectedDate";e[d].className=f;e[d].innerHTML=c.getDate();c.setDate(c.getDate()+1)}};
DatePicker.prototype.selectDate=function(a){if("today"==a){this.currentDate=this.today;a=this.hasTime?DateUtil.getDateTimeStringFromUserLocale(this.today):DateUtil.getDateStringFromUserLocale(this.today);this.setMyDate(this.today);this.generateMonth()}else{var b=new Date(this.today.getTime());b.setDate(1);b.setFullYear(parseInt(this.yearPicker[this.yearPicker.selectedIndex].value));var c=parseInt(this.monthPicker[this.monthPicker.selectedIndex].value);if(a.className.indexOf("nextMonth")!=-1)c++;else a.className.indexOf("prevMonth")!=
-1&&c--;b.setMonth(c);b.setDate(a.innerHTML);a=this.hasTime?DateUtil.getDateTimeStringFromUserLocale(b):DateUtil.getDateStringFromUserLocale(b);this.hide()}DatePicker.insertDate(a,this.myField.id,this.callOnChange)};
DatePicker.prototype.position=function(){for(var a=0,b=0,c=this.myElement;c!=null&&c!=this.calendarDiv.offsetParent;){a+=c.offsetLeft;b+=c.offsetTop;c=c.offsetParent}if(getObjY(this.myElement)+this.calendarDiv.offsetHeight>getScrollY()+getWindowHeight())b-=this.calendarDiv.offsetHeight;else b+=this.myElement.offsetHeight;c="left";if(LC.isRtlPage()){c="right";a=this.calendarDiv.offsetParent.offsetWidth-a-this.myElement.offsetWidth}this.shim.setStyle(c,a+"px");this.shim.setStyle("top",b+"px")};
DatePicker.prototype.show=function(a,b,c,e){if(this.skipReopen)this.skipReopen=false;else{this.callOnChange=a;this.hasTime=c;this.myField=getElementByIdCS(b);this.myElement=e?e:getElementByIdCS(b);var d=this;if(this.myField.type!="hidden"){if(this.addedFields[b]!==this.myField)this.addedFields[b]=null;if(!this.addedFields[b]){this.addedFields[b]=this.myField;addEvent(this.myField,"keydown",function(h){d.handleKeyPress(h)},false);if(!c&&LC.isEnglishLanguage()){a=LC.isEnglishUS()?function(){DateUtil.checkYear(d.myField,
d.callOnChange)}:function(){DateUtil.evaluateShortcut(d.myField,d.callOnChange)};addEvent(this.myField,"blur",a,false)}}}c=c?DateUtil.getDateFromFormat(this.myField.value,UserContext.dateTimeFormat):DateUtil.getDateFromFormat(this.myField.value,UserContext.dateFormat);if(c!=0){this.currentDate=new Date(c);this.setMyDate(this.currentDate)}else this.setMyDate(this.today);this.generateMonth();if(!window.bodyOnLoad||AlohaSkin.resizeComplete||UserContext&&UserContext.uiSkin!=UiSkin.ALOHA.apiValue){this.shim.setStyle("display",
"block");this.position();this.skipReopen=false}else var f=this,g=setInterval(function(){if(g&&(AlohaSkin.resizeComplete||AlohaSkin.resizeDisabled)){clearInterval(g);f.shim.setStyle("display","block");f.position();f.skipReopen=false}},100)}};DatePicker.prototype.cancelHide=function(a){eventCancelBubble(a);return false};
DatePicker.prototype.handleKeyPress=function(a){a=getEvent(a).keyCode;if(a==KEY_ESC||a==KEY_TAB)this.hide();else if(a==KEY_ENTER&&!this.hasTime)if(LC.isEnglishUS())DateUtil.checkYear(this.myField);else LC.isEnglishLanguage()&&DateUtil.evaluateShortcut(this.myField)};DatePicker.prototype.hide=function(a){a&&getEventTarget(a)===this.myField||this.shim.setStyle("display","none")};DatePicker.datePicker=null;
DatePicker.pickDate=function(a,b,c,e){if(!DatePicker.datePicker){DatePicker.datePicker=new DatePicker;var d=getElementByIdCS(b);d&&addEvent(d,"click",function(f){if(d&&document.activeElement&&d===document.activeElement&&typeof d.onfocus==="function")d.onfocus(f)},false)}DatePicker.datePicker.show(a,b,c,e)};
DatePicker.insertDate=function(a,b,c){var e=getElementByIdCS(b);if(!e.disabled&&e.value!=a){e.value=a;if(window.sfdcPage&&window.sfdcPage.getLookupFieldsControlledBy){b=(a=sfdcPage.getLookupFieldsControlledBy(b))?a.length:0;for(var d=0;d<b;d++)ForeignKeyInputElement.allElements[a[d]].validate()}c&&XBrowser.fireEvent(e,"change");if(!DatePicker.datePicker){DatePicker.datePicker=new DatePicker;addEvent(e,"click",function(f){if(e&&document.activeElement&&e===document.activeElement&&typeof e.onfocus===
"function")e.onfocus(f)},false)}DatePicker.datePicker.skipReopen=true;e.focus()}};DatePicker.datePickEventRemove=function(){DatePicker.datePicker&&removeEvent(document,"click",DatePicker.datePicker.closeHandler,false)};
function confirmDelete(a){a||(a=LC.getLabel("Global","are_you_sure"));return Modal.confirm(a)};
function DeveloperNameInputElement(){}DeveloperNameInputElement.setName=function(d,c,g){d=d.value;var b="",e=false,f=false;if(c!==null&&c.value.length==0&&d.length>0){for(i=0;i<d.length;i++){var a=d.charAt(i);if(a>="a"&&a<="z"||a>="A"&&a<="Z"||a>="0"&&a<="9"){if(!e&&a>="0"&&a<="9")b+="X";b+=a;e=true;f=false}else if(e&&!f){b+="_";f=true}}if(e){if(c.maxLength&&c.maxLength>0)b=b.substr(0,c.maxLength);c.value=f?b.substring(0,b.length-1):b}else c.value=g}return true};
DhtmlHistory.POLLING_FREQUENCY=300;DhtmlHistory.WAIT_FREQUENCY=500;function DhtmlHistory(a,c,b){this.locationOfBlankPage=UserContext.getUrl("/back_blank.html?");this.currentLocation=null;this.listener=c;this.iframe=null;this.ignoreLocationChange=false;this.currentWaitTime=0;this.historyStorage=a;this.parentObject=b;this.create()}
DhtmlHistory.prototype.add=function(a,c){var b=this;window.setTimeout(function(){if(b.currentWaitTime>0)b.currentWaitTime-=DhtmlHistory.WAIT_FREQUENCY;a=b.removeHash(a);if(document.getElementById(a))Gack.sendGack("History locations can not have the same value as any id's that might be in the document");else{b.historyStorage[a]=c;b.ignoreLocationChange=true;b.currentLocation=a;window.location.hash=a;if(XBrowser.userAgent.isIE)if(b.iframe)b.iframe.src=b.locationOfBlankPage+a;else{var e=document.getElementsByTagName("body")[0];
if(e){var d=document.createElement("div");e.appendChild(d);d.style.display="none";d.innerHTML="<iframe class='dhtmlHistoryFrame' name='DhtmlHistoryFrame' id='DhtmlHistoryFrame' src='"+b.locationOfBlankPage+a+"'></iframe>";b.iframe=document.getElementById("DhtmlHistoryFrame")}}}},this.currentWaitTime);this.currentWaitTime+=DhtmlHistory.WAIT_FREQUENCY};DhtmlHistory.prototype.getCurrentLocation=function(){return this.removeHash(window.location.hash)};
DhtmlHistory.prototype.create=function(){this.currentLocation=this.getCurrentLocation();this.ignoreLocationChange=true;if(!XBrowser.userAgent.isIE){var a=this;setInterval(function(){a.checkLocation()},DhtmlHistory.POLLING_FREQUENCY)}};DhtmlHistory.prototype.fireHistoryEvent=function(a,c){this.listener.call(this.parentObject,a,c)};DhtmlHistory.prototype.shouldProceedWithHistoryEvent=function(){if(this.ignoreLocationChange)return this.ignoreLocationChange=false;else return true};
DhtmlHistory.prototype.checkLocation=function(){if(!(XBrowser.userAgent.isIE||!this.shouldProceedWithHistoryEvent())){var a=this.getCurrentLocation();if(a!=this.currentLocation){var c=this.currentLocation;this.currentLocation=a;this.fireHistoryEvent(c,a)}}};DhtmlHistory.prototype.removeHash=function(a){return a?a==""||a.length==1&&a.charAt(0)=="#"?"":a.length>1&&a.charAt(0)=="#"?a.substring(1):a:null};
DhtmlHistory.prototype.iframeLoaded=function(a){if(XBrowser.userAgent.isIE&&this.shouldProceedWithHistoryEvent()){a=new String(a.search);if(!a||a.length==1&&a.charAt(0)=="?")a="";else if(a.length>=2&&a.charAt(0)=="?")a=a.substring(1);var c=this.removeHash(window.location.hash);window.location.hash=a;this.fireHistoryEvent(c,a)}};
function DuelingListBoxesElement(a,b,e,f){this.sListIds=a;this.warnDiv=b;this.removeWarnIf=e;this.removeWarningText=f}DuelingListBoxesElement.prototype.storeStateOnce=function(){if(!this.isStored){this.isStored=true;this.storeState()}};
DuelingListBoxesElement.prototype.storeState=function(){this.selectContents=[];for(var a=0;a<this.sListIds.length;a++){var b=document.getElementById(this.sListIds[a]);if(b){this.selectContents[a]=[];for(var e=0;e<b.options.length;e++)this.selectContents[a][e]=[b.options[e].text,b.options[e].value]}}};DuelingListBoxesElement.prototype.resetSelection=function(){if(this.isStored)for(var a=0;a<this.sListIds.length;a++){var b=document.getElementById(this.sListIds[a]);b&&Util.refreshDynamicSelect(b,this.selectContents[a])}};
DuelingListBoxesElement.prototype.quickWarn=function(a){DuelingListBoxesElement.warning(this.warnDiv,a)};DuelingListBoxesElement.prototype.quickUnwarn=function(){DuelingListBoxesElement.removeWarning(this.warnDiv)};DuelingListBoxesElement.prototype.instMoveDown=function(a,b,e,f,g){this.storeStateOnce();DuelingListBoxesElement.moveDown(a,b,e,f,g)};DuelingListBoxesElement.prototype.instMoveUp=function(a,b,e,f,g){this.storeStateOnce();DuelingListBoxesElement.moveUp(a,b,e,f,g)};
DuelingListBoxesElement.prototype.instMoveBottom=function(a,b){this.storeStateOnce();DuelingListBoxesElement.moveBottom(a,b)};DuelingListBoxesElement.prototype.instMoveTop=function(a,b){this.storeStateOnce();DuelingListBoxesElement.moveTop(a,b)};DuelingListBoxesElement.prototype.instMoveOption=function(a,b,e,f,g,d,c,h,i){this.storeStateOnce();DuelingListBoxesElement.moveOption(a,b,e,f,g,d,c,h,i,this.removeWarnIf,this.removeWarningText)};
DuelingListBoxesElement.prototype.instSaveAllSelected=function(a,b,e,f,g){DuelingListBoxesElement.saveAllSelected(a,b,e,f,g)};DuelingListBoxesElement.warning=function(a,b){if(a){var e=document.getElementById(a);if(e){e.innerHTML=LC.getLabel("Global","colonSeparatedWords",LC.getLabel("Global","error"),b);e.style.display="block"}}};DuelingListBoxesElement.removeWarning=function(a){if(a)if(a=document.getElementById(a)){a.innerHTML="";a.style.display="none"}};
DuelingListBoxesElement.moveTop=function(a,b){if(a.length>1){for(var e=a.options,f=[],g=0,d=0;d<a.length;d++)if(e[d].selected){f[g]=d;g++}for(d=0;d<f.length;d++){g=f[d];delta=g-d;for(var c=0;c<delta;c++){DuelingListBoxesElement.privateMoveUp(e,g-c);e[g-c].selected=false;e[g-c-1].selected=true}}a.focus();if(a.onLocalMoveTop)a.onLocalMoveTop()}DuelingListBoxesElement.removeWarning(b)};
DuelingListBoxesElement.moveBottom=function(a,b){if(a.length>1){for(var e=a.options,f=[],g=0,d=0;d<a.length;d++)if(e[d].selected){f[g]=d;g++}g=a.length-1;var c;for(d=f.length-1;d>=0;d--){c=f[d];for(var h=g-c,i=0;i<h;i++){DuelingListBoxesElement.privateMoveDown(e,c+i);e[c+i].selected=false;e[c+i+1].selected=true}g--}a.focus();if(a.onLocalMoveBottom)a.onLocalMoveBottom()}DuelingListBoxesElement.removeWarning(b)};
DuelingListBoxesElement.privateMoveUp=function(a,b){var e=new Option(a[b-1].text,a[b-1].value);a[b-1].text=a[b].text;a[b-1].value=a[b].value;a[b].text=e.text;a[b].value=e.value};DuelingListBoxesElement.privateMoveDown=function(a,b){var e=new Option(a[b+1].text,a[b+1].value);a[b+1].text=a[b].text;a[b+1].value=a[b].value;a[b].text=e.text;a[b].value=e.value};
DuelingListBoxesElement.moveDown=function(a,b,e,f,g){var d=false;if(a.length>1){var c=a.options,h=[],i=0;if(b!=null){if(b==c[0].value&&c[0].selected&&(c[1].value!=e||c[1].selected)){c[0].selected=false;if(f!=null){DuelingListBoxesElement.warning(g,f);d=true}}if(e&&c[1].value==b&&c[1].selected){c[1].selected=false;if(f!=null){DuelingListBoxesElement.warning(g,nmovableAlertMessage);d=true}}}for(b=a.length-2;b>=0;b--)if(a.options[b].selected){h[i]=b;i++}for(b=0;b<h.length;b++){i=h[b];DuelingListBoxesElement.privateMoveDown(c,
i);c[i].selected=false;c[i+1].selected=true}a.focus();if(a.onLocalMoveDown)a.onLocalMoveDown()}d||DuelingListBoxesElement.removeWarning(g)};
DuelingListBoxesElement.moveUp=function(a,b,e,f,g){if(a.length>1){var d=a.options,c=[],h=0;if(b!=null){if(d[0].value==b&&d[1].selected&&d[1].value!=e){d[1].selected=false;if(f!=null){DuelingListBoxesElement.warning(g,f);return}}if(e&&d[2].selected&&(d[1].value==b||d[1].selected)){d[2].selected=false;if(f!=null){DuelingListBoxesElement.warning(g,f);return}}}for(b=1;b<a.length;b++)if(d[b].selected){c[h]=b;h++}for(b=0;b<c.length;b++){h=c[b];DuelingListBoxesElement.privateMoveUp(d,h);d[h].selected=false;
d[h-1].selected=true}a.focus();if(a.onLocalMoveUp)a.onLocalMoveUp()}DuelingListBoxesElement.removeWarning(g)};
DuelingListBoxesElement.moveOption=function(a,b,e,f,g,d,c,h,i,m,j){if(m&&m())if(!(Modal.confirm&&Modal.confirm(j)||!Modal.confirm&&window.confirm(j)))return;m=false;j=a.options;var l,k=[],o=0;if(a.cannotBeEmpty||c){for(c=l=0;c<a.length;c++)a.options[c].selected&&l++;if(l==a.options.length){a.handleEmptyList&&a.handleEmptyList();h&&DuelingListBoxesElement.warning(i,h);return}}for(c=0;c<a.length;c++){h=j[c];if(h.selected){if((l=h.text!=e)&&f!=null)for(var n=0;n<f.length;n++)if(f[n]==h.value){l=false;
if(g[n]!=null){DuelingListBoxesElement.warning(i,g[n]);m=true}break}if(l){k[o]=c;o++}else h.selected=false}}f=b.options;if(k.length>0){b.selectedIndex=-1;for(c=0;c<k.length;c++){h=new Option(j[k[c]].text,j[k[c]].value);h.title=j[k[c]].title;if(f.length==1&&f[0].text==d){f[0]=h;f[0].selected=true}else{f[f.length]=h;f[f.length-1].selected=true}}}if(b.onchange)b.onchange();if(a.onchange)a.onchange();for(c=k.length-1;c>-1;c--)a.remove(k[c]);a.disabled=true;a.disabled=false;if(j.length==0)j[0]=new Option(e,
e);k.length>0&&b.focus();if(b.onLocalMoveOptions)b.onLocalMoveOptions();if(a.onLocalMoveOptions)a.onLocalMoveOptions();m||DuelingListBoxesElement.removeWarning(i)};DuelingListBoxesElement.saveAllSelected=function(a,b,e,f,g){var d,c;for(d=0;d<a.length;d++){b[d].value="";for(c=0;c<a[d].length;c++){if(!(a[d].length==1&&a[d].options[0].value==g)){var h=a[d].options[c].value.replace(RegExp(f+f,"g"),f+f);b[d].value+=h.replace(RegExp(e,"g"),f+e)}if(c+1<a[d].length)b[d].value+=e}}};
function EncryptedTextInputElement(c,d,e){if(e){this.maxLength=d;if(this.element=getElementByIdCS(c)){this.wasCleared=false;this.origValue=this.element.value;var a=this;this.handleOnFocus=function(){a.wasCleared||a.element.select()};this.handleKey=function(b){if(!a.wasCleared){b=getEvent(b).keyCode;if(!(b===KEY_ENTER||b===KEY_TAB||b===KEY_PAGEUP||b===KEY_PAGEDOWN)){a.element.value="";a.element.maxLength=a.maxLength;a.wasCleared=true}}};this.handleBlur=function(){if(a.element.value===a.origValue)a.wasCleared=
false};addEvent(this.element,"focus",this.handleOnFocus,true);addEvent(this.element,"blur",this.handleBlur,true);addEvent(this.element,"keypress",this.handleKey,true)}}};
function FileFieldInputElement(a){this.elementId=a;this.ffDiv=document.getElementById(a);this.ffUploadingDiv=document.getElementById(a+"_uploading");this.backupOfDiv=this.ffDiv.innerHTML;this.isTimeout=false}
FileFieldInputElement.prototype.completeUpload=function(a,b){this.isTimeout=false;document.getElementById(this.elementId+"_timeout").style.display="none";if(this.isCancelled)this.isCancelled=false;else{this.ffDiv.innerHTML=a.innerHTML;b&&a.parentNode.removeChild(a);this.ffDiv.style.display="block";this.ffUploadingDiv.style.display="none";FileFieldInputElement.stopUpload&&FileFieldInputElement.stopUpload()}};FileFieldInputElement.prototype.removeUpload=function(){this.ffDiv.innerHTML=this.backupOfDiv};
FileFieldInputElement.prototype.createHiddenInput=function(a,b){var c=document.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name",a);c.setAttribute("value",b);return c};FileFieldInputElement.prototype.restoreFormTarget=function(){var a=this.ffDiv.getElementsByTagName("input")[0].form;if(a.targetBak)a.target=a.targetBak;else a.removeAttribute("target")};
FileFieldInputElement.prototype.upload=function(a){var b=a.form.elements[this.elementId+":file"];if(!b.value||b.files&&b.files.length==1&&b.files[0].fileSize==0){alert(LC.getLabel("FileFieldType","InvalidFile"));return false}this.isCancelled=false;this.isTimeout=true;FileFieldInputElement.startUpload&&FileFieldInputElement.startUpload();a.form.targetBak=a.form.target;a.form.target=this.elementId+"_upload_iframe";this.ffDiv.style.display="none";this.ffUploadingDiv.style.display="block";return true};
FileFieldInputElement.prototype.timeout=function(){if(this.isTimeout){document.getElementById(this.elementId+"_timeout").style.display="block";this.cancelUpload(null)}};FileFieldInputElement.prototype.cancelUpload=function(){this.isCancelled=true;this.restoreFormTarget();this.ffDiv.style.display="block";this.ffUploadingDiv.style.display="none";FileFieldInputElement.stopUpload&&FileFieldInputElement.stopUpload()};
ForeignKeyInputElement=function(a,c,b,d,e){this.id=a;this.validationServletURI=c;this.mruServletURI=b;this.requestParams=e;this.element=getElementByIdCS(this.id);this.idElement=getElementByIdCS(this.id+EditElement.pID_SUFFIX);this.matchBlanks=d;this.onChangeListeners=[];ForeignKeyInputElement.allElements[a]=this};ForeignKeyInputElement.allElements={};
ForeignKeyInputElement.reload=function(){var a=[],c;for(c in ForeignKeyInputElement.allElements){var b=ForeignKeyInputElement.allElements[c],d=getElementByIdCS(b.id);if(d){b.element=d;b.idElement=getElementByIdCS(b.id+EditElement.pID_SUFFIX)}else{b.element=null;b.idElement=null;a.push(c)}}for(c=0;c<a.length;c++)delete ForeignKeyInputElement.allElements[a[c]]};
ForeignKeyInputElement.dispatchLookupChange=function(a){if(a=ForeignKeyInputElement.allElements[a]){a.applyValidationChanges({});a.validateDependents();ForeignKeyInputElement.showHideLookup(a,true);if(a.clearButton)a.clearButton.style.display="inline-block"}};ForeignKeyInputElement.showHideLookup=function(a,c){if(a.ghostTextInput)if(c){a.element.style.display="";a.ghostTextInput.style.display="none"}else{a.element.style.display="none";a.ghostTextInput.style.display=""}};
ForeignKeyInputElement.disableAndAddClearButton=function(a){if(a&&!a.isDisabled){a.element.readOnly=true;addStyleClass(a.element,"readonly");var c=document.createElement("INPUT");c.className="emptyDependentLookup readonly";c.style.display="none";c.readOnly=true;c.value=LC.getLabel("Global","click_lookup_icon");c.tabIndex=a.element.tabIndex;a.element.parentNode.insertBefore(c,a.element.nextSibling);a.ghostTextInput=c;var b=document.createElement("IMG");b.className="closeIcon";b.alt=LC.getLabel("Global",
"clear");b.src="/s.gif";addEvent(b,"mouseover",function(){this.className="closeIconOn"},true);addEvent(b,"mouseout",function(){this.className="closeIcon"},true);addEvent(b,"focus",function(){this.className="closeIconOn"},true);addEvent(b,"blur",function(){this.className="closeIcon"},true);a.element.parentNode.insertBefore(b,a.element.nextSibling);a.clearButton=b;if(a.idElement.value==""||a.element.value==""){b.style.display="none";ForeignKeyInputElement.showHideLookup(a,false)}addEvent(b,"click",
function(){b.style.display="none";a.element.value="";a.idElement.value="";ForeignKeyInputElement.showHideLookup(a,false);a.validateDependents()},true);a.isDisabled=true;a.element.blur();a.blurred=true}};ForeignKeyInputElement.prototype.validate=function(){this.element.value&&this.performValidation();this.lookupAutoCompleteElement&&this.lookupAutoCompleteElement.clearCache&&this.lookupAutoCompleteElement.clearCache()};ForeignKeyInputElement.prototype.validateDependents=function(){for(var a=0;a<this.onChangeListeners.length;a++)this.onChangeListeners[a].validate()};
ForeignKeyInputElement.prototype.afterLoad=function(){var a=false;if(this.referredDomIds)for(var c=this,b=0;b<this.referredDomIds.length;b++){var d=ForeignKeyInputElement.allElements[this.referredDomIds[b]];if(d){d.onChangeListeners.push(this);ForeignKeyInputElement.disableAndAddClearButton(d);a=a||d.blurred}else(d=getElementByIdCS(this.referredDomIds[b]))&&addEvent(d,"change",function(){c.validate()})}this.initAutoComplete();a&&setFocus()};
ForeignKeyInputElement.prototype.initAutoComplete=function(){if(this.mruServletURI)this.lookupAutoCompleteElement=new LookupAutoCompleteInputElement(this.id,this.mruServletURI,1,this.requestParams,this.matchBlanks,this.referredDomIds?this.id:null)};ForeignKeyInputElement.prototype.validateAfterLoadIfNecessary=function(){var a=getElementByIdCS(this.id+EditElement.pMOD_SUFFIX);a&&a.value=="1"&&this.validateDependents()};
ForeignKeyInputElement.prototype.performValidation=function(){var a=new QueryString;if(this.requestParams)for(var c in this.requestParams)a.add(c,this.requestParams[c]);a.add(LookupUi.pSEARCH_VALUE,this.element.value);a.add(LookupValidationServlet.pLKID_NAME,this.idElement.value);if(sfdcPage.getReferredDomIds)(c=sfdcPage.getReferredDomIds(this.id))&&a.add(LookupValidationServlet.pDEPDATA_NAME,dpdLkUtil.serialize(c,this.id));a.add(EditElement.pBASE_NAME,this.id);var b=this;XBrowser.getHttpResponse(this.validationServletURI+
a.toString(),function(d){if(d=d.responseText)(d=Util.evalAjaxServletOutput(d))&&d[LookupValidationServlet.pFILTER_RESULTS]&&b.applyValidationChanges(d[LookupValidationServlet.pFILTER_RESULTS])});return true};ForeignKeyInputElement.ARIA_ERROR_SUFFIX="_pcm";
ForeignKeyInputElement.prototype.applyValidationChanges=function(a){var c=this.element.parentNode,b=c.nextSibling;if(b&&b.className!="errorMsg")b=null;if(a.error){if(!b){var d=this.element.getAttribute("aria-labelledby");b=document.createElement("div");if(d){b.id=this.id+ForeignKeyInputElement.ARIA_ERROR_SUFFIX;this.element.setAttribute("aria-labelledby",d+" "+b.id)}b.className="errorMsg";c.parentNode.appendChild(b)}b.innerHTML=a.error}else if(b){delStyleClass(this.element,"error");(d=this.element.getAttribute("aria-labelledby"))&&
this.element.setAttribute("aria-labelledby",d.replace(" "+this.id+ForeignKeyInputElement.ARIA_ERROR_SUFFIX,""));c.parentNode.removeChild(b)}};ForeignKeyInputElementSelectProxy=function(a){ForeignKeyInputElement.call(this,a)};Util.extend(ForeignKeyInputElementSelectProxy,ForeignKeyInputElement);ForeignKeyInputElementSelectProxy.prototype.performValidation=function(){};ForeignKeyInputElementSelectProxy.prototype.validateAfterLoadIfNecessary=function(){};
ForeignKeyInputElementSelectProxy.prototype.showHideLookup=function(){};ForeignKeyInputElementSelectProxy.prototype.disableAndAddClearButton=function(){};
HtmlDetailElement={};HtmlDetailElement.populateIframeFromDiv=function(a,c){var b=document.getElementById(a);if(b!==null){b=b.contentWindow.document;if(b!==null){var d=document.getElementById(c);if(d!==null)b.body.innerHTML=d.innerHTML}}};HtmlDetailElement.adjustSfdcSpaceSize=function(a){a=document.getElementById(a+"_frame");HtmlDetailElement.adjustFrameSize(a)};
HtmlDetailElement.registerRta=function(a){if(typeof window.twistSection=="function"){if(!HtmlDetailElement.rtaIds){HtmlDetailElement.rtaIds=[];var c=window.twistSection;window.twistSection=function(b,d){if(c(b,d)){HtmlDetailElement.adjustSfdcAllFrames();return true}return false}}HtmlDetailElement.rtaIds.push(a)}};HtmlDetailElement.adjustSfdcAllFrames=function(){for(var a=0;a<HtmlDetailElement.rtaIds.length;a++)HtmlDetailElement.adjustSfdcSpaceSize(HtmlDetailElement.rtaIds[a])};
HtmlDetailElement.adjustFrameSize=function(a){if(a){var c;c=a.Document?a.Document.body:a.contentWindow.document.documentElement;if(!document.getElementById("knowledgeTOCRenderer")){var b=600,d=c.scrollWidth+20;if(d>b)b=d;a.width=b}b=c.getElementsByTagName("body")[0];var e=d=0;ua=navigator.userAgent.toLowerCase();if(/msie 8/.test(ua))e=40;else if(/msie/.test(ua)||/gecko/.test(ua)&&/rv:1/.test(ua))e=20;if(b){if(b.scrollHeight!=b.clientHeight)d=b.scrollHeight-b.clientHeight;c=b.clientHeight+d+HtmlDetailElement.adjustFrameSizeForListOnly(b)+
e;if(b.firstChild&&b.firstChild.offsetTop)c+=b.firstChild.offsetTop;a.height=c}else{if(c.scrollHeight!=c.clientHeight)d=c.scrollHeight-c.clientHeight;a.height=c.scrollHeight+d+HtmlDetailElement.adjustFrameSizeForListOnly(c)+e}}};HtmlDetailElement.adjustFrameSizeForListOnly=function(a){if(a&&a.childNodes&&a.childNodes.length==1&&a.firstChild.nodeName.toLowerCase()=="ul"){a=a.firstChild;if(a.childNodes&&a.childNodes.length>=1)return a.getElementsByTagName("li")[0].clientHeight}return 0};
function ImageSelectElement(b,c,d){var a=this;this.inputElement=document.getElementById(b);this.image=document.getElementById(c);this.partialImageURL=d;this.inputElement.imageSelectElement=this;this.inputElement.onchange=function(){a.image.src=a.partialImageURL+a.inputElement.value}}ImageSelectElement.prototype.isNull=function(){return!(this.inputElement&&this.inputElement.value&&this.inputElement.value.length>0)};
function ListElement(a){this.formName=a}ListElement.prototype.cbWarn=function(){var a=document.getElementById(this.formName);for(i=0;i<a.elements.length;i++)if(a.elements[i].name==ListView.CHECKBOX_ID&&a.elements[i].checked)if(window.confirm(LC.getLabel("List","checkboxWarning"))){for(j=i;j<a.elements.length;j++)if(a.elements[j].name==ListView.CHECKBOX_ID)a.elements[j].checked=false;break}else return false;return true};ListElement.getList=function(a){return instances[a]};ListElement.instances={};
ListElement.createListElement=function(a){ListElement.instances[a]=new ListElement(a)};
function LookupElement(){var c=this;this.lookupPick=function(b,a,d,e,f,g,h,i){setTimeout(function(){c.closeLookup()},1);lookupPick(b,a,d,e,f,g,h,i)};this.lookupPick2=function(b,a,d,e,f,g,h,i,j,k){setTimeout(function(){c.closeLookup()},1);lookupPick2(b,a,d,e,f,g,h,i,j,k)};this.lookupPhonePick=function(b,a){setTimeout(function(){c.closeLookup()},1);lookupPhonePick(b,a)}}LookupElement.prototype.openLookup=function(c,b,a,d){if(a=="1")c+=d;this.initOverlay(c).show()};
LookupElement.prototype.closeLookup=function(){this.getOverlay().hide();this.redirectIframe(IFrameElement.BLANK_SRC)};LookupElement.prototype.getOverlay=function(){return sfdcPage.getDialogById(LookupInputElement.DIALOG_ID)};LookupElement.prototype.redirectIframe=function(c){this.getOverlay().getContentElement().firstChild.src=c};
LookupElement.prototype.initOverlay=function(c){var b=this.getOverlay();if(b)this.redirectIframe(c);else{var a=[];a.push("<iframe ");a.push('src="');a.push(c);a.push('" class="pageMaskIFrame" scrolling="no" ');a.push('id="');a.push(LookupInputElement.LOOKUP_IFRAME);a.push('" name="');a.push(LookupInputElement.LOOKUP_IFRAME);a.push('"></iframe>');a=a.join("");b=new FunctionalDialog(LookupInputElement.DIALOG_ID,true,LC.getLabel("Lookup","Title"));b.setWidth(900);b.setMaxHeight(700);b.hideSummaryElement();
b.clearButtons();sfdcPage.registerDialog(b);b.setContentInnerHTML(a)}return b};
function ManageableInfoElement(a){if(a)if(a=document.getElementById(a)){var c=getElementsByClassName(ManageableInfo.MORE_INFO_CLASS,a,"div");if(!(!c||c.length<1)){var d=c[0],b=this;this.isHidden=true;this.onLinkClickHandler=function(){if(b.isHidden){d.style.display="block";b.link.innerHTML=LC.getLabel("ManageableInfo","LessInfo");b.isHidden=false}else{d.style.display="none";b.link.innerHTML=LC.getLabel("ManageableInfo","MoreInfo");b.isHidden=true}window.VFEditor&&window.VFEditor.refreshTroughPosition()};
if((a=a.getElementsByTagName("a"))&&a.length>0){this.link=a[0];addEvent(this.link,"click",this.onLinkClickHandler,false)}}}};
function MenuButton(a,c){this.id=a;this.hasDefaultAction=c;if(this.id)if(this.hook_isAccessibleMode())this.initAccessibilityMode(this.id);else{this.parentDiv=document.getElementById(a);this.buttonDiv=document.getElementById(a+MenuButtonElement.BUTTON);this.buttonLabel=document.getElementById(a+MenuButtonElement.LABEL);this.menuDiv=document.getElementById(a+MenuButtonElement.MENU);this.buttonWidth=MenuButton.DEFAULT_ARROW;this.shim=new iframeShim(this.menuDiv);var b=this;addEvent(document,"click",
function(d){b.hideOthers(d)},false);addEvent(document,"keydown",function(d){b.handleKeyPress(d)},false);addEvent(this.parentDiv,"click",function(d){b.handleDivClick(d)},false);addEvent(this.parentDiv,"mouseover",function(){addStyleClass(b.parentDiv,"menuButtonOver")});addEvent(this.parentDiv,"mouseout",function(){delStyleClass(b.parentDiv,"menuButtonOver")});addEvent(this.buttonLabel,"mousedown",function(d){b.removeDottedLinkOutline(d)},false);addEvent(this.buttonLabel,"mouseout",function(d){b.removeDottedLinkOutline(d)},
false);addEvent(this.buttonLabel,"keydown",function(d){d.keyCode==KEY_ENTER&&b.handleDivClick(d)},false);addEvent(this.menuDiv,"click",function(d){return b.handleMenuClick(d)},false)}}MenuButton.DEFAULT_ARROW=17;MenuButton.prototype.handleDivClick=function(a){if(this.hasDefaultAction){var c=getEventTarget(a);c=c.parentNode;if(this.defaultActionCondition(getMouseX(a)-getObjX(c),a)){this.defaultAction();return}}XBrowser.getCurrentStyle(this.menuDiv,"display")=="none"?this.show():this.hide()};
MenuButton.prototype.handleMenuClick=function(a){this.hide();hasStyleClass(this.parentDiv,"menuButtonActivated")&&delStyleClass(this.parentDiv,"menuButtonActivated");eventCancelBubble(a)};MenuButton.prototype.defaultActionCondition=function(a){return LC.isRtlPage()?a>this.buttonWidth&&a<this.buttonDiv.offsetWidth:a<this.buttonDiv.offsetWidth-this.buttonWidth};MenuButton.prototype.hook_isAccessibleMode=function(){return UserContext.isAccessibleMode};
MenuButton.prototype.defaultAction=function(){var a=this.menuDiv.childNodes[0];this.hide();if(a.target){var c=document.getElementsByName(a.target);if(c&&c[0].src)c[0].src=a.href}else navigateToUrl(a.href)};MenuButton.prototype.show=function(){addStyleClass(this.parentDiv,"menuButtonActivated");this.shim.setStyle("display","block");this.position();this.show_hook()};MenuButton.prototype.show_hook=function(){};MenuButton.prototype.getMenuWidth=function(){return this.buttonDiv.offsetWidth-2};
MenuButton.prototype.position=function(){this.menuDiv.style.width="";for(var a=this.getMenuWidth(),c=0;c<this.menuDiv.childNodes.length;c++){var b=this.menuDiv.childNodes[c];if(b.nodeType==Node.ELEMENT_NODE)if(b.offsetWidth>a)a=b.offsetWidth}this.shim.setStyle("width",a+"px");a=XBrowser.getCurrentStyle(this.parentDiv,"display");if(a=="inline"||a=="inline-block"){this.parentDiv.style.position="relative";this.shim.setStyle("top",this.buttonDiv.offsetHeight+"px")}};
MenuButton.prototype.hide=function(a){delStyleClass(this.parentDiv,"menuButtonActivated");if(XBrowser.getCurrentStyle(this.menuDiv,"display")!="none"){this.shim.setStyle("display","none");this.parentDiv.style.position="";a||this.hide_hook()}};MenuButton.prototype.hide_hook=function(){};
MenuButton.prototype.hideOthers=function(a){a=getEventTarget(a);if(a!=this.buttonDiv&&a!=this.buttonLabel&&a!=this.parentDiv&&a.parentNode!=this.buttonDiv&&!hasStyleClass(a,"menuButtonMenuLink")){this.hide(true);hasStyleClass(this.parentDiv,"menuButtonActivated")&&delStyleClass(this.parentDiv,"menuButtonActivated")}};MenuButton.prototype.handleKeyPress=function(a){a.keyCode==KEY_ESC&&this.hide()};
MenuButton.prototype.addOption=function(a,c,b,d){if(!this.hook_isAccessibleMode()){var e=document.createElement("a");if(b)e.className=b;if(d)e.target=d;e.href=c;e.innerHTML=a;this.menuDiv.appendChild(e)}};MenuButton.prototype.initAccessibilityMode=function(a){var c=document.getElementById(a+MenuButtonElement.GO_BUTTON);addEvent(c,"click",function(){var b=document.getElementById(a+MenuButtonElement.SELECT);b=b.options[b.selectedIndex].value;b!=""&&navigateToUrl(b)},false)};
MenuButton.prototype.removeDottedLinkOutline=function(a){if(getEventTarget(a)==this.buttonLabel)if(a.type=="mousedown"){this.buttonLabel.blur();if(isIE)this.buttonLabel.hideFocus=true;else this.buttonLabel.style.outline="none"}else if(a.type=="mouseout"){this.buttonLabel.blur();if(isIE)this.buttonLabel.hideFocus=false;else this.buttonLabel.style.outline=null}};
var MultiSelectPicklist={};MultiSelectPicklist.loadMSP=function(a){var d=getElementByIdCS(a+"_selected");a=getElementByIdCS(a+"_unselected");if(isSafari){for(i=0;i<d.childNodes.length;i++){var c=d.childNodes[i];c.nodeName=="OPTGROUP"&&c.appendChild(document.createElement("p"))}for(i=0;i<a.childNodes.length;i++){c=a.childNodes[i];c.nodeName=="OPTGROUP"&&c.appendChild(document.createElement("p"))}}MultiSelectPicklist.resizeMSP(d,a)};
MultiSelectPicklist.resizeMSP=function(a,d){if(a&&d)if(!XBrowser.getCurrentStyle(a,"width")){var c=a.scrollWidth>d.scrollWidth?a.scrollWidth:d.scrollWidth;c+=35;a.style.width=c+"px";d.style.width=c+"px"}};
MultiSelectPicklist.handleMSPChange=function(a){var d=getElementByIdCS(a.id+"_selected"),c=getElementByIdCS(a.id+"_unselected");if(isSafari){var f,g;for(b=0;b<d.childNodes.length;b++){var e=d.childNodes[b];if(e.nodeName=="OPTGROUP"){f=b;var h=e.childNodes.length;for(j=0;j<h;j++)e.removeChild(e.childNodes[0]);e.appendChild(document.createElement("p"))}}for(b=0;b<c.childNodes.length;b++){e=c.childNodes[b];if(e.nodeName=="OPTGROUP"){g=b;h=e.childNodes.length;for(j=0;j<h;j++)e.removeChild(e.childNodes[0]);
e.appendChild(document.createElement("p"))}}for(b=0;b<a.options.length;b++)if(a.options[b].value!=picklistNAMarker){e=document.createElement("option");e.text=a.options[b].text;e.value=b;a.options[b].selected?d.childNodes[f].appendChild(e):c.childNodes[g].appendChild(e)}}else if(Sfdc.userAgent.isIE9){this.clearOptions(d);this.clearOptions(c);f=d.getElementsByTagName("optgroup");g=c.getElementsByTagName("optgroup");var b=0;for(e=a.options.length;b<e;b++)if(a.options[b].value!=picklistNAMarker){h=new Option(a.options[b].text,
b);if(a.options[b].selected)f.length?f[0].appendChild(h):d.options.push(h);else g.length?g[0].appendChild(h):c.options.push(h)}}else{g=f=0;d.length=0;for(b=c.length=0;b<a.options.length;b++)if(a.options[b].value!=picklistNAMarker)if(a.options[b].selected){d.options[f]=new Option(a.options[b].text,b);f++}else{c.options[g]=new Option(a.options[b].text,b);g++}}MultiSelectPicklist.resizeMSP(d,c);if(a.onchange)a.onchange()};
MultiSelectPicklist.clearOptions=function(a){if(Sfdc.userAgent.isIE9){var d=a.getElementsByTagName("optgroup");if(d&&d.length){a=0;for(var c=d.length,f,g;a<c;a++){f=d[a];g=f.getElementsByTagName("option");g.length===0&&f.appendChild(new Option("",0));for(f=g.length-1;f>=0;f--)g[f].removeNode()}}else a.length=0}else a.length=0};
MultiSelectPicklist.handleMSPSelect=function(a){var d=getElementByIdCS(a);a=getElementByIdCS(a+"_unselected");for(var c=0;c<a.options.length;c++)if(a.options[c].selected)d.options[parseInt(a.options[c].value)].selected=true;MultiSelectPicklist.handleMSPChange(d)};MultiSelectPicklist.handleMSPUnSelect=function(a){var d=getElementByIdCS(a);a=getElementByIdCS(a+"_selected");for(var c=0;c<a.options.length;c++)if(a.options[c].selected)d.options[parseInt(a.options[c].value)].selected=false;MultiSelectPicklist.handleMSPChange(d)};
function OverlayDialog(){this.dialog=this.id=null;this.isModal=true;this.extraClass="";this.background=null;this.width=OverlayDialog.MAX_WIDTH;this.minHeight=OverlayDialog.MIN_HEIGHT;this.minWidth=OverlayDialog.MIN_WIDTH;this.buttons=[];this.info=this.header=this.title=null;this.created=this.isOpen=false;this.allowKeyboardEsc=this.displayX=true;this.resizing=this.moving=this.positioned=this.isAbsolutePositioned=this.isMovable=this.isResizable=false;this.changeY=this.changeX=this.relativeY=this.relativeX=
this.fixedY=this.fixedX=0;this.refreshOnClose=false}OverlayDialog.prototype.addEvents=function(){if(this.id){var a=this;this.allowKeyboardEsc&&addEvent(document,"keydown",function(b){a.handleKeyPress(b)},false);addEvent(window,"resize",function(){a.resizeEvent()},false);XBrowser.userAgent.isIE6&&addEvent(window,"scroll",function(){a.scrollEvent()},false)}};OverlayDialog.prototype.setTitle=function(a){this.title=a;if(this.created)document.getElementById(this.id+"Title").innerHTML=this.title};
OverlayDialog.prototype.setHeader=function(a){this.header=a;if(this.created)document.getElementById(this.id+"Header").innerHTML=this.header};OverlayDialog.prototype.setInfo=function(a){this.info=a;if(this.created)document.getElementById(this.id+"Info").innerHTML=this.info};OverlayDialog.prototype.setWidth=function(a){this.width=a;if(this.created){this.dialog.style.width=typeof a=="string"?a:a+"px";this.isOpen&&this.position()}};OverlayDialog.prototype.setMinHeight=function(a){this.minHeight=a};
OverlayDialog.prototype.setMinWidth=function(a){this.minWidth=a};OverlayDialog.prototype.overrideButton=function(a,b,c){if(a>=OverlayDialog.MAX_BUTTONS)throw"Cannot have more than "+OverlayDialog.MAX_BUTTONS+" buttons.";this.buttons[a]={display:b,action:c}};OverlayDialog.prototype.setupDefaultButtons=function(){this.buttons=[];this.buttons[0]={display:LC.getLabel("Buttons","ok"),action:null};this.buttons[1]={display:LC.getLabel("Buttons","cancel"),action:null}};
OverlayDialog.prototype.clearButtons=function(){this.buttons=[]};OverlayDialog.MAX_BUTTONS=4;OverlayDialog.MAX_WIDTH=800;OverlayDialog.MIN_WIDTH=300;OverlayDialog.MIN_HEIGHT=200;OverlayDialog.EDGE_BUFFER=40;OverlayDialog.LOAD_MARK="OverlayLoadStart";OverlayDialog.LOAD_MEASURE="overlayLoadDone";
OverlayDialog.prototype.show=function(){this.dialog.style.display="block";this.position();if(this.isModal){this.background||this.createBackground();this.resizeBackground();this.background.style.display="block";this.processSelectElems()}this.dialog.style.visibility="visible";this.isOpen=true;Jiffy.measure(OverlayDialog.LOAD_MEASURE,OverlayDialog.LOAD_MARK)};
OverlayDialog.prototype.processSelectElems=function(){if(XBrowser.userAgent.isIE6){for(var a=document.getElementsByTagName("select"),b=this.dialog.getElementsByTagName("select"),c=a.length,d=b.length,e=0;e<c;e++)a[e].style.visibility="hidden";for(e=0;e<d;e++)b[e].style.visibility="visible"}};
OverlayDialog.prototype.hide=function(){this.isMovable&&this.stopDrag();if(this.isModal){this.background.style.display="none";if(XBrowser.userAgent.isIE6)for(var a=document.getElementsByTagName("select"),b=a.length,c=0;c<b;c++)a[c].style.visibility="visible"}this.dialog.style.visibility="hidden";if(!XBrowser.userAgent.isFirefox)this.dialog.style.display="none";this.isOpen=false;this.refreshOnClose&&!XBrowser.userAgent.isChromeFrame&&window.location.reload(true)};OverlayDialog.prototype.cancel=function(){this.hide()};
OverlayDialog.prototype.handleKeyPress=function(a){if(this.isOpen){a=getEvent(a);var b=a.keyCode;if(b==KEY_ESC&&this.allowKeyboardEsc)this.cancel();else b==KEY_ENTER&&this.captureEnter(getEventTarget(a))&&this.enter()}};OverlayDialog.prototype.captureEnter=function(a){return a.nodeName!="A"&&a.nodeName!="TEXTAREA"&&a.type!="button"};OverlayDialog.prototype.enter=function(){};
OverlayDialog.prototype.position=function(){if(this.resizing){var a=this.startWidth+this.changeX,b=this.startHeight+this.changeY;if(a<this.minWidth)a=this.minWidth;if(b<this.minHeight)b=this.minHeight;this.dialog.style.width=a+"px";this.dialog.style.height=b+"px";document.getElementById(this.getContentId()).style.height=b-46+"px"}else{if(this.positioned){a=getWindowWidth()-OverlayDialog.EDGE_BUFFER;b=getWindowHeight()-OverlayDialog.EDGE_BUFFER;var c=OverlayDialog.EDGE_BUFFER-this.dialog.offsetWidth,
d=OverlayDialog.EDGE_BUFFER/2;if(this.fixedX<c)this.fixedX=c;else if(this.fixedX>a)this.fixedX=a;if(this.fixedY<d)this.fixedY=OverlayDialog.EDGE_BUFFER;else if(this.fixedY>b)this.fixedY=b}else{this.setInnerHeight();a=getWindowWidth()-this.dialog.offsetWidth;a=a<6?6:a/2;b=getWindowHeight()-this.dialog.offsetHeight;this.fixedX=a;this.fixedY=b<6?6:b/2}if(XBrowser.userAgent.isIE6){this.dialog.style.left=this.fixedX+getScrollX()+"px";this.dialog.style.top=this.fixedY+getScrollY()+"px"}else{this.dialog.style.left=
this.fixedX+"px";this.dialog.style.top=this.fixedY+"px"}}};OverlayDialog.prototype.setInnerHeight=function(){};OverlayDialog.prototype.createBackground=function(){this.background=document.createElement("div");this.background.className="overlayBackground";document.body.appendChild(this.background);var a=this;addEvent(this.background,"mousedown",function(b){a.smash(b)},false);addEvent(this.background,"click",function(b){a.smash(b)},false)};
OverlayDialog.prototype.resizeBackground=function(){if(this.background)if(this.dialog.currentStyle&&XBrowser.userAgent.isIE6){this.background.style.width=document.body.offsetWidth+"px";this.background.style.height=document.body.offsetHeight+"px"}else{this.background.style.width=Math.max(document.documentElement.scrollWidth,getWindowWidth())+"px";this.background.style.height=Math.max(document.documentElement.scrollHeight,getWindowHeight())+"px"}};
OverlayDialog.prototype.scrollEvent=function(){this.created&&this.position()};
OverlayDialog.prototype.resizeEvent=function(){if(this.created){if(this.background)if(this.background.currentStyle&&XBrowser.userAgent.isIE6){this.background.style.width=document.body.offsetWidth+"px";this.background.style.height=document.body.offsetHeight+"px"}else{this.background.style.width=Math.max(document.documentElement.scrollWidth,getWindowWidth())+"px";this.background.style.height=Math.max(document.documentElement.scrollHeight,getWindowHeight())+"px"}this.position()}};
OverlayDialog.prototype.createDialog=function(){var a=document.createElement("div");a.id=this.id;var b=["overlayDialog"];this.isAbsolutePositioned&&b.push("absolutePositionedOverlayDialog");b.push(this.extraClass);a.className=b.join(" ");if(typeof this.width=="string")a.style.width=this.width;else if(typeof this.width=="number")a.style.width=this.width+"px";b=[];b.push("<div class='topRight");this.isMovable&&b.push(" movable");b.push("'><div class='topLeft'>");if(this.displayX){b.push("<img title='"+
LC.getLabel("Buttons","close")+"' id='");b.push(this.id);b.push("X' onmouseover=\"this.className = 'dialogCloseOn'\" onmouseout=\"this.className = 'dialogClose'\" onclick=\"sfdcPage.getDialogById('");b.push(this.id);b.push("').cancel()\" class='dialogClose' src='"+UserContext.getUrl("/s.gif")+"'>")}b.push("<h2 id='");b.push(this.id);b.push("Title'>");b.push(this.title);b.push("</h2></div></div><div class='middle'><div class='innerContent' id='");b.push(this.getContentId());b.push("'></div></div>");
if(this.isResizable){b.push("<div id='");b.push(this.id);b.push("Resize' class='dialogResize'></div>")}b.push("<div class='bottomRight'><div class='bottomLeft'></div></div>");a.innerHTML=b.join("");document.body.appendChild(a);this.dialog=a;var c=this;if(this.isMovable||this.isResizable){addEvent(document,"mouseup",function(){c.stopDrag()},false);if(this.isMovable){addEvent(this.dialog.firstChild,"mousedown",function(d){c.startMove(d)},false);addEvent(document,"mousemove",function(d){c.move(d)},false)}if(this.isResizable){a=
document.getElementById(this.id+"Resize");addEvent(a,"mousedown",function(d){c.startResize(d)},false);addEvent(document,"mousemove",function(d){c.resize(d)},false)}}this.createContent();this.created=true};OverlayDialog.prototype.createContent=function(){};
OverlayDialog.prototype.startMove=function(a){a=getEvent(a);if(getEventTarget(a).nodeName!="IMG"){this.moving=this.positioned=true;this.relativeX=a.clientX-this.dialog.offsetLeft;this.relativeY=a.clientY-this.dialog.offsetTop;if(XBrowser.userAgent.isIE6){this.relativeX+=getScrollX();this.relativeY+=getScrollY()}this.fixedX=a.clientX-this.relativeX;this.fixedY=a.clientY-this.relativeY;this.smash(a)}};
OverlayDialog.prototype.startResize=function(a){a=getEvent(a);this.resizing=this.positioned=true;this.relativeX=a.clientX;this.relativeY=a.clientY;this.startWidth=this.dialog.offsetWidth;this.startHeight=this.dialog.offsetHeight;this.smash(a)};OverlayDialog.prototype.stopDrag=function(){this.resizing=this.moving=false};OverlayDialog.prototype.move=function(a){if(this.moving){a=getEvent(a);this.smash(a);this.fixedX=a.clientX-this.relativeX;this.fixedY=a.clientY-this.relativeY;this.position()}};
OverlayDialog.prototype.resize=function(a){if(this.resizing){a=getEvent(a);this.smash(a);this.changeX=a.clientX-this.relativeX;this.changeY=a.clientY-this.relativeY;this.position()}};OverlayDialog.prototype.smash=function(a){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;if(a.preventDefault)a.preventDefault();else a.returnValue=false};OverlayDialog.prototype.getContentId=function(){return this.id+"Content"};
OverlayDialog.prototype.createButtons=function(a){a.push("<div id='"+this.id+"_buttons' class='buttons'>");for(var b=0;b<this.buttons.length;b++){var c=this.buttons[b].display,d=this.buttons[b].action,e=this.buttons[b].id;a.push("<input class='btn' type='button' value='");a.push(c);if(e){a.push("' id='");a.push(e)}a.push("' onclick=\"");if(typeof d=="string"){a.push("if(");a.push(d.replace(/"/,'\\"'));a.push(")")}else if(typeof d=="function"){a.push("if(");a.push(d.name);a.push("())")}a.push("sfdcPage.getDialogById('");
a.push(this.id);a.push("').hide();\">")}a.push("</div>")};OverlayDialog.prototype.register=function(){sfdcPage.registerDialog(this)};
function Paginator(a){a&&this.init(a)}Paginator.prototype.init=function(a){if(a.listId){this.listId=a.listId;this.id=this.listId+"_paginator"}else this.id=a.id;Paginator.addPaginator(this);this.containerIds=a.containerIds;this.handler=a.handler;this.ref="Paginator.instances['"+this.id+"']";this.setState(a)};
Paginator.prototype.setState=function(a){this.currentPage=parseInt(a.currentPage)||this.currentPage||1;this.recordsPerPage=parseInt(a.recordsPerPage)||this.recordsPerPage||50;this.totalRecords=parseInt(a.totalRecords)||this.totalRecords;this.recordsOnThisPage=parseInt(a.recordsOnThisPage);this.more=a.more;if(this.totalRecords)this.totalPages=Math.ceil(this.totalRecords/this.recordsPerPage);this.startingRecord=(this.currentPage-1)*this.recordsPerPage+1;if(!a.nodraw){var b=this;window.sfdcPage.appendToOnloadQueue(function(){b.draw()})}};
Paginator.prototype.draw=function(){var a=[];a.push("<div class='paginator'>");a.push("<span class='left'>");a.push(this.getRecordCounts());a.push("</span>");a.push(this.getPrevNextLinks());a.push("<span class='right'>");a.push(this.getPageXofY());a.push("</span>");a.push("</div>");a.push("<div class='clearingBox'/>");for(var b=0;b<this.containerIds.length;b++)document.getElementById(this.containerIds[b]).innerHTML=a.join("").replace(/__CID__/g,this.containerIds[b])};
Paginator.keyHandle=function(a){if(window.ActiveXObject&&a.keyCode==KEY_ENTER)getEventTarget(a).onchange()};Paginator.prototype.getTempId=function(a){return"__CID__"+a};
Paginator.prototype.getPageXofY=function(){var a=[];if(this.totalPages){a.push("<label for='");a.push(this.getTempId("_getPageXofY"));a.push("'>");a.push(LC.getLabel("Paginator","page"));a.push("</label>");a.push("<input class='pageInput' maxlength='4' onchange=\"");a.push(this.ref);a.push('.goToPage(this.value)"');a.push(' onkeydown="');a.push('Paginator.keyHandle(event)"');a.push(" value='");a.push(this.currentPage);a.push("' id='");a.push(this.getTempId("_getPageXofY"));a.push("'/>");a.push(LC.getLabel("Paginator",
"of",this.totalPages))}else{a.push(LC.getLabel("Paginator","page"));a.push("&nbsp;");a.push(this.currentPage)}return a.join("")};
Paginator.prototype.getRecordCounts=function(){if(!this.totalRecords&&this.recordsOnThisPage==0)return"0";else{var a=[];a.push(this.startingRecord);a.push("-");var b=0;b=this.totalRecords?Math.min(this.startingRecord+this.recordsPerPage-1,this.totalRecords):Math.min(this.startingRecord+this.recordsPerPage-1,this.startingRecord+this.recordsOnThisPage-1);a.push(b);if(this.totalRecords){a.push(" ");a.push(LC.getLabel("Paginator","of",this.totalRecords))}return a.join("")}};
Paginator.prototype.getPrevNextLinks=function(){var a=[],b="";a.push("<span class='prevNextLinks'>");if(this.currentPage!=1){b=this.ref+".goToPage(1)";a.push("<a title='");a.push(LC.getLabel("Paginator","first_page"));a.push("' class='prevNext' href=\"javascript:");a.push(b);a.push('">')}else a.push("<span class='prevNext prevNextDisabled'>");a.push("&lt;&lt;");this.currentPage!=1?a.push("</a>"):a.push("</span>");if(this.currentPage!=1){b=this.ref+".goToPage("+(this.currentPage-1)+")";a.push("<a title='");
a.push(LC.getLabel("Paginator","previous_page"));a.push("' class='prevNext' href=\"javascript:");a.push(b);a.push('">')}else a.push("<span class='prevNext prevNextDisabled'>");a.push("&lt; ");a.push(LC.getLabel("Paginator","previous"));this.currentPage!=1?a.push("</a>"):a.push("</span>");if(this.more||this.totalPages&&this.currentPage!=this.totalPages){b=this.ref+".goToPage("+(this.currentPage+1)+")";a.push("<a title='");a.push(LC.getLabel("Paginator","next_page"));a.push("' class='prevNext' href=\"javascript:");
a.push(b);a.push('">')}else a.push("<span class='prevNext prevNextDisabled'>");a.push(LC.getLabel("Paginator","next"));a.push(" &gt;");this.more||this.totalPages&&this.currentPage!=this.totalPages?a.push("</a>"):a.push("</span>");if(this.totalPages&&this.currentPage!=this.totalPages){b=this.ref+".goToPage("+this.totalPages+")";a.push("<a title='");a.push(LC.getLabel("Paginator","last_page"));a.push("' class='prevNext' href=\"javascript:");a.push(b);a.push('">')}else a.push("<span class='prevNext prevNextDisabled'>");
a.push("&gt;&gt;");this.totalPages&&this.currentPage!=this.totalPages?a.push("</a>"):a.push("</span>");a.push("</span>");return a.join("")};Paginator.prototype.goToPage=function(a){if(isNaN(a)||a<1)a=1;else if(a>this.totalPages)a=this.totalPages;this.handler&&this.handler(a)};Paginator.addPaginator=function(a){Paginator.instances[a.id]=a};Paginator.instances={};
function RelatedListPanel(a,b){this.panelId=a;this.delayingShow=this.delayingHide=this.currentListId=null;this.numLists=0;this.linksHtml=[];this.isConsole=location.search.indexOf(Desktop.IS_DESKTOP)>-1;this.iframeReady=false;this.skipAppendOnView=b}RelatedListPanel.prototype.getPanelNode=function(){return document.getElementById(this.panelId)};RelatedListPanel.prototype.getPanelShadowNode=function(){return this.getPanelNode()?this.getPanelNode().parentNode:null};
RelatedListPanel.prototype.getIFrameNode=function(){return Sfdc.select("iframe",this.getPanelNode())[0]};RelatedListPanel.prototype.registerList=function(a){this.linksHtml.push(this.getSimpleLinkHTML(a))};
RelatedListPanel.prototype.addListsToPanel=function(a){var b=this.getHoverableLinksNode();if((a||b.innerHTML.indexOf("linklet")<0)&&b.nodeName!=="SCRIPT".toUpperCase()){Sfdc.Dom.updateHTML(b,this.linksHtml.join('<span class="pipe"> | </span>'));a=b.getElementsByTagName("a");for(var c=0;c<a.length;c++)this.addEventsToLinks(a[c])}b.style.visibility="visible"};
RelatedListPanel.prototype.addEventsToLinks=function(a){var b=a.href.substring(a.href.indexOf("#")+1,a.href.indexOf("_target")),c=RelatedList.get(b);if(c&&c.isHoverEnabled()){Sfdc.on(a,"mouseover",function(){sfdcPage.getRelatedListPanel(b).showRLDelayed(b)});Sfdc.on(a,"mouseout",function(){sfdcPage.getRelatedListPanel(b).hideRLDelayed(b)});Sfdc.on(a,"click",function(){sfdcPage.getRelatedListPanel(b).hideRL(b)})}};
RelatedListPanel.prototype.getSimpleLinkHTML=function(a){var b=[];b.push('<a class="linklet" href="#');b.push(a.getLinkTarget());b.push('" id="');b.push(this.getLinkId(a.listId));b.push('"');b.push(">");b.push('<span class="listTitle">');b.push(a.getTitle());b.push(this.getCountIndicator(a));b.push("</span></a>");return b.join("")};
RelatedListPanel.prototype.getCountIndicator=function(a){var b=[];if(a.shouldLoad)b.push('<span class="count">[...]</span>');else{b.push('<span class="count">[');b.push(a.getNumberVisibleRows());a.hasMore()&&b.push('<span class="plus">+</span>');b.push("]</span>")}return b.join("")};RelatedListPanel.prototype.getHoverableLinksNode=function(){return this.getPanelShadowNode().nextSibling};
RelatedListPanel.prototype.showRLDelayed=function(a){var b=false;this.clearhidemenu();if(this.currentListId&&this.currentListId!=a){this.hideRL(this.currentListId);this.populateRL(a);this.showRL(a)}else{var c=this;this.delayingShow=setTimeout(function(){c.showRL(a)},500);try{if(!this.iframeReady){b=this.iframeReady=true;if(!this.skipAppendOnView){var d=c.getIFrameNode().contentWindow,e=d.document;DomUtil.copyScriptsCssBodyClass(document,e,sfdcPage.scriptsToNotCopy,function(){d.navigateToUrl=function(g){window.navigateToUrl(g)};
d.RelatedList=window.RelatedList;d.sfdcPage=window.sfdcPage});e.body.className+=" rlHoverFrame"}}}catch(f){}b?setTimeout(function(){c.populateRL(a)},1):c.populateRL(a)}};RelatedListPanel.prototype.hideRLDelayed=function(a,b){this.clearshowmenu();b||(b=50);if(!a)a=this.currentListId;var c=this;this.delayingHide=setTimeout(function(){c.hideRL(a)},b)};
RelatedListPanel.prototype.getStyleSheetHtml=function(){for(var a=[],b=0;b<document.styleSheets.length;b++)document.styleSheets[b].owningElement&&document.styleSheets[b].owningElement.outerHTML&&a.push(document.styleSheets[b].owningElement.outerHTML);return a.join("")};
RelatedListPanel.prototype.populateRL=function(a){if(!a)a=this.currentListId;if(this.currentListId!=a){var b=this.getIFrameNode();if(b){var c=getElementByIdCS(a),d=b.contentWindow.document;if(c&&d){this.currentListId=a;if(d.importNode){Sfdc.Dom.updateHTML(d.body,"");d.body.appendChild(d.importNode(c,false));Sfdc.Dom.updateHTML(d.body.firstChild,c.innerHTML)}else if(c.outerHTML)Sfdc.Dom.updateHTML(d.body,c.outerHTML);else return false;var e=this;setTimeout(function(){e.fixContent()},1);b.contentWindow.navigateToUrl=
function(f){window.navigateToUrl(f)}}}}};
RelatedListPanel.prototype.showRL=function(a,b){this.clearhidemenu();if(a==this.currentListId){var c=this.getPanelShadowNode();if(c){var d=this.getIFrameNode(),e=getElementByIdCS(this.getLinkId(a)),f=Sfdc.get(".bPageBlock",Sfdc.get(a));if(d&&e)if(!(e.className.indexOf("linkletOn")>0&&!b)){c.style.top=e.offsetTop+e.offsetHeight+"px";if(this.isConsole){c.style.left=getObjX(this.getHoverableLinksNode())-4+"px";c.style.width=f.offsetWidth-3+"px"}else{if(LC.isRtlPage()){var g=this.getHoverableLinksNode().parentNode;
c.style.right=getObjX(g)+g.offsetWidth-(getObjX(this.getHoverableLinksNode())+this.getHoverableLinksNode().offsetWidth)-14+"px"}else c.style.left=getObjX(this.getHoverableLinksNode())-14+"px";c.style.width=f.offsetWidth+13+"px"}d.style.height=f.offsetHeight+5+"px";c.style.display="block";e.className+=" linkletOn"}}}};
RelatedListPanel.prototype.hideRL=function(a){if(!Modal.isBlocked()){this.clearshowmenu();if(!a)a=this.currentListId;this.currentListId=null;var b=this.getPanelShadowNode();if(a=getElementByIdCS(this.getLinkId(a)))a.className="linklet";if(b)b.style.display="none"}};RelatedListPanel.prototype.clearhidemenu=function(){this.delayingHide&&clearTimeout(this.delayingHide)};RelatedListPanel.prototype.clearshowmenu=function(){this.delayingShow&&clearTimeout(this.delayingShow)};
RelatedListPanel.prototype.getLinkId=function(a){return a+"_link"};RelatedListPanel.prototype.fixContent=function(){for(var a=["a","form"],b=this.getIFrameNode().contentWindow,c=0,d;d=a[c];c++){d=b.document.body.getElementsByTagName(d);for(var e=0,f;f=d[e];e++)if(!f.target)f.target="_parent"}a=b.document.body.getElementsByTagName("script");for(c=0;c<a.length;c++)b.eval(a[c].innerHTML)};
RelatedListPanel.prototype.refresh=function(a){for(var b in a){var c=a[b],d=[],e=this.getIFrameNode().contentWindow.document.getElementById(c.listId),f=document.getElementById(c.listId),g=document.getElementById(this.getLinkId(c.listId));if(e&&e.innerHTML){Sfdc.Dom.updateHTML(e,f.innerHTML);this.fixContent(e);g&&g.className&&g.className.indexOf("linkletOn")>-1&&this.showRL(c.listId,true)}if(g){d.push('<span class="listTitle">');d.push(c.getTitle());d.push(this.getCountIndicator(c));d.push("</span>");
Sfdc.Dom.updateHTML(g,d.join(""))}}};
var RoleTreeNodeElement=function(){this.openRoleList=[];this.downloadedRoles=[];this.downloadedAll=false;this.treeFormName=null};RoleTreeNodeElement.prototype.init=function(b,a){this.downloadedAll=b;if(a!=null){this.openRoleList=a.split(":");this.downloadedRoles=a.split(":")}};
RoleTreeNodeElement.prototype.addToOpenRoles=function(b){for(var a=0;a<this.openRoleList.length;a++)if(this.openRoleList[a]==null||this.openRoleList[a]==""){this.openRoleList[a]=b;this.updateCookiesRole();return}this.openRoleList[this.openRoleList.length]=b;this.updateCookiesRole()};RoleTreeNodeElement.prototype.isInDownloadedRoles=function(b){if(b=="000000000000000")return true;for(var a=0;a<this.downloadedRoles.length;a++)if(this.downloadedRoles[a]==b)return true;return false};
RoleTreeNodeElement.prototype.removeFromOpenRoles=function(b){for(var a=0;a<this.openRoleList.length;a++)if(this.openRoleList[a]==b)this.openRoleList[a]=null;this.updateCookiesRole()};RoleTreeNodeElement.prototype.updateCookiesRole=function(){for(var b="",a=0;a<this.openRoleList.length;a++)if(this.openRoleList[a]!=null&&this.openRoleList[a]!="")b=b+this.openRoleList[a]+":";Sfdc.Cookie.setCookie(RoleTreeCookieConstants.COOKIE_KEY,b,null,"/")};
RoleTreeNodeElement.prototype.toggleRoles=function(b,a,c){a=document.getElementById(a);if(a!=null)if(visible=a.style.display!="none"){a.style.display="none";b.className=TreeNodeElement.prototype.getCollapsedWidgetState(b.className);this.removeFromOpenRoles(c)}else{this.addToOpenRoles(c);if(this.downloadedAll||this.isInDownloadedRoles(c)){a.style.display="block";b.className=TreeNodeElement.prototype.getExpandedWidgetState(b.className)}else this.refreshTree()}};
RoleTreeNodeElement.prototype.collapseAllRoles=function(){Sfdc.Cookie.setCookie(RoleTreeCookieConstants.COOKIE_KEY,"",null,"/");this.refreshTree()};RoleTreeNodeElement.prototype.expandAllRoles=function(){Sfdc.Cookie.setCookie(RoleTreeCookieConstants.COOKIE_KEY,"EXPANDALL",null,"/");this.refreshTree()};RoleTreeNodeElement.prototype.setTreeFormName=function(b){this.treeFormName=b};
RoleTreeNodeElement.prototype.refreshTree=function(){this.treeFormName==null?window.location.replace(window.location.href):window.document.forms[this.treeFormName].submit()};
function ScheduleReportOverlayUtil(){}ScheduleReportOverlayUtil.displayScheduleReportDialogElement=function(b,c){var d=OverlayDialogElement.getDialog("deleteScheduleReportDialog_"+b);d.isModal=true;d.setWidth(480);var a=DesktopContext.preserveDesktopPageUrl("/"+b+"?"+ReportConstants.pDELREP+"=1");if(c)a+="&"+CSRFConstants.CSRF_TOKEN+"="+c;return ScheduleReportOverlayUtil.warnScheduleReportDialogElement(b,function(){navigateToUrl(a)},function(){document.getElementById("del_"+b).focus()})};
ScheduleReportOverlayUtil.warnScheduleReportDialogElement=function(b,c,d){var a=OverlayDialogElement.getDialog("deleteScheduleReportDialog_"+b);a.isModal=true;a.setWidth(480);a.onOkayCallback=c;a.onCancelCallback=d;var e;if(b.indexOf("00O")===0){c=LC.getLabel("Report","DeleteScheduleReportTitle");d=LC.getLabel("Report","DeleteScheduleReportContentTopHalf");e=LC.getLabel("Report","DeleteScheduleReportConfirm")}else{c=LC.getLabel("Report","DeleteScheduleDashboardTitle");d=LC.getLabel("Report","DeleteScheduleDashboardContentTopHalf");
e=LC.getLabel("Report","DeleteScheduleDashboardConfirm")}a.buttonContents='<input value="'+e+'" class="btn" id="deleteScheduleReportDialog_'+b+'_overlayConfirmButton" name="overlayConfirmButton" onclick="if(true) {var dialog = sfdcPage.getDialogById(\'deleteScheduleReportDialog_'+b+'\'); dialog.hide(); dialog.onOkayCallback()}" title="'+LC.getLabel("Report","DeleteScheduleReportConfirm")+'" type="button" /><input value="'+LC.getLabel("Buttons","cancel")+'" class="btn" name="cancel" onclick="var dialog = OverlayDialogElement.getDialog(\'deleteScheduleReportDialog_'+
b+'\');dialog.onCancelCallback();dialog.cancel()" title="'+LC.getLabel("Buttons","cancel")+'" type="button" />';a.setTitle(c);c=d;d=LC.getLabel("Report","DeleteScheduleReportContentBottom");a.contents='<div><table ><tr><td><img src="/s.gif" alt="Warning"  class="warningLarge" style=\'margin-right: 15px; margin-left: 8px\'="style=\'margin-right: 15px\'" title="Warning"/></td><td><br/>'+c+"<br/><br/>"+d+"</td></tr>\n</table></div>";a.createContent();a.show();document.getElementById("deleteScheduleReportDialog_"+
b+"_overlayConfirmButton").focus();return false};
function SelectElementDependency(e,b){this.divIds=b;this.selectElementId=e;var c=this;this.changeVisibleDiv=function(){for(var f=document.getElementById(c.selectElementId).selectedIndex,a=0;a<b.length;a++){var d;d=a==f?"block":"none";document.getElementById(c.divIds[a]).style.display=d}};this.changeVisibleDiv();addEvent(document.getElementById(this.selectElementId),"change",this.changeVisibleDiv,false)};
var SelectFilterElement=function(a,b,d,c,e,f,h,g){this.controllerName=a;this.controllerOption=b;this.targetName=d;this.targetOption=c;this.existingName=e;this.selectedOptions=[];this.allOptions=[];this.maxValues=f;this.searchQueueCount=0;this.useJsSearch=h;this.itemAdded=this.searchStringChanged=false;this.ajaxFilterUrl=g};SelectFilterElement.prototype.getSearchElementId=function(){return"searchValue_"+this.controllerName};
SelectFilterElement.prototype.addOptions=function(a){for(var b=0;b<a.length;b++)this.addOption.apply(this,a[b])};SelectFilterElement.prototype.addOption=function(a,b,d,c,e){var f=new Option(b,d);f.searchValue=c;c=this.allOptions[a];if(!c){c=[];this.allOptions[a]=c}c[c.length]=f;if(e&&this.selectedOptions!=null&&this.selectedOptions[d])e.options[e.options.length]=new Option(b,d)};
SelectFilterElement.prototype.queueSearch=function(){this.searchQueueCount++;var a=this.getJavascriptVarName()+".doSearch()";setTimeout(a,300)};SelectFilterElement.prototype.doSearch=function(){this.searchQueueCount--;if(!(this.searchQueueCount>0)){this.searchQueueCount=0;this.useJsSearch?this.doSearchJS():this.doSearchServer()}};
SelectFilterElement.prototype.doSearchJS=function(){var a=document.getElementById(this.controllerName),b=document.getElementById(this.targetName),d=document.getElementById(this.existingName),c=document.getElementById(this.getSearchElementId());c=c.value?c.value.toLowerCase():"";if(c.length==0)this.filter();else{var e=b.options.length=0,f=0;if(a=this.allOptions[a.value])for(var h=0;h<a.length&&f<this.maxValues+1;h++){var g=a[h];if(d&&this.selectedOptions[g.value])e++;else if(!g.searchValue||g.searchValue.length==
0||g.searchValue.indexOf(c)==0||g.searchValue.indexOf(" "+c)>-1){if(f<this.maxValues)b.options[f]=g;e++;f++}}this.showErrorMessage(e>this.maxValues);if(b.options.length==0)b.options[0]=new Option(LC.getLabel("SelectElement","Required"),"000000000000000")}};
SelectFilterElement.prototype.onSearchComplete=function(a){document.getElementById(this.controllerName);a=Util.evalAjaxServletOutput(a.responseText);document.getElementById(this.existingName);var b=document.getElementById(this.targetName);b.options.length=0;if(a.FilteredOptions&&a.FilteredOptions.length>0){for(var d=[],c=0;c<a.FilteredOptions.length&&c<this.maxValues;c++)d[c]=[a.FilteredOptions[c].text,a.FilteredOptions[c].value];Util.refreshDynamicSelect(b,d,false,null);this.showErrorMessage(a.FilteredOptions.length>
this.maxValues)}else b.options[0]=new Option(LC.getLabel("SelectElement","Required"),Udd.EMPTY_KEY)};
SelectFilterElement.prototype.doSearchServer=function(){if(this.ajaxFilterUrl){var a=document.getElementById(this.getSearchElementId());a=a.value?a.value:"";if(a.length===0)this.filter();else{var b=document.getElementById(this.controllerName);XBrowser.postHttpResponse(UserContext.getUrl(this.ajaxFilterUrl),this.onSearchComplete,XBrowser.buildPost({searchStr:a,controlType:b.value}),null,this)}}else{a=document.forms[SelectFilterElement.FORMNAME];if(a.onsubmit)a.onsubmit();a.submit()}};
SelectFilterElement.FORMNAME=EditPageConstants.pEDIT_PAGE;SelectFilterElement.prototype.handleKeyDown=function(a){a=getEvent(a);if(a.keyCode==13||a.which==13){this.queueSearch();return false}else this.searchStringChanged=true;return true};SelectFilterElement.prototype.handlePropertyChange=function(){this.useJsSearch&&this.queueSearch()};
SelectFilterElement.prototype.showErrorMessage=function(a,b){var d=document.getElementById(this.getSearchElementId()),c=document.getElementById("error_"+this.targetName);if(d&&c)if(a){c.style.visibility="visible";c.innerHTML=b?b:LC.getLabel("Search_Filter","too_many",this.maxValues,this.maxValues)}else c.style.visibility="hidden"};
SelectFilterElement.prototype.filter=function(){var a=document.getElementById(this.controllerName),b=document.getElementById(this.targetName),d=document.getElementById(this.getSearchElementId());if(this.useJsSearch&&d&&d.value.length!=0)d.value="";b.options.length=0;if(SelectFilterElement.prototype.NONE_LABEL)b.options[0]=new Option(SelectFilterElement.prototype.NONE_LABEL,"000000000000000");var c=0,e=0;if(a=this.allOptions[a.value]){var f=this.existingName;f&&this.initSelectedOptionsFromUi();for(var h=
0;h<a.length&&(!d||e<this.maxValues+1);h++){var g=a[h];if(!(f&&this.selectedOptions[g.value])){c++;if(!d||e<this.maxValues){b.options[b.options.length]=g;e++}}}}this.showErrorMessage(c>this.maxValues);if(b.options.length==0)b.options[0]=new Option(LC.getLabel("SelectElement","Required"),"000000000000000")};
SelectFilterElement.prototype.initSelectedOptionsFromUi=function(){if(this.existingName){this.selectedOptions=[];var a=document.getElementById(this.existingName);if(a)for(var b=0;b<a.options.length;b++)if(a.options[b].value.length>0)this.selectedOptions[a.options[b].value]=true}};
SelectFilterElement.prototype.init=function(){this.filter();if(this.existingName){var a=document.getElementById(this.existingName);if(a){a.selectFilterEl=this;a.onchange=function(){this.selectFilterEl.initSelectedOptionsFromUi()}}}if(this.controllerOption&&this.controllerName){var b=document.getElementById(this.controllerName);if(b.options!=null&&b.options!=undefined)for(a=0;a<b.options.length;a++)if(b.options[a].value==this.controllerOption)b.options[a].selected=true}if(this.targetOption){b=document.getElementById(this.targetName);
for(a=0;a<b.options.length;a++)if(b.options[a].value==this.targetOption)b.options[a].selected=true}};SelectFilterElement.prototype.getJavascriptVarName=function(){return this.targetName+"Var"};SelectFilterElement.prototype.filterDropdown=function(a,b){for(var d=b.selectedIndex,c=0;c<b.options.length;c++)document.getElementById(a+"_"+b.options[c].value).style.display=c==d?"inline":"none"};SelectFilterElement.prototype.moveLeft=function(){this.filter()};
SelectFilterElement.prototype.beforeMoveRight=function(){this.itemAdded=true};
var SELECT_MENU_SELECT=1,SELECT_MENU_SIDEWAYS=2;
function SelectMenu(b,e,a,i,j,f,g,k,l,m){this.sourceList=document.getElementById(b);this.menuDiv=this.select=null;this.displayWord=a;this.targetDiv=document.getElementById(e);this.divClass=i+" menuButton";this.menuClass=j+" menuButtonMenu";this.hasSetPosition=this.menuOpen=false;this.scrollbars=k;this.hasDefaultAction=l;this.isCreateNew=false;this.isRightAligned=m;this.style=f?f:SELECT_MENU_SELECT;var d=this;this.documentHideMenu=function(c){getEventTarget(c).className!=g&&d.menuOpen&&d.hideMenu()};
this.handleDocumentKeyDown=function(c){c=getEvent(c);d.menuOpen&&c.keyCode==KEY_ESC&&d.hideMenu()};this.handleDivClick=function(c){var h=getEventTarget(c);if(h.className!=g){if(d.hasDefaultAction)if((c.layerX?c.layerX:c.offsetX)<h.offsetWidth-17){window.location=d.sourceList.childNodes[0].href;eventCancelBubble(c);return}if(d.menuOpen)d.hideMenu();else{d.showMenu();d.setPosition()}eventCancelBubble(c)}};this.sourceList&&this.targetDiv&&this.init()}
SelectMenu.prototype.showMenu=function(){if(!this.isCreateNew)this.targetDiv.style.position="relative";this.menuDiv.setStyle("display","block");this.menuOpen=true};SelectMenu.prototype.hideMenu=function(){if(!this.isCreateNew)this.targetDiv.style.position="static";this.menuDiv.setStyle("display","none");this.menuOpen=false};
SelectMenu.prototype._setPositionSelect=function(){if(!this.hasSetPosition){this.hasSetPosition=true;if(!this.isCreateNew){this.menuDiv.setStyle("top",this.select.offsetHeight+"px");this.isRightAligned?this.menuDiv.setStyle("right","3px"):this.menuDiv.setStyle("left","0px")}for(var b=this.sourceList.childNodes[0].scrollWidth,e=b,a=1;a<this.sourceList.childNodes.length;a++)if(this.sourceList.childNodes[a].scrollWidth>b)b=this.sourceList.childNodes[a].scrollWidth;for(a=0;a<this.sourceList.childNodes.length;a++){this.sourceList.childNodes[a].style.width=
"100%";if(this.sourceList.childNodes[a].offsetWidth>e)e=this.sourceList.childNodes[a].offsetWidth}this.menuDiv.setStyle("width",b+"px");if(this.scrollbars){b=this.sourceList.childNodes[0].offsetHeight*20;a=this.sourceList.offsetHeight;if(a<b)b=a;this.menuDiv.setStyle("height",b+"px");this.menuDiv.setStyle("overflowY","auto")}if(this.menuDiv.div.offsetWidth<this.select.childNodes[0].offsetWidth){this.menuDiv.setStyle("width",this.select.childNodes[0].offsetWidth+"px");if(this.scrollbars){this.menuDiv.setStyle("width",
e+34+"px");this.menuDiv.setStyle("backgroundColor","#CCC");this.menuDiv.div.childNodes[0].style.width=this.menuDiv.div.offsetWidth-34+"px"}}}};SelectMenu.prototype._setPositionSideways=function(){this.menuDiv.setStyle("top",this.select.offsetHeight/2+"px");this.menuDiv.setStyle("left",this.select.offsetWidth+"px")};
SelectMenu.prototype.init=function(){this.select=document.createElement("div");this.select.className=this.divClass;this.targetDiv.insertBefore(this.select,this.targetDiv.firstChild);var b=document.createElement("div");b.className=this.hasDefaultAction?"selectMenuButton menuButtonButton hasDefault":"selectMenuButton menuButtonButton";this.select.appendChild(b);b.appendChild(document.createTextNode(this.displayWord));this.menuDiv=document.createElement("div");this.menuDiv.className=this.menuClass;this.select.appendChild(this.menuDiv);
this.menuDiv.appendChild(this.sourceList);switch(this.style){case SELECT_MENU_SIDEWAYS:this.setPosition=this._setPositionSideways;break;default:this.setPosition=this._setPositionSelect}this.menuDiv=new iframeShim(this.menuDiv);this.menuDiv.setStyle("display","none");this.menuDiv.setStyle("position","absolute");addEvent(document,"click",this.documentHideMenu,false);addEvent(document,"keydown",this.handleDocumentKeyDown,true);addEvent(this.targetDiv,"click",this.handleDivClick,false)};
var ShareRuleSelectFilterElement=function(){};ShareRuleSelectFilterElement.prototype.filterDropdown=function(b,a,c){for(var f=c.selectedIndex,h=this.getMappedOption(f,a,c),d=0;d<c.options.length;d++){var g=this.getMappedOption(d,a,c),e=document.getElementById(b+"_"+g);if(e)if(g==h){if(d==f)e.style.display="inline"}else e.style.display="none"}};ShareRuleSelectFilterElement.prototype.getMappedOption=function(b,a,c){b=c.options[b].value;(a=a[b])||(a=b);return a};
function SimpleDialog(b,a){this.id=b;this.isModal=true;this.isMovable=a;this.extraClass="";this.width=450;this.title="";this.displayX=false;this.addEvents()}SimpleDialog.prototype=new OverlayDialog;SimpleDialog.prototype.createContent=function(){var b=document.getElementById(this.getContentId()),a=[];a.push("<h2 id='");a.push(this.id);a.push("Header'>");a.push(this.header);a.push("</h2>");a.push("<div id='");a.push(this.id);a.push("Inner'></div>");b.innerHTML=a.join("")};
SimpleDialog.prototype.setContentInnerHTML=function(b){this.getContentElement().innerHTML=b};SimpleDialog.prototype.importContentNode=function(b){this.setContentInnerHTML("");this.getContentElement().appendChild(b)};SimpleDialog.prototype.getContentElement=function(){return document.getElementById(this.id+"Inner")};
function SimpleTimePicker(){this.now=DateUtil.getDateTimeFromUserLocale(UserContext.today);this.created=false;this.fields=[];this.currentField=null;this.currentHour=0;this.isVisible=false;this.timeDivs=[];this.selectedDiv=null}function TimeDivData(a,b){this.divId=a;this.timeValue=b}
SimpleTimePicker.prototype.create=function(a){this.created=true;this.hoursDiv=document.createElement("div");this.hoursDiv.className="hourPicker";this.hoursDiv.id="simpleTimePicker";var b=new Date;b.setMinutes(0);var c=[];this.timeDivs=Array(48);for(var d=0;d<48;d++){b.setHours(Math.floor(d/2));d%2==0?b.setMinutes(0):b.setMinutes(30);var e=DateUtil.getTimeStringFromUserLocale(b),g="timePickerItem_"+d;this.timeDivs[d]=new TimeDivData(g,e);c.push("<div class='simpleHour' id='"+g+"' onmouseover='SimpleTimePicker.timePicker.highLightTimeItem(");
c.push(d);c.push(")' onclick=\"SimpleTimePicker.timePicker.selectTime('");c.push(e);c.push("', true)\">");c.push(e);c.push("</div>")}a?a.appendChild(this.hoursDiv):document.body.appendChild(this.hoursDiv);this.hoursDiv.innerHTML=c.join("");var h=this;addEvent(document,"click",function(f){h.hide(f)},false);addEvent(this.hoursDiv,"click",function(f){eventCancelBubble(getEvent(f));return false},false);this.hoursShim=new iframeShim(this.hoursDiv)};
SimpleTimePicker.prototype.highLightTimeItem=function(a){if(this.selectedDiv!=null)document.getElementById(this.timeDivs[this.selectedDiv].divId).className="simpleHour";this.selectedDiv=a;document.getElementById(this.timeDivs[this.selectedDiv].divId).className="simpleHour hover";this.adjustScrollbar(a)};SimpleTimePicker.prototype.selectTimeItem=function(a){this.highLightTimeItem(a);this.selectTime(this.timeDivs[this.selectedDiv].timeValue,false)};
SimpleTimePicker.prototype.positionTime=function(a){var b=getObjX(this.currentField),c=getObjY(this.currentField)+this.currentField.offsetHeight;if(a){var d=getObjX(a);a=getObjY(a);b-=d;c-=a}this.hoursShim.setStyle("left",b+"px");this.hoursShim.setStyle("top",c+"px");c=b=0;if(this.currentField.value){d=DateUtil.getTimeFromUserLocale(this.currentField.value);if(d.getTime()){b=d.getHours();c=d.getMinutes()}}else{b=this.now.getHours();c=this.now.getMinutes()}c=parseFloat(c/60);SimpleTimePicker.timePicker.highLightTimeItem(Math.round(2*
(b+c)))};SimpleTimePicker.prototype.adjustScrollbar=function(a){a*=this.hoursDiv.firstChild.offsetHeight;if(a<this.hoursDiv.scrollTop||a>this.hoursDiv.scrollTop+this.hoursDiv.clientHeight)this.hoursDiv.scrollTop=a;else if(a>this.hoursDiv.scrollTop+this.hoursDiv.clientHeight-this.hoursDiv.firstChild.offsetHeight)this.hoursDiv.scrollTop+=this.hoursDiv.firstChild.offsetHeight};
SimpleTimePicker.prototype.show=function(a,b){this.created||this.create(b);this.currentField=getElementByIdCS(a);if(this.fields[a]!==this.currentField)this.fields[a]=null;if(!this.fields[a]){var c=this;this.currentField.onkeydown=function(d){return c.trapEnterKey(d)};addEvent(this.currentField,"keydown",function(d){return c.handleKeyPress(d)},false);this.fields[a]=this.currentField}this.hoursDiv.style.width=this.currentField.clientWidth+2+"px";this.hoursShim.setStyle("display","block");this.positionTime(b);
this.isVisible=true};SimpleTimePicker.prototype.hide=function(a){if(!(a&&getEventTarget(a)===this.currentField)){this.hoursShim.setStyle("display","none");this.isVisible=false}};SimpleTimePicker.prototype.trapEnterKey=function(a){if(getEvent(a).keyCode==KEY_ENTER&&this.isVisible){eventCancelBubble(getEvent(a));return false}return true};
SimpleTimePicker.prototype.handleKeyPress=function(a){var b=getEvent(a).keyCode;if(this.isVisible)if(b==KEY_ESC||b==KEY_TAB)this.hide();else if(b==KEY_ENTER){this.hide();eventCancelBubble(getEvent(a));return false}else if(b==KEY_ARROW_U)this.selectedDiv>0&&this.selectTimeItem(this.selectedDiv-1);else b==KEY_ARROW_D&&this.selectedDiv<this.timeDivs.length-1&&this.selectTimeItem(this.selectedDiv+1);else if(b==KEY_ARROW_U||b==KEY_ARROW_D)this.show(this.currentField.id);return true};
SimpleTimePicker.prototype.selectTime=function(a,b){b&&this.hide();if(!this.currentField.disabled&&this.currentField.value!=a){this.currentField.value=a;if(this.currentField.onchange)this.currentField.onchange()}};SimpleTimePicker.timePicker=null;SimpleTimePicker.pickTime=function(a,b){if(!SimpleTimePicker.timePicker)SimpleTimePicker.timePicker=new SimpleTimePicker;SimpleTimePicker.timePicker.show(a,b)};SimpleTimePicker.hideTimePicker=function(){SimpleTimePicker.timePicker&&SimpleTimePicker.timePicker.hide()};
SimpleTimePicker.quickTime=function(a,b){var c=getElementByIdCS(b);if(!c.disabled&&c.value!=a){c.value=a;if(c.onchange)c.onchange()}};
function TimePicker(){this.now=DateUtil.getDateTimeFromUserLocale(UserContext.today);this.created=false;this.fields=[];this.currentField=null;this.currentHour=0;this.hidingMinutes=null}
TimePicker.prototype.create=function(){this.created=true;this.hoursDiv=document.createElement("div");this.hoursDiv.className="hourPicker";var a=new Date;a.setMinutes(0);for(var b=[],c=0;c<24;c++){a.setHours(c);b.push("<div class='hour' onmouseover='TimePicker.timePicker.selectHour(");b.push(c);b.push(")' onclick='TimePicker.timePicker.selectTime(");b.push(c);b.push(", 0)'>");b.push(DateUtil.getTimeStringFromUserLocale(a));b.push("</div>")}document.body.appendChild(this.hoursDiv);this.hoursDiv.style.width=
DateUtil.hasAMPM(UserContext.timeFormat)?"7em":"5.5em";this.hoursDiv.innerHTML=b.join("");this.minutesDiv=document.createElement("div");this.minutesDiv.className="minutePicker";b=[];for(c=15;c<60;c+=15){b.push("<div class='minutes' onclick='TimePicker.timePicker.selectMinutes(");b.push(c);b.push(")' onmouseover='this.className = \"minutes hover\";' onmouseout='this.className = \"minutes\";'>:");b.push(c);b.push("</div>")}document.body.appendChild(this.minutesDiv);this.minutesDiv.innerHTML=b.join("");
var e=this;addEvent(document,"click",function(d){e.hide(d)},false);addEvent(this.hoursDiv,"click",function(d){eventCancelBubble(d);return false},false);addEvent(this.minutesDiv,"click",function(d){eventCancelBubble(d);return false},false);addEvent(this.minutesDiv,"mouseout",function(){e.delayHideMinutes()},false);addEvent(this.hoursDiv,"mouseout",function(){e.delayHideMinutes()},false);addEvent(this.minutesDiv,"mouseover",function(){e.cancelHideMinutes()},false);this.hoursShim=new iframeShim(this.hoursDiv);
this.minutesShim=new iframeShim(this.minutesDiv)};TimePicker.prototype.positionHours=function(){var a=getObjX(this.currentField),b=getObjY(this.currentField)+this.currentField.offsetHeight;this.hoursShim.setStyle("left",a+"px");this.hoursShim.setStyle("top",b+"px");a=0;if(this.currentField.value){b=DateUtil.getTimeFromUserLocale(this.currentField.value);if(b.getTime())a=b.getHours()}else a=this.now.getHours();this.hoursDiv.scrollTop=a*this.hoursDiv.firstChild.offsetHeight};
TimePicker.prototype.positionMinutes=function(){var a=getObjY(this.hoursDiv)+this.currentHour*this.hoursDiv.firstChild.offsetHeight-this.hoursDiv.scrollTop+1;this.minutesShim.setStyle("left",getObjX(this.hoursDiv)+this.hoursDiv.firstChild.offsetWidth+"px");this.minutesShim.setStyle("top",a+"px")};
TimePicker.prototype.show=function(a){this.created||this.create();this.currentField=getElementByIdCS(a);if(this.fields[a]!==this.currentField)this.fields[a]=null;if(!this.fields[a]){var b=this;addEvent(this.currentField,"keydown",function(c){b.handleKeyPress(c)},false);this.fields[a]=this.currentField}this.hoursShim.setStyle("display","block");this.positionHours()};TimePicker.prototype.showMinutes=function(){this.cancelHideMinutes();this.positionMinutes();this.minutesShim.setStyle("display","block")};
TimePicker.prototype.cancelHideMinutes=function(){if(this.hidingMinutes){clearTimeout(this.hidingMinutes);this.hidingMinutes=null}};TimePicker.prototype.delayHideMinutes=function(){var a=this;this.hidingMinutes=setTimeout(function(){a.hideMinutes()},50)};TimePicker.prototype.hideMinutes=function(){this.minutesShim.setStyle("display","none");this.hoursDiv.childNodes[this.currentHour].className="hour"};
TimePicker.prototype.hide=function(a){if(!(a&&getEventTarget(a)===this.currentField)){this.hideMinutes();this.hoursShim.setStyle("display","none")}};TimePicker.prototype.handleKeyPress=function(a){a=getEvent(a).keyCode;if(a==KEY_ESC||a==KEY_TAB)this.hide()};TimePicker.prototype.selectHour=function(a){this.hoursDiv.childNodes[this.currentHour].className="hour";this.currentHour=a;this.hoursDiv.childNodes[this.currentHour].className="hour hover";this.showMinutes()};
TimePicker.prototype.selectMinutes=function(a){this.selectTime(this.currentHour,a)};TimePicker.prototype.selectTime=function(a,b){this.hide();var c=new Date;c.setHours(a);c.setMinutes(b);c=DateUtil.getTimeStringFromUserLocale(c);if(!this.currentField.disabled&&this.currentField.value!=c){this.currentField.value=c;if(this.currentField.onchange)this.currentField.onchange()}};TimePicker.timePicker=null;TimePicker.pickTime=function(a){if(!TimePicker.timePicker)TimePicker.timePicker=new TimePicker;TimePicker.timePicker.show(a)};
TimePicker.quickTime=function(a,b){var c=getElementByIdCS(b);if(!c.disabled&&c.value!=a){c.value=a;if(c.onchange)c.onchange()}};
var TreeNodeElement=function(){};TreeNodeElement.prototype.collapsedWidget=new Image(20,16);TreeNodeElement.prototype.collapsedWidget.className="plus";TreeNodeElement.prototype.collapsedWidgetStart=new Image(20,16);TreeNodeElement.prototype.collapsedWidgetStart.className="plusStart";TreeNodeElement.prototype.collapsedWidgetEnd=new Image(20,16);TreeNodeElement.prototype.collapsedWidgetEnd.className="plusEnd";TreeNodeElement.prototype.expandedWidget=new Image(20,16);
TreeNodeElement.prototype.expandedWidget.className="minus";TreeNodeElement.prototype.expandedWidgetStart=new Image(20,16);TreeNodeElement.prototype.expandedWidgetStart.className="minusStart";TreeNodeElement.prototype.expandedWidgetEnd=new Image(20,16);TreeNodeElement.prototype.expandedWidgetEnd.className="minusEnd";
TreeNodeElement.prototype.getExpandedWidgetState=function(a){if(a.indexOf("Start")!=-1)return TreeNodeElement.prototype.expandedWidgetStart.className;if(a.indexOf("End")!=-1)return TreeNodeElement.prototype.expandedWidgetEnd.className;return TreeNodeElement.prototype.expandedWidget.className};
TreeNodeElement.prototype.getCollapsedWidgetState=function(a){if(a.indexOf("Start")!=-1)return TreeNodeElement.prototype.collapsedWidgetStart.className;if(a.indexOf("End")!=-1)return TreeNodeElement.prototype.collapsedWidgetEnd.className;return TreeNodeElement.prototype.collapsedWidget.className};
TreeNodeElement.prototype.toggle=function(a,c){var b=document.getElementById(c);if(b!=null)if(visible=b.style.display!="none"){b.style.display="none";a.className=TreeNodeElement.prototype.getCollapsedWidgetState(a.className)}else{b.style.display="block";a.className=TreeNodeElement.prototype.getExpandedWidgetState(a.className)}};
function TwistyElement(a,b,d,e,c){this.twisty=document.getElementById(a);this.dep=document.getElementById(b);this.showLabel=d;this.hideLabel=e;if(this.twisty&&this.dep){if(c)this.dep.style.display="none";this.hidden=c;var f=this;addEvent(this.twisty.parentNode,"click",function(g){f.twistElement(g)})}}
TwistyElement.prototype.twistElement=function(a){var b=getElementsByClassName("twistyText",this.twisty.parentNode)[0];a=getEventTarget(getEvent(a));if(a===b||a===this.twisty)if(this.hidden){this.dep.style.display="block";this.hidden=false;this.twisty.className="hideListButton";b.innerHTML=this.hideLabel}else{this.dep.style.display="none";this.hidden=true;this.twisty.className="showListButton";b.innerHTML=this.showLabel}};
function VerticallyArrangableSelectElement(a){this.id=a;var c=this;sfdcPage.appendToOnloadQueue(function(){c.init()})}
VerticallyArrangableSelectElement.prototype.init=function(){for(var a=document.getElementById(this.id).parentNode.parentNode.getElementsByTagName("img"),c=this.id,b=0;a&&b<a.length;b++)if(hasStyleClass(a[b],vaSelectElementConst.UP_CLASS))addEvent(a[b],"click",function(){moveUp(document.getElementById(c))},false);else hasStyleClass(a[b],vaSelectElementConst.DOWN_CLASS)&&addEvent(a[b],"click",function(){moveDown(document.getElementById(c))},false)};
var Captcha={formName:"",submitButtonName:"",publicKey:"",recaptchaLang:"",dialog:null,verified:false,click:function(a,c,e,d,b){Captcha.formName=a;Captcha.submitButtonName=c;Captcha.publicKey=e;Captcha.recaptchaLang=b;if(Captcha.verified)Captcha.proceed();else if(typeof Recaptcha=="undefined")Captcha.submitClientError();else{if(!Captcha.dialog){Captcha.dialog=new SimpleDialog("captcha_dialog",true);Captcha.dialog.enter=Captcha.submit;Captcha.dialog.setupDefaultButtons();Captcha.dialog.overrideButton(0,
LC.getLabel("Buttons","submit"),"Captcha.submit()");Captcha.dialog.setWidth("350px");Captcha.dialog.register();a=[];a.push('<div id="recaptcha_widget">');a.push(LC.getLabel("CaptchaElement","dialog"));a.push('<div id="recaptcha_image"></div>');a.push('<div id="incorrect" style="display:none;color:red">');a.push(LC.getLabel("CaptchaElement","incorrect"));a.push("</div>");a.push('<table class="captchaContent" border="0" cellpadding="0" cellspacing="0">');a.push('  <tr><td><span class="recaptcha_only_if_image">');
a.push(LC.getLabel("CaptchaElement","imagePrompt"));a.push("</span>");a.push('          <span class="recaptcha_only_if_audio">');a.push(LC.getLabel("CaptchaElement","audioPrompt"));a.push("</span>");a.push('          <input id="recaptcha_response_field" name="recaptcha_response_field" type="text">');a.push("      </td>");a.push('      <td style="width:25px;border-left:none;cursor:pointer">');a.push('          <img src="'+UserContext.getUrl("/img/recaptcha_refresh.gif")+'" alt="'+LC.getLabel("CaptchaElement",
"refresh")+'" title="'+LC.getLabel("CaptchaElement","refresh")+'" onclick="Recaptcha.reload()">');a.push('          <img class="recaptcha_only_if_image" src="'+UserContext.getUrl("/img/recaptcha_audio.gif")+'" alt="'+LC.getLabel("CaptchaElement","audio")+'" title="'+LC.getLabel("CaptchaElement","audio")+'" onclick="Recaptcha.switch_type(\'audio\')">');a.push('          <img class="recaptcha_only_if_audio" src="'+UserContext.getUrl("/img/recaptcha_text.gif")+'" alt="'+LC.getLabel("CaptchaElement",
"image")+'" title="'+LC.getLabel("CaptchaElement","image")+'" onclick="Recaptcha.switch_type(\'image\')">');d!=null&&d.length>0&&a.push('          <img src="'+UserContext.getUrl("/img/recaptcha_help.gif")+'" alt="'+LC.getLabel("Buttons","help")+'" title="'+LC.getLabel("Buttons","help")+'" onclick="'+d+'">');a.push("      </td>");a.push("  </tr>");a.push('  <tr><td colspan="2" style="border:0px">');Captcha.dialog.createButtons(a);a.push('<a id="moreinfo" style="float:right" href="#" onclick="Captcha.toggleMoreinfo(true)">');
a.push(LC.getLabel("CaptchaElement","moreinfo"));a.push("</a>");a.push("  </td></tr>");a.push('  <tr><td colspan="2" style="border:0px">');a.push('    <div id="about" style="display:none"><img src="img/reCAPTCHAlogo.png" style="float:left;padding-right:5px">');a.push('      <div style="font-size:85%">Security test provided by <a href="http://www.recaptcha.net" target="_blank">reCAPTCHA&trade;</a>');a.push("      <br>The words above come from scanned books.  By typing them, you help to digitize old texts.</div>");
a.push('      <a style="float:right" href="#" onclick="Captcha.toggleMoreinfo(false)">');a.push(LC.getLabel("CaptchaElement","lessinfo"));a.push("</a>");a.push("    </div>");a.push("  </td></tr>");a.push("</table>");a.push("</div>");Captcha.dialog.setContentInnerHTML(a.join(""))}Captcha.dialog.show();Captcha.displayOnly()}},toggleMoreinfo:function(a){if(a){document.getElementById("about").style.display="block";document.getElementById("moreinfo").style.display="none"}else{document.getElementById("about").style.display=
"none";document.getElementById("moreinfo").style.display="inline"}},displayOnly:function(){Recaptcha.create(Captcha.publicKey,null,{callback:Recaptcha.focus_response_field,theme:"custom",lang:Captcha.recaptchaLang})},hide:function(){Captcha.dialog.hide()},submit:function(){Captcha.checkRecaptchaConnected()?Captcha.verify():Captcha.submitClientError();return false},verify:function(){var a=Recaptcha.get_challenge(),c=Recaptcha.get_response();Recaptcha.destroy();Captcha.callVerifier(a,c,"false",Captcha.verifyResultCallback)},
verifyResultCallback:function(a){if(Util.evalAjaxServletOutput(a.responseText)[CaptchaVerifierServlet.VALID_KEY]==true){Captcha.verified=true;Captcha.hide();Captcha.proceed()}else{document.getElementById("incorrect").style.display="block";Captcha.displayOnly()}},proceed:function(){if(Captcha.formName)document.forms[Captcha.formName][Captcha.submitButtonName].click();else window.location=document.getElementById(Captcha.submitButtonName).href},submitClientError:function(){Captcha.callVerifier("","",
"true",Captcha.proceed)},callVerifier:function(a,c,e,d){var b={};b[CaptchaVerifierServlet.CHALLENGE_PARAM]=a;b[CaptchaVerifierServlet.RESPONSE_PARAM]=c;b[CaptchaVerifierServlet.CLIENT_ERROR_PARAM]=e;a=UrlMap.convertClassNameToUrl(CaptchaVerifierServlet.SERVLET_NAME,null);XBrowser.postHttpResponse(a,d,XBrowser.buildPost(b))},checkRecaptchaConnected:function(){return!!document.getElementById("recaptcha_image").innerHTML}};
function MotifElement(a,b,c,d){arguments.length>0&&this.init(a,b,c,d)}MotifElement.prototype.init=function(a,b,c,d){this.motifElement=document.getElementById(a);this.motifDescCell=document.getElementById(b);this.motifIcon=document.getElementById(c);this.motifKey=d;this.motifElement.motifElement=this};MotifElement.prototype.getDescription=function(){return this.motifDescCell.firstChild.nodeValue};
function MotifInputElement(a){this.paramName=a;this.motifKeyInput=document.getElementById(a+MotifInputElementConst.FIELD_NAME_MOTIF);this.motifElement=document.getElementById(a+MotifInputElementConst.MOTIF_ELEMENT_SUFFIX);this.motifElementObj=this.motifElement.motifElement;this.motifDescInput=document.getElementById(a+MotifInputElementConst.FIELD_NAME_DESCRIPTION);this.motifDescCell=this.motifElementObj.motifDescCell;this.motifIconInput=document.getElementById(a+MotifInputElementConst.FIELD_NAME_ICON);
this.motifIcon=this.motifElementObj.motifIcon;this.motifElement.motifInputElement=this;document.getElementById(a).motifInputElement=this}MotifInputElement.prototype.setIconSrc=function(a){this.motifIcon.src=a};MotifInputElement.prototype.setIconValue=function(a){this.motifIconInput.value=a};MotifInputElement.prototype.setMotifKey=function(a){this.motifKeyInput.value=a};
MotifInputElement.prototype.setDescription=function(a){if(this.motifDescCell.firstChild)this.motifDescCell.firstChild.nodeValue=a;else this.motifDescCell.appendChild(document.createTextNode(a))};MotifInputElement.prototype.openWindow=function(a,b,c){openPopup(a,this.paramName+"MotifPickerWindow",b,c,"width="+b+",height="+c+",dependent=yes,resizable=yes,toolbar=no,status=no,directories=no,menubar=no,scrollbars=1",true)};
MotifInputElement.prototype.isNull=function(){return!(this.motifKeyInput.value&&this.motifKeyInput.value.length>0)};
function PickableMotifElement(d,c,b,e,f){this.init(d,c,b,e);var a=this;if(window.opener)this.parentMotifInputElementObj=window.opener.document.getElementById(f).motifInputElement;this.motifElement.onclick=function(){a.parentMotifInputElementObj.motifElement.className=a.motifElement.className;a.parentMotifInputElementObj.setDescription(a.getDescription());if(a.motifIcon&&a.motifIcon.src){a.parentMotifInputElementObj.setIconSrc(a.motifIcon.src);a.parentMotifInputElementObj.setIconValue("")}a.parentMotifInputElementObj.setMotifKey(a.motifKey);
window.blur();window.close();return false}}PickableMotifElement.prototype=new MotifElement;PickableMotifElement.toggleUsedMotifVisibility=function(d){for(var c=document.getElementsByTagName("a"),b=0;b<c.length;b++)if(d&&c[b].style.display=="none"&&c[b].className.indexOf("motifElement")>-1)c[b].style.display="block";else if(!d&&c[b].className&&c[b].className.indexOf("usedMotif")>-1)c[b].style.display="none"};
PickableMotifElement.doFontFixForIE7=function(){document.getElementById("fontColorIE7Fix").style.zoom="1"};PickableMotifElement.hideUsedStyle=function(){document.getElementById("hideUsedStyle").style.display="none";document.getElementById("showUsedStyle").style.display="block";PickableMotifElement.toggleUsedMotifVisibility(false);XBrowser.userAgent.isIE7&&setTimeout("PickableMotifElement.doFontFixForIE7()",250);return false};
PickableMotifElement.showUsedStyle=function(){document.getElementById("showUsedStyle").style.display="none";document.getElementById("hideUsedStyle").style.display="block";PickableMotifElement.toggleUsedMotifVisibility(true);XBrowser.userAgent.isIE7&&setTimeout("PickableMotifElement.doFontFixForIE7()",250);return false};
function DynamicCss(){this.cssLinks=[];this.readyToWrite=false;this.delayedDocs=[]}DynamicCss.prototype.isReadyToWrite=function(){return this.readyToWrite};DynamicCss.prototype.addCssUrl=function(b,a,c){c?this.cssLinks.unshift(new DynamicCss.CssLink(b,a)):this.cssLinks.push(new DynamicCss.CssLink(b,a));if(this.cssLinks.length===1)if(window.sfdcPage){var e=this;window.sfdcPage.appendToOnloadQueue(function(){e.loadingComplete()})}};
DynamicCss.prototype.loadingComplete=function(){this.readyToWrite=true;this.delayedDocs.length>0&&this.writeToDelayedDocs()};DynamicCss.prototype.appendCssWhenReady=function(b,a){this.delayedDocs.push({apiVersion:b,targetDoc:a})};DynamicCss.prototype.writeCss=function(b,a){for(var c=0;c<this.cssLinks.length;c++)a.write(this.cssLinks[c].getLink(b))};
DynamicCss.prototype.writeToDelayedDocs=function(){for(var b=0;b<this.delayedDocs.length;b++){var a=this.delayedDocs[b].targetDoc,c=a&&DynamicCss.getHead(a);if(c)for(var e=this.delayedDocs[b].apiVersion,d=0;d<this.cssLinks.length;d++)c.appendChild(this.cssLinks[d].getLinkElement(e,a))}this.delayedDocs=[]};DynamicCss.addCssUrl=function(b,a,c){DynamicCss.instance.addCssUrl(b,a,c)};DynamicCss.doneLoading=function(){DynamicCss.instance.loadingComplete()};
DynamicCss.writeCss=function(b,a,c){if(DynamicCss.instance.isReadyToWrite()){DynamicCss.instance.writeCss(b,a);c||a.close()}else DynamicCss.instance.appendCssWhenReady(b,a)};DynamicCss.loadCSS=function(b,a){var c=document.createElement("link");c.setAttribute("type","text/css");c.setAttribute("href",a);c.setAttribute("rel","stylesheet");b.appendChild(c)};
DynamicCss.loadSkin=function(b,a){var c=DynamicCss.getHead();if(c){var e="Theme2";if(b&&b.userUiSkin)e=b.userUiSkin;var d;d=a?UserContext.getUrl("/sCSS/")+a:UserContext.getUrl("/dCSS");d=d+"/"+e+"/default";DynamicCss.loadCSS(c,d+"/common.css");DynamicCss.loadCSS(c,d+"/custom.css")}};DynamicCss.getHead=function(b){b||(b=document);return(b=b.getElementsByTagName("head"))&&b.length==1?b[0]:null};DynamicCss.CssLink=function(b,a){this.url=b;this.mediaType=a?a:null};
DynamicCss.CssLink.prototype.getUrl=function(){return this.url};DynamicCss.CssLink.prototype.getMediaType=function(){return this.mediaType};DynamicCss.CssLink.prototype.getFullUrl=function(b){var a=this.getUrl();if(b){if(!DynamicCss.CssLink.URL_VERSION_REGEX)DynamicCss.CssLink.URL_VERSION_REGEX=/sCSS\/[^\/]*/;a=a.replace(DynamicCss.CssLink.URL_VERSION_REGEX,"sCSS/"+b)}return a};
DynamicCss.CssLink.prototype.getLink=function(b){var a=[];a.push("<link type='text/css' rel='stylesheet' href='");a.push(this.getFullUrl(b));a.push("'");if(this.getMediaType()){a.push(" media='");a.push(this.getMediaType());a.push("'")}a.push(">");return a.join("")};
DynamicCss.CssLink.prototype.getLinkElement=function(b,a){a||(a=document);var c=a.createElement("link");c.setAttribute("type","text/css");c.setAttribute("rel","stylesheet");c.setAttribute("href",this.getFullUrl(b));this.getMediaType()&&c.setAttribute("media",this.getMediaType());return c};DynamicCss.instance=new DynamicCss;
var FilterEdit=function(){};FilterEdit.prototype.disableDiv=function(a,c){var b=document.getElementById(a);if(b!=null){b.disabled=c;b.selectedIndex=b.options.length-1}};FilterEdit.prototype.setFocusOnSearch=function(){var a=document.getElementsByName(FilterEditPageConstants.pSEARCH_ANCHOR);a&&a.length==1&&a[0].focus()};
function ListFilterColumn(a){if(a){this.columnName=a[InlineEditConstants.COLUMN_NAME];this.label=a[InlineEditConstants.COLUMN_LABEL];this.state=InlineEditState[a[InlineEditConstants.FIELD_STATE]];if(this.state==InlineEditState.EDIT){this.columnType=InlineEditField.resolveSwitchableField(a);if(this.columnType==ColumnType.PERSONNAME||this.columnType==ColumnType.SWITCHABLE_PERSONNAME)this.state=InlineEditState.NONE;else{this.fieldId=a[InlineEditConstants.FIELD_ID];this.columnId=a[InlineEditConstants.COLUMN_ID];
this.required=a[InlineEditConstants.FIELD_REQUIRED];if(this.columnId=="FirstName"||this.columnId=="Salutation")this.required=false;var b=this.columnType.inlineEditExtraData;if(b){this.extraData={};for(var c=0;c<b.length;c++)this.extraData[b[c]]=a[b[c]]}this.fieldObject=null}}}}ListFilterColumn.prototype.getFieldId=function(){if(this.fieldId){var a=this.fieldId;if(this.columnId)a+=this.columnId;return a}else return this.columnName};
ListFilterColumn.prototype.createEditElements=function(a,b){var c=this.getFieldId();if(b===null){b="";if(this.columnType==ColumnType.BOOLEAN)b=false;else if(this.columnType==ColumnType.DYNAMICENUM)b=["","",null];else if(this.columnType==ColumnType.MULTIENUM)b=null;else if(this.columnType==ColumnType.ENTITYID)b=["",Udd.EMPTY_KEY]}this.fieldObject=new (this.columnType.inlineEditFieldConstructor())(c,this.state,this.required,true,b,this.extraData);this.fieldObject.label=this.label;this.fieldObject.tableCell=
a.parentNode;this.fieldObject.editDiv=a;this.fieldObject.createEditElements();this.fieldObject.created=true};ListFilterColumn.prototype.setError=function(a){this.fieldObject&&this.fieldObject.setError(a)};ListFilterColumn.prototype.getDisplayValue=function(){if(this.fieldObject)return this.fieldObject.formatValue()};
ListFilterColumn.prototype.addSaveData=function(a){this.fieldObject.currentValue=this.fieldObject.getValueFromEdit();a.fieldId=this.fieldId;a.columnId=this.columnId;a.nullable=!this.required;this.fieldObject.addSaveData(a)};
ListFilterColumn.prototype.onDisplay=function(){var a=this.fieldObject.editElement;if(a){a.focus();if(this.fieldObject.saveOnEnter)a.onkeypress=function(b){b=getEvent(b);if(b.keyCode==KEY_ENTER){eventCancelBubble(b);document.getElementById("saveButton").click()}};a.type=="text"&&a.select()}};
function ListInlineEditData(b){if(b!=null){this.viewport=b.viewport;this.isEditable=b[InlineEditConstants.EDITABLE];this.columns={};this.currentRow=this.currentColumn=null;if(this.isEditable){this.isMassEditable=b[InlineEditConstants.MASS_EDITABLE];this.csrf_token=b[CSRFConstants.CSRF_TOKEN];this.entityType=b[InlineEditConstants.ENTITY_TYPE];this.isPersonAccount=b[InlineEditConstants.IS_PERSON];this.dynamicDataUrl=b[InlineEditConstants.DYNAMIC_DATA];this.nameLabel=b[InlineEditConstants.NAME_LABEL];
this.editUrl=b[InlineEditConstants.SAVE_URL];if(typeof this.editUrl=="undefined")this.editUrl="/_ui/common/udd/object/InlineEditListSave";var d=this;this.dynamicDataUrl&&XBrowser.createDynamicScript(this.dynamicDataUrl,function(){d.dynamicDataLoaded()});this.layoutInfo=b[InlineEditConstants.LAYOUT_INFO];for(var e=0;e<b.shownColumns.length;e++){var c=b.shownColumns[e],a=this.layoutInfo[c.fieldId];c.state=a?a[0]:"READONLY";c.required=a?a[1]:false;if(this.isPersonAccount&&c[InlineEditConstants.OVERRIDE_TYPE])c[InlineEditConstants.OVERRIDE_TYPE]=
"PERSONNAME";else if(!this.isPersonAccount&&this.entityType=="Account"&&(c.columnId=="LastName"||c.columnId=="FirstName"||c.columnId=="Salutation"))c.state="NONE";this.columns[c.columnName]=d.createNewListFilterColumn(c)}if(!ListInlineEditData.dialog){ListInlineEditData.dialog=this.getNewDialog("massEdit");ListInlineEditData.dialog.displayX=true;ListInlineEditData.dialog.setWidth(520);ListInlineEditData.dialog.extraClass="inlineEditDialog";ListInlineEditData.dialog.register()}}}}
ListInlineEditData.prototype.getNewDialog=function(b){return new SimpleDialog(b,false)};ListInlineEditData.prototype.createNewListFilterColumn=function(b){return new ListFilterColumn(b)};ListInlineEditData.dialog=null;ListInlineEditData.prototype.dynamicDataLoaded=function(){};ListInlineEditData.prototype.getColumnById=function(b){return this.columns[b]};
ListInlineEditData.prototype.openColumn=function(b,d,e){if((d=this.columns[d])&&d.state==InlineEditState.EDIT){this.currentColumn=d;this.currentRow=b;b=this.viewport.grid.getSelectionModel().getCount();var c=this.isMassEditable&&b>1,a=[];a.push("<div class='fieldTableDiv'><table class='fieldTable' border='0'><tr class='fieldRow'><td class='labelCol'>");a.push(this.currentColumn.label);a.push("</td><td class='dataCol'>");a.push("<div id='massEditFieldDiv' class='");this.currentColumn.required?a.push("inlineEditRequiredDiv"):
a.push("inlineEditDiv");a.push("'></div></td></tr></table></div>");if(c){a.push("<table class='fieldTable'><tr class='selectionRow'><td class='labelCol'>");a.push(LC.getLabel("MassListEdit","EditLabel"));a.push("</td><td class='dataCol'>");a.push("<div class='radio'><input type='radio' name='massOrSingleEdit' id='singleEditRadio' checked='checked'><label for='singleEditRadio'>");a.push(LC.getLabel("MassListEdit","SingleEdit"));a.push("</label></div><div class='radio'><input type='radio' name='massOrSingleEdit' id='massEditRadio'><label for='massEditRadio'>");
a.push(LC.getLabel("MassListEdit","MultiEdit",b));a.push("</label></div></td></tr></table>")}a.push("<div class='inlineEditButtons'>");a.push("<input class='btn' type='button' value='");a.push(LC.getLabel("Buttons","save"));a.push("' id='saveButton'><input class='btn' type='button'value='");a.push(LC.getLabel("Buttons","cancel"));a.push("' id='cancelButton'>");a.push("</div>");ListInlineEditData.dialog.setContentInnerHTML(a.join(""));ListInlineEditData.dialog.setTitle(LC.getLabel("List","edit")+" "+
this.currentColumn.label);this.currentColumn.createEditElements(document.getElementById("massEditFieldDiv"),c?null:e);var f=this;document.getElementById("saveButton").onclick=function(){f.save()};document.getElementById("cancelButton").onclick=function(){f.closeColumn()};if(d.columnType.isDate){e=document.getElementById(DatePickerIds.DOM_ID);document.getElementById(ListInlineEditData.dialog.getContentId()).appendChild(e)}ListInlineEditData.dialog.show();this.currentColumn.onDisplay()}};
ListInlineEditData.prototype.save=function(){var b={},d=document.getElementById("massEditRadio");b[InlineEditConstants.IDS]=this.isMassEditable&&d&&d.checked?this.viewport.grid.getSelectionModel().selections.keys:this.currentRow;b[CSRFConstants.CSRF_TOKEN]=this.csrf_token;b[InlineEditConstants.ENTITY_TYPE]=this.entityType;b[InlineEditConstants.NULLABLE]=!this.currentColumn.required;this.currentColumn.addSaveData(b);ListInlineEditData.dialog.hide();this.viewport.beforeSave();var e=this;XBrowser.postHttpResponse(UserContext.getUrl(this.editUrl),
function(c){e.handleSaveResponse(c.responseText)},XBrowser.buildPost(b))};ListInlineEditData.prototype.closeColumn=function(){ListInlineEditData.dialog.hide();this.currentColumn=null};
ListInlineEditData.prototype.handleSaveResponse=function(b){b=Util.evalAjaxServletOutput(b);if(b.error){var d=document.createElement("div");d.innerHTML=b.error;ListInlineEditData.dialog.getContentElement().appendChild(d);ListInlineEditData.dialog.show()}else if(b.fieldError){this.currentColumn.setError(b.fieldError);ListInlineEditData.dialog.show()}else if(b.errorsByRow)this.createErrorWindow(b.saved.length||0,b.errorsByRow);if(b.error||b.fieldError||b.errorsByRow)this.csrf_token=b[CSRFConstants.CSRF_TOKEN];
this.viewport.afterSave(b.saved,this.currentColumn)};
ListInlineEditData.prototype.createErrorWindow=function(b,d){var e=window.open("","errorWin","width=720,height=400,resizable=yes",false);if(e){var c=e.document;c.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">');c.writeln("<html><head><title>"+LC.getLabel("Global","errors")+"</title>");DynamicCss.writeCss(null,c,true);c.writeln('<link rel="stylesheet" type="text/css" href="/EXT/ext-3.2.2/resources/css/ext-all.css" />');c.writeln('<style type="text/css">.x-grid3-col-error{white-space: normal}</style>');
c.writeln('<script src="/EXT/ext-3.2.2/ext.js"><\/script>');if(XBrowser.userAgent.isIE)for(var a=(new Date).getTime();(new Date).getTime()<a+1E3;);a=[];a.push('<script type="text/javascript">\n');a.push("Ext.onReady(function() {\n");a.push("    var sm = new Ext.grid.CheckboxSelectionModel();\n");a.push("    new Ext.Viewport({\n");a.push('        layout: "border",\n');a.push("        items: [{\n");a.push('            region: "north",\n');a.push('            contentEl: "topNav"\n');a.push("        }, {\n");
a.push('            xtype: "grid",\n');a.push('            region: "center",\n');a.push('            id: "errorGrid",\n');a.push('            autoExpandColumn: "error",\n');a.push("            sm: sm,\n");a.push('            ctCls: "errorConsole",\n');a.push("            store: new Ext.data.JsonStore({\n");a.push('                root: "errorsByRow",\n');a.push("                fields: [\n");a.push('                    { name: "entityId", type: "string" },\n');a.push('                    { name: "name", type: "string" },\n');
a.push('                    { name: "errorDesc", type: "string" }\n');a.push("                ],\n");a.push("                data: { errorsByRow: [\n");var f=0,g;for(g in d){f!=0&&a.push(",\n");f++;a.push('{ entityId: "');a.push(g);a.push('", name: ');a.push('"');a.push(d[g].name.replace(/"/g,'\\"'));a.push('"');a.push(', errorDesc: "');a.push(d[g].errorDesc.replace(/"/g,'\\"'));a.push('"}\n')}a.push("                ]}\n");a.push("            }),\n");a.push("            columns: [\n");a.push("                sm,\n");
a.push('                { id: "name", dataIndex: "name", sortable: false, menuDisabled: true, width: 150, header: "');a.push(this.nameLabel);a.push('",\n renderer: function(value, metadata, record, rowIndex, colIndex, store) {\n');a.push("                    var html = [];\n");a.push("                    html.push(\"<img src='"+UserContext.getUrl("/s.gif")+"' class='errorSmall'>\");\n");a.push('                    if (value === "") {\n');a.push('                        html.push("');a.push(LC.getLabel("MassListEdit",
"NoName"));a.push('");\n');a.push("                    } else {\n");a.push("                        html.push(\"<a target='_blank' href='"+UserContext.getUrl("/")+'");\n');a.push("                        html.push(record.data.entityId);\n");a.push('                        html.push("\'>");\n');a.push("                        html.push(value);\n");a.push('                        html.push("</a>");\n');a.push("                    }\n");a.push('                    return html.join("");\n');a.push("                } },\n");
a.push('                { id: "error", header: "');a.push(LC.getLabel("MassListEdit","ErrorColumn"));a.push('", dataIndex: "errorDesc", menuDisabled: true, sortable: false }\n');a.push("            ]\n");a.push("        }]\n");a.push("    });\n");a.push('    var grid = Ext.getCmp("errorGrid");\n');a.push('    Ext.fly("clearSelected").on("click", function(e) {\n');a.push("        var selections = grid.getSelectionModel().getSelections();\n");a.push("        for (var i = 0; i < selections.length; i++) {\n");
a.push("            grid.getStore().remove(selections[i]);\n");a.push("        }\n");a.push("        grid.getView().refresh();\n");a.push("    });\n");a.push('    grid.on("cellclick", function(grid, rowIndex, columnIndex, e) {\n');a.push('        if (grid.getColumnModel().getDataIndex(columnIndex) == "name" && e.getTarget("a", 1)) {\n');a.push('            Ext.fly(grid.getView().getCell(rowIndex, columnIndex)).addClass("viewedError");\n');a.push('            Ext.fly(grid.getView().getCell(rowIndex, columnIndex + 1)).addClass("viewedError");\n');
a.push("        \n");a.push("        }\n");a.push("    });\n");a.push("});\n");a.push("<\/script>");c.writeln(a.join(""));a=[];a.push('</head><body class="');a.push(this.viewport.filter.bodyClass);a.push('"><div id="topNav" class="primaryPalette errorConsoleHeader"><div class="errorSummary">\n');a.push("<img src='"+UserContext.getUrl("/s.gif")+"' class='confirmSmall'>");b==1?a.push(LC.getLabel("MassListEdit","OneSuccessful")):a.push(LC.getLabel("MassListEdit","ManySuccessful",b));a.push("</div><div class='errorSummary'><img src='"+
UserContext.getUrl("/s.gif")+"' class='errorSmall'>");f==1?a.push(LC.getLabel("MassListEdit","OneError")):a.push(LC.getLabel("MassListEdit","ManyErrors",f));a.push("</div><div class='errorTitle'>");a.push(LC.getLabel("MassListEdit","Summary"));a.push('<input type="button" class="btn" id="clearSelected" value="');a.push(LC.getLabel("MassListEdit","ClearSelected"));a.push('"></div></div>');c.writeln(a.join(""));c.writeln("</body></html>");c.close();e.focus()}};
function RelatedList(c,a,d,b,k,m,l,e,h){this.listId=c;this.visibleRowCount=a;this.title=d;this.listHasMore=b;this.refreshURL=k;this.refreshQS=m;this.isOnlySkipLink=l;this.shouldLoad=e;this.listCommonId=h;RelatedList.add(this)}(function(){var c={};RelatedList.get=function(a){return c[a]};RelatedList.getAll=function(){return c};RelatedList.add=function(a){c[a.listId]=a}})();
RelatedList.prototype={baseListNode:null,getRelatedListNode:function(){if(!this.baseListNode)this.baseListNode=document.getElementById(this.listId);return this.baseListNode},getLinkTarget:function(){return this.listId+"_target"},isHoverEnabled:function(){return!this.isOnlySkipLink},getTitle:function(){if(!Sfdc.isDefAndNotNull(this.title)){var c=Sfdc.select("H3",this.getRelatedListNode())[0];this.title=Sfdc.Dom.getText(c)||""}return this.title},hasMore:function(){if(!Sfdc.isDefAndNotNull(this.listHasMore))this.listHasMore=
!!Sfdc.get(".pShowMore",this.getRelatedListNode());return this.listHasMore},getNumberVisibleRows:function(){if(!Sfdc.isDefAndNotNull(this.visibleRowCount))this.visibleRowCount=Sfdc.select("tr.dataRow:not(.extraRow)",this.getRelatedListNode()).length;return this.visibleRowCount},refresh:function(c,a){if(this.refreshURL&&this.refreshQS){qs=this.refreshQS;if(c){for(var d=[],b=0,k=c.length;b<k;b++)d.push(c[b]+"="+a[b]);qs=qs+"&"+d.join("&")}this.callRelatedListAction(null,this.refreshURL,qs)}},showXMore:function(c,
a){if(window.sfdcPage&&window.sfdcPage.makeRLAjaxRequest){var d={rowsperlist:c,keepPref:1};if(a){var b=document.getElementById(a);if(b)d[a]=b.value}window.sfdcPage.makeRLAjaxRequest(null,this.listId,d)}},showMoreList:function(c,a){this.callRelatedListAction(null,c,a)},performActionAndRefreshList:function(c){var a=this.listId,d=this;Sfdc.Ajax.request(c,{success:function(){window.sfdcPage.makeRLAjaxRequest(null,a);Sfdc.Event.fireEvent(d,"relatedList:onAction",{data:[c]})},failure:function(){window.location=
c}})}};
RelatedList.prototype.callRelatedListAction=function(c,a,d,b,k,m,l){var e=this;this.makeRequest(c,a,d,function(h){if(h){if(window.sfdcPage&&window.sfdcPage.hasNoRelatedList&&window.sfdcPage.hasNoRelatedList(h,e.listId)){var f={};f[DynamicContent.pCOOKIE_PARAM]=null;a=Sfdc.Url.generateUrl(a,f,{allowMultipleOfParam:true});window.location=a}if(!(window.sfdcPage&&window.sfdcPage.checkActionCanceled&&window.sfdcPage.checkActionCanceled(h,e.listId))){var i=k||e.listId,j=Sfdc.get(b||e.listId,document);h=
Sfdc.get(i,h);f=sfdcPage.relatedListPanel;if(j&&h){if(Sfdc.userAgent.isIE||Sfdc.userAgent.isSafari||Sfdc.userAgent.isOpera){j.innerHTML=h.innerHTML;window.sfdcPage&&window.sfdcPage.evalScripts&&window.sfdcPage.evalScripts(j)}else{var g=document.createElement(j.tagName);g.style.display="none";var n=document.getElementsByTagName("body")[0];n.appendChild(g);j.innerHTML="";var o=Util.stripScriptsUnderElement(h);g.innerHTML=h.innerHTML;for(Util.evalScriptList(o);g.firstChild;)j.appendChild(g.removeChild(g.firstChild));
n.removeChild(g)}window.sfdcPage&&window.sfdcPage.hook_postRelatedListActionUpdate&&window.sfdcPage.hook_postRelatedListActionUpdate(a);if(j.id!=i)j.id=i;e.visibleRowCount=null;e.listHasMore=null;if(f){i=[];j=f.getIFrameNode().contentWindow.document.getElementById(e.listId);g=document.getElementById(f.getLinkId(e.listId));if(j&&j.innerHTML){j.innerHTML=h.innerHTML;f.fixContent(j);g&&g.className&&g.className.indexOf("linkletOn")>-1&&f.showRL(e.listId,true)}if(g){i.push('<span class="listTitle">');
i.push(e.getTitle());i.push(f.getCountIndicator(e));i.push("</span>");g.innerHTML=i.join("")}}l&&l();typeof Sfdc!="undefined"&&typeof Sfdc.SideTabs!="undefined"&&typeof Sfdc.SideTabs.refreshDDItemTitles!="undefined"&&Sfdc.SideTabs.refreshDDItemTitles([e])}}}})};
RelatedList.prototype.makeRequest=function(c,a,d,b){function k(e){return e}function m(e,h){var f=new Date;f.setTime(f.getTime()+6E5);var i=DynamicContent.pCOOKIE_PARAM+f.getTime();Sfdc.Cookie.setCookie(i,d,f);f={};f[DynamicContent.pCOOKIE_PARAM]=i;f[DynamicContent.pTYME]=(new Date).getTime();e=Sfdc.Url.generateUrl(e,f,{escape:k,unescape:k,allowMultipleOfParam:true});try{Sfdc.Ajax.request(e,{success:function(g){h(l.parseResult(g))},failure:function(g){l.handleRequestError(l.parseResult(g),e)},escape:k})}catch(j){Sfdc.error(j)}}
var l=this;c?m(c,function(){m(a,b)}):m(a,b)};
RelatedList.prototype.parseResult=function(c){var a="parserFrame"+(new Date).getTime(),d="div"+a,b=document.body,k=document.createElement("div");if(!Sfdc.userAgent.isSafari)k.style.display="none";k.id=d;b.appendChild(k);k.innerHTML=isSafari?'<iframe src="javascript:false" style="height:1px;width:1px" id="'+a+'" name="'+a+'"></iframe>':'<iframe src="javascript:false" style="display:none;" id="'+a+'" name="'+a+'"></iframe>';a=document.getElementById(a);b=null;try{var m=c.toLowerCase(),l=m.indexOf("<table"),
e=c.substring(l,m.length);b=a.contentWindow||a.contentDocument;if(b.document)b=b.document;b.open();b.write("<html><body></body></html>");b.close();b.body.innerHTML=e}catch(h){Sfdc.error(h)}finally{setTimeout(function(){var f=document.body,i=document.getElementById(d);i&&f.removeChild(i)},5E3)}return b};
RelatedList.prototype.handleRequestError=function(c,a){if(window.sfdcPage&&window.sfdcPage.desktopAjaxDisplayErrorInline&&window.sfdcPage.desktopAjaxDisplayErrorInline()){var d=c.getElementById(DynamicContent.pERROR_TITLE),b=c.getElementById(DynamicContent.pERROR_DESC);if(d){d=d.innerHTML;if(b)d=d+"\n\n"+b.innerHTML;alert(d)}}else{b={};b[DynamicContent.pCOOKIE_PARAM]=null;a=Sfdc.Url.generateUrl(a,b);Sfdc.Url.navigateTo(a)}};
if(window.Ext&&window.Ext.grid&&window.Ext.grid.GridView){Ext.ns("Sfdc","Sfdc.grid");Sfdc.grid.GridView=Ext.extend(Ext.grid.GridView,{sortState:{field:null,dir:null},onRowSelect:function(a){var b=this.grid.store.getAt(a).id;if(b=getElementByIdCS(b)){b.checked=true;updateToggleAllBox(b.form,"ids")}this.addRowClass(a,"x-grid3-row-selected");this.grid.viewport.paginator.selectedOnThisPage++},onRowDeselect:function(a){var b=this.grid.store.getAt(a).id;if(b=getElementByIdCS(b)){b.checked=false;updateToggleAllBox(b.form,
"ids")}this.removeRowClass(a,"x-grid3-row-selected");this.grid.viewport.paginator.selectedOnThisPage--},initTemplates:function(){var a=this.templates||{};if(!a.master)a.master=new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',
"</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>");if(!a.header)a.header=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">','<thead><tr class="x-grid3-hd-row">{cells}</tr></thead>',"</table>");if(!a.hcell)a.hcell=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id}" style="{style}"><div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" style="{istyle}">',this.grid.enableHdMenu?
'<a class="x-grid3-hd-btn" href="#"></a>':"",'{value}<img class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div></td>");if(!a.body)a.body=new Ext.Template("{rows}");if(!a.row)a.row=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"><table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':
"","</tbody></table></div>");if(!a.cell)a.cell=new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" id="{domId}" {attr}>{value}</div>',"</td>");for(var b in a){var c=a[b];if(c&&typeof c.compile=="function"&&!c.compiled){c.disableFormats=true;c.compile()}}this.templates=a;this.tdClass="x-grid3-cell";this.cellSelector="td.x-grid3-cell";this.hdCls="x-grid3-hd";this.rowSelector="div.x-grid3-row";
this.colRe=/x-grid3-td-([^\s]+)/},doRender:function(a,b,c,d,f,i){var l=this.templates,q=l.cell;l=l.row;for(var r=f-1,o=[],m,g,e={},k={tstyle:"width:"+this.getTotalWidth()+";"},h,n=0,s=b.length;n<s;n++){h=b[n];m=[];for(var p=n+d,j=0;j<f;j++){g=a[j];e.domId=h.id+"_"+g.id;e.id=g.id;e.css=j==0?"x-grid3-cell-first ":j==r?"x-grid3-cell-last ":"";e.attr=e.cellAttr="";e.value=g.renderer(h.data[g.name],e,h,p,j,c);e.style=g.style;if(e.value==undefined||e.value==="")e.value="&#160;";if(h.dirty&&typeof h.modified[g.name]!==
"undefined")e.css+=" x-grid3-dirty-cell";m[m.length]=q.apply(e)}g=[];if(i&&(p+1)%2==0)g[0]="x-grid3-row-alt";if(h.dirty)g[1]=" x-grid3-dirty-row";k.cols=f;if(this.getRowClass)g[2]=this.getRowClass(h,p,k,c);k.alt=g.join(" ");k.cells=m.join("");o[o.length]=l.apply(k)}return o.join("")},getColumnStyle:function(a){return Sfdc.grid.GridView.superclass.getColumnStyle.call(this,a,false)},setScrollOffset:function(){if(this.innerHd&&this.getOffsetWidth)this.innerHd.firstChild.style.width=this.getOffsetWidth()},
sizeColumnToContent:function(a){for(var b=0,c=this.getRows().length,d=this.grid.getColumnModel().getColumnWidth(a)-2,f=0;f<c;f++){var i=this.getCell(f,a).firstChild.scrollWidth;if(i!=d)if(i>b)b=i}b!=0&&this.grid.getColumnModel().setColumnWidth(a,b+8)}});Sfdc.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:"<input type='checkbox' id='allBox' value='' onclick='return false'/>",width:20,sortable:false,fixed:true,dataIndex:"",id:"checkbox",renderer:function(a,b,c){a=[];a.push("<input id='");
a.push(c.id);a.push("' value='");a.push(c.id);a.push("'");a.push(" type='checkbox'");a.push(" class='checkbox'");a.push(" name='ids'");a.push(" onclick='return false;'/>");return a.join("")},initEvents:function(){Sfdc.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var a=this.grid.getView();a.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(a.innerHd).on("mousedown",this.onHdMouseDown,this)},this);this.on("beforerowselect",this.onBeforeRowSelect,
this)},maxSelections:200,selectRow:function(a,b,c){if(this.locked||a<0||a>=this.grid.store.getCount())return false;if(this.isSelected(a))return true;var d=this.grid.store.getAt(a);if(d&&this.fireEvent("beforerowselect",this,a,b,d)!==false){if(!b||this.singleSelect)this.clearSelections();this.selections.add(d);this.last=this.lastActive=a;if(!c)this.grid.getView().onRowSelect(a);this.fireEvent("rowselect",this,a,d);this.fireEvent("selectionchange",this);this.grid.viewport.paginator.setSelectCount(this.selections.length)}else return false;
return true},deselectRow:function(a,b){if(!(this.locked||!this.isSelected(a))){this.last=a;var c=this.grid.store.getAt(a);if(c){this.selections.removeKey(c.id);if(!b)this.grid.getView().onRowDeselect(a);this.fireEvent("rowdeselect",this,a,c);this.fireEvent("selectionchange",this);this.grid.viewport.paginator.setSelectCount(this.selections.length)}}},selectRows:function(a,b){b||this.clearSelections();for(var c=0,d=a.length;c<d;c++)if(!this.selectRow(a[c],true))break},selectRange:function(a,b,c){if(!this.locked){c||
this.clearSelections();if(a<=b)for(;a<=b;a++){if(!this.selectRow(a,true))break}else for(;a>=b;a--)if(!this.selectRow(a,true))break}},deselectRange:function(a,b,c){if(!this.locked)if(a<=b)for(;a<=b;a++)this.deselectRow(a,c);else for(;a>=b;a--)this.deselectRow(a,c)},clearAllSelections:function(){this.clearSelections();this.selections.clear();this.grid.viewport.paginator.setSelectCount(0);this.grid.viewport.paginator.selectedOnThisPage=0},clearSelections:function(){for(var a=0,b=this.grid.store.getCount();a<
b;a++)this.deselectRow(a);this.last=false},selectAll:function(){if(!this.locked)for(var a=0,b=this.grid.store.getCount();a<b;a++)if(!this.selectRow(a,true))break},onBeforeRowSelect:function(){if(this.selections.length>=this.maxSelections){alert(LC.getLabel("List","selectionLimit",this.maxSelections));return false}},handleMouseDown:function(){},onEditorKey:function(){},onMouseDown:function(a,b){if(a.button===0&&b.className=="checkbox"){a.stopEvent();var c=a.getTarget(".x-grid3-row");if(c){c=c.rowIndex;
if(a.shiftKey&&this.last!==false){var d=this.last;this.isSelected(d)?this.selectRange(d,c,true):this.deselectRange(d,c);this.last=d}else this.isSelected(c)?this.deselectRow(c):this.selectRow(c,true)}}},onHdMouseDown:function(a,b){if(a.button===0)if(b.id=="allBox"){a.stopEvent();b.checked?this.clearSelections():this.selectAll()}},onRefresh:function(){var a=getElementByIdCS("allBox");if(a)a.checked=false;a=this.grid.store;var b,c=this.getSelections();if(this.grid.viewport.paginator)this.grid.viewport.paginator.selectedOnThisPage=
0;for(var d=[],f=0,i=c.length;f<i;f++)if((b=a.indexOfId(c[f].id))!=-1)this.grid.getView().onRowSelect(b);else{d.push("<input type='hidden' name='ids' value='");d.push(c[f].id);d.push("'/>")}Sfdc.Dom.updateHTML(this.grid.viewport.offPageIds,d.join(""));c.length!=this.selections.getCount()&&this.fireEvent("selectionchange",this);this.last=false;this.grid.viewport.paginator&&this.grid.viewport.paginator.draw(this.grid.viewport.paginator.totalRecords===0)}})};
var ActivityReminder={};ActivityReminder._REMINDER_COOKIE="reminderCookie";ActivityReminder._REMINDER_INTERVAL=5E3;ActivityReminder._LOCK_COOKIE="reminderLockCookie";ActivityReminder._MAX_COOKIE_LENGTH=4096;
ActivityReminder.initialize=function(a,b,c){ActivityReminder._isPopup=b;ActivityReminder._launched=(new Date).getTime();ActivityReminder._currentSchedule=a;ActivityReminder._checkScheduleUpdates();if(ActivityReminder._isPopup){if(!c){ActivityReminder._isBlur=false;addEvent(window,"focus",ActivityReminder._wasFocused,false);addEvent(window,"blur",ActivityReminder._wasBlured,false);setTimeout("ActivityReminder._pseudoFlash()",500)}ActivityReminder._popupCountdown();ActivityReminder._setupMeetingSummary();
ActivityReminder._setupSnoozeDismiss();ActivityReminder._updateSchedule();ActivityReminder._closeIfEmpty();window.onresize=ActivityReminder._resizeToFitHorizontalChange;ActivityReminder._resizeToFitHorizontal();updateToggleAllBox(document.forms.reminder,"ids")}};
ActivityReminder._checkScheduleUpdates=function(){var a=getCookie(ActivityReminder._REMINDER_COOKIE);if(a){ActivityReminder._currentSchedule=a.split(",");setTimeout("deleteCookie(ActivityReminder._REMINDER_COOKIE)",ActivityReminder._REMINDER_INTERVAL)}a=(new Date).getTime();for(var b=false,c=[],d=0;d<ActivityReminder._currentSchedule.length;d++)if(Number(ActivityReminder._currentSchedule[d])<=a+ActivityReminder._REMINDER_INTERVAL*2){if(!b){ActivityReminder._schedule(ActivityReminder._currentSchedule[d]);
b=true}}else c.push(ActivityReminder._currentSchedule[d]);ActivityReminder._currentSchedule=c;setTimeout("ActivityReminder._checkScheduleUpdates()",ActivityReminder._REMINDER_INTERVAL)};ActivityReminder._schedule=function(a){var b=Number(a)-(new Date).getTime();if(b<2E3)b=2E3;if(ActivityReminder._isPopup)b+=1E4;a=Number(a)-ActivityReminder._launched;!ActivityReminder._isPopup&&a<=-72E5?setTimeout("ActivityReminder._showPopup(false)",b):setTimeout("ActivityReminder._showPopupIfRequired()",b)};
ActivityReminder._updateSchedule=function(){var a=ActivityReminder._currentSchedule.join(","),b=new Date((new Date).getTime()+ActivityReminder._REMINDER_INTERVAL*2);a.length<=ActivityReminder._MAX_COOKIE_LENGTH&&setCookie(ActivityReminder._REMINDER_COOKIE,a,b)};
ActivityReminder._showPopupIfRequired=function(){var a=(new Date).getTime();makeAjaxRequest(UrlMap.convertClassNameToUrl(ActivityReminderRefreshPage.pCLASS_NAME)+"?at="+a,function(b){var c=b.indexOf(ActivityReminderConstants.REMINDERS_OK);if(c<0){c=b.indexOf(ActivityReminderConstants.REMINDERS_NONE);c<0&&ActivityReminder._showPopup()}else ActivityReminder._showPopup()})};
ActivityReminder._showPopup=function(a){if(!getCookie(ActivityReminder._LOCK_COOKIE)){var b=new Date((new Date).getTime()+5E3);setCookie(ActivityReminder._LOCK_COOKIE,"shown",b);b=isFirefox?"yes":"no";var c=(new Date).getTime(),d=isNetscape&&!isIE?"yes":"no",e=320;if(isNetscape&&isIE)e+=40;c=(b=window.parent.open(UrlMap.convertClassNameToUrl(ActivityReminderPage.pCLASS_NAME)+"?at="+c+(a==true?"&test=1":""),"Reminder","width=450,height="+e+",status=no,location="+b+",dependent=no,resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars="+
d,false))&&!b.closed;if(a&&!c)alert(LC.getLabel("Page_ActivityReminder","popup_blocked"));else c&&b.focus()}};ActivityReminder._popupCountdown=function(){for(var a=(new Date).getTime(),b=0;;b++){var c=document.getElementById(ActivityReminderConstants.DUE_MINUTES_ID+b);if(!c)break;var d=c.getAttribute(ActivityReminderConstants.DUE_TIME_ATTR);d!=0&&ActivityReminder._updateTime(c,d-a)}ActivityReminder._enableSnoozeOptions();setTimeout("ActivityReminder._popupCountdown()",3E4)};
ActivityReminder._updateTime=function(a,b){var c=Math.round(b/6E4),d=a.firstChild,e;if(c<0){e=true;c=-c}else e=false;c=ActivityReminder._formatDuration(c,e);if(e)c=LC.getLabel("Page_ReminderSettings","overdue",c);d.nodeValue=c};
ActivityReminder._formatDuration=function(a,b){if(a>=60){var c=b?Math.floor(a/60):Math.ceil(a/60);if(c>=24){c=Math.floor(c/24);return c==1?LC.getLabel("Page_ReminderSettings","day",c):LC.getLabel("Page_ReminderSettings","days",c)}else return c==1?LC.getLabel("Page_ReminderSettings","hour",c):LC.getLabel("Page_ReminderSettings","hours",c)}else return a==1?LC.getLabel("Page_ReminderSettings","minute",a):LC.getLabel("Page_ReminderSettings","minutes",a)};
ActivityReminder.showLink=function(a){var b=ActivityReminder._stopFlash=true;try{b=!window.opener||window.opener.closed||window.opener==window;if(!b)try{b=!window.opener.document}catch(c){b=true}}catch(d){}if(b)window.open(a,null,"",false);else if((b=window.opener.document.getElementById("mainFrame"))&&b.tagName=="IFRAME")b.src=a+"?"+Desktop.IS_DESKTOP+"=mn";else window.opener.location=a};
ActivityReminder._closeIfEmpty=function(){for(var a=0,b=0;;b++)if(document.getElementById("ids"+b))a++;else break;a||setTimeout("window.close()",10)};
ActivityReminder._setupMeetingSummary=function(){var a=getElementsByClassName("dataRow");if(a)for(var b=0;b<a.length;b++)addEvent(a[b],"mouseover",function(c){return function(d){eventCancelBubble(d);ActivityReminder._displayMeeting(c)}}(b));a=document.getElementById(ActivityReminderConstants.REMINDER_ID);addEvent(a,"mouseover",function(){ActivityReminder._displayMeeting()});ActivityReminder._displayMeeting()};
ActivityReminder._displayMeeting=function(a){if(typeof a=="undefined")for(var b=0;;b++){var c=document.getElementById("ids"+b);if(!c){a=0;break}if(c.checked){a=b;break}}for(b=0;;b++){c=document.getElementById(ActivityReminderConstants.SUMMARY_ID+b);if(!c)break;c.style.display=b==a?"block":"none"}};
ActivityReminder._setupSnoozeDismiss=function(){for(var a=0;;a++){var b=document.getElementById("ids"+a);if(!b)break;addEvent(b,"click",ActivityReminder._reenableSnoozeDismiss)}(a=document.getElementById("allBox"))&&addEvent(a,"click",ActivityReminder._reenableSnoozeDismiss);ActivityReminder._reenableSnoozeDismiss()};ActivityReminder.updateBrowserTime=function(){document.getElementById(ActivityReminderConstants.pSNOOZED_AT).value=(new Date).getTime()};
ActivityReminder._reenableSnoozeDismiss=function(){for(var a=false,b=0;;b++){var c=document.getElementById("ids"+b);if(!c)break;if(c.checked){a=true;break}}b=a?"btn":"btnDisabled";document.getElementById(ActivityReminderConstants.SNOOZE_ID).disabled=!a;document.getElementById(ActivityReminderConstants.SNOOZE_ID).className=b;document.getElementById(ActivityReminderConstants.SNOOZE_TIME_ID).disabled=!a;document.getElementById(ActivityReminderConstants.DISMISS_ID).disabled=!a;document.getElementById(ActivityReminderConstants.DISMISS_ID).className=
b;ActivityReminder._enableSnoozeOptions()};
ActivityReminder._enableSnoozeOptions=function(){for(var a=(new Date).getTime(),b,c=0;;c++){var d=document.getElementById(ActivityReminderConstants.DUE_MINUTES_ID+c);if(!d)break;if(document.getElementById("ids"+c).checked){var e=d.getAttribute(ActivityReminderConstants.DUE_TIME_ATTR);d=d.getAttribute(ActivityReminderConstants.ALL_DAY_ATTR);e-=a;if(!b||b>e)b=e;if(d=="true")b=0}}a=document.getElementById(ActivityReminderConstants.SNOOZE_TIME_ID);var f=a.childNodes,i=false;e=[0,5,10,15];for(c=0;c<e.length;c++){d=
e[c];f=a.childNodes;for(var h=null,j=f.length-1;j>=0;j--){var g=f[j];if(g.text&&g.value==-d){h=g;break}}if((d+1.5)*6E4<=b){if(!h){g=document.createElement("option");f=d==0?LC.getLabel("Page_ReminderSettings","hours_before",d):LC.getLabel("Page_ReminderSettings","minutes_before",d);f=document.createTextNode(f);g.appendChild(f);g.value=-d;a.insertBefore(g,a.firstChild);i=true}}else if(h){if(h.selected==true)i=true;a.removeChild(h)}}if(i==true){f=a.childNodes;for(c=0;c<f.length;c++){g=f[c];if(g.text){g.selected=
"true";break}}}};ActivityReminder.selectAll=function(){for(var a=0;;a++){var b=document.getElementById("ids"+a);if(!b)break;b.checked=true}};ActivityReminder._wasFocused=function(){ActivityReminder._isBlur=false};ActivityReminder._wasBlured=function(){ActivityReminder._isBlur=true};
ActivityReminder._pseudoFlash=function(){if(!ActivityReminder._originalTitle)ActivityReminder._originalTitle=document.title;var a=ActivityReminder._flashCount;if(a)a++;else a=1;ActivityReminder._flashCount=a;if((ActivityReminder._isBlur!=true||ActivityReminder._stopFlash==true||isNetscape)&&ActivityReminder._flashCount>(isNetscape?6:12))document.title=ActivityReminder._originalTitle;else{document.title=a%2==1?LC.getLabel("Page_ActivityReminder","new_flash"):ActivityReminder._originalTitle;setTimeout("ActivityReminder._pseudoFlash()",
500)}};ActivityReminder.testPopup=function(){setTimeout("ActivityReminder._showPopup(true)",1500)};
ActivityReminder._resizeToFitHorizontalChange=function(){if(isIE)if(document.documentElement.clientWidth!=ActivityReminder._oldWidth){ActivityReminder._oldWidth=document.documentElement.clientWidth;var a=getElementsByClassName("maxHorizontal"),b=false,c;for(c in a){var d=a[c];if(d.style.width&&d.style.width!=null){d.style.width=null;b=true}}b&&window.setTimeout("ActivityReminder._resizeToFitHorizontal()",100)}};
ActivityReminder._resizeToFitHorizontal=function(){if(isNetscape&&!isIE){var a=getElementsByClassName("maxHorizontal"),b=0,c;for(c in a){var d=a[c],e=d.offsetWidth;d.style.width="200px";d.style.overflow="hidden"}if(a[0])a[0].parentNode.parentNode.parentNode.style.height="auto"}else if(isIE){a=getElementsByClassName("bRelatedList")[0];d=getElementsByClassName("list")[0].offsetWidth+4;var f=document.documentElement.clientWidth-(a.offsetWidth<d?d:a.offsetWidth);if(f!=0){a=getElementsByClassName("maxHorizontal");
b=0;for(c in a){d=a[c];e=d.offsetWidth;b=Math.max(b,e)}b=Math.max(100,b+f);for(c in a){d=a[c];d.style.width=b+"px"}}}};
function DetailPage(a){this.relatedListPanel=null;this.editMode=false;this.inlineEditData=null;this.detailButtons=[];this.editButtons=[];this.errorDiv=null;this.saving=false;this.entityId=a;this.scriptsToNotCopy=["/ext.js","/Chatter.js","/GuidedTour.js","/HighlightsPanel.js","/SideTabs.js","EntitlementTimeline.js","/datacloud/datacloud.listview.Jigsaw/datacloud.listview.Jigsaw.nocache.js"]}DetailPage.prototype=new GenericSfdcPage;DetailPage.REFRESH_EVENT="refresh";
DetailPage.prototype.registerRelatedListPanel=function(a,b){this.relatedListPanel=new RelatedListPanel(a,b)};DetailPage.prototype.getRelatedListPanel=function(){return this.relatedListPanel};DetailPage.prototype.getEntityId=function(){if(this.entityId)return this.entityId;var a=window.location.href.split("?")[0].split("/");return this.entityId=a[a.length-1]};DetailPage.prototype.evalScripts=function(a){a=a.getElementsByTagName("script");for(var b=0;b<a.length;b++)eval(a[b].innerHTML)};
DetailPage.prototype.hasNoRelatedList=function(a,b){return getElementByIdCSWithDoc(a,b)?false:true};DetailPage.prototype.desktopAjaxDisplayErrorInline=function(){return false};DetailPage.prototype.hook_postRelatedListActionUpdate=function(){};DetailPage.prototype.getReferredDomIds=function(a){return this.getFieldById(a).lookupControllerIds};DetailPage.prototype.getFieldValueById=function(a){if(a=this.getFieldById(a)){a=a.currentValue;return a.constructor===Array?a[1]:a}};
DetailPage.prototype.initInlineEdit=function(a){this.inlineEditData=a;if(a.isEditable){var b=this;this.appendToOnloadQueue(function(){b.inlineEditData.init()},"Initialize inline edit");this.appendToOnloadQueue(function(){b.initializeButtons()},"Setup detail buttons")}};DetailPage.prototype.getInlineEditData=function(){return this.inlineEditData};
DetailPage.prototype.getFieldById=function(a){var b=this.getInlineEditData(a);if(b)return a.search(InlineEditConstants.CELL_ID+"$")!=-1?b.getField(a.substring(0,a.length-InlineEditConstants.CELL_ID.length)):b.getField(a)};
DetailPage.prototype.initializeButtons=function(){function a(c){var d=document.getElementById(c),e=d.getElementsByTagName("input");for(c=0;c<e.length;c++){var f=e[c];if(f.type=="button")f.name==InlineEditConstants.SAVE_BUTTON||f.name==InlineEditConstants.CANCEL_BUTTON?b.editButtons.push(f):b.detailButtons.push(f)}d=d.getElementsByTagName("div");for(c=0;c<d.length;c++){e=d[c];e.className=="menuButton"&&b.detailButtons.push(e)}}var b=this;a(DetailElement.TOP_BUTTON_ROW);a(DetailElement.BOTTOM_BUTTON_ROW)};
DetailPage.prototype.focusOnSave=function(){this.editButtons[0].focus()};DetailPage.prototype.activateInlineEditMode=function(){if(!this.errorDiv)this.errorDiv=document.getElementById(DetailElement.DEFAULT_ERROR_DIV_ID+(this.visualforce?"_"+this.visualforce:""));this.editMode=true;for(var a=0;a<this.detailButtons.length;a++)this.detailButtons[a].style.display="none";for(a=0;a<this.editButtons.length;a++)this.editButtons[a].style.display="inline";this.updateDirtyState(GenericSfdcPage.STATE_DIRTY)};
DetailPage.prototype.deactivateInlineEditMode=function(){this.editMode=false;for(var a=0;a<this.detailButtons.length;a++)this.detailButtons[a].style.display="inline";for(a=0;a<this.editButtons.length;a++)this.editButtons[a].style.display="none";this.clearError();this.updateDirtyState(GenericSfdcPage.STATE_CLEAN)};
DetailPage.prototype.setError=function(a){if(this.saving){this.saving=false;for(var b=0;b<this.editButtons.length;b++){this.editButtons[b].className="btn";if(this.editButtons[b].name==InlineEditConstants.SAVE_BUTTON)this.editButtons[b].value=LC.getLabel("Buttons","save");else if(this.editButtons[b].name==InlineEditConstants.CANCEL_BUTTON)this.editButtons[b].value=LC.getLabel("Buttons","cancel")}}if(a)this.errorDiv.innerHTML=a;this.errorDiv.style.display="block";this.updateDirtyState(GenericSfdcPage.STATE_ERROR)};
DetailPage.prototype.clearError=function(){this.errorDiv.style.display="none"};DetailPage.prototype.refreshDetail=function(){var a=window.location.href,b=a.indexOf("#");if(b!=-1)a=a.substring(0,b);navigateToUrl(a,"DETAIL");this.callListeners(DetailPage.REFRESH_EVENT)};DetailPage.prototype.save=function(){if(!this.saving&&this.editMode){this.saving=true;for(var a=0;a<this.editButtons.length;a++){this.editButtons[a].className="btnDisabled";this.editButtons[a].value=LC.getLabel("Buttons","saving")}this.inlineEditData.save()}};
DetailPage.prototype.revert=function(){if(!this.saving&&this.editMode){this.inlineEditData.revert();this.deactivateInlineEditMode()}};DetailPage.prototype.dblClickField=function(a,b){Jiffy.mark(OverlayDialog.LOAD_MARK);var c=getEventTarget(getEvent(a));if(c.nodeName.toLowerCase()!="a"){var d=this.getFieldById(b.id);if(d&&d.state==InlineEditState.EDIT){this.editMode||this.activateInlineEditMode(c.id);this.getInlineEditData(c.id).isCurrentField(d)||this.getInlineEditData(c.id).openField(d);eventCancelBubble(a)}}};
DetailPage.prototype.clickField=function(a,b){var c=this.getFieldById(b.id);c&&this.getInlineEditData(b.id).isCurrentField(c)&&eventCancelBubble(a)};DetailPage.prototype.mouseOverField=function(a,b){var c=this.getFieldById(b.id);if(c){delStyleClass(b,c.getCSSClass());addStyleClass(b,c.getCSSHoverClass())}};DetailPage.prototype.mouseOutField=function(a,b){var c=this.getFieldById(b.id);if(c){delStyleClass(b,c.getCSSHoverClass());addStyleClass(b,c.getCSSClass())}};
DetailPage.prototype.doRelatedListAjax=function(){var a=this;this.appendToOnloadQueue(function(){if(a.relatedListsById){var b=[],c;for(c in a.relatedListsById)b.push(c);a.makeRLAjaxRequest(a.getEntityId(),b)}},"rlAjax: Making Ajax request for related list data")};
DetailPage.prototype.makeRLAjaxRequest=function(a,b,c){Jiffy.mark("RL");var d=UserContext.getUrl("/_ui/common/list/RelatedListServlet");a=a||this.getEntityId();c=c||{};c=Util.applyIf(c,{parentId:a,rlId:b||"",visualforce:this.visualforce||"",retURL:window.location.pathname});a=new QueryString;c=Util.applyIf(c,a.params);XBrowser.postHttpResponse(d,function(e){window.sfdcPage.handleRLAjaxResponse(e.responseText)},XBrowser.buildPost(c))};
DetailPage.prototype.handleRLAjaxResponse=function(a){Jiffy.measure("rlResponse","RL");var b;try{b=Util.evalAjaxServletOutput(a)}catch(c){window.location.reload()}if(b.exElem)this.handleRLAjaxException(b.exElem);else{if(b.rls){a=[];for(var d in b.rls){var e=getElementByIdCS(d+"_title"),f=getElementsByClassName("pbButton",getElementByIdCS(d),"td")[0],g=getElementByIdCS(d+"_body");if(e&&f&&g){b.rls[d].title&&Sfdc.Dom.updateHTML(e,b.rls[d].title);if(b.rls[d].buttons){if(f.currentStyle)b.rls[d].buttons=
'<span style="display:none" id="__REMOVE">.</span>'+b.rls[d].buttons;Sfdc.Dom.updateHTML(f,b.rls[d].buttons);f.currentStyle&&Sfdc.Dom.removeChild(document.getElementById("__REMOVE"),true);this.relatedListPanel&&this.relatedListPanel.getIFrameNode()&&DomUtil.copyScripts(f,this.relatedListPanel.getIFrameNode().contentWindow.document,this.scriptsToNotCopy);Util.evalScriptsUnderElement(f)}e=document.createElement("div");Sfdc.Dom.updateHTML(e,b.rls[d].content);g.parentNode.replaceChild(e.firstChild,g);
this.relatedListsById[d].visibleRowCount=null;this.relatedListsById[d].listHasMore=null;this.relatedListsById[d].shouldLoad=false;a.push(this.relatedListsById[d])}}this.relatedListPanel&&this.relatedListPanel.refresh(a);typeof Sfdc!="undefined"&&typeof Sfdc.SideTabs!="undefined"&&typeof Sfdc.SideTabs.refreshDDItemTitles!="undefined"&&Sfdc.SideTabs.refreshDDItemTitles(a)}if(b.devFooterHTML)if(d=document.getElementById("ajaxPlSql"))d.innerHTML=b.devFooterHTML;Jiffy.measure("rlDisplay","RL")}};
DetailPage.prototype.handleRLAjaxException=function(a){var b=document.createElement("div");b.innerHTML=a;a=getElementsByClassName("bRelatedList",document.getElementById("bodyCell"),"div");a[0].parentNode.replaceChild(b,a[0]);for(b=1;b<a.length;b++)Sfdc.Dom.removeChild(a[b],true);if(this.relatedListPanel){b=this.relatedListPanel.getHoverableLinksNode();Sfdc.Dom.removeChild(b,true)}};
function EditPage(a){this.saved=false;this.submitButtons=[];this.originalButtonClasses=[];this.originalButtonValues=[];this.pressedButton=null;this.entityId=a;this.dependentLks={};this.controllerToControlledLookups={};var b=this;a!==undefined&&this.appendToOnloadQueue(function(){b.initLookups()},"Initialize dependent lookups");this.updateDirtyState(GenericSfdcPage.STATE_DIRTY)}EditPage.prototype=new GenericSfdcPage;
EditPage.prototype.initButtons=function(a){for(var b=this,c=0;c<a.length;c++)for(var e=document.getElementsByName(a[c]),d=0;d<e.length;d++){this.submitButtons.push(e[d]);this.originalButtonClasses.push(e[d].className);this.originalButtonValues.push(e[d].value);addEvent(e[d],"click",function(f){b.pressedButton=getEventTarget(f)},false)}};EditPage.prototype.getEntityId=function(){return this.entityId};EditPage.prototype.getSubmitButtons=function(){return this.submitButtons};
EditPage.prototype.registerDependentLookup=function(a,b){this.dependentLks[a]=b;for(var c=b.length-1;c>=0;c--)if(this.controllerToControlledLookups[b[c]])this.controllerToControlledLookups[b[c]].push(a);else this.controllerToControlledLookups[b[c]]=[a]};EditPage.prototype.getReferredDomIds=function(a){return this.dependentLks[a]};EditPage.prototype.getLookupFieldsControlledBy=function(a){return this.controllerToControlledLookups[a]};
EditPage.prototype.disableSaveButtons=function(){if(this.saved)return false;else{if(!this.pressedButton||this.pressedButton.name!=EditPageConstants.pCANCEL)this.disableButtons();return this.saved=true}};EditPage.prototype.disableButtons=function(){for(var a=0;a<this.submitButtons.length;a++){this.submitButtons[a].className="btnDisabled";this.submitButtons[a].value=LC.getLabel("Buttons","saving")}};
EditPage.prototype.enableSaveButtons=function(){if(this.saved){for(var a=0;a<this.submitButtons.length;a++){this.submitButtons[a].className=this.originalButtonClasses[a];this.submitButtons[a].value=this.originalButtonValues[a]}this.saved=false;return true}else return false};
EditableListPage=function(){EditPage.call(this,"000000000000000")};Util.extend(EditableListPage,EditPage);
function FormulaEditor(){}FormulaEditor.init=function(a,b,c,d){FormulaEditor.editorElementId=a;FormulaEditor.functionSelectionElementId=b;FormulaEditor.formId=c;FormulaEditor.validationStatusNotValidated=d;FormulaEditor.setFunctionInfo(FormulaEditor.getSelectedFunction())};FormulaEditor.setFunctionInfo=function(a){if(a){document.getElementById("funcFormat").innerHTML=functionNameToPrototypeMap[a];document.getElementById("funcExplain").innerHTML=functionNameToDescriptionMap[a]}};
FormulaEditor.getSelectedFunction=function(){functionSelectElement=document.getElementById(FormulaEditor.functionSelectionElementId);if(!functionSelectElement)return null;return functionSelectElement.options[functionSelectElement.selectedIndex].value};FormulaEditor.setListToCategory=function(a,b,c,d,e){c=document.getElementById(c);a=b[a!=""?a:d];e=e?1:0;c.options.length=e;if(a)for(b=0;b<a.length;b++)c.options[b+e]=a[b]};
FormulaEditor.switchMode=function(a){if(document.getElementById("editorMode").value!=a){document.getElementById("editorMode").value=a;document.getElementById("changeEditorMode").value="1";document.getElementById(FormulaEditor.formId).submit()}};FormulaEditor.formulaKeypressEventListener=function(){var a=document.getElementById("validationStatus");if(a)a.innerHTML=FormulaEditor.validationStatusNotValidated};
FormulaEditor.registerFormulaEventListeners=function(a){setCurrentParamName(a);a=getDoc();if(a.addEventListener)a.addEventListener("keypress",FormulaEditor.formulaKeypressEventListener,false);else a.onkeypress=FormulaEditor.formulaKeypressEventListener};FormulaEditor.insertFieldReference=function(a,b,c){var d=b.options[b.selectedIndex].value;if(d){FormulaEditor.insertCode(a,d,c);b.selectedIndex=0}};
FormulaEditor.insertCode=function(a,b,c){restoreSelection(document.getElementById(a));b=c&&!findDelimiters(a,"{!","}")?"{!"+b+"}":" "+b+" ";insertTextAtSelectionInEditor(a,b)};
function GoogleTalk(c,f,g){this.gadget=c;this.gadgetUrl=g;this.resizeBar=f;this.resizeBarOrigHeight=f.style.height;this.mouseStatus="up";this.popupWindow=function(){};this.showOnExitOverlay=true;c=getCookie(GoogleTalkConstants.HEIGHT_COOKIE);this.expandedHeight=c==null||c==0?GoogleTalkConstants.EXPANDED_HEIGHT:c;if(this.gadget.height!=GoogleTalkConstants.COLLAPSED_HEIGHT)this.gadget.src=this.gadgetUrl;GoogleTalk.prototype.toggle=function(a,d){var b=this.gadget.height==GoogleTalkConstants.COLLAPSED_HEIGHT;
this.gadget.height=b?this.expandedHeight:GoogleTalkConstants.COLLAPSED_HEIGHT;this.gadget.src=b?this.gadgetUrl:UrlMap.getURL("BlankPage");var e=new Date;e.setTime(e.getTime()+31536E7);setCookie(GoogleTalkConstants.COLLAPSED_COOKIE,b?"0":"1",e);if(b){d.style.display="inline";a.style.display="none"}else{d.style.display="none";a.style.display="inline"}this.resizeBar.style.display=b?"block":"none";typeof resizeFramesToFit!="undefined"&&resizeFramesToFit()};GoogleTalk.prototype.resize=function(a){if(this.mouseStatus==
"down"){a=parseInt(this.curHeight+parseInt((typeof event=="undefined"?a:event).clientY-this.curPos));a=a<GoogleTalkConstants.MIN_EXPANDED_HEIGHT?GoogleTalkConstants.MIN_EXPANDED_HEIGHT:a;this.gadget.height=a}};GoogleTalk.prototype.setStartDrag=function(a){this.resizeBar.style.height="39px";var d=this.gadget.height-35;this.gadget.height=d>GoogleTalkConstants.MIN_EXPANDED_HEIGHT?d:GoogleTalkConstants.MIN_EXPANDED_HEIGHT;this.mouseStatus="down";this.curPos=(typeof event=="undefined"?a:event).clientY;
this.curHeight=parseInt(this.gadget.height);document.body.onmousemove=function(b){GoogleTalk.prototype.theGadget.resize(b)};document.body.onmouseup=function(b){GoogleTalk.prototype.theGadget.setEndDrag(b)}};GoogleTalk.prototype.setEndDrag=function(){if(this.mouseStatus=="down"){this.mouseStatus="up";this.resizeBar.style.height=this.resizeBarOrigHeight;var a=new Date;a.setTime(a.getTime()+31536E7);setCookie(GoogleTalkConstants.HEIGHT_COOKIE,this.gadget.height,a);this.expandedHeight=this.gadget.height}};
GoogleTalk.prototype.popout=function(){this.popupWindow=window.open(this.gadgetUrl,"gTalkPopup","toolbar=no,width=300,height=600,resizable=yes,toolbars=no,status=no,scrollbars=yes,menubar=no,directories=yes,location=yes,dependant=no",false,false)};GoogleTalk.prototype.hide=function(){this.gadget.height=0};GoogleTalk.prototype.show=function(){this.gadget.height=this.expandedHeight};GoogleTalk.prototype.isShown=function(){return this.gadget.height!=GoogleTalkConstants.COLLAPSED_HEIGHT}};
function ListPage(){}ListPage.prototype=new GenericSfdcPage;
function FieldTree(a,b,c){this.rootList=a;this.currentNode=FieldTree.ROOT_NODE;this.currentDepth=0;this.formulaType=b;this.servletUrl=c}FieldTree.LOADING_MARKER="__";FieldTree.ROOT_NODE={};FieldTree.prototype.getCurrentList=function(){return this.currentNode===FieldTree.ROOT_NODE?this.rootList:this.getChildren(this.currentNode)};
FieldTree.prototype.ascend=function(a){var b=a?a:this.currentDepth-1;if(a===0)b=0;if(b>this.currentDepth)b=this.currentDepth;for(;this.currentDepth>b;)if(a=this.currentNode)if(a.parent){this.currentNode=a.parent;this.currentDepth--}else{this.currentNode=FieldTree.ROOT_NODE;this.currentDepth=0}else break};FieldTree.prototype.handleChildrenResponse=function(a,b,c){a=eval(Util.evalAjaxServletOutput(a.responseText)[AjaxGetFieldTreeChildren.NODE_LIST]);b.setChildren(a);c&&c(b)};
FieldTree.prototype.handleChildrenError=function(a,b,c){b.setChildren([new FieldTreeNode(FieldTree.LOADING_MARKER,true,null,LC.getLabel("Global","error"),true)]);c&&c(b)};FieldTree.prototype.descend=function(a){a=this.getNodeFromCurrentList(a);if(!a)return false;if(a.isLeaf)return false;this.currentNode=a;this.currentDepth++;return true};
FieldTree.prototype.getChildren=function(a,b){if(!a.isLeaf&&!a.children){message={};message[AjaxGetFieldTreeChildren.NODE_KEY]=a.getLabelToInsert(true);message[AjaxGetFieldTreeChildren.FORMULA_TYPE]=this.formulaType;var c=this;XBrowser.postHttpResponse(this.servletUrl,function(d){c.handleChildrenResponse(d,a,b)},XBrowser.buildPost(message),function(d){c.handleChildrenError(d,a,b)});a.setChildren([new FieldTreeNode(FieldTree.LOADING_MARKER,true,null,LC.getLabel("Global","loading"),true)])}return a.children};
FieldTree.prototype.getNodeFromCurrentList=function(a){for(var b,c=this.getCurrentList(),d=0;d<c.length;d++)if(c[d].key==a){b=c[d];break}return b};FieldTree.prototype.getNodeFromListByAttr=function(a,b,c,d){for(var f,e=0;e<a.length;e++)if(a[e].attributes[b]==c&&d==a[e].isLeaf){f=a[e];break}return f};
function FieldTreeController(a,c,b,f,e,h,d,l){if(a){this.tree=new FieldTree(c,d,l);this.selectId=f;this.selects=[document.getElementById(this.selectId+"0")];this.elementName=b;this.insertCurlyBangDelims=e;this.container=a;this.afterInsertCallback=h;this.focusDepth=0;this.idPrefix="";var j=/(\d+)$/,k=this;this.handleSelectClick=function(g){g=getEventTarget(getEvent(g));var i=j.exec(g.name);if(i){i=parseInt(i[1]);k.moveSelectionTo(i,g.options[g.selectedIndex].value)}};this.handleOnFocus=function(g){g=
getEventTarget(getEvent(g));if(g=j.exec(g.name))k.focusDepth=parseInt(g[1])};addEvent(this.container.firstChild.firstChild,"change",this.handleSelectClick,false);addEvent(this.selects[0],"focus",this.handleOnFocus,false);this.hideSelects()}}FieldTreeController.prototype.setScrollDiv=function(a){this.scrollDiv=a};FieldTreeController.prototype.ajaxRefreshNode=function(a){if(a===this.tree.currentNode){this.eraseSelects(this.tree.currentDepth);this.buildSelect(a.children,this.tree.currentDepth);this.scrollRight()}};
FieldTreeController.prototype.moveSelectionTo=function(a,c){if(c){a<this.tree.currentDepth&&this.tree.ascend(a);var b=this.tree.getNodeFromCurrentList(c);if(b.isLeaf)this.buildInsert(a+1,b);else{var f=this;this.buildSelect(this.tree.getChildren(b,function(e){f.ajaxRefreshNode(e)}),a+1);this.tree.descend(b.key)}this.scrollRight()}};FieldTreeController.prototype.focusTop=function(){var a=this.selects[0];a&&a.focus()};
FieldTreeController.prototype.reset=function(){this.tree.ascend(0);this.selects=[document.getElementById(this.selectId+"0")];var a=this.selects[0];if(a.options.length>0){a.selectedIndex=0;this.moveSelectionTo(0,a.options[0].value)}};FieldTreeController.prototype.filterBuildSelectMap=function(a){for(var c=[],b=0;b<a.length;b++){var f=a[b].isLeaf?escapeHTML(a[b].labelName):escapeHTML(a[b].labelName)+" &gt;";c[b]=[f,a[b].key]}return c};
FieldTreeController.prototype.buildSelect=function(a,c){var b=this.filterBuildSelectMap(a);this.eraseSelects(c);if(b.length==0){var f=LC.getLabel("NewFormulaEditor","NoFieldsMatch"),e=document.createElement("TD");this.container.appendChild(e);e.id=this.idPrefix+"insertBox";e.className="insertBox";b=document.createElement("SPAN");b.id=this.idPrefix+"insertWrapperInfo"+this.selects.length;e.appendChild(b);b.innerHTML=f;b.isDynamicSelect=false;b.className="insertWrapperInfo";this.selects.push(b.firstChild)}else{f=
Util.createDynamicSelect({size:"9",name:this.selectId+this.selects.length,"class":"fieldTreeSelect"},b,false);b=document.createElement("TD");b.id=this.idPrefix+"selectWrapper"+this.selects.length;b.className="selectWrapper";this.container.appendChild(b);b.innerHTML=f;b.isDynamicSelect=true;this.selects.push(b.firstChild);addEvent(this.selects[c],"change",this.handleSelectClick,false);addEvent(this.selects[c],"focus",this.handleOnFocus,false)}};FieldTreeController.prototype.getInsertDisplayHTML=function(a){return escapeHTML(a.getLabelToInsert())};
FieldTreeController.prototype.getAttributesDisplayHTML=function(a){return a.getAttributesForInsert()};
FieldTreeController.prototype.buildInsert=function(a,c){var b=LC.getLabel("NewFormulaEditor","SelectedInfo"),f="<input type='button' id='"+this.idPrefix+"fieldInsertButton' name='insertButton' class='btn' value='"+LC.getLabel("Buttons","ins")+"' />",e=this;this.selects[a]&&this.eraseSelects(a);var h=document.createElement("TD");this.container.appendChild(h);h.id=this.idPrefix+"insertBox";h.className="insertBox";var d=document.createElement("SPAN");d.id=this.idPrefix+"insertWrapperInfo"+this.selects.length;
h.appendChild(d);d.innerHTML=b;d.isDynamicSelect=false;d.className="insertWrapperInfo";d=document.createElement("SPAN");d.id=this.idPrefix+"insertWrapperString"+this.selects.length;h.appendChild(d);d.innerHTML=this.getInsertDisplayHTML(c);d.isDynamicSelect=true;d.className="insertWrapperString";this.selects.push(d.firstChild);if(b=this.getAttributesDisplayHTML(c)){d=document.createElement("SPAN");d.id=this.idPrefix+"insertWrapperAttributes"+this.selects.length;h.appendChild(d);d.innerHTML=b;d.isDynamicSelect=
false;d.className="insertWrapperAttributes"}d=document.createElement("SPAN");d.id=this.idPrefix+"insertWrapperButton"+this.selects.length;h.appendChild(d);d.innerHTML=f;d.isDynamicSelect=false;d.className="insertWrapperButton";addEvent(document.getElementById(this.idPrefix+"fieldInsertButton"),"click",function(){e.insertCode(e.elementName,c,e.insertCurlyBangDelims)},false)};
FieldTreeController.prototype.eraseSelects=function(a){for(var c=this.selects.length;c>a;){c--;for(var b=this.selects[c].parentNode;b.nodeName!="TD";)b=b.parentNode;this.container.removeChild(b);this.selects.pop()}};FieldTreeController.prototype.insertCode=function(a,c,b){FormulaEditor.insertCode(a,c.getLabelToInsert(),b);this.afterInsertCallback&&this.afterInsertCallback()};
FieldTreeController.prototype.scrollRight=function(){var a=this.scrollDiv||this.container;if(a.clientWidth==0)a=a.parentNode;a.scrollLeft=a.scrollWidth-a.clientWidth};FieldTreeController.prototype.showSelects=function(){for(var a=0;a<this.selects.length;a++){var c=this.selects[a];if(c!=null&&c.nodeName=="SELECT")c.style.display="inline"}};
FieldTreeController.prototype.hideSelects=function(){for(var a=0;a<this.selects.length;a++){var c=this.selects[a];if(c!=null&&c.nodeName=="SELECT")c.style.display="none"}};
FieldTreeController.prototype.switchFocus=function(a){this.focusDepth=a?this.focusDepth-1:this.focusDepth+1;if(this.focusDepth<0)this.focusDepth=this.selects.length;if(this.focusDepth>this.selects.length)this.focusDepth=0;if(this.focusDepth<this.selects.length){a=this.selects[this.focusDepth];if(a.nodeName=="SELECT")a.focus();else this.focusDepth===this.selects.length-1&&document.getElementById(this.idPrefix+"fieldInsertButton").focus()}else document.getElementById(this.idPrefix+"fieldSelectClose").focus()};
function FieldTreeNode(a,b,c,d,e,f){this.key=a;this.isLeaf=b;this.labelName=d;this.showLabel=e;this.attributes=f;c&&this.setChildren(c)}FieldTreeNode.prototype.setChildren=function(a){this.isLeaf=false;this.children=a;for(var b=0;b<a.length;b++)a[b].parent=this};FieldTreeNode.prototype.getLabelToInsert=function(a){if(!(this.parent&&(this.parent.showLabel||a)))return this.key;return this.parent.getLabelToInsert(a)+"."+this.key};
FieldTreeNode.prototype.getLabelNameToInsert=function(a){if(!(this.parent&&(this.parent.showLabel||a)))return this.labelName;return LC.getLabel("Global","labelWithColon",this.parent.getLabelNameToInsert(a))+" "+this.labelName};FieldTreeNode.prototype.getAttributeToInsert=function(a,b){if(!(this.parent&&(this.parent.showLabel||b)))return this.attributes[a];return this.parent.getAttributeToInsert(a,b)+"."+this.attributes[a]};
FieldTreeNode.prototype.getAttributesForInsert=function(){var a=["<table class='fieldPickerAttributeTable'>"];this.addAttributeRowToTable(a,LC.getLabel("NewFormulaEditor","AttributeFieldType"),this.attributes.type);this.addAttributeRowToTable(a,LC.getLabel("NewFormulaEditor","ApiName"),this.getLabelToInsert());a.push("</table>");return a.join("")};
FieldTreeNode.prototype.addAttributeRowToTable=function(a,b,c){a.push("<tr><td class='fieldPickerAttributeCategory'>");a.push(LC.getLabel("Global","labelWithColonNSpace",b));a.push(c);a.push("</td></tr>")};
function OverviewPage(){}OverviewPage.prototype=new GenericSfdcPage;
function OwnerChangePage(a){this.entityId=a;this.updateDirtyState(GenericSfdcPage.STATE_DIRTY);var b=this;a!==undefined&&this.appendToOnloadQueue(function(){b.initAutoComplete()},"Add AutoComplete")}OwnerChangePage.prototype=new GenericSfdcPage;OwnerChangePage.prototype.getEntityId=function(){return this.entityId};OwnerChangePage.prototype.getReferredDomIds=function(){return[]};
OwnerChangePage.prototype.initAutoComplete=function(){for(var a in ForeignKeyInputElement.allElements)if(ForeignKeyInputElement.allElements.hasOwnProperty(a)){var b=ForeignKeyInputElement.allElements[a];b.referredDomIds=[];b.initAutoComplete()}};
function Sidebar(c,d,f,g){if(d){this.div=c;this.sidebarContainer=document.getElementById(BodyLayout.SIDEBAR_CELL)||document.getElementById("noTableSidebar");this.handlebarContainer=document.getElementById(SidebarConstants.HANDLEBAR_CONTAINER);if(this.sidebarContainer&&this.handlebarContainer){this.pinned=!!f;this.disableHotkey=!!g;var a=this;this.handleDocumentKeyDown=function(b){b=getEvent(b);if(b.altKey&&String.fromCharCode(b.keyCode)==="S"){a.pin();if(a.pinned)if(b=document.getElementById(SidebarConstants.pSEARCH_SIDEBAR_STR)){b.focus();
b.select()}}};this.disableHotkey||addEvent(document,"keydown",this.handleDocumentKeyDown,false);if(XBrowser.userAgent.isIE6){var e=document.getElementById("bodyTable")||document.getElementById("noTableContainer");if(e){a.handlebarContainer.style.height=e.offsetHeight;addEvent(this.sidebarContainer,"resize",function(){a.handlebarContainer.style.height=e.offsetHeight})}}addEvent(this.handlebarContainer,"click",function(){a.pin()});addEvent(this.handlebarContainer,"mouseover",function(){addStyleClass(a.handlebarContainer,
"hover")});addEvent(this.handlebarContainer,"mouseout",function(){delStyleClass(a.handlebarContainer,"hover")});if(getElementsByClassName(EditElement.ERROR_CLASS,this.div).length>0)this.pinned||this.pin()}}else deleteCookie(SidebarConstants.SIDEBAR_PINNED_COOKIE)}Sidebar.prototype.setSidebarCookie=function(c){var d=new Date;d.setTime(d.getTime()+31536E7);setCookie(SidebarConstants.SIDEBAR_PINNED_COOKIE,c,d)};Sidebar.prototype.getSidebarCookie=function(){return getCookie(SidebarConstants.SIDEBAR_PINNED_COOKIE)};
Sidebar.prototype.pin=function(c){if(this.pinned){this.pinned=false;c||this.setSidebarCookie("0");this.handlebarContainer.title=this.disableHotkey?LC.getLabel("Sidebar","expandNoHotkey"):LC.getLabel("Sidebar","expand");addStyleClass(this.sidebarContainer,SidebarConstants.SIDEBAR_COLLAPSED_CLASS)}else{this.pinned=true;c||this.setSidebarCookie("1");this.handlebarContainer.title=this.disableHotkey?LC.getLabel("Sidebar","collapseNoHotkey"):LC.getLabel("Sidebar","collapse");delStyleClass(this.sidebarContainer,
SidebarConstants.SIDEBAR_COLLAPSED_CLASS)}};
function VFRTAEditor(){this.hasRun=false;this.onLoadQueue=[];this.assertIsReady=function(){Sfdc.assert(this.isReady,"You are performing action when RTA is not ready. Please use appendToOnloadQueue or call isReady() before using.")};if(typeof FCKeditor==="undefined"){var a=this;XBrowser.createDynamicScript(VisualforceConstants.FCK_LIBRARY,function(){a.init()})}else this.init()}
VFRTAEditor.prototype.getInstance=function(){if(!this.instance)this.instance=FCKeditorAPI.GetInstance(VisualforceConstants.EDITOR_NAME);return this.instance};
VFRTAEditor.prototype.init=function(){this.element=document.createElement("span");this.element.innerHTML=this._createEditor().CreateHtml();document.body.appendChild(this.element);this.element.style.display="none";this.iframeElement=getElementByIdCS(VisualforceConstants.EDITOR_NAME+VisualforceConstants.IFRAME_SUFFIX);this.iframeElement.style.position="absolute";var a=this;Sfdc.on(a.iframeElement,"load",function(){a.getInstance()});Sfdc.Event.add(window,"resize",function(){a.resizeEditor()})};
VFRTAEditor_OnComplete=function(){typeof __vf_RTAEditor!=="undefined"&&__vf_RTAEditor&&__vf_RTAEditor.executeOnloadQueue()};VFRTAEditor_setEditingAreaContainer=function(a){if(typeof __vf_RTAEditor!=="undefined"&&__vf_RTAEditor)__vf_RTAEditor.editingAreaContainer=a};VFRTAEditor.prototype.appendToOnloadQueue=function(a,b){if(b)a.operator=b;this.hasRun?this.execFunctionNoThrow(a):this.onLoadQueue.push(a)};
VFRTAEditor.prototype.executeOnloadQueue=function(){for(var a=0;this.onLoadQueue&&a<this.onLoadQueue.length;a++)this.execFunctionNoThrow(this.onLoadQueue[a]);this.hasRun=true;this.onLoadQueue=[]};VFRTAEditor.prototype.execFunctionNoThrow=function(a){try{a()}catch(b){if(a.operator)switch(a.operator){case VFRTAEditor.Operator.openField:b.sfdcDesc="Trying to open VF RTA Editor for inline edit";break;case VFRTAEditor.Operator.closeField:b.sfdcDesc="Trying to close VF RTA Editor for inline edit"}Gack.handleException(b)}};
VFRTAEditor.prototype.isReady=function(){return this.hasRun};VFRTAEditor.prototype.hide=function(){this.assertIsReady();this.element.style.display="none"};VFRTAEditor.prototype.setId=function(a){this.assertIsReady();if(a)this.iframeElement.id=a.search(VisualforceConstants.IFRAME_SUFFIX+"$")!=-1?a:a+VisualforceConstants.IFRAME_SUFFIX};VFRTAEditor.prototype.show=function(){this.assertIsReady();this.element.style.display="block";this.resizeEditor()};
VFRTAEditor.prototype.resizeEditor=function(){if(this.currentContainer){var a=Sfdc.Dom.getHeight(this.currentContainer)+"px",b=Sfdc.Dom.getWidth(this.currentContainer)+"px";this.setPosition(Sfdc.Dom.getElementXY(this.currentContainer));this.setSize(a,b)}if(XBrowser.userAgent.isIE9)if(this.editingAreaContainer){a=Sfdc.Dom.getHeight(this.iframeElement);this.editingAreaContainer.style.height=a-35+"px"}};VFRTAEditor.prototype.setContainerElement=function(a){this.currentContainer=a};
VFRTAEditor.prototype.setPosition=function(a){this.assertIsReady();if(a){Sfdc.assert(a.x&&a.y,"Invalid position for VFRTAEditor");this.iframeElement.style.top=a.y+"px";this.iframeElement.style.left=a.x+"px"}};VFRTAEditor.prototype.setSize=function(a,b){this.assertIsReady();if(a)this.iframeElement.style.height=a;if(b)this.iframeElement.style.width=b};VFRTAEditor.prototype.SetHTML=function(a){this.assertIsReady();this.getInstance().SetHTML(a)};
VFRTAEditor.prototype.GetHTML=function(a){this.assertIsReady();return this.getInstance().GetHTML(a)};VFRTAEditor.prototype._createEditor=function(){var a=new FCKeditor(VisualforceConstants.EDITOR_NAME,null,0);a.BasePath="/apexpages/fckeditor/";a.Config.CustomConfigurationsPath="/apexpages/richtext.config.js";a.ToolbarSet="SalesforceBasic";a.Config.SkinPath=a.BasePath+"editor/skins/sfdc/";a.Config.DefaultLanguage=UserContext.language;a.Config.ImageUpload=true;return a};var __vf_RTAEditor;
VFRTAEditor.Operator={closeField:0,openField:1};VFRTAEditor.getOrCreateRTAEditor=function(){__vf_RTAEditor||(__vf_RTAEditor=new VFRTAEditor);return __vf_RTAEditor};
GhostTextInputWrapperElement=function(b,c,e,f,g,d,h){this.element=getElementByIdCS(b);this.ghostText=(!c||c=="")&&d?d():c;this.inputElementCssClass=e;this.ghostTextCssClass=f;this.form=getElementByIdCS(g);this.getGhostTextFunction=d;h&&this.setGhostTextIfEmpty();var a=this;addEvent(this.element,"focus",function(){a.clearGhostText()});addEvent(this.element,"blur",function(){a.setGhostTextIfEmpty()});this.form&&addEvent(this.form,"submit",function(){a.clearGhostText()});this.element.getGhostText=function(){return a.getGhostText()};
this.element.setGhostText=function(){a.setGhostText()};this.element.setGhostTextIfEmpty=function(){a.setGhostTextIfEmpty()};this.element.setGhostTextFunction=function(i){a.getGhostTextFunction=i};this.element.clearGhostText=function(){return a.clearGhostText()}};GhostTextInputWrapperElement.prototype.focusOnMe=function(){Sfdc.isDefAndNotNull(window.parent.getOpenDialog())&&this.element.focus()};
GhostTextInputWrapperElement.prototype.clearGhostText=function(){if(this.element.isGhost){this.element.isGhost=false;this.element.value="";this.element.className=this.inputElementCssClass}};GhostTextInputWrapperElement.prototype.setGhostTextIfEmpty=function(){if(!this.element.value||this.element.value=="")this.setGhostText()};GhostTextInputWrapperElement.prototype.setGhostText=function(){this.element.isGhost=true;this.element.className=this.ghostTextCssClass;this.element.value=this.getGhostText()};
GhostTextInputWrapperElement.prototype.getGhostText=function(){return this.getGhostTextFunction?this.getGhostTextFunction():this.ghostText};GhostTextInputWrapperElement.getSearchString=function(b){var c="";b=document.getElementById(b);if(!b.isGhost)c=b.value;return c};
UnifiedSearchButton=function(b,c,d,e){if(b){this.parentDiv=getElementByIdCS(b);this.searchButton=getElementByIdCS(c);this.mouseOverCssClass=d;var a=this;addEvent(this.parentDiv,"click",function(){UnifiedSearchButton.submit(e)},false);addEvent(this.parentDiv,"mouseover",function(){addStyleClass(a.parentDiv,a.mouseOverCssClass)});addEvent(this.parentDiv,"mouseout",function(){delStyleClass(a.parentDiv,a.mouseOverCssClass)});addEvent(this.searchButton,"focus",function(){addStyleClass(a.parentDiv,a.mouseOverCssClass)});
addEvent(this.searchButton,"blur",function(){delStyleClass(a.parentDiv,a.mouseOverCssClass)})}};UnifiedSearchButton.submit=function(b){b=getElementByIdCS(b);XBrowser.fireEvent(b,"submit")&&b.submit()};
var HTMLTreeNode=function(){};HTMLTreeNode.prototype.toggleHTMLTree=function(a){var b=HTMLTreeNode.prototype.getNodeChild(a);if(b!=null)if(HTMLTreeNode.prototype.isVisible(b)){HTMLTreeNode.prototype.close(b,a);SetupTreeNode.prototype.removeFromOpenSetup(a)}else{HTMLTreeNode.prototype.open(b,a);SetupTreeNode.prototype.addToOpenSetup(a)}};HTMLTreeNode.prototype.isVisible=function(a){return a.style.display!="none"};HTMLTreeNode.prototype.setVisible=function(a,b){if(a)a.style.display=b?"":"none"};
HTMLTreeNode.prototype.getNode=function(a){if(document.getElementById("treeInformation")!=null)return document.getElementById(a)};HTMLTreeNode.prototype.getNodeChild=function(a){var b=document.getElementById("treeInformation");if(b!=null){a+=b.getAttribute("child");return document.getElementById(a)}};
HTMLTreeNode.prototype.open=function(a,b){var e=document.getElementById("treeInformation");if(e!=null){a.style.display="block";var c=document.getElementById(b+e.getAttribute("icon"));if(c!=null){var d=c.getElementsByTagName("img")[0].title;c=c.getElementsByTagName("img")[0];c.src=e.getAttribute("minusSrc");c.title=HTMLTreeNode.prototype.changePreTitle(d,e.getAttribute("collapse"));c.alt=HTMLTreeNode.prototype.changePreTitle(d,e.getAttribute("collapse"))}}};
HTMLTreeNode.prototype.close=function(a,b){var e=document.getElementById("treeInformation");if(e!=null){a.style.display="none";var c=document.getElementById(b+e.getAttribute("icon"));if(c!=null){var d=c.getElementsByTagName("img")[0].title;c=c.getElementsByTagName("img")[0];c.src=e.getAttribute("plusSrc");c.title=HTMLTreeNode.prototype.changePreTitle(d,e.getAttribute("expand"));c.alt=HTMLTreeNode.prototype.changePreTitle(d,e.getAttribute("expand"))}}};
HTMLTreeNode.prototype.changePreTitle=function(a,b){return b+" "+a.substr(a.indexOf("-"))};
HTMLTreeNode.prototype.openHTMLTree=function(a,b){var e=a?unescapeJsInHtml(a):null,c=b?unescapeJsInHtml(b):null,d=document.getElementById("treeInformation");if(d!=null){if(c!=null){HTMLTreeNode.prototype.unHighlightAll();var g=document.getElementById(c+d.getAttribute("leaf"));if(g&&g.className){g.className="setupHighlightLeaf";d.setAttribute("lastHighlight",c+d.getAttribute("leaf"))}}var i=document.getElementById(e+d.getAttribute("child"));if(i==null&&c!=null){g=document.getElementById(c+d.getAttribute("leaf"));
if(g!=null){var f=g.parentNode;if(f!=null&&f.id.indexOf(d.getAttribute("child"))>0){e=f.id.substr(0,f.id.indexOf(d.getAttribute("child")));i=f}}}if(i!=null){g=document.getElementById(e+d.getAttribute("icon"));e=g.getElementsByTagName("img")[0].title;i.style.display="block";f=g.getElementsByTagName("img")[0];f.src=d.getAttribute("minusSrc");f.title=HTMLTreeNode.prototype.changePreTitle(e,d.getAttribute("collapse"));f.alt=HTMLTreeNode.prototype.changePreTitle(e,d.getAttribute("collapse"));f=i.parentNode;
if(f!=null){f=f.parentNode;if(f!=null&&f.id.indexOf(d.getAttribute("child"))>0){e=f.id.substr(0,f.id.indexOf(d.getAttribute("child")));HTMLTreeNode.prototype.openHTMLTree(e,null)}}c!=null&&window.scrollTo(0,g.offsetTop)}else if(c!=null){g=document.getElementById(c+d.getAttribute("leaf"));g!=null&&window.scrollTo(0,g.offsetTop)}}};
HTMLTreeNode.prototype.unHighlightAll=function(){var a=document.getElementById("treeInformation");if(a!=null){var b=a.getAttribute("lastHighlight");if(b!=null){b=document.getElementById(b);if(b!=null&&b.className==a.getAttribute("highlightClass"))b.className=a.getAttribute("leafClass")}}};
HTMLTreeNode.prototype.populateTheTreeInformation=function(a,b,e,c,d,g,i,f,j,k){var h=document.getElementById("treeInformation");if(h!=null){h.setAttribute("font",a);h.setAttribute("child",b);h.setAttribute("icon",e);h.setAttribute("leaf",c);h.setAttribute("expand",d);h.setAttribute("collapse",g);h.setAttribute("plusSrc",i);h.setAttribute("minusSrc",f);h.setAttribute("highlightClass",j);h.setAttribute("leafClass",k);h.setAttribute("lastHighlight","none")}};
var SetupTreeNode=function(a,b){this.treeRoot=document.getElementById(a);this.findInput=document.getElementById(b);var c=this;addEvent(this.findInput,"keyup",function(){c.handleKeyUp.apply(c,arguments)},true);addEvent(document.getElementById("setupNavExpandAll"),"click",function(d){c.expandAll();XBrowser.preventDefaultEvent(d)},false);addEvent(document.getElementById("setupNavCollapseAll"),"click",function(d){c.collapseAll();XBrowser.preventDefaultEvent(d)},false);if(this.findInput.value!=="")this.findInput.value=
""};SetupTreeNode.excludeNodes=["Customize","DevTools","DevToolsIntegrate","Deploy"];SetupTreeNode.openListSetup=[];SetupTreeNode.TYPING_THRESHOLD_MILLIS=120;
SetupTreeNode.prototype={handleKeyUp:function(){this.bufferSearch()},bufferSearch:function(){this.TIMEOUT_ID&&clearTimeout(this.TIMEOUT_ID);this.TIMEOUT_ID=setTimeout(function(){var a=this;return function(){a.doSearch()}}.apply(this),SetupTreeNode.TYPING_THRESHOLD_MILLIS)},doSearch:function(){this.filterTree(trim(this.findInput.value))},filterTree:function(a){var b=this.treeRoot.childNodes;this.foundCount=this.childCount=0;var c=this.lastCategory=null;if(a.length>0){c=this.escapeForRegexp(a);c=a.charAt(0).match(/^\w/)?
RegExp("\\b"+c,"i"):RegExp(c,"i")}for(var d=0;d<b.length;d++)b[d].nodeName.toLowerCase()!="img"&&this.filterNode(b[d],c);document.getElementById("setupSearchError").style.display=this.foundCount===0&&a.length>0?"block":"none";if(this.lastCategory!=null&&a.length>0&&(this.foundCount===0||this.childCount===0))this.lastCategory.style.display="none"},filterNode:function(a,b,c){this.clearHighlight(a);var d=false;if(hasStyleClass(a,"setupNavtree")){d=true;if(b&&this.lastCategory!=null&&this.childCount===
0)this.lastCategory.style.display="none";this.lastCategory=a;this.childCount=0}else{var e=a.id,f=this.getNodeLabel(a).search(b)>=0;if((!b||f||c)&&!this.arrayContains(SetupTreeNode.excludeNodes,e)){d=true;this.childCount++}b&&f&&this.highlight(a,b);if(hasStyleClass(a,"parent")){f=HTMLTreeNode.prototype.getNodeChild(e);var h=false,i=f.childNodes;c=d;for(var g=0;g<i.length;g++)if(this.filterNode(i[g],b,c))h=true;if((d=d||h)&&b){HTMLTreeNode.prototype.open(f,e);SetupTreeNode.prototype.addToOpenSetup(e)}else{HTMLTreeNode.prototype.close(f,
e);SetupTreeNode.prototype.removeFromOpenSetup(e)}}d&&b&&this.foundCount++}a.style.display=d?"block":"none";return d},getNodeLabel:function(a){if(a.nodeName=="A"&&a.innerHTML.indexOf("<")!=0)return a.innerHTML;a=a.childNodes;for(var b=0;b<a.length;b++)if(a[b].nodeName=="A"&&a[b].innerHTML.indexOf("<")!=0)return a[b].innerHTML;else if(a[b].nodeName=="SPAN")for(var c=a[b].childNodes,d=0;d<c.length;d++)if(c[d].nodeName=="A"&&c[d].innerHTML.indexOf("<")!=0)return c[d].innerHTML;return""},expandAll:function(){for(var a=
getElementsByClassName("parent",this.treeRoot),b=0,c=a.length;b<c;b++){var d=a[b].id,e=HTMLTreeNode.prototype.getNodeChild(d);HTMLTreeNode.prototype.open(e,d);SetupTreeNode.prototype.addToOpenSetup(d)}},collapseAll:function(){for(var a=getElementsByClassName("parent",this.treeRoot),b=0;b<a.length;b++){var c=a[b].id,d=HTMLTreeNode.prototype.getNodeChild(c);HTMLTreeNode.prototype.close(d,c);SetupTreeNode.prototype.removeFromOpenSetup(c)}},getHighlightElem:function(a){return hasStyleClass(a,"setupLeaf")?
a.childNodes[0]:a},highlight:function(a){addStyleClass(this.getHighlightElem(a),"se_highlight")},clearHighlight:function(a){delStyleClass(this.getHighlightElem(a),"se_highlight")},arrayContains:function(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return true;return false},escapeForRegexp:function(a){return a.replace(/([\/.*+?|()[\]{}\\^$])/g,"\\$1")},removeFromOpenSetup:function(a){for(var b=0;b<SetupTreeNode.prototype.openListSetup.length;b++)if(SetupTreeNode.prototype.openListSetup[b]==a)SetupTreeNode.prototype.openListSetup[b]=
null;SetupTreeNode.prototype.updateCookiesSetup()},getNodes:function(){var a=[],b=getElementsByClassName("parent");a=a.concat(b);b=getElementsByClassName("setupLeaf");return a=a.concat(b)},openListSetup:[],addToOpenSetup:function(a){for(var b=0;b<SetupTreeNode.prototype.openListSetup.length;b++)if(SetupTreeNode.prototype.openListSetup[b]==null){SetupTreeNode.prototype.openListSetup[b]=a;SetupTreeNode.prototype.updateCookiesSetup();return}SetupTreeNode.prototype.openListSetup[SetupTreeNode.prototype.openListSetup.length]=
a;SetupTreeNode.prototype.updateCookiesSetup()},updateCookiesSetup:function(){for(var a="",b=0;b<SetupTreeNode.prototype.openListSetup.length;b++)if(SetupTreeNode.prototype.openListSetup[b]!=null)a=a+SetupTreeNode.prototype.openListSetup[b]+":";Sfdc.Cookie.setCookie(SetupTreeNodeConstants.COOKIE_KEY,a,null,"/")}};
function InlineEditData(a){if(a){this.isEditable=a[InlineEditConstants.EDITABLE];this.sysMod=a[InlineEditConstants.LAST_MOD];this.id=a[InlineEditConstants.ENTITY_ID];this.csrf_token=a[CSRFConstants.CSRF_TOKEN];this.fields={};this.dependencyGroups=[];this.hasCompoundFields=false;this.allFieldData=a[InlineEditConstants.FIELD_DATA];this.dynamicDataUrl=a[InlineEditConstants.DYNAMIC_DATA];this.initHook=a[InlineEditConstants.INIT_HOOK];this.sentRequest=this.loadedDynamicData=false;this.currentField=null;
this.visualforce=a[InlineEditConstants.VF_ENABLED];sfdcPage.initInlineEdit(this)}}InlineEditData.prototype.init=function(){this.createFields();if(this.hasCompoundFields&&!InlineEditField.overlay){InlineEditField.overlay=new InlineEditDialog;InlineEditField.overlay.register()}var a=this;addEvent(document,"click",function(c){if(Sfdc.userAgent.isFirefox&&c.button==2)return false;a.closeCurrentField()},false)};
InlineEditData.prototype.createFields=function(){if(this.allFieldData){for(var a=0;a<this.allFieldData.length;a++){var c=this.allFieldData[a],b=InlineEditField.createField(c);if(this.fields[c.fieldId]=b)if(b.compound)this.hasCompoundFields=true}for(a in this.fields){(c=this.fields[a])&&c.afterLoad&&c.afterLoad();if(c&&c.controllerId){this.createDependency(c);this.hasCompoundFields=true}if(c&&c.lookupControllerIds)for(b=0;b<c.lookupControllerIds.length;b++){var d=this.getField(c.lookupControllerIds[b]);
if(d){if(!d.dependentIds)d.dependentIds=[];d.dependentIds.push(c.id)}}}if(this.initHook)(a=window[this.initHook])&&typeof a.initInlineEditData==="function"&&a.initInlineEditData(this)}};
InlineEditData.prototype.createDependency=function(a){if(!a.group){for(var c=this.getField(a.controllerId),b=null;c!=null;){if(b=c.group)break;c=this.getField(c.controllerId)}if(b)for(var d=b.length;a!=c;){b.splice(d,0,a.id);a.group=b;if(a instanceof BooleanField)a.waitForLoad=true;a=this.getField(a.controllerId)}else{for(c=[];a!=null;){c.unshift(a.id);a.group=c;if(a instanceof BooleanField)a.waitForLoad=true;a=this.getField(a.controllerId)}this.dependencyGroups.push(c)}}};
InlineEditData.prototype.openField=function(a){if(a.group)a=this.fields[a.group[0]];else this.isCurrentField(a)||this.closeCurrentField();this.currentField=a;if(this.visualforce&&!a.waitForLoad){var c=sfdcPage.getRegisteredPickList(this.visualforce);if(c&&window.pl)window.pl=c}if(a.waitForLoad&&!this.loadedDynamicData)this.loadDynamicData();else{a.group?this.openGroup(a.group):a.openField();if(this.visualforce)sfdcPage.currentFieldForInlineEditDialog=this.visualforce}};
InlineEditData.prototype.openGroup=function(a){var c=this.fields[a[0]];if(!c.created){var b=document.createElement("div");b.className="inlineEditDiv dependentFields";if(XBrowser.userAgent.isIE6&&a){b.style.height=100+a.length*20+"px";b.style.width="440px"}document.body.appendChild(b);var d=[];d.push("<table border=0>");for(var e=0;e<a.length;e++){var f=this.fields[a[e]];d.push("<tr><td class='labelCol'>");d.push(f.getFieldLabel());d.push("</td><td></td></tr>");f.state==InlineEditState.EDIT?f.createEditDiv():
f.createDummy()}d.push("</table>");b.innerHTML=d.join("");d=false;for(e=0;e<a.length;e++){f=this.fields[a[e]];if(f.state==InlineEditState.EDIT){if(this.visualforce&&!d){sfdcPage.loadDetailJS(this.visualforce);d=true}f.load();b.firstChild.rows[e].lastChild.appendChild(f.editDiv)}else b.firstChild.rows[e].lastChild.innerHTML=f.initialHTML}InlineEditField.overlay.addField(c.id,b,LC.getLabel("DependentElement","dependentFields"))}InlineEditField.overlay.setActiveField(c.id);InlineEditField.overlay.setMaxWidth(500);
if(XBrowser.userAgent.isIE6&&InlineEditField.overlay.dialog)InlineEditField.overlay.dialog.style.width="500px";InlineEditField.overlay.show()};InlineEditData.prototype.isCurrentField=function(a){return this.currentField&&this.currentField==a&&!this.currentField.group};InlineEditData.prototype.closeCurrentField=function(a,c){if(typeof c==="undefined")c=true;if(this.currentField){this.currentField.group?this.closeGroup(this.currentField.group,c):this.currentField.closeField(c);this.currentField=null}};
InlineEditData.prototype.closeGroup=function(a){for(var c=0;c<a.length;c++){var b=this.fields[a[c]];if(b.state==InlineEditState.EDIT){var d=b.getValueFromEdit();if(b.isDifferentValue(d)){if(!b.changed){b.changed=true;addStyleClass(b.readDiv,"inlineEditModified")}b.currentValue=d;b.updateReadElement();b.updateDependents();if(b.changed){b.readDiv.appendChild(b.undoButton);b.undoButton.innerHTML===""&&b.attachUndoButtonImage();b.undoButton.style.display="inline"}}else if(b.changed){b.changed=false;b.currentValue=
d;delStyleClass(b.readDiv,"inlineEditModified");b.updateReadElement();b.undoButton.style.display="none"}}}InlineEditField.overlay.hide()};InlineEditData.prototype.resetCurrentField=function(){this.resetField(this.currentField);this.currentField=null};InlineEditData.prototype.resetFieldById=function(a){this.resetField(this.fields[a])};InlineEditData.prototype.resetField=function(a){if(a)a.group?this.resetGroup(a.group):a.reset(true)};
InlineEditData.prototype.resetGroup=function(a){for(var c=0;c<a.length;c++){var b=this.fields[a[c]];b.state==InlineEditState.EDIT&&b.reset(true)}InlineEditField.overlay.hide()};InlineEditData.prototype.getField=function(a){if(a)return this.visualforce?a.toString().match(this.visualforce)?this.fields[a]:this.fields[a.toString()+this.visualforce]:this.fields[a];return null};
InlineEditData.prototype.save=function(){if(this.isEditable){this.closeCurrentField();var a={};a[InlineEditConstants.ENTITY_ID]=this.id;a[InlineEditConstants.LAST_MOD]=this.sysMod;a[CSRFConstants.CSRF_TOKEN]=this.csrf_token;a[EditPageConstants.pSAVE]="1";DesktopContext.setCurrentDesktopParam(a);for(var c in this.fields){var b=this.fields[c];if(b&&b.doPost()){b.clearError();b.addSaveData(a)}}if(this.visualforce)a=sfdcPage.postProcessSaveData(a,this.visualforce);var d=this;XBrowser.postHttpResponse(UserContext.getUrl("/ui/common/InlineEditEntitySave"),
function(e){d.handleResponse(e.responseText)},XBrowser.buildPost(a),function(){var e=escape(window.location.pathname+window.location.search);window.location.replace(UserContext.getUrl("/ex/errorduringprocessing.jsp?retURL=")+e)})}};
InlineEditData.prototype.handleResponse=function(a){a=Util.evalAjaxServletOutput(a);if(a[InlineEditConstants.SUCCESS]){a=a[InlineEditConstants.AFTER_SAVE_REDIRECT_URL];if(this.visualforce&&sfdcPage.renderDetail)sfdcPage.renderDetail(this.visualforce);else if(a){sfdcPage.callListeners(DetailPage.REFRESH_EVENT);navigateToUrl(a,"DETAIL")}else sfdcPage.refreshDetail()}else{this.csrf_token=a[CSRFConstants.CSRF_TOKEN];this.handleErrors(a)}};
InlineEditData.prototype.handleErrors=function(a){sfdcPage.setError(a[InlineEditConstants.NON_SPECIFIC_ERRORS],this.visualforce);a=a[InlineEditConstants.VALIDATION_ERRORS];var c,b;for(b in a){var d=this.getField(b);if(d){if(!d.compound&&!d.group)if(!c||c.tableCell.offsetTop>d.tableCell.offsetTop)c=d;d.setError(a[b])}}c&&c.state==InlineEditState.EDIT&&this.openField(c)};
InlineEditData.prototype.revert=function(){if(this.isEditable){this.closeCurrentField(true);var a={},c;for(c in this.fields){var b=this.fields[c];if(b)if(b.changed)if(b.group)a[b.group[0]]=true;else b.reset();else b.clearError()}for(c in a)this.resetGroup(this.fields[c].group)}};InlineEditData.prototype.loadDynamicData=function(){if(!this.sentRequest){this.sentRequest=true;var a=this;XBrowser.createDynamicScript(this.dynamicDataUrl,function(){a.dynamicDataLoaded()})}};
InlineEditData.prototype.dynamicDataLoaded=function(){if(!this.loadedDynamicData){this.loadedDynamicData=true;if(this.currentField.waitForLoad){this.openField(this.currentField);this.visualforce&&sfdcPage.registerPickList(this.visualforce,pl)}}};
function InlineEditField(){this.readDiv=this.tableCell=this.id=null;this.created=false;this.editDiv=null;this.state=InlineEditState.NONE;this.required=false;this.currentValue=this.initialHTML=this.initialValue=this.label=null;this.changed=false;this.errorDiv=this.error=this.undoButton=null;this.waitForLoad=this.compound=false;this.controllerId=null;this.saveOnEnter=false}InlineEditField.overlay=null;
InlineEditField.prototype.init=function(a,b,c,e,d){this.id=a;this.state=b;this.required=c;this.isColumn=e;this.currentValue=this.initialValue=d===undefined||d===null?"":d;if(!this.isColumn){this.tableCell=getElementByIdCS(a+InlineEditConstants.CELL_ID);this.readDiv=getElementByIdCS(a+InlineEditConstants.INNER_ID);if(!this.tableCell||!this.readDiv)this.state=InlineEditState.NONE;else this.initialHTML=this.readDiv.innerHTML}};InlineEditField.prototype.isDifferentValue=function(){};
InlineEditField.prototype.openField=function(){};InlineEditField.prototype.showEdit=function(){};InlineEditField.prototype.hideEdit=function(){};InlineEditField.prototype.closeField=function(){};InlineEditField.prototype.createEditElements=function(){};InlineEditField.prototype.getValueFromEdit=function(){return null};InlineEditField.prototype.updateReadElement=function(){};InlineEditField.prototype.updateEditElementImpl=function(){};InlineEditField.prototype.formatValue=function(){};
InlineEditField.prototype.addSaveData=function(){};InlineEditField.prototype.createDummy=function(){};InlineEditField.prototype.load=function(){};InlineEditField.prototype.mayUndo=function(){return true};InlineEditField.prototype.updateEditElement=function(){this.created&&this.updateEditElementImpl()};InlineEditField.prototype.doPost=function(){return this.state==InlineEditState.EDIT||this.state==InlineEditState.POSTONLY};InlineEditField.prototype.reset=function(){};
InlineEditField.prototype.cleanValue=function(a){if(a&&a.replace)return this.cleanValueNoBR(a).replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/\n/g,"<br>");return a};InlineEditField.prototype.getDeletedValue=function(){return this.isColumn?"":"<em>"+LC.getLabel("Global","deleted")+"</em>"};InlineEditField.prototype.cleanValueNoBR=function(a){if(a&&a.replace)return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return a};
InlineEditField.prototype.createUndoButton=function(){this.undoButton=document.createElement("a");this.undoButton.className="inlineEditUndoLink";this.undoButton.title=LC.getLabel("Icons","inlineEditUndo");this.undoButton.href="javascript:sfdcPage.getInlineEditData('"+this.id+"').resetFieldById('"+this.id+"');";this.attachUndoButtonImage()};
InlineEditField.prototype.attachUndoButtonImage=function(){if(this.undoButton!==null)this.undoButton.innerHTML="<img width='16px' height='16px' src='/s.gif' alt='"+LC.getLabel("Icons","inlineEditUndo")+"' class='inlineEditUndo'>"};InlineEditField.prototype.getFieldLabel=function(){if(this[VisualforceConstants.LABEL])return this[VisualforceConstants.LABEL];for(var a=this.tableCell.previousSibling;a&&a.nodeType!=Node.TEXT_NODE;)a=a.firstChild;return a?a.nodeValue:""};
InlineEditField.prototype.setError=function(a){this.error=a;if(this.errorDiv){this.errorDiv.innerHTML=this.error;this.errorDiv.style.display="block"}else{this.errorDiv=document.createElement("div");this.errorDiv.className="errorMsg";this.errorDiv.innerHTML=this.error;this.tableCell.appendChild(this.errorDiv)}};
InlineEditField.prototype.updateDependents=function(){if(this.dependentIds)for(var a=0;a<this.dependentIds.length;a++){var b=sfdcPage.getFieldById(this.dependentIds[a]);b.lookupAutoCompleter&&b.lookupAutoCompleter.clearCache();b.performValidation&&b.currentValue[0]!=""&&b.performValidation()}};InlineEditField.prototype.clearError=function(){if(this.errorDiv)this.errorDiv.style.display="none";this.error=null};InlineEditField.prototype.getCSSClass=function(){return this.state.cssClass};
InlineEditField.prototype.getCSSHoverClass=function(){return this.state.cssClass+"On"};
InlineEditField.createField=function(a){var b=InlineEditField.resolveSwitchableField(a),c=a[InlineEditConstants.FIELD_ID],e=InlineEditState[a[InlineEditConstants.FIELD_STATE]],d=a[InlineEditConstants.FIELD_REQUIRED],k=a[InlineEditConstants.FIELD_VALUE],g={};if(b&&b.inlineEditExtraData)for(var f=0;f<b.inlineEditExtraData.length;f++)g[b.inlineEditExtraData[f]]=a[b.inlineEditExtraData[f]];try{if(b&&b.inlineEditFieldObject&&c&&e){var h=sfdcPage.getInlineEditData(c),l=h.visualforce?c.replace(h.visualforce,
""):c,i=InlineEditField.specialFieldMappings[l];if(i)var j=i(a);return new (j?j:b.inlineEditFieldConstructor())(c,e,d,false,k,g)}}catch(m){}return null};InlineEditField.resolveSwitchableField=function(a){var b=ColumnType[a[InlineEditConstants.FIELD_TYPE]];if(b==ColumnType.SWITCHABLE_PERSONNAME)return ColumnType[a[InlineEditConstants.OVERRIDE_TYPE]];return b};
InlineEditField.specialFieldMappings={opp11:function(){if(window.OpportunityInlineEditing.OpportunityStageField)return OpportunityInlineEditing.OpportunityStageField},ForecastCategoryName:function(){if(window.OpportunityInlineEditing.OpportunityForecastingField)return OpportunityInlineEditing.OpportunityForecastingField},opp2:function(){if(window.OpportunityInlineEditing.OpportunityPrivateCheckboxField)return OpportunityInlineEditing.OpportunityPrivateCheckboxField}};
function PreferenceBits(a){this.bitsByName={};for(var c=0;c<a.length;c++){var d=a[c];this.bitsByName[d.name]={index:d.index,val:d.value}}}PreferenceBits.prototype.csrfToken=null;PreferenceBits.prototype.getBoolean=function(a){return this.bitsByName[a].val};PreferenceBits.prototype.getIndexByName=function(a){return this.bitsByName[a].index};PreferenceBits.prototype.setBoolean=function(a,c,d){if(typeof c=="boolean"){var b=this.bitsByName[a];if(b&&b.val!=c){this.bitsByName[a].val=c;this.save(a,d)}}};
PreferenceBits.prototype.save=function(a,c){var d,b=this.bitsByName[a];if(b){d={};d.csrf=PreferenceBits.prototype.csrfToken;var e={};e.val=b.val;e.bit=b.index;b={};b.headers=d;b.data=e;Sfdc.Ajax.post(UserContext.getUrl("/_ui/common/request/servlet/UserPreferencesServlet"),c||function(){},b)}};
var Animation={ANIMATION_SLAVE:"_animationEventHandler",RESIZE_HEIGHT_STEPS:8,RESIZE_HEIGHT_DELAY:20,animations:{},animateResizeHeight:function(a,b,d,e){if(a){var c,g=false;if(Animation.animations[a]){c=Animation.animations[a];c.clean()}else{c={};c.height=XBrowser.getElementStyle(a,"height");c.overflow=a.style.overflow}Animation.animations[a]=c;a.style.overflow="hidden";if(d===-1){a.style.height=b+"px";a.style.display="block";d=XBrowser.getActualHeight(a,true);g=true}var h=Animation._getLinearSeries(b,
d,Animation.RESIZE_HEIGHT_STEPS);g&&XBrowser.userAgent.isFirefox&&h.pop();var f=0;c.clean=function(){a.style.height=c.height;a.style.overflow=c.overflow;clearInterval(c.intervalHandle);Animation.animations[a]=null;e&&e()};c.stepper=function(){if(f<Animation.RESIZE_HEIGHT_STEPS){a.style.height=h[f]+"px";f++}else c.clean()};c.intervalHandle=setInterval(c.stepper,Animation.RESIZE_HEIGHT_DELAY);c.stepper()}},rollIn:function(a,b){Animation.animateResizeHeight(a,1,-1,b)},rollOut:function(a,b){a.style.display=
"block";Animation.animateResizeHeight(a,XBrowser.getActualHeight(a),1,function(){a.style.display="none";b&&b()})},rollInRollOut:function(a,b,d){Animation.rollIn(a,function(){setTimeout(function(){Animation.rollOut(a,d)},b)})},animateOpacity:function(a,b,d,e){if(a)if(!window[Animation.ANIMATION_SLAVE]){if(b<0)b=0;else if(b>100)b=100;if(d<0)d=0;else if(d>100)d=100;var c=b<d;currentOpacity=Animation.setOpacity(a,b);if(c)a.style.visibility="visible";if(b!=d){window[Animation.ANIMATION_SLAVE]=function(){if(c&&
currentOpacity>d||!c&&currentOpacity<d){window[Animation.ANIMATION_SLAVE]=false;Animation.setOpacity(a,d);if(!c&&d==0)a.style.visibility="hidden";Sfdc.Animation.clearOpacity(a);e&&e()}else{currentOpacity=c?Animation.setOpacity(a,currentOpacity+5):Animation.setOpacity(a,currentOpacity-5);setTimeout("window."+Animation.ANIMATION_SLAVE+"();",20)}};window[Animation.ANIMATION_SLAVE]()}}},fadeOut:function(a,b){Animation.animateOpacity(a,100,0,b)},fadeIn:function(a,b){Animation.animateOpacity(a,0,100,b)},
setOpacity:function(a,b){if(XBrowser.userAgent.isIE)a.style.filter="alpha(opacity="+b+")";else a.style.opacity=b/100;return b},clearOpacity:function(a){if(XBrowser.userAgent.isIE&&!Sfdc.isEmpty(a.style.filter))a.style.filter=Sfdc.String.trim(a.style.filter.replace(/alpha\(opacity=(.*)\)/i,""));else a.style.opacity=""},_getLinearSeries:function(a,b,d){ret=[];d-=1;ret.push(a);step=(b-a)/d;for(var e=0;e<d-1;e++){a+=step;ret.push(a)}ret.push(b);return ret}};
var Cookies=function(){};Cookies.prototype.getCookieVal=function(a){var b=document.cookie.indexOf(";",a);if(b==-1)b=document.cookie.length;return unescape(document.cookie.substring(a,b))};Cookies.prototype.GetCookie=function(a){a+="=";for(var b=a.length,e=document.cookie.length,c=0;c<e;){var d=c+b;if(document.cookie.substring(c,d)==a)return Cookies.prototype.getCookieVal(d);c=document.cookie.indexOf(" ",c)+1;if(c==0)break}return null};
Cookies.prototype.SetCookie=function(a,b,e,c,d,f){document.cookie=a+"="+b+(e==null?"":"; expires="+e.toGMTString())+(c==null?"":"; path="+c)+(d==null?"":"; domain="+d)+(f==true?"; secure":"")};Cookies.prototype.DeleteCookie=function(a){if(Cookies.prototype.GetCookie(a)!=null){var b=new Date;b.setTime(b.getTime()-1);Cookies.prototype.SetCookie(a,"",b,"/")}};
function DateUtil(){}DateUtil.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];DateUtil.DAY_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat"];DateUtil.LZ=function(a){return(a<0||a>9?"":"0")+a};DateUtil.isDate=function(a,c){if(DateUtil.getDateFromFormat(a,c)===0)return false;return true};
DateUtil.compareDates=function(a,c,b,g){a=DateUtil.getDateFromFormat(a,c);b=DateUtil.getDateFromFormat(b,g);if(a===0||b===0)return-1;else if(a>b)return 1;return 0};
DateUtil.formatDate=function(a,c){c+="";var b="",g=0,f="",d="";f=a.getFullYear()+"";d=a.getMonth()+1;var m=a.getDate(),n=a.getDay(),i=a.getHours(),k=a.getMinutes(),j=a.getSeconds(),e={};if(LC.isThaiTHLocale())f=f-0+LC.BUDDHIST_CAL_OFFSET+"";e.y=""+f;e.yyyy=f;e.yy=f.substring(2,4);e.M=d;e.MM=DateUtil.LZ(d);e.MMM=DateUtil.MONTH_NAMES[d-1];e.NNN=DateUtil.MONTH_NAMES[d+11];e.d=m;e.dd=DateUtil.LZ(m);e.E=DateUtil.DAY_NAMES[n+7];e.EE=DateUtil.DAY_NAMES[n];e.H=i;e.HH=DateUtil.LZ(i);e.h=i===0?12:i>12?i-12:
i;e.hh=DateUtil.LZ(e.h);e.K=i>11?i-12:i;e.k=i+1;e.KK=DateUtil.LZ(e.K);e.kk=DateUtil.LZ(e.k);e.a=i>11?DateUtil.getPMSymbol():DateUtil.getAMSymbol();e.m=k;e.mm=DateUtil.LZ(k);e.s=j;for(e.ss=DateUtil.LZ(j);g<c.length;){f=c.charAt(g);for(d="";c.charAt(g)==f&&g<c.length;)d+=c.charAt(g++);b+=Sfdc.isDefAndNotNull(e[d])?e[d]:d}return b};DateUtil._isInteger=function(a){for(var c=0;c<a.length;c++)if("1234567890".indexOf(a.charAt(c))==-1)return false;return true};
DateUtil._getInt=function(a,c,b,g){for(;g>=b;g--){var f=a.substring(c,c+g);if(f.length<b)break;if(DateUtil._isInteger(f))return f}return null};
DateUtil.getDateFromFormat=function(a,c){a+="";c+="";var b=0,g=0,f="",d="",m,n,i=new Date,k=i.getFullYear(),j=i.getMonth()+1,e=1,h=i.getHours(),o=i.getMinutes();i=i.getSeconds();for(var l="";g<c.length;){f=c.charAt(g);for(d="";c.charAt(g)==f&&g<c.length;)d+=c.charAt(g++);if(d=="yyyy"||d=="yy"||d=="y"){if(d=="yyyy"){m=2;n=4}if(d=="yy")n=m=2;if(d=="y"){m=2;n=4}k=DateUtil._getInt(a,b,m,n);if(k===null)return 0;b+=k.length;if(k.length==2)k=k>70?1900+(k-0):2E3+(k-0)}else if(d=="MMM"||d=="NNN"){for(f=j=
0;f<DateUtil.MONTH_NAMES.length;f++){var p=DateUtil.MONTH_NAMES[f];if(a.substring(b,b+p.length).toLowerCase()==p.toLowerCase())if(d=="MMM"||d=="NNN"&&f>11){j=f+1;if(j>12)j-=12;b+=p.length;break}}if(j<1||j>12)return 0}else if(d=="EE"||d=="E")for(f=0;f<DateUtil.DAY_NAMES.length;f++){d=DateUtil.DAY_NAMES[f];if(a.substring(b,b+d.length).toLowerCase()==d.toLowerCase()){b+=d.length;break}}else if(d=="MM"||d=="M"){j=DateUtil._getInt(a,b,1,2);if(j===null||j<1||j>12)return 0;b+=j.length}else if(d=="dd"||d==
"d"){e=DateUtil._getInt(a,b,1,2);if(e===null||e<1||e>31)return 0;b+=e.length}else if(d=="hh"||d=="h"){h=DateUtil._getInt(a,b,d.length,2);if(h===null||h<1||h>12)return 0;b+=h.length}else if(d=="HH"||d=="H"){h=DateUtil._getInt(a,b,d.length,2);if(h===null||h<0||h>23)return 0;b+=h.length}else if(d=="KK"||d=="K"){h=DateUtil._getInt(a,b,d.length,2);if(h===null||h<0||h>11)return 0;b+=h.length}else if(d=="kk"||d=="k"){h=DateUtil._getInt(a,b,d.length,2);if(h===null||h<1||h>24)return 0;b+=h.length;h--}else if(d==
"mm"||d=="m"){o=DateUtil._getInt(a,b,d.length,2);if(o===null||o<0||o>59)return 0;b+=o.length}else if(d=="ss"||d=="s"){i=DateUtil._getInt(a,b,d.length,2);if(i===null||i<0||i>59)return 0;b+=i.length}else if(d=="a"){l=DateUtil.getAMSymbol();d=DateUtil.getPMSymbol();f=a.substring(b,b+l.length);p=a.substring(b,b+d.length);if(!(f==l||f.toUpperCase()==l))if(p==d||p.toUpperCase()==d)l=d;else return 0;b+=l.length}else if(a.substring(b,b+d.length)!=d)return 0;else b+=d.length}if(b!=a.length)return 0;if(LC.isThaiTHLocale())k-=
LC.BUDDHIST_CAL_OFFSET;if(j==2)if(k%4===0&&k%100!==0||k%400===0){if(e>29)return 0}else if(e>28)return 0;if(j==4||j==6||j==9||j==11)if(e>30)return 0;if(h<12&&l==DateUtil.getPMSymbol())h=h-0+12;else if(h>11&&l==DateUtil.getAMSymbol())h-=12;return(new Date(k,j-1,e,h,o,i)).getTime()};
DateUtil.parseDate=function(a){var c=arguments.length==2?arguments[1]:false;generalFormats=["y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d"];monthFirst=["M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d","M.d"];dateFirst=["d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M","d.M"];c=["generalFormats",c?"dateFirst":"monthFirst",c?"monthFirst":"dateFirst"];for(var b=null,g=0;g<c.length;g++)for(var f=window[c[g]],d=0;d<f.length;d++){b=DateUtil.getDateFromFormat(a,f[d]);if(b!==0)return new Date(b)}return null};
DateUtil.getTimezoneOffset=function(){var a=new Date,c=a.getTimezoneOffset()*6E4,b=DateUtil.getTimezoneIndex(a);if(DateUtil.TIMEZONES===undefined)DateUtil.TIMEZONES=DateUtil.getTimezones(a);return DateUtil.TIMEZONES[b]+c};DateUtil.isBrowserAndSystemTimezoneSame=function(){return DateUtil.getTimezoneOffset()===0};DateUtil.getTimezoneIndex=function(a){return DateUtil.formatDate(a,"yyyyMMdd")};
DateUtil.getTimezones=function(a){a=Sfdc.Url.generateUrl(UserContext.getUrl("/home/timezones.jsp"),{ts:a.getTime()});if(a=Sfdc.Ajax.request(a,{async:false}))return eval("("+a+")");return null};DateUtil.rollDate=function(a,c){var b=new Date(a.getTime());b.setDate(b.getDate()+c);return b};DateUtil.roundDate=function(a){a=new Date(a.getTime());a.setHours(0);a.setMinutes(0);a.setSeconds(0);return a};DateUtil.getDateStringFromUserLocale=function(a){return DateUtil.formatDate(a,UserContext.dateFormat)};
DateUtil.getDateFromUserLocale=function(a){return new Date(DateUtil.getDateFromFormat(a,UserContext.dateFormat))};DateUtil.getDateTimeStringFromUserLocale=function(a){return DateUtil.formatDate(a,UserContext.dateTimeFormat)};DateUtil.getDateTimeFromUserLocale=function(a){return new Date(DateUtil.getDateFromFormat(a,UserContext.dateTimeFormat))};DateUtil.getTimeStringFromUserLocale=function(a){return DateUtil.formatDate(a,UserContext.timeFormat)};
DateUtil.getTimeFromUserLocale=function(a){return new Date(DateUtil.getDateFromFormat(a,UserContext.timeFormat))};DateUtil.getAMSymbol=function(){return UserContext.initialized?UserContext.ampm[0]:"AM"};DateUtil.getPMSymbol=function(){return UserContext.initialized?UserContext.ampm[1]:"PM"};DateUtil.is24Hour=function(a){return a.indexOf("k")>-1};DateUtil.hasAMPM=function(a){return a.indexOf("a")>-1};DateUtil.equals=function(a,c){return a&&c&&DateUtil.compare(a,c)===0};
DateUtil.lessThan=function(a,c){return DateUtil.compare(a,c)<0};DateUtil.greaterThan=function(a,c){return DateUtil.compare(a,c)>0};DateUtil.compare=function(a,c){return a.getFullYear()!=c.getFullYear()?a.getFullYear()-c.getFullYear():a.getMonth()!=c.getMonth()?a.getMonth()-c.getMonth():a.getDate()-c.getDate()};DateUtil.separators=["/","-","."];DateUtil.checkYear=function(a,c){var b=a.value.toLowerCase();if(b=DateUtil.getCheckYearValue(b)){a.value=b;if(c&&a.onchange)a.onchange()}};
DateUtil.getCheckYearValue=function(a){if(!(a&&a.length>0))return null;for(var c=null,b=0;b<DateUtil.separators.length;b++)if(a.indexOf(DateUtil.separators[b])!=-1){c=DateUtil.separators[b];break}b=DateUtil.getDateTimeFromUserLocale(UserContext.today);if(c){b.setDate(1);a=a.split(c);if(a.length==2){if(!isNaN(parseInt(a[0],10))&&!isNaN(parseInt(a[1],10))){b.setMonth(parseInt(a[0],10)-1);b.setDate(parseInt(a[1],10));return DateUtil.getDateStringFromUserLocale(b)}}else if(a.length==3)if(!isNaN(parseInt(a[2],
10))&&!isNaN(parseInt(a[0],10))&&!isNaN(parseInt(a[1],10))){var g=parseInt(a[2],10);if(g/1E3<1){b.setMonth(parseInt(a[0],10)-1);b.setDate(parseInt(a[1],10));g>=60&&g<100?b.setFullYear(g+1900):b.setFullYear(g+2E3);return DateUtil.getDateStringFromUserLocale(b)}else if(c!="/")return a[0]+"/"+a[1]+"/"+a[2]}}else return DateUtil.getEvaluateShortcutValue(a)};DateUtil.DAY_SHORTCUTS=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
DateUtil.evaluateShortcut=function(a,c){var b=a.value.toLowerCase();if(b=DateUtil.getEvaluateShortcutValue(b)){a.value=b;if(c&&a.onchange)a.onchange()}};
DateUtil.getEvaluateShortcutValue=function(a){if(!(a&&a.length>0))return null;var c=DateUtil.getDateTimeFromUserLocale(UserContext.today);if(a.indexOf("tod")===0)return DateUtil.getDateStringFromUserLocale(c);else if(a.indexOf("yes")===0){c.setDate(c.getDate()-1);return DateUtil.getDateStringFromUserLocale(c)}else if(a.indexOf("tom")===0){c.setDate(c.getDate()+1);return DateUtil.getDateStringFromUserLocale(c)}else if(a.length>=3)for(var b=0;b<DateUtil.DAY_SHORTCUTS.length;b++)if(a.indexOf(DateUtil.DAY_SHORTCUTS[b].toLowerCase())===
0){a=b-c.getDay();if(a<0)a+=7;c.setDate(c.getDate()+a);return DateUtil.getDateStringFromUserLocale(c)}return null};DateUtil.differenceInMinutes=function(a,c){var b=c.getTime()-a.getTime();return Math.round(b/6E4)};DateUtil.getDateFromValue=function(a,c){var b=c?DateUtil.getDateFromFormat(a,UserContext.dateTimeFormat):DateUtil.getDateFromFormat(a,UserContext.dateFormat);if(b!==0)return new Date(b);return null};
function DomUtil(){}DomUtil.importNode=function(a,b){if(a)if(b.importNode)return b.importNode(a,false);else{for(var e=b.createElement(a.tagName),c=0;c<a.attributes.length;c++)a.attributes[c].specified&&e.setAttribute(a.attributes[c].name,a.attributes[c].value);return e}else Gack.sendGack("invalid Node")};
DomUtil.copyScripts=function(a,b,e,c){b=b.body.parentNode.firstChild;a=a.getElementsByTagName("SCRIPT");for(var f=b.getElementsByTagName("SCRIPT"),d=a.length,j={},k=function(){typeof c==="function"&&--d===0&&c()},g=0;g<f.length;g++)j[f[g].src]=true;for(var h=0;h<a.length;h++){g=a[h];f=false;if(g.src&&e)for(var i=0;i<e.length;i++){if(g.src.indexOf(e[i])!==-1){f=true;d--;break}}else d--;if(!f&&g.src)if(j[g.src])c&&--d===0&&c();else XBrowser.createDynamicScript(g.src,k,b)}};
DomUtil.copyCSS=function(a,b,e){for(var c=b.body.parentNode.firstChild,f=0,d;f<a.styleSheets.length;f++){d=a.styleSheets[f];d=d.ownerNode?DomUtil.importNode(d.ownerNode,b):DomUtil.importNode(d.owningElement,b);if(e&&d.href&&d.href.replace)d.href=d.href.replace("/sCSS/","/sCSS"+e+"/");c.appendChild(d)}};DomUtil.copyScriptsCssBodyClass=function(a,b,e,c){DomUtil.copyCSS(a,b);DomUtil.copyScripts(a,b,e,c);b.body.className=a.body.className};
DomUtil.setHelpLink=function(a,b,e,c){if(e&&c)b=UserContext.getUrl("/help/doc/user_ed.jsp?loc=help&target=")+e+"&section="+c;if(a=Sfdc.get(".helpLink",a))if((a=a.parentNode)&&a.href&&a.href.indexOf("openPopupFocusEscapePounds")>0)a.href=a.href.replace(/'.*?'/,"'"+b+"'")};
function Map(){this.size=0;this.map={}}Map.prototype.put=function(a,b){if(!(!a||typeof b=="undefined")){a in this.map||this.size++;this.map[a]=b}};Map.prototype.remove=function(a){if(a in this.map){delete this.map[a];this.size--}};Map.prototype.get=function(a){return this.map[a]};Map.prototype.getSize=function(){return this.size};Map.prototype.containsKey=function(a){return this.get(a)!=null};Map.prototype.each=function(a){for(var b in this.map)a(b)};
var UrlMap=new function(){this.urlMap=[];this.urlMap.EventTeamView=UserContext.getUrl("/appex/calendar/cal.jsp");this.urlMap.Login=UserContext.getUrl("/secur/login_page.jsp");this.urlMap.Home=UserContext.getUrl("/home/home.jsp");this.urlMap.Inviter=UserContext.getUrl("/email/inviter.jsp");this.urlMap.ComboBox=UserContext.getUrl("/widg/combobox.jsp");this.urlMap.EmailAuthorPopupCloser=UserContext.getUrl("/email/author/popupcloser.jsp");this.urlMap.BlankPage=UserContext.getUrl("/blank.html");this.getURL=
function(b){return this.urlMap[b]};this.convertClassNameToUrl=function(b,c){var a=new String(UserContext.getUrl("/")),d=new String(b);if(d.indexOf(JSPDispatcher.STANDARD_PACKAGE+".")!=0)a=a.concat(JSPDispatcher.NONSTANDARD_PACKAGE_PREFIX);a=a.concat(d.replace(/\./g,"/"));if(c!=null)a=a.concat(c.toString());return a.valueOf()}};
var XBrowser={userAgent:function(){var a=navigator.userAgent,b=a.indexOf("AppleWebKit")!=-1,c=b&&a.indexOf("Chrome/")!=-1,d=b&&!c,e=a.indexOf("Firefox/")!=-1,f=a.indexOf("MSIE 8")!=-1,g=a.indexOf("MSIE 7")!=-1&&!f&&a.indexOf("Trident/5")==-1;return{isIE:a.indexOf("MSIE")!=-1,isIE10:a.indexOf("MSIE 10")!=-1,isIE9:a.indexOf("MSIE 9")!=-1,isIE8:f,isIE7:g,isIE6:a.indexOf("MSIE 6")!=-1&&!f&&!g,isWebkit:b,isChrome:c,isChromeFrame:c&&typeof window.externalHost!="undefined",isSafari:b&&!c,isSafari3:d&&a.indexOf("Version/3")!=
-1,isFirefox:e,isFirefox4Plus:e&&a.indexOf("Firefox/3")==-1,isOpera:a.indexOf("Opera")!=-1,isNetscape:a.indexOf("Netscape/")!=-1,isIpadSafari:b&&a.indexOf("iPad")!=-1}}(),dashify:function(a){return a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},getCurrentStyle:function(a,b){if(a.currentStyle)return a.currentStyle[b];else if(document.defaultView&&document.defaultView.getComputedStyle)return document.defaultView.getComputedStyle(a,null).getPropertyValue(XBrowser.dashify(b));return null},getElementStyle:function(a,
b){if(a.currentStyle)return a.currentStyle[b];else if(a.style.getPropertyValue)return a.style.getPropertyValue(b);return null},getActualHeight:function(a,b){var c=/.*px$/,d=b?a.scrollHeight:a.offsetHeight,e=XBrowser.getCurrentStyle(a,"paddingTop"),f=XBrowser.getCurrentStyle(a,"paddingBottom");if(!c.exec(e)||!c.exec(f))return d;e=e.substring(0,e.length-2);f=f.substring(0,f.length-2);return d-e-f},createHttpRequest:function(){if(window.XMLHttpRequest)return new XMLHttpRequest;else if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}return null},
getHttpResponse:function(a,b,c,d,e,f){var g=XBrowser.createHttpRequest();g.open(d||"GET",a,true);g.onreadystatechange=!b&&!c?function(){}:function(){if(g.readyState==4)if(g.status==200&&b)b.call(f,g);else c&&c.call(f,g)};e&&d=="POST"&&g.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-13");g.send(e);return g},postHttpResponse:function(a,b,c,d,e){return XBrowser.getHttpResponse(a,b,d,"POST",c,e)},buildPost:function(a){var b=[],c=true,d;for(d in a){c||b.push("&");
c=false;if(a[d]instanceof Array){var e=a[d];if(e.length===0){b.push(d);b.push("=")}else for(var f=0;f<e.length;f++){f>0&&b.push("&");b.push(d);b.push("=");b.push(encodeURIComponent(e[f]))}}else{b.push(d);b.push("=");b.push(encodeURIComponent(a[d]))}}return b.join("")},createDynamicScript:function(a,b,c){c=c||document.body;var d=c.ownerDocument.createElement("script");if(b)if(window.ActiveXObject)d.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded"){b();d.onreadystatechange=
function(){}}};else d.onload=b;d.type="text/javascript";d.src=a;c.appendChild(d)},turnOnBackgroundImageCache:function(){try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}},fireEvent:function(a,b){if(document.createEvent&&a.dispatchEvent){var c=document.createEvent("HTMLEvents");c.initEvent(b,true,true);return a.dispatchEvent(c)}else return document.createEventObject&&a.fireEvent?a.fireEvent("on"+b,document.createEventObject()):null},preventDefaultEvent:function(a){a=a.browserEvent||
a;if(a.preventDefault)a.preventDefault();else a.returnValue=false}};if(!window.Node)var Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};
var dpdLkUtil={scrapePage:function(a,c){for(var d=[sfdcPage.getEntityId(c)],b=0;b<a.length;b++)if(a[b]&&a[b].length>0){var e=sfdcPage.getFieldValueById(a[b]);d.push(typeof e=="string"?e.replace("\u00a0"," "):e)}else d.push(undefined);return d},serialize:function(a,c){return Sfdc.JSON.stringify(dpdLkUtil.scrapePage(a,c))}};
var isIE=navigator.appVersion.indexOf("MSIE")!=-1?true:false,isWin=navigator.appVersion.toLowerCase().indexOf("win")!=-1?true:false,isOpera=navigator.userAgent.indexOf("Opera")!=-1?true:false,isIPad=navigator.userAgent.indexOf("iPad")!=-1?true:false,isIPhone=navigator.userAgent.indexOf("iPhone")!=-1?true:false;
function controlVersion(){var a,c;try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=c.GetVariable("$version")}catch(g){}if(!a)try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";c.AllowScriptAccess="always";a=c.GetVariable("$version")}catch(d){}if(!a)try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=c.GetVariable("$version")}catch(b){}if(!a)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(e){}if(!a)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
a="WIN 2,0,0,11"}catch(f){a=-1}return a}
function getSwfVer(){var a=-1;if(navigator.plugins!==null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){a=navigator.plugins["Shockwave Flash"+(navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"")].description.split(" ");var c=a[2].split("."),g=c[0];c=c[1];var d=a[3];if(d==="")d=a[4];if(d[0]=="d")d=d.substring(1);else if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0)d=d.substring(0,d.indexOf("d"))}a=g+"."+c+"."+d}}else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=
-1)a=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)a=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)a=2;else if(isIE&&isWin&&!isOpera)a=controlVersion();return a}
function detectFlashVer(a,c,g){versionStr=getSwfVer();if(versionStr==-1)return false;else if(versionStr!==0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else versionArray=versionStr.split(".");var d=versionArray[0],b=versionArray[1],e=versionArray[2];if(d>parseFloat(a))return true;else if(d==parseFloat(a))if(b>parseFloat(c))return true;else if(b==parseFloat(c))if(e>=parseFloat(g))return true;return false}}
function ac_AddExtension(a,c){return a.indexOf("?")!=-1?a.replace(/\?/,c+"?"):a+c}
function ac_Generateobj(a,c,g,d){var b="",e;if(isIE&&isWin&&!isOpera){b+="<object ";for(e in c)if(e!="parent")b+=e+'="'+c[e]+'" ';b+=">";for(e in g)if(g.hasOwnProperty(e))b+='<param name="'+e+'" value="'+g[e]+'" /> ';b+="<p>"+LC.getLabel("ContentFlashPlayer","flashFilePreview")+"</p></object>"}else{b+="<embed ";for(e in d)if(d.hasOwnProperty(e))if(typeof d[e]!="function")b+=e+'="'+d[e]+'" ';b+="><noembed><p>"+LC.getLabel("ContentFlashPlayer","flashFilePreview")+"</p></noembed></embed>"}a.innerHTML=
b}
function ac_GetArgs(a,c,g,d,b){var e={};e.embedAttrs={};e.params={};e.objAttrs={};for(var f=0;f<a.length;f+=2)switch(a[f].toLowerCase()){case "parent":e.parent=a[f+1];break;case "classid":break;case "pluginspage":e.embedAttrs[a[f]]=a[f+1];break;case "src":case "movie":a[f+1]=ac_AddExtension(a[f+1],c);e.embedAttrs.src=a[f+1];e.params[g]=a[f+1];break;case "onafterupdate":case "onbeforeupdate":case "onblur":case "oncellchange":case "onclick":case "ondblClick":case "ondrag":case "ondragend":case "ondragenter":case "ondragleave":case "ondragover":case "ondrop":case "onfinish":case "onfocus":case "onhelp":case "onmousedown":case "onmouseup":case "onmouseover":case "onmousemove":case "onmouseout":case "onkeypress":case "onkeydown":case "onkeyup":case "onload":case "onlosecapture":case "onpropertychange":case "onreadystatechange":case "onrowsdelete":case "onrowenter":case "onrowexit":case "onrowsinserted":case "onstart":case "onscroll":case "onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "type":case "codebase":e.objAttrs[a[f]]=a[f+
1];break;case "id":case "width":case "height":case "align":case "vspace":case "hspace":case "class":case "title":case "accesskey":case "name":case "tabindex":e.embedAttrs[a[f]]=e.objAttrs[a[f]]=a[f+1];break;default:e.embedAttrs[a[f]]=e.params[a[f]]=a[f+1]}e.objAttrs.classid=d;if(b)e.embedAttrs.type=b;return e}
function ac_FL_RunContent(){var a=ac_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");ac_Generateobj(a.parent,a.objAttrs,a.params,a.embedAttrs)}function getFlexRoot(a){return navigator.appName.indexOf("Microsoft")!=-1?window[a]:document[a]}
function sizeImagePreview(a,c,g,d){var b=document.getElementById(a),e=b.height/b.width,f="0px";if(b.width>=c&&e<=g/c){b.width=c;b.height=b.width*e}else if(b.height>=g){b.height=g;b.width=b.height/e}if(b.height<g)f=(g-b.height)*0.45+"px";b.style.marginTop=f;if(d)Ext.fly(a).removeClass(d);else Ext.fly(a).dom.style.display="block"}function onPreviewSuccess(a,c,g,d){sizeImagePreview(a,c,g,d);if(a=Ext.fly("fullPreviewNotSupported"))a.dom.style.display="block"}
function showPreviewError(a){a=Ext.fly(a).parent("div");if(a.dom.id=="chatterFileViewerPanel"){a.dom.innerHTML=previewErrorHtml;a.child("div").dom.style.display="block"}else{var c=LC.getLabel("ChatterFileListPage","noPreviewOnDevice");a.dom.innerHTML='<table style="font-size:1.2em;font-weight:bold;width:100%;height:100%"><tr><td style="text-align:center;vertical-align:middle;"></td></tr></table>';a.child("td").dom.innerHTML=c}if(a=Ext.fly("fullPreviewNotSupported"))a.dom.style.display="none"}
function doIPadIPhonePreview(a,c,g,d,b,e,f,j,k,l,h){var i;d=g.split("&");for(b=0;b<d.length;b++)if(d[b].indexOf("v=")===0)i=d[b].substring(2);c=UserContext.getUrl("/sfc/servlet.shepherd/version/download/"+i+"?asPdf=true");i=UserContext.getUrl("/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId="+i);d=a.clientWidth;b=a.clientHeight-30;previewErrorHtml=a.innerHTML;i='<div style="'+("width:"+d+"px; height:"+b+"px;")+'"><a href="'+c+'"><img onerror="showPreviewError(this)" onload="onPreviewSuccess(\'imageRendition\', \''+
d+"', '"+b+'\')" id="imageRendition" style="display:none;margin:auto;" src="'+i+'"/></a></div>';d=null;b=false;if(h&&h.fileType){d=h.fileType;b=h.isImage}h="";if(!b){b=null;if(d!==null)b=escapeHTML(LC.getLabel("ContentDownloadLinkElement","downloadFeedPost"," "+d));h='<div id="fullPreviewNotSupported" style="display:none"><table cellpadding="0" cellspacing="0" class="fullPreviewNotSupported"><tr><td class="iconCell"><img class="warningIcon" width="1" height="1" alt="" src="/img/s.gif"/></td><td class="textCell">'+
escapeHTML(LC.getLabel("ChatterFileListPage","fullPreviewNotSupported"))+"</td>";if(b!==null)h+=' <td><div class="download"><a class="actionLink" href="'+c+'"><img width="1" height="1" title="'+b+'" class="downloadIcon" alt="" src="/img/s.gif"/><span class="actionLabel">'+b+"</span></a></div></td>";h+="</tr></table></div>"}a.innerHTML=i+h}
function insertFlexComponent(a,c,g,d,b,e,f,j,k,l){var h=typeof e=="string"?document.getElementById(e):e;if(isIPad||isIPhone)doIPadIPhonePreview(h,a,c,g,d,b,e,f,j,k,l);else{e=detectFlashVer(6,0,65);j=detectFlashVer(9,0,115);if(e&&!j)showDownloadLink(h,k);else j?ac_FL_RunContent("src",a,"FlashVars",c,"width",g,"height",d,"align","middle","id",f,"quality","high","bgcolor",b,"name",f,"allowScriptAccess","sameDomain","allowFullScreen","true","type","application/x-shockwave-flash","pluginspage","http://www.adobe.com/go/getflashplayer",
"wmode","opaque","parent",h):showDownloadLink(h,k)}}
function showDownloadLink(a,c){if(typeof Ext!="undefined"&&typeof Shepherd!="undefined"){var g=new Ext.Element(Ext.getDom("container_bubble"));g.setSize(500,100);g.center();Shepherd.getHelper("bubble").getBubble().wrapper.style.top=Position.realOffset($("body_content"))[1]+50;new Ext.Panel({id:"noFlashPanel",border:false,buttonAlign:"center",renderTo:a,frame:false,bodyStyle:"text-align:center;margin-bottom:20px;",html:c.adobeFlashVersionLbl,buttons:[new Ext.Button({text:c.downloadAdobeLbl,handler:function(){window.open("http://www.adobe.com/go/getflashplayer")}}),
new Ext.Button({text:c.closeDialogLbl,hidden:!Ext.fly(a).up("div#container_bubble"),handler:function(){Shepherd.run("bubble","hide")}})]})}else a.innerHTML="<font style='text-align:center' color='#000'>"+c.adobeFlashVersionLbl+" "+c.downloadAdobeLinkLbl+"<br/><a href='http://www.adobe.com/go/getflashplayer' target='_blank'>http://www.adobe.com/go/getflashplayer</a></font>"}
function closeContentPreviewDialog(){var a;if(window.dialog&&window.dialog.id==="docViewerOverlay")window.dialog.hide();else if(sfdcPage)(a=sfdcPage.getDialogById("docViewerOverlay"))&&a.hide()};
function Attachments(){}var hasPendingAttachments=false;function addPendingAttachment(a){document.getElementById(Activity.pNEW_ATTACHMENTS).value=document.getElementById(Activity.pNEW_ATTACHMENTS).value+a+",";hasPendingAttachments=true;displayAttachmentWarning(true)}
function removePendingAttachment(a,d){var b=document.getElementById(Activity.pNEW_ATTACHMENTS);if(b){var c=new String(b.value);b.value=c.replace(a+",","");(hasPendingAttachments=b.value.length>=15)||displayAttachmentWarning(false);b=null;if(c=document.getElementById(Activity.pNEW_ATTACHMENTS))b=Array(c.id);var e=sfdcPage.getRelatedListById(d);if(e)e.refresh(b,c?Array(c.value):null)}}
function displayAttachmentWarning(a){var d=document.getElementById(Activity.pATT_WARNING);if(d)d.style.display=a?"block":"none"}function activityBodyOnLoad(a,d){window.opener.addPendingAttachment(a);var b=null,c=window.opener.document.getElementById(Activity.pNEW_ATTACHMENTS);if(c)b=Array(c.id);var e=window.opener.sfdcPage.getRelatedListById(d);if(e)e.refresh(b,c?Array(c.value):null)}
Attachments.prototype.promoteAttachments=function(a,d,b,c){var e=null;if(a&&d&&(b||c)){var f=new QueryString("");f.add("sid",a);f.add("pid",d);f.add("att",b);c&&f.add("check","1");a=UserContext.getUrl("/servlet/promoteAtt")+f.toString();if(a=Sfdc.Ajax.request(a,{async:false}))e=eval("("+a+")")}return e};
var CSNWelcomeMessageElement={close:function(){UserContext.userPreferences.setBoolean("HideCSNWelcomeMessage",true);document.getElementById(CSNWelcomeMessage.DOM_ID).style.display="none"}};
function EmailAddrEdit(){}EmailAddrEdit.prototype.changeToCancelRetURL=function(){var a=new QueryString("");a.add(EmailAddrEditConstants.pSAVE_CANCEL,"true");document.editPage.elements.retURL.value=UrlMap.getURL("EmailAuthorPopupCloser")+a.toString()};
function EmailCCBccLookup(){}EmailCCBccLookup.prototype.storeAddrs=function(a,b,c,g){b.value="";c.value="";if(Sfdc.isDefAndNotNull(a))for(var f=true,d=0,e;d<a.length;d++)if((e=a.options[d])&&e.value!==""&&e.value!==g){if(f)f=false;else{b.value+=EmailAuthorConstants.EMAIL_ADDR_DELIM;c.value+=EmailAuthorConstants.EMAIL_ADDR_DELIM}b.value+=a.options[d].text;c.value+=a.options[d].value}};
EmailCCBccLookup.prototype.storeAllAddresses=function(a){EmailCCBccLookup.prototype.storeAddrs(document.getElementById(EmailCCBccLookupConstants.ADDITIONAL_TO_ID),document.getElementById(EmailCCBccLookupConstants.ADDITIONAL_TO_NAME_ID),document.getElementById(EmailCCBccLookupConstants.ADDITIONAL_TO_ADDR_ID),a);EmailCCBccLookup.prototype.storeAddrs(document.getElementById(EmailCCBccLookupConstants.CC_ID),document.getElementById(EmailCCBccLookupConstants.CC_NAME_ID),document.getElementById(EmailCCBccLookupConstants.CC_ADDR_ID),
a);EmailCCBccLookup.prototype.storeAddrs(document.getElementById(EmailCCBccLookupConstants.BCC_ID),document.getElementById(EmailCCBccLookupConstants.BCC_NAME_ID),document.getElementById(EmailCCBccLookupConstants.BCC_ADDR_ID),a)};EmailCCBccLookup.prototype.changeContactType=function(a){EmailCCBccLookup.prototype.storeAllAddresses(a);document.forms[EditPageConstants.pEDIT_PAGE].submit();return true};
EmailCCBccLookup.prototype.sizeToContent=function(){for(var a,b,c=0;c<5;c++){if(document.height)a=document.height;else if(document.body.offsetHeight)a=document.body.offsetHeight;else break;b=window.innerHeight?window.innerHeight:document.documentElement.clientHeight&&document.documentElement.clientHeight>0?document.documentElement.clientHeight:document.body.clientHeight;if(a>b&&window.resizeBy)window.resizeBy(0,a-b);else break}};
function MailmergeTemplateSelectElement(b,a,c){this.id=b;this.items=a;this.fileDownloadUrl=c;var d=this;sfdcPage.appendToOnloadQueue(function(){d.init()})}
MailmergeTemplateSelectElement.prototype.init=function(){var b=document.getElementById(this.id),a=this,c=document.getElementById(MailmergeTemplateSelectElementConst.TEMPLATE_VIEW_BUTTON+"_"+this.id);c&&addEvent(c,"mouseup",function(){MailmergeTemplateSelectElement.showPreview(a.fileDownloadUrl,b)},false);addEvent(b,"mousemove",function(){MailmergeTemplateSelectElement.showDetails(a.id,b,a.items)},false);addEvent(b,"change",function(){MailmergeTemplateSelectElement.showDetails(a.id,b,a.items)},false);
MailmergeTemplateSelectElement.showDetails(a.id,b,a.items)};
MailmergeTemplateSelectElement.showDetails=function(b,a,c){if(!(a.selectedIndex<0)){a=(a=a.options[a.selectedIndex])?c[a.value]:null;if(a!=null){c=a[MailmergeTemplateSelectElementConst.TEMPLATE_TITLE];a=a[MailmergeTemplateSelectElementConst.TEMPLATE_DESCRIPTION];document.getElementById(MailmergeTemplateSelectElementConst.TEMPLATE_TITLE+"_"+b).innerHTML=c;document.getElementById(MailmergeTemplateSelectElementConst.TEMPLATE_DESCRIPTION+"_"+b).innerHTML=a}}};
MailmergeTemplateSelectElement.showPreview=function(b,a){a.selectedIndex<0||window.open(b+"?file="+a.options[a.selectedIndex].value,"_blank")};
var CustomObjectTeamMemberPage={};CustomObjectTeamMemberPage.getMemberRow=function(a){return document.getElementById(CustomObjectTeamMemberUiConstants.MEMBERS_TABLE_ROW_PREFIX+a)};
CustomObjectTeamMemberPage.initializeRoles=function(){for(var a=parseInt(document.getElementById(CustomObjectTeamMemberUiConstants.pMEMBERS_COUNT).value),b=0;b<a;b++){CustomObjectTeamMemberPage.roleChangeHandler(b);var e=document.getElementById(CustomObjectTeamMemberUiConstants.pREMOVED_MEMBERS_PREFIX+b);if(e.value=="1")CustomObjectTeamMemberPage.getMemberRow(b).style.display="none"}a=parseInt(document.getElementById(CustomObjectTeamMemberUiConstants.pTEAM_RECORDS_COUNT).value);for(b=0;b<a;b++){e=
document.getElementById(CustomObjectTeamMemberUiConstants.pREMOVED_TEAMS_PREFIX+b);if(e.value=="1")CustomObjectTeamMemberPage.getTeamRecordRow(b).style.display="none"}};
CustomObjectTeamMemberPage.roleChangeHandler=function(a){var b=document.getElementById(CustomObjectTeamMemberUiConstants.pROLE_PREFIX+a),e=document.getElementById(CustomObjectTeamMemberUiConstants.pSHARE_ACCESS_PREFIX+a);a=document.getElementById(CustomObjectTeamMemberUiConstants.pCSP_PORTAL_PREFIX+a);b=b.options[b.selectedIndex].value;if(b==""){e.innerHTML="";a.innerHTML=""}else{e.innerHTML=document.getElementById(CustomObjectTeamMemberUiConstants.pSHARE_ACCESS_PREFIX+b).value;a.innerHTML=document.getElementById(CustomObjectTeamMemberUiConstants.pCSP_PORTAL_PREFIX+
b).innerHTML}};
CustomObjectTeamMemberPage.addMemberRow=function(a,b,e,g){var c=document.getElementById(CustomObjectTeamMemberUiConstants.pMEMBERS_COUNT),d=parseInt(c.value);c.value=d+1;c=document.createElement("tr");c.id=CustomObjectTeamMemberUiConstants.MEMBERS_TABLE_ROW_PREFIX+d;var f=document.createElement("a");f.className="actionLink";f.innerHTML=e;f.href="javascript:CustomObjectTeamMemberPage.removeMemberRow("+d+");";f.title=LC.getLabel("Page_CustomObjectTeamMember","RemoveTeamMember",d+1);e=document.createElement("td");
e.className="actionColumn";e.appendChild(f);c.appendChild(e);e="new_tm_"+d;f=document.createElement("td");f.id=e;c.appendChild(f);f=document.createElement("select");f.id=CustomObjectTeamMemberUiConstants.pROLE_PREFIX+d;f.name=CustomObjectTeamMemberUiConstants.pROLE_PREFIX+d;f.title=LC.getLabel("Page_CustomObjectTeamMember","TeamMemberRowRole",d+1);var h;for(h=0;h<a.length;h+=1){var i=document.createElement("option");i.innerHTML=a[h][0];i.value=a[h][1];f.appendChild(i)}a=document.createElement("td");
a.appendChild(f);c.appendChild(a);a=document.createElement("td");a.id=CustomObjectTeamMemberUiConstants.pSHARE_ACCESS_PREFIX+d;c.appendChild(a);a=document.createElement("td");a.className="booleanColumn";a.id=CustomObjectTeamMemberUiConstants.pCSP_PORTAL_PREFIX+d;c.appendChild(a);f.onchange=function(){CustomObjectTeamMemberPage.roleChangeHandler(d)};document.getElementById(CustomObjectTeamMemberUiConstants.MEMBERS_TABLE).firstChild.appendChild(c);c=document.createElement("input");c.id=CustomObjectTeamMemberUiConstants.pREMOVED_MEMBERS_PREFIX+
d;c.name=c.id;document.getElementById(CustomObjectTeamMemberUiConstants.REMOVED_MEMBERS_CONTAINER).appendChild(c);b=new ForeignKeyField(CustomObjectTeamMemberUiConstants.pMEMBER_PREFIX+d,true,false,false,["",""],{domain:b,useNewLookups:false});b.tableCell={previousSibling:{nodeType:Node.TEXT_NODE,nodeValue:g}};b.editDiv=document.getElementById(e);b.createEditElements();document.getElementById(b.id).title=LC.getLabel("Page_CustomObjectTeamMember","TeamMemberRowName",d+1);document.getElementById(b.getComponentId(ForeignKeyField.MULTIDOMAIN)).title=
LC.getLabel("Page_CustomObjectTeamMember","TeamMemberRowType",d+1)};CustomObjectTeamMemberPage.removeMemberRow=function(a){CustomObjectTeamMemberPage.getMemberRow(a).style.display="none";document.getElementById(CustomObjectTeamMemberUiConstants.pREMOVED_MEMBERS_PREFIX+a).value="1"};CustomObjectTeamMemberPage.getTeamRecordRow=function(a){return document.getElementById(CustomObjectTeamMemberUiConstants.TEAMS_TABLE_ROW_PREFIX+a)};
CustomObjectTeamMemberPage.addTeamRecordRow=function(a,b,e){var g=document.getElementById(CustomObjectTeamMemberUiConstants.pTEAM_RECORDS_COUNT),c=parseInt(g.value);g.value=c+1;g=document.createElement("tr");g.id=CustomObjectTeamMemberUiConstants.TEAMS_TABLE_ROW_PREFIX+c;var d=document.createElement("a");d.className="actionLink";d.innerHTML=b;d.href="javascript:CustomObjectTeamMemberPage.removeTeamRecordRow("+c+");";d.title=LC.getLabel("Page_CustomObjectTeamMember","RemoveCaseTeamRow",c+1);b=document.createElement("td");
b.className="actionColumn";b.appendChild(d);g.appendChild(b);b="new_tt_"+c;d=document.createElement("td");d.id=b;g.appendChild(d);document.getElementById(CustomObjectTeamMemberUiConstants.TEAMS_TABLE).firstChild.appendChild(g);g=document.createElement("input");g.id=CustomObjectTeamMemberUiConstants.pREMOVED_TEAMS_PREFIX+c;g.name=g.id;document.getElementById(CustomObjectTeamMemberUiConstants.REMOVED_TEAMS_CONTAINER).appendChild(g);a=new ForeignKeyField(CustomObjectTeamMemberUiConstants.pTEAM_RECORD_PREFIX+
c,true,false,false,["",""],{domain:a,useNewLookups:false});a.tableCell={previousSibling:{nodeType:Node.TEXT_NODE,nodeValue:e}};a.editDiv=document.getElementById(b);a.createEditElements();document.getElementById(a.id).title=LC.getLabel("Page_CustomObjectTeamMember","CaseTeamRow",c+1)};
CustomObjectTeamMemberPage.removeTeamRecordRow=function(a){CustomObjectTeamMemberPage.getTeamRecordRow(a).style.display="none";document.getElementById(CustomObjectTeamMemberUiConstants.pREMOVED_TEAMS_PREFIX+a).value="1"};
var CustomObjectTeamTemplatePage={};CustomObjectTeamTemplatePage.getMemberRow=function(b){return document.getElementById(CustomObjectTeamTemplateUiConstants.pSHARE_ACCESS_PREFIX+b).parentNode};
CustomObjectTeamTemplatePage.initializeRoles=function(){for(var b=parseInt(document.getElementById(CustomObjectTeamTemplateUiConstants.pMEMBERS_COUNT).value),d=0;d<b;d++){CustomObjectTeamTemplatePage.roleChangeHandler(d);if(document.getElementById(CustomObjectTeamTemplateUiConstants.pREMOVED_PREFIX+d).value=="1")CustomObjectTeamTemplatePage.getMemberRow(d).style.display="none"}};
CustomObjectTeamTemplatePage.roleChangeHandler=function(b){var d=document.getElementById(CustomObjectTeamTemplateUiConstants.pROLE_PREFIX+b),c=document.getElementById(CustomObjectTeamTemplateUiConstants.pSHARE_ACCESS_PREFIX+b);b=document.getElementById(CustomObjectTeamTemplateUiConstants.pCSP_PORTAL_PREFIX+b);d=d.options[d.selectedIndex].value;if(d==""){c.innerHTML="";b.innerHTML=""}else{c.innerHTML=document.getElementById(CustomObjectTeamTemplateUiConstants.pSHARE_ACCESS_PREFIX+d).value;b.innerHTML=
document.getElementById(CustomObjectTeamTemplateUiConstants.pCSP_PORTAL_PREFIX+d).innerHTML}};
CustomObjectTeamTemplatePage.addMemberRow=function(b,d){var c=CustomObjectTeamTemplatePage.ALL_ROLES,a=document.getElementById(CustomObjectTeamTemplateUiConstants.pMEMBERS_COUNT),f=parseInt(a.value);a.value=f+1;a=document.createElement("tr");var g=document.createElement("a");g.className="actionLink";g.innerHTML=d;g.href="javascript:CustomObjectTeamTemplatePage.removeMemberRow("+f+");";var e=document.createElement("td");e.className="actionColumn";e.appendChild(g);a.appendChild(e);g="new_tm_"+f;e=document.createElement("td");
e.id=g;a.appendChild(e);e=document.createElement("select");e.id=CustomObjectTeamTemplateUiConstants.pROLE_PREFIX+f;e.name=CustomObjectTeamTemplateUiConstants.pROLE_PREFIX+f;var h;for(h=0;h<c.length;h+=1){var i=document.createElement("option");i.innerHTML=c[h][0];i.value=c[h][1];e.appendChild(i)}c=document.createElement("td");c.appendChild(e);a.appendChild(c);c=document.createElement("td");c.id=CustomObjectTeamTemplateUiConstants.pSHARE_ACCESS_PREFIX+f;a.appendChild(c);c=document.createElement("td");
c.className="booleanColumn";c.id=CustomObjectTeamTemplateUiConstants.pCSP_PORTAL_PREFIX+f;a.appendChild(c);e.onchange=function(){CustomObjectTeamTemplatePage.roleChangeHandler(f)};document.getElementById("tm_t").firstChild.appendChild(a);a=document.createElement("input");a.id=CustomObjectTeamTemplateUiConstants.pREMOVED_PREFIX+f;a.name=a.id;document.getElementById(CustomObjectTeamTemplateUiConstants.REMOVED_CONTAINER).appendChild(a);a=new ForeignKeyField(CustomObjectTeamTemplateUiConstants.pMEMBER_PREFIX+
f,true,false,false,["",""],{domain:b,useNewLookups:false});a.tableCell={previousSibling:{nodeType:Node.TEXT_NODE,nodeValue:"node"}};a.editDiv=document.getElementById(g);a.createEditElements()};
CustomObjectTeamTemplatePage.removeMemberRow=function(b){document.getElementById(CustomObjectTeamTemplateUiConstants.pMEMBER_PREFIX+b).value=document.getElementById(CustomObjectTeamTemplateUiConstants.pMEMBER_PREFIX+b+EditElement.pOLD_NAME_SUFFIX).value;CustomObjectTeamTemplatePage.getMemberRow(b).style.display="none";document.getElementById(CustomObjectTeamTemplateUiConstants.pREMOVED_PREFIX+b).value="1"};
var KEY_BACKSPACE=8,KEY_TAB=9,KEY_ENTER=13,KEY_ESC=27,KEY_SPACE=32,KEY_PAGEDOWN=33,KEY_PAGEUP=34,KEY_ARROW_L=37,KEY_ARROW_U=38,KEY_ARROW_R=39,KEY_ARROW_D=40,KEY_SHIFT=16,KEY_CTRL=17,KEY_ALT=18,KEY_CAPSLOCK=20,KEY_0=48,KEY_1=49,KEY_2=50,KEY_3=51,KEY_4=52,KEY_5=53,KEY_6=54,KEY_7=55,KEY_8=56,KEY_9=57,KEY_A=65,KEY_B=66,KEY_C=67,KEY_D=68,KEY_E=69,KEY_F=70,KEY_G=71,KEY_H=72,KEY_I=73,KEY_J=74,KEY_K=75,KEY_L=76,KEY_M=77,KEY_N=78,KEY_O=79,KEY_P=80,KEY_Q=81,KEY_R=82,KEY_S=83,KEY_T=84,KEY_U=85,KEY_V=86,KEY_W=
87,KEY_X=88,KEY_Y=89,KEY_Z=90,KEY_WINDOWS_L=91,KEY_WINDOWS_R=92,KEY_SELECT=93,KEY_NUMPAD_0=96,KEY_NUMPAD_1=97,KEY_NUMPAD_2=98,KEY_NUMPAD_3=99,KEY_NUMPAD_4=100,KEY_NUMPAD_5=101,KEY_NUMPAD_6=102,KEY_NUMPAD_7=103,KEY_NUMPAD_8=104,KEY_NUMPAD_9=105,KEY_NUMPAD_MULTIPLY=106,KEY_NUMPAD_PLUS=107,KEY_NUMPAD_MINUS=109,KEY_NUMPAD_DECIMAL=110,KEY_NUMPAD_DIVIDE=111,KEY_F1=112,KEY_F2=113,KEY_F3=114,KEY_F4=115,KEY_F5=116,KEY_F6=117,KEY_F7=118,KEY_F8=119,KEY_F9=120,KEY_F10=121,KEY_F11=122,KEY_F12=123,KEY_PAUSE=19,
KEY_END=35,KEY_HOME=36,KEY_INSERT=45,KEY_DELETE=46,KEY_NUMLOCK=144,KEY_SCROLLLOCK=145,KEY_SEMICOLON=XBrowser.userAgent.isFirefox?59:186,KEY_EQUALS=61,KEY_COMMA=188,KEY_DASH=109,KEY_PERIOD=190,KEY_FORWARDSLASH=191,KEY_GRAVE=192,KEY_OPENBRACKET=219,KEY_BACKSLASH=220,KEY_CLOSEBRACKET=221,KEY_APOSTROPHE=222,KEY_PROCESS=229;
function leadConvertLookupPick(f,c,d,e){c=document.getElementById(c);for(b=0;b<c.options.length;b++){var a=c.options[b];if(a.value==d){a.selected=true;if(c.onchange)c.onchange();return}}e=LC.getLabel("Page_Lead_Convert","attach",e);b=new Option(e,d,true,true);c.options[c.options.length]=b;var b=0;if(a=document.getElementById("accids")){a.id="accids0";document.getElementById("accnames").id="accnames0";b=1}else{do a=document.getElementById("accids"+b++);while(a);b--}a=document.createElement("input");
a.type="hidden";a.id="accids"+b;a.name="accids";a.value=d;d=document.createElement("input");d.type="hidden";d.id="accnames"+b;d.name="accnames";d.value=e;document[f].appendChild(a);document[f].appendChild(d);if(c.onchange)c.onchange()};
(function(){function A(a,b,c,d,e,f){e=0;for(var h=d.length;e<h;e++){var g=d[e];if(g){var k=false;for(g=g[a];g;){if(g.sizcache===c){k=d[g.sizset];break}if(g.nodeType===1&&!f){g.sizcache=c;g.sizset=e}if(g.nodeName.toLowerCase()===b){k=g;break}g=g[a]}d[e]=k}}}function B(a,b,c,d,e,f){e=0;for(var h=d.length;e<h;e++){var g=d[e];if(g){var k=false;for(g=g[a];g;){if(g.sizcache===c){k=d[g.sizset];break}if(g.nodeType===1){if(!f){g.sizcache=c;g.sizset=e}if(typeof b!=="string"){if(g===b){k=true;break}}else if(i.filter(b,
[g]).length>0){k=g;break}}g=g[a]}d[e]=k}}}var y=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,z=0,C=Object.prototype.toString,u=false,D=true,r=/\\/g,v=/\W/;[0,0].sort(function(){D=false;return 0});var i=function(a,b,c,d){c=c||[];var e=b=b||document;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!=="string")return c;var f,h,g,k,p,n=true,m=i.isXML(b),l=[],w=a;do{y.exec("");if(f=y.exec(w)){w=f[3];l.push(f[1]);
if(f[2]){k=f[3];break}}}while(f);if(l.length>1&&G.exec(a))if(l.length===2&&j.relative[l[0]])h=E(l[0]+l[1],b);else for(h=j.relative[l[0]]?[b]:i(l.shift(),b);l.length;){a=l.shift();if(j.relative[a])a+=l.shift();h=E(a,h)}else{if(!d&&l.length>1&&b.nodeType===9&&!m&&j.match.ID.test(l[0])&&!j.match.ID.test(l[l.length-1])){f=i.find(l.shift(),b,m);b=f.expr?i.filter(f.expr,f.set)[0]:f.set[0]}if(b){f=d?{expr:l.pop(),set:o(d)}:i.find(l.pop(),l.length===1&&(l[0]==="~"||l[0]==="+")&&b.parentNode?b.parentNode:
b,m);h=f.expr?i.filter(f.expr,f.set):f.set;if(l.length>0)g=o(h);else n=false;for(;l.length;){f=p=l.pop();if(j.relative[p])f=l.pop();else p="";if(f===null||f===undefined)f=b;j.relative[p](g,f,m)}}else g=[]}g||(g=h);g||i.error(p||a);if(C.call(g)==="[object Array]")if(n)if(b&&b.nodeType===1)for(a=0;g[a]!==null&&g[a]!==undefined;a++){if(g[a]&&(g[a]===true||g[a].nodeType===1&&i.contains(b,g[a])))c.push(h[a])}else for(a=0;g[a]!==null&&g[a]!==undefined;a++)g[a]&&g[a].nodeType===1&&c.push(h[a]);else c.push.apply(c,
g);else o(g,c);if(k){i(k,e,c,d);i.uniqueSort(c)}return c};i.uniqueSort=function(a){if(x){u=D;a.sort(x);if(u)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a};i.matches=function(a,b){return i(a,null,null,b)};i.matchesSelector=function(a,b){return i(b,null,null,[a]).length>0};i.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=j.order.length;e<f;e++){var h,g=j.order[e];if(h=j.leftMatch[g].exec(a)){var k=h[1];h.splice(1,1);if(k.substr(k.length-1)!=="\\"){h[1]=(h[1]||"").replace(r,
"");if(d=j.find[g](h,b,c)){a=a.replace(j.match[g],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};i.filter=function(a,b,c,d){for(var e,f,h=a,g=[],k=b,p=b&&b[0]&&i.isXML(b[0]);a&&b.length;){for(var n in j.filter){e=j.leftMatch[n].exec(a);if(e!==null&&e!==undefined&&e[2]){var m,l,w=j.filter[n],q=e[1];f=false;e.splice(1,1);if(q.substr(q.length-1)!=="\\"){if(k===g)g=[];if(j.preFilter[n])if(e=j.preFilter[n](e,k,c,g,d,p)){if(e===true)continue}else f=
m=true;if(e)for(q=0;(l=k[q])!==null&&l!==undefined;q++)if(l){m=w(l,e,q,k);var F=d^!!m;if(c&&m!==null&&m!==undefined)if(F)f=true;else k[q]=false;else if(F){g.push(l);f=true}}if(m!==undefined){c||(k=g);a=a.replace(j.match[n],"");if(!f)return[];break}}}}if(a===h)if(f===null||f===undefined)i.error(a);else break;h=a}return k};i.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var j=i.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className",
"for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!v.test(b);c=c&&!d;if(d)b=b.toLowerCase();d=0;for(var e=a.length,f;d<e;d++)if(f=a[d]){for(;(f=f.previousSibling)&&f.nodeType!==1;);a[d]=c||f&&f.nodeName.toLowerCase()===b?f||false:f===b}c&&i.filter(b,a,true)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!v.test(b))for(b=b.toLowerCase();e<f;e++){if(c=a[e]){c=c.parentNode;a[e]=c.nodeName.toLowerCase()===
b?c:false}}else{for(;e<f;e++)if(c=a[e])a[e]=d?c.parentNode:c.parentNode===b;d&&i.filter(b,a,true)}},"":function(a,b,c){var d,e=z++,f=B;if(typeof b==="string"&&!v.test(b)){d=b=b.toLowerCase();f=A}f("parentNode",b,e,a,d,c)},"~":function(a,b,c){var d,e=z++,f=B;if(typeof b==="string"&&!v.test(b)){d=b=b.toLowerCase();f=A}f("previousSibling",b,e,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if(typeof b.getElementsByName!==
"undefined"){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(r,"")+" ";if(f)return a;f=0;for(var h;(h=b[f])!==null&&h!==undefined;f++)if(h)if(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0))c||d.push(h);else if(c)b[f]=
false;return false},ID:function(a){return a[1].replace(r,"")},TAG:function(a){return a[1].replace(r,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||i.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}else a[2]&&i.error(a[0]);a[0]=z++;return a},ATTR:function(a,b,c,d,e,f){b=a[1]=a[1].replace(r,"");if(!f&&j.attrMap[b])a[1]=j.attrMap[b];a[4]=(a[4]||
a[5]||"").replace(r,"");if(a[2]==="~=")a[4]=" "+a[4]+" ";return a},PSEUDO:function(a,b,c,d,e){if(a[1]==="not")if((y.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=i(a[3],null,null,b);else{a=i.filter(a[3],b,c,true^e);c||d.push.apply(d,a);return false}else if(j.match.POS.test(a[0])||j.match.CHILD.test(a[0]))return true;return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===true},checked:function(a){return a.checked===
true},selected:function(a){return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!i(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===
a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-
0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=j.filters[e];if(f)return f(a,c,b,d);else if(e==="contains")return(a.textContent||a.innerText||i.getText([a])||"").indexOf(b[3])>=0;else if(e==="not"){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return false;return true}else i.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case "only":case "first":for(;d=d.previousSibling;)if(d.nodeType===1)return false;if(c==="first")return true;d=a;case "last":for(;d=d.nextSibling;)if(d.nodeType===1)return false;
return true;case "nth":c=b[2];var e=b[3];if(c===1&&e===0)return true;var f=b[0],h=a.parentNode;if(h&&(h.sizcache!==f||!a.nodeIndex)){var g=0;for(d=h.firstChild;d;d=d.nextSibling)if(d.nodeType===1)d.nodeIndex=++g;h.sizcache=f}d=a.nodeIndex-e;return c===0?d===0:d%c===0&&d/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>
-1},ATTR:function(a,b){var c=b[1];c=j.attrHandle[c]?j.attrHandle[c](a):a[c]!==null&&a[c]!==undefined?a[c]:a.getAttribute(c);var d=c+"",e=b[2],f=b[4];return c===null||c===undefined?e==="!=":e==="="?d===f:e==="*="?d.indexOf(f)>=0:e==="~="?(" "+d+" ").indexOf(f)>=0:!f?d&&c!==false:e==="!="?d!==f:e==="^="?d.indexOf(f)===0:e==="$="?d.substr(d.length-f.length)===f:e==="|="?d===f||d.substr(0,f.length+1)===f+"-":false},POS:function(a,b,c,d){var e=j.setFilters[b[2]];if(e)return e(a,c,b,d)}}},G=j.match.POS,
H=function(a,b){return"\\"+(b-0+1)},s;for(s in j.match){j.match[s]=RegExp(j.match[s].source+/(?![^\[]*\])(?![^\(]*\))/.source);j.leftMatch[s]=RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[s].source.replace(/\\(\d+)/g,H))}var o=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(I){o=function(a,b){var c=0,d=b||[];if(C.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length===
"number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var x,t;if(document.documentElement.compareDocumentPosition)x=function(a,b){if(a===b){u=true;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1};else{x=function(a,b){var c,d,e=[],f=[];c=a.parentNode;d=b.parentNode;var h=c;if(a===b){u=true;return 0}else if(c===d)return t(a,b);else if(c){if(!d)return 1}else return-1;
for(;h;){e.unshift(h);h=h.parentNode}for(h=d;h;){f.unshift(h);h=h.parentNode}c=e.length;d=f.length;for(h=0;h<c&&h<d;h++)if(e[h]!==f[h])return t(e[h],f[h]);return h===c?t(a,f[h],-1):t(e[h],b,1)};t=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1}}i.getText=function(a){for(var b="",c,d=0;a[d];d++){c=a[d];if(c.nodeType===3||c.nodeType===4)b+=c.nodeValue;else if(c.nodeType!==8)b+=i.getText(c.childNodes)}return b};(function(){var a=document.createElement("div"),
b="script"+(new Date).getTime(),c=document.documentElement;a.innerHTML="<a name='"+b+"'/>";c.insertBefore(a,c.firstChild);if(document.getElementById(b)){j.find.ID=function(d,e,f){if(typeof e.getElementById!=="undefined"&&!f)return(e=e.getElementById(d[1]))?e.id===d[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===d[1]?[e]:undefined:[]};j.filter.ID=function(d,e){var f=typeof d.getAttributeNode!=="undefined"&&d.getAttributeNode("id");return d.nodeType===1&&f&&f.nodeValue===
e}}c.removeChild(a);c=a=null})();(function(){var a=document.createElement("div");a.appendChild(document.createComment(""));if(a.getElementsByTagName("*").length>0)j.find.TAG=function(b,c){var d=c.getElementsByTagName(b[1]);if(b[1]==="*"){for(var e=[],f=0;d[f];f++)d[f].nodeType===1&&e.push(d[f]);d=e}return d};a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#")j.attrHandle.href=function(b){return b.getAttribute("href",
2)};a=null})();document.querySelectorAll&&function(){var a=i,b=document.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!(b.querySelectorAll&&b.querySelectorAll(".TEST").length===0)){i=function(d,e,f,h){e=e||document;if(!h&&!i.isXML(e)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(d);if(g&&(e.nodeType===1||e.nodeType===9))if(g[1])return o(e.getElementsByTagName(d),f);else if(g[2]&&j.find.CLASS&&e.getElementsByClassName)return o(e.getElementsByClassName(g[2]),f);if(e.nodeType===9){if(d===
"body"&&e.body)return o([e.body],f);else if(g&&g[3]){var k=e.getElementById(g[3]);if(k&&k.parentNode){if(k.id===g[3])return o([k],f)}else return o([],f)}try{return o(e.querySelectorAll(d),f)}catch(p){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){k=(g=e.getAttribute("id"))||"__sizzle__";var n=e.parentNode,m=/^\s*[+~]/.test(d);if(g)k=k.replace(/'/g,"\\$&");else e.setAttribute("id",k);if(m&&n)e=e.parentNode;try{if(!m||n)return o(e.querySelectorAll("[id='"+k+"'] "+d),f)}catch(l){}finally{g||
e.removeAttribute("id")}}}return a(d,e,f,h)};for(var c in a)i[c]=a[c];b=null}}();(function(){var a=document.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,c=false;try{b.call(document.documentElement,"[test!='']:sizzle")}catch(d){c=true}if(b)i.matchesSelector=function(e,f){f=f.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!i.isXML(e))try{if(c||!j.match.PSEUDO.test(f)&&!/!=/.test(f))return b.call(e,f)}catch(h){}return i(f,null,null,[e]).length>
0}})();(function(){var a=document.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!a.getElementsByClassName||a.getElementsByClassName("e").length===0)){a.lastChild.className="e";if(a.getElementsByClassName("e").length!==1){j.order.splice(1,0,"CLASS");j.find.CLASS=function(b,c,d){if(typeof c.getElementsByClassName!=="undefined"&&!d)return c.getElementsByClassName(b[1])};a=null}}})();i.contains=document.documentElement.contains?function(a,b){return a!==b&&
(a.contains?a.contains(b):true)}:document.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return false};i.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":false};var E=function(a,b){for(var c,d=[],e="",f=b.nodeType?[b]:b;c=j.match.PSEUDO.exec(a);){e+=c[0];a=a.replace(j.match.PSEUDO,"")}a=j.relative[a]?a+"*":a;c=0;for(var h=f.length;c<h;c++)i(a,f[c],d);return i.filter(e,d)};window.Sizzle=i})();
this.org=this.org||{};org.cometd={};org.cometd.JSON={};org.cometd.JSON.toJSON=org.cometd.JSON.fromJSON=function(){throw"Abstract";};org.cometd.Utils={};org.cometd.Utils.isString=function(l){if(l===undefined||l===null)return false;return typeof l==="string"||l instanceof String};org.cometd.Utils.isArray=function(l){if(l===undefined||l===null)return false;return l instanceof Array};org.cometd.Utils.inArray=function(l,f){for(var e=0;e<f.length;++e)if(l==f[e])return e;return-1};
org.cometd.Utils.setTimeout=function(l,f,e){return setTimeout(function(){try{f()}catch(g){l._debug("Exception invoking timed function",f,g)}},e)};
org.cometd.TransportRegistry=function(){var l=[],f={};this.getTransportTypes=function(){return l.slice(0)};this.findTransportTypes=function(e,g,s){for(var n=[],h=0;h<l.length;++h){var r=l[h];f[r].accept(e,g,s)===true&&n.push(r)}return n};this.negotiateTransport=function(e,g,s,n){for(var h=0;h<l.length;++h)for(var r=l[h],p=0;p<e.length;++p)if(r==e[p]){var i=f[r];if(i.accept(g,s,n)===true)return i}return null};this.add=function(e,g,s){for(var n=false,h=0;h<l.length;++h)if(l[h]==e){n=true;break}if(!n){typeof s!==
"number"?l.push(e):l.splice(s,0,e);f[e]=g}return!n};this.find=function(e){for(var g=0;g<l.length;++g)if(l[g]==e)return f[e];return null};this.remove=function(e){for(var g=0;g<l.length;++g)if(l[g]==e){l.splice(g,1);g=f[e];delete f[e];return g}return null};this.reset=function(){for(var e=0;e<l.length;++e)f[l[e]].reset()}};
org.cometd.Transport=function(){var l,f;this.registered=function(e,g){l=e;f=g};this.unregistered=function(){f=l=null};this._debug=function(){f._debug.apply(f,arguments)};this._mixin=function(){return f._mixin.apply(f,arguments)};this.getConfiguration=function(){return f.getConfiguration()};this.getAdvice=function(){return f.getAdvice()};this.setTimeout=function(e,g){return org.cometd.Utils.setTimeout(f,e,g)};this.convertToMessages=function(e){if(org.cometd.Utils.isString(e))try{return org.cometd.JSON.fromJSON(e)}catch(g){this._debug("Could not convert to JSON the following string",
'"'+e+'"');throw g;}if(org.cometd.Utils.isArray(e))return e;if(e===undefined||e===null)return[];if(e instanceof Object)return[e];throw"Conversion Error "+e+", typeof "+typeof e;};this.accept=function(){throw"Abstract";};this.getType=function(){return l};this.send=function(){throw"Abstract";};this.reset=function(){this._debug("Transport",l,"reset")};this.abort=function(){this._debug("Transport",l,"aborted")};this.toString=function(){return this.getType()}};
org.cometd.Transport.derive=function(l){function f(){}f.prototype=l;return new f};
org.cometd.RequestTransport=function(){function l(o){for(;i.length>0;){var d=i[0],j=d[0];d=d[1];if(j.url===o.url&&j.sync===o.sync){i.shift();o.messages=o.messages.concat(j.messages);this._debug("Coalesced",j.messages.length,"messages from request",d.id)}else break}}function f(o,d){this.transportSend(o,d);d.expired=false;if(!o.sync){var j=this.getConfiguration().maxNetworkDelay,k=j;if(d.metaConnect===true)k+=this.getAdvice().timeout;this._debug("Transport",this.getType(),"waiting at most",k,"ms for the response, maxNetworkDelay",
j);var t=this;d.timeout=this.setTimeout(function(){d.expired=true;d.xhr&&d.xhr.abort();var v="Request "+d.id+" of transport "+t.getType()+" exceeded "+k+" ms max network delay";t._debug(v);t.complete(d,false,d.metaConnect);o.onFailure(d.xhr,o.messages,"timeout",v)},k)}}function e(o){var d=++h,j={id:d,metaConnect:false};if(p.length<this.getConfiguration().maxConnections-1){p.push(j);f.call(this,o,j)}else{this._debug("Transport",this.getType(),"queueing request",d,"envelope",o);i.push([o,j])}}function g(o,
d){var j=org.cometd.Utils.inArray(o,p);j>=0&&p.splice(j,1);if(i.length>0){j=i.shift();var k=j[0],t=j[1];this._debug("Transport dequeued request",t.id);if(d){this.getConfiguration().autoBatch&&l.call(this,k);e.call(this,k);this._debug("Transport completed request",o.id,k)}else{var v=this;this.setTimeout(function(){v.complete(t,false,t.metaConnect);k.onFailure(t.xhr,k.messages,"error","Previous request failed")},0)}}}var s=new org.cometd.Transport,n=org.cometd.Transport.derive(s),h=0,r=null,p=[],i=
[];n.complete=function(o,d,j){if(j){o=o.id;this._debug("Transport",this.getType(),"metaConnect complete, request",o);if(r!==null&&r.id!==o)throw"Longpoll request mismatch, completing request "+o;r=null}else g.call(this,o,d)};n.transportSend=function(){throw"Abstract";};n.transportSuccess=function(o,d,j){if(!d.expired){clearTimeout(d.timeout);this.complete(d,true,d.metaConnect);if(j&&j.length>0)o.onSuccess(j);else o.onFailure(d.xhr,o.messages,"Empty HTTP response")}};n.transportFailure=function(o,
d,j,k){if(!d.expired){clearTimeout(d.timeout);this.complete(d,false,d.metaConnect);o.onFailure(d.xhr,o.messages,j,k)}};n.send=function(o,d){if(d){if(r!==null)throw"Concurrent metaConnect requests not allowed, request id="+r.id+" not yet completed";var j=++h;this._debug("Transport",this.getType(),"metaConnect send, request",j,"envelope",o);j={id:j,metaConnect:true};f.call(this,o,j);r=j}else e.call(this,o)};n.abort=function(){s.abort();for(var o=0;o<p.length;++o){var d=p[o];this._debug("Aborting request",
d);d.xhr&&d.xhr.abort()}if(r){this._debug("Aborting metaConnect request",r);r.xhr&&r.xhr.abort()}this.reset()};n.reset=function(){s.reset();r=null;p=[];i=[]};return n};
org.cometd.LongPollingTransport=function(){var l=new org.cometd.RequestTransport,f=org.cometd.Transport.derive(l),e=true;f.accept=function(g,s){return e||!s};f.xhrSend=function(){throw"Abstract";};f.transportSend=function(g,s){this._debug("Transport",this.getType(),"sending request",s.id,"envelope",g);var n=this;try{var h=true;s.xhr=this.xhrSend({transport:this,url:g.url,sync:g.sync,headers:this.getConfiguration().requestHeaders,body:org.cometd.JSON.toJSON(g.messages),onSuccess:function(p){n._debug("Transport",
n.getType(),"received response",p);var i=false;try{var o=n.convertToMessages(p);if(o.length===0){e=false;n.transportFailure(g,s,"no response",null)}else{i=true;n.transportSuccess(g,s,o)}}catch(d){n._debug(d);if(!i){e=false;n.transportFailure(g,s,"bad response",d)}}},onError:function(p,i){e=false;h?n.setTimeout(function(){n.transportFailure(g,s,p,i)},0):n.transportFailure(g,s,p,i)}});h=false}catch(r){e=false;this.setTimeout(function(){n.transportFailure(g,s,"error",r)},0)}};f.reset=function(){l.reset();
e=true};return f};
org.cometd.CallbackPollingTransport=function(){var l=new org.cometd.RequestTransport;l=org.cometd.Transport.derive(l);l.accept=function(){return true};l.jsonpSend=function(){throw"Abstract";};l.transportSend=function(f,e){for(var g=this,s=0,n=f.messages.length,h=[];n>0;){var r=org.cometd.JSON.toJSON(f.messages.slice(s,s+n));r=f.url.length+encodeURI(r).length;if(r>2E3){if(n==1){var p="Bayeux message too big ("+r+" bytes, max is 2000) for transport "+this.getType();this.setTimeout(function(){g.transportFailure(f,e,
"error",p)},0);return}--n}else{h.push(n);s+=n;n=f.messages.length-s}}var i=f;if(h.length>1){s=0;n=h[0];this._debug("Transport",this.getType(),"split",f.messages.length,"messages into",h.join(" + "));i=this._mixin(false,{},f);i.messages=f.messages.slice(s,n);i.onSuccess=f.onSuccess;i.onFailure=f.onFailure;for(r=1;r<h.length;++r){var o=this._mixin(false,{},f);s=n;n+=h[r];o.messages=f.messages.slice(s,n);o.onSuccess=f.onSuccess;o.onFailure=f.onFailure;this.send(o,e.metaConnect)}}this._debug("Transport",
this.getType(),"sending request",e.id,"envelope",i);try{var d=true;this.jsonpSend({transport:this,url:i.url,sync:i.sync,headers:this.getConfiguration().requestHeaders,body:org.cometd.JSON.toJSON(i.messages),onSuccess:function(k){var t=false;try{var v=g.convertToMessages(k);if(v.length===0)g.transportFailure(i,e,"no response");else{t=true;g.transportSuccess(i,e,v)}}catch(x){g._debug(x);t||g.transportFailure(i,e,"bad response",x)}},onError:function(k,t){d?g.setTimeout(function(){g.transportFailure(i,
e,k,t)},0):g.transportFailure(i,e,k,t)}});d=false}catch(j){this.setTimeout(function(){g.transportFailure(i,e,"error",j)},0)}};return l};
org.cometd.WebSocketTransport=function(){function l(d,j){try{var k=org.cometd.JSON.toJSON(d.messages);i.send(k);this._debug("Transport",this.getType(),"sent",d,"metaConnect =",j);var t=this.getConfiguration().maxNetworkDelay,v=t;if(j)v+=this.getAdvice().timeout;k=[];for(var x=0;x<d.messages.length;++x){var y=d.messages[x];if(y.id){k.push(y.id);var G=this;r[y.id]=this.setTimeout(function(){var K="Message "+y.id+" of transport "+G.getType()+" exceeded "+v+" ms max network delay";G._debug(K);delete r[y.id];
for(var E in p)if(p[E]===d){delete p[E];break}d.onFailure(i,d.messages,"timeout",K)},v)}}this._debug("Transport",this.getType(),"waiting at most",v," ms for messages",k,"maxNetworkDelay",t,", timeouts:",r)}catch(O){this.setTimeout(function(){d.onFailure(i,d.messages,"error",O)},0)}}var f=new org.cometd.Transport,e=org.cometd.Transport.derive(f),g,s=true,n=false,h=2,r={},p={},i,o;e.registered=function(d,j){f.registered(d,j);g=j};e.accept=function(){return s&&!!window.WebSocket&&g.websocketEnabled===
true};e.onMessage=function(d){this._debug("Transport",this.getType(),"received websocket message",d);if(h===1){d=this.convertToMessages(d.data);for(var j=[],k=0;k<d.length;++k){var t=d[k];if(/^\/meta\//.test(t.channel)||t.data===undefined)if(t.id){j.push(t.id);var v=r[t.id];if(v){clearTimeout(v);delete r[t.id];this._debug("Transport",this.getType(),"removed timeout for message",t.id,", timeouts",r)}}"/meta/disconnect"===t.channel&&t.successful&&i.close()}k=false;for(t=0;t<j.length;++t){var x=j[t],
y;for(y in p){v=y.split(",");var G=org.cometd.Utils.inArray(x,v);if(G>=0){k=true;v.splice(G,1);x=p[y];delete p[y];if(v.length>0)p[v.join(",")]=x;break}}}k&&this._debug("Transport",this.getType(),"removed envelope, envelopes",p);o.call(this,d)}};e.onClose=function(){this._debug("Transport",this.getType(),"closed",i);s=n;for(var d in r){clearTimeout(r[d]);delete r[d]}for(var j in p){p[j].onFailure(i,p[j].messages,"closed");delete p[j]}h=2};e.send=function(d,j){this._debug("Transport",this.getType(),
"sending",d,"metaConnect =",j);for(var k=[],t=0;t<d.messages.length;++t){var v=d.messages[t];v.id&&k.push(v.id)}p[k.join(",")]=d;this._debug("Transport",this.getType(),"stored envelope, envelopes",p);if(h===1)l.call(this,d,j);else{k=d.url.replace(/^http/,"ws");this._debug("Transport",this.getType(),"connecting to URL",k);i=new window.WebSocket(k);var x=this;i.onopen=function(){x._debug("WebSocket opened",i);n=true;h=1;o=d.onSuccess;l.call(x,d,j)};i.onclose=function(){x.onClose()};i.onmessage=function(y){x.onMessage(y)}}};
e.reset=function(){f.reset();i&&i.close();s=true;n=false;h=2;r={};p={};o=i=null};return e};
org.cometd.Cometd=function(l){function f(a,b){for(var c=b||{},m=2;m<arguments.length;++m){var q=arguments[m];if(!(q===undefined||q===null))for(var w in q){var z=q[w];if(z!==b)if(z!==undefined)c[w]=a&&typeof z==="object"&&z!==null?z instanceof Array?f(a,[],z):f(a,{},z):z}}return c}function e(a){return org.cometd.Utils.isString(a)}function g(a){if(a===undefined||a===null)return false;return typeof a==="function"}function s(a,b){if(window.console){var c=window.console[a];g(c)&&c.apply(window.console,
b)}}function n(){u.logLevel!="warn"&&s("info",arguments)}function h(){u.logLevel=="debug"&&s("debug",arguments)}function r(){for(var a in H)for(var b=H[a],c=0;c<b.length;++c){var m=b[c];if(m&&!m.listener){delete b[c];h("Removed subscription",m,"for channel",a)}}}function p(a){if(L!=a){h("Status",L,"->",a);L=a}}function i(){return L=="disconnecting"||L=="disconnected"}function o(a,b,c,m,q){try{return b.call(a,m)}catch(w){h("Exception during execution of extension",c,w);a=I.onExtensionException;if(g(a)){h("Invoking extension exception callback",
c,w);try{a.call(I,w,c,q,m)}catch(z){n("Exception during execution of exception callback in extension",c,z)}}return m}}function d(a){for(var b=0;b<A.length;++b){if(a===undefined||a===null)break;var c=A[b],m=c.extension.outgoing;if(g(m)){c=o(c.extension,m,c.name,a,true);a=c===undefined?a:c}}return a}function j(a,b){var c=H[a];if(c&&c.length>0)for(var m=0;m<c.length;++m){var q=c[m];if(q)try{q.callback.call(q.scope,b)}catch(w){h("Exception during notification",q,b,w);var z=I.onListenerException;if(g(z)){h("Invoking listener exception callback",
q,w);try{z.call(I,w,q.handle,q.listener,b)}catch(P){n("Exception during execution of listener callback",q,P)}}}}}function k(a,b){j(a,b);for(var c=a.split("/"),m=c.length-1,q=m;q>0;--q){var w=c.slice(0,q).join("/")+"/*";q==m&&j(w,b);w+="*";j(w,b)}}function t(){S!==null&&clearTimeout(S);S=null}function v(a){t();var b=C.interval+B;h("Function scheduled in",b,"ms, interval =",C.interval,"backoff =",B,a);S=org.cometd.Utils.setTimeout(I,a,b)}function x(a,b,c,m){for(var q=0;q<b.length;++q){var w=b[q];w.id=
""+ ++ja;if(M)w.clientId=M;w=d(w);if(w!==undefined&&w!==null)b[q]=w;else b.splice(q--,1)}if(b.length!==0){q=u.url;if(u.appendMessageTypeToURL){q.match(/\/$/)||(q+="/");if(m)q+=m}a={url:q,sync:a,messages:b,onSuccess:function(z){try{X.call(I,z)}catch(P){h("Exception during handling of messages",P)}},onFailure:function(z,P,ka,la){try{T.call(I,z,P,ka,la)}catch(ma){h("Exception during handling of failure",ma)}}};h("Send",a);F.send(a,c)}}function y(a){J>0||Q===true?N.push(a):x(false,[a],false)}function G(){var a=
N;N=[];a.length>0&&x(false,a,false)}function O(){p("connecting");v(function(){if(!i()){var a={channel:"/meta/connect",connectionType:F.getType()};if(!U)a.advice={timeout:0};p("connecting");h("Connect sent",a);x(false,[a],true,"connect");p("connected")}})}function K(a){if(a){C=f(false,{},u.advice,a);h("New advice",C)}}function E(a){t();a&&F.abort();M=null;p("disconnected");B=J=0;if(N.length>0){T.call(I,undefined,N,"error","Disconnected");N=[]}}function Y(a){M=null;r();if(i()){D.reset();K(u.advice)}else K(f(false,
C,{reconnect:"retry"}));J=0;Q=true;V=a;a=D.findTransportTypes("1.0",R,u.url);var b=f(false,{},V,{version:"1.0",minimumVersion:"0.9",channel:"/meta/handshake",supportedConnectionTypes:a,advice:{timeout:C.timeout,interval:C.interval}});F=D.negotiateTransport(a,"1.0",R,u.url);h("Initial transport is",F.getType());p("handshaking");h("Handshake sent",b);x(false,[b],false,"handshake")}function Z(){p("handshaking");Q=true;v(function(){Y(V)})}function $(a){k("/meta/handshake",a);k("/meta/unsuccessful",a);
if(!i()&&C.reconnect!="none"){if(B<u.maxBackoff)B+=u.backoffIncrement;Z()}else E(false)}function aa(a){k("/meta/connect",a);k("/meta/unsuccessful",a);a=i()?"none":C.reconnect;switch(a){case "retry":if(B<u.maxBackoff)B+=u.backoffIncrement;O();break;case "handshake":D.reset();B=0;Z();break;case "none":E(false);break;default:throw"Unrecognized advice action"+a;}}function ba(a){E(true);k("/meta/disconnect",a);k("/meta/unsuccessful",a)}function ca(a){k("/meta/subscribe",a);k("/meta/unsuccessful",a)}function da(a){k("/meta/unsubscribe",
a);k("/meta/unsuccessful",a)}function ea(a){k("/meta/publish",a);k("/meta/unsuccessful",a)}function fa(a){for(var b=0;b<A.length;++b){if(a===undefined||a===null)break;var c=A[u.reverseIncomingExtensions?A.length-1-b:b],m=c.extension.incoming;if(g(m)){c=o(c.extension,m,c.name,a,false);a=c===undefined?a:c}}if(!(a===undefined||a===null)){K(a.advice);switch(a.channel){case "/meta/handshake":if(a.successful){M=a.clientId;b=D.negotiateTransport(a.supportedConnectionTypes,a.version,R,u.url);if(b===null)throw"Could not negotiate transport with server; client "+
D.findTransportTypes(a.version,R,u.url)+", server "+a.supportedConnectionTypes;else if(F!=b){h("Transport",F,"->",b);F=b}Q=false;G();a.reestablish=W;W=true;k("/meta/handshake",a);a=i()?"none":C.reconnect;switch(a){case "retry":B=0;O();break;case "none":E(false);break;default:throw"Unrecognized advice action "+a;}}else $(a);break;case "/meta/connect":if(U=a.successful){k("/meta/connect",a);a=i()?"none":C.reconnect;switch(a){case "retry":B=0;O();break;case "none":E(false);break;default:throw"Unrecognized advice action "+
a;}}else aa(a);break;case "/meta/disconnect":if(a.successful){E(false);k("/meta/disconnect",a)}else ba(a);break;case "/meta/subscribe":a.successful?k("/meta/subscribe",a):ca(a);break;case "/meta/unsubscribe":a.successful?k("/meta/unsubscribe",a):da(a);break;default:if(a.successful===undefined)a.data?k(a.channel,a):h("Unknown message",a);else a.successful?k("/meta/publish",a):ea(a)}}}function ga(a){if(a=H[a])for(var b=0;b<a.length;++b)if(a[b])return true;return false}function ha(a,b){var c={scope:a,
method:b};if(g(a)){c.scope=undefined;c.method=a}else if(e(b)){if(!a)throw"Invalid scope "+a;c.method=a[b];if(!g(c.method))throw"Invalid callback "+b+" for scope "+a;}else if(!g(b))throw"Invalid callback "+b;return c}function ia(a,b,c,m){b=ha(b,c);h("Adding listener on",a,"with scope",b.scope,"and callback",b.method);m={channel:a,scope:b.scope,callback:b.method,listener:m};b=H[a];if(!b){b=[];H[a]=b}b=b.push(m)-1;m.id=b;m.handle=[a,b];h("Added listener",m,"for channel",a,"having id =",b);return m.handle}
var I=this,na=l||"default",R=false,D=new org.cometd.TransportRegistry,F,L="disconnected",ja=0,M=null,J=0,N=[],Q=false,H={},B=0,S=null,A=[],C={},V,W=false,U=false,u={maxConnections:2,backoffIncrement:1E3,maxBackoff:6E4,logLevel:"info",reverseIncomingExtensions:true,maxNetworkDelay:1E4,requestHeaders:{},appendMessageTypeToURL:true,autoBatch:false,advice:{timeout:6E4,interval:0,reconnect:"retry"}};this._mixin=f;this._warn=function(){s("warn",arguments)};this._info=n;this._debug=h;var X,T;this.send=y;
this.receive=fa;X=function(a){h("Received",a);for(var b=0;b<a.length;++b)fa(a[b])};T=function(a,b,c,m){h("handleFailure",a,b,c,m);for(c=0;c<b.length;++c){var q=b[c];switch(q.channel){case "/meta/handshake":$({successful:false,failure:true,channel:"/meta/handshake",request:q,xhr:a,advice:{reconnect:"retry",interval:B}});break;case "/meta/connect":m=a;U=false;aa({successful:false,failure:true,channel:"/meta/connect",request:q,xhr:m,advice:{reconnect:"retry",interval:B}});break;case "/meta/disconnect":ba({successful:false,
failure:true,channel:"/meta/disconnect",request:q,xhr:a,advice:{reconnect:"none",interval:0}});break;case "/meta/subscribe":ca({successful:false,failure:true,channel:"/meta/subscribe",request:q,xhr:a,advice:{reconnect:"none",interval:0}});break;case "/meta/unsubscribe":da({successful:false,failure:true,channel:"/meta/unsubscribe",request:q,xhr:a,advice:{reconnect:"none",interval:0}});break;default:ea({successful:false,failure:true,channel:q.channel,request:q,xhr:a,advice:{reconnect:"none",interval:0}})}}};
this.registerTransport=function(a,b,c){if(c=D.add(a,b,c)){h("Registered transport",a);g(b.registered)&&b.registered(a,this)}return c};this.getTransportTypes=function(){return D.getTransportTypes()};this.unregisterTransport=function(a){var b=D.remove(a);if(b!==null){h("Unregistered transport",a);g(b.unregistered)&&b.unregistered()}return b};this.findTransport=function(a){return D.find(a)};this.configure=function(a){h("Configuring cometd object with",a);if(e(a))a={url:a};a||(a={});u=f(false,u,a);if(!u.url)throw"Missing required configuration parameter 'url' specifying the Bayeux server URL";
a=/(^https?:)?(\/\/(([^:\/\?#]+)(:(\d+))?))?([^\?#]*)(.*)?/.exec(u.url);R=a[3]&&a[3]!=window.location.host;if(u.appendMessageTypeToURL)if(a[8]!==undefined&&a[8].length>0){n("Appending message type to URI "+a[7]+a[8]+" is not supported, disabling 'appendMessageTypeToURL' configuration");u.appendMessageTypeToURL=false}else{var b=a[7].split("/"),c=b.length-1;if(a[7].match(/\/$/))c-=1;if(b[c].indexOf(".")>=0){n("Appending message type to URI "+a[7]+" is not supported, disabling 'appendMessageTypeToURL' configuration");
u.appendMessageTypeToURL=false}}};this.init=function(a,b){this.configure(a);this.handshake(b)};this.handshake=function(a){p("disconnected");W=false;Y(a)};this.disconnect=function(a,b){if(!i()){if(b===undefined)if(typeof a!=="boolean"){b=a;a=false}var c=f(false,{},b,{channel:"/meta/disconnect"});p("disconnecting");x(a===true,[c],false,"disconnect")}};this.startBatch=function(){++J};this.endBatch=function(){--J;if(J<0)throw"Calls to startBatch() and endBatch() are not paired";J===0&&!i()&&!Q&&G()};
this.batch=function(a,b){var c=ha(a,b);this.startBatch();try{c.method.call(c.scope);this.endBatch()}catch(m){h("Exception during execution of batch",m);this.endBatch();throw m;}};this.addListener=function(a,b,c){if(arguments.length<2)throw"Illegal arguments number: required 2, got "+arguments.length;if(!e(a))throw"Illegal argument type: channel must be a string";return ia(a,b,c,true)};this.removeListener=function(a){if(!org.cometd.Utils.isArray(a))throw"Invalid argument: expected subscription, not "+
a;var b=H[a[0]];if(b){delete b[a[1]];h("Removed listener",a)}};this.clearListeners=function(){H={}};this.subscribe=function(a,b,c,m){if(arguments.length<2)throw"Illegal arguments number: required 2, got "+arguments.length;if(!e(a))throw"Illegal argument type: channel must be a string";if(i())throw"Illegal state: already disconnected";if(g(b)){m=c;c=b;b=undefined}var q=!ga(a),w=ia(a,b,c,false);if(q){q=f(false,{},m,{channel:"/meta/subscribe",subscription:a});y(q)}return w};this.unsubscribe=function(a,
b){if(arguments.length<1)throw"Illegal arguments number: required 1, got "+arguments.length;if(i())throw"Illegal state: already disconnected";this.removeListener(a);var c=a[0];if(!ga(c)){c=f(false,{},b,{channel:"/meta/unsubscribe",subscription:c});y(c)}};this.clearSubscriptions=function(){r()};this.publish=function(a,b,c){if(arguments.length<1)throw"Illegal arguments number: required 1, got "+arguments.length;if(!e(a))throw"Illegal argument type: channel must be a string";if(i())throw"Illegal state: already disconnected";
var m=f(false,{},c,{channel:a,data:b});y(m)};this.getStatus=function(){return L};this.isDisconnected=i;this.setBackoffIncrement=function(a){u.backoffIncrement=a};this.getBackoffIncrement=function(){return u.backoffIncrement};this.getBackoffPeriod=function(){return B};this.setLogLevel=function(a){u.logLevel=a};this.registerExtension=function(a,b){if(arguments.length<2)throw"Illegal arguments number: required 2, got "+arguments.length;if(!e(a))throw"Illegal argument type: extension name must be a string";
for(var c=false,m=0;m<A.length;++m)if(A[m].name==a){c=true;break}if(c){n("Could not register extension with name",a,"since another extension with the same name already exists");return false}else{A.push({name:a,extension:b});h("Registered extension",a);g(b.registered)&&b.registered(a,this);return true}};this.unregisterExtension=function(a){if(!e(a))throw"Illegal argument type: extension name must be a string";for(var b=false,c=0;c<A.length;++c){var m=A[c];if(m.name==a){A.splice(c,1);b=true;h("Unregistered extension",
a);a=m.extension;g(a.unregistered)&&a.unregistered();break}}return b};this.getExtension=function(a){for(var b=0;b<A.length;++b){var c=A[b];if(c.name==a)return c.extension}return null};this.getName=function(){return na};this.getClientId=function(){return M};this.getURL=function(){return u.url};this.getTransport=function(){return F};this.getConfiguration=function(){return f(true,{},u)};this.getAdvice=function(){return f(true,{},C)}};
window.Modernizr=function(j,g,i){function x(){e.input=function(b){for(var a=0,c=b.length;a<c;a++)v[b[a]]=!!(b[a]in f);return v}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));e.inputtypes=function(b){for(var a=0,c,h,k,y=b.length;a<y;a++){f.setAttribute("type",h=b[a]);(c=f.type!=="text")&&(f.value=p,f.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(h)&&f.style.WebkitAppearance!==i?(m.appendChild(f),k=g.defaultView,c=k.getComputedStyle&&
k.getComputedStyle(f,null).WebkitAppearance!=="textfield"&&f.offsetHeight!==0,m.removeChild(f)):/^(search|tel)$/.test(h)||(/^(url|email)$/.test(h)?c=f.checkValidity&&f.checkValidity()===false:/^color$/.test(h)?(m.appendChild(f),c=f.value!=p,m.removeChild(f)):c=f.value!=p));w[b[a]]=!!c}return w}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function z(b,a){var c=b.charAt(0).toUpperCase()+b.substr(1),h;a:{c=(b+" "+A.join(c+" ")+c).split(" ");for(var k in c)if(n[c[k]]!==
i&&(!a||a(c[k],q))){h=true;break a}}return!!h}function l(b,a){return typeof b===a}var e={},m=g.documentElement;g.head||g.getElementsByTagName("head");var q=g.createElement("modernizr"),n=q.style,f=g.createElement("input"),p=":)",B=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),A="Webkit Moz O ms Khtml".split(" "),d={},w={},v={},C=[],o,r=function(){var b={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(a,c){c=c||g.createElement(b[a]||"div");
var h=(a="on"+a)in c;h||(c.setAttribute||(c=g.createElement("div")),c.setAttribute&&c.removeAttribute&&(c.setAttribute(a,""),h=l(c[a],"function"),l(c[a],i)||(c[a]=i),c.removeAttribute(a)));return h}}(),s={}.hasOwnProperty,t;l(s,i)||l(s.call,i)?t=function(b,a){return a in b&&l(b.constructor.prototype[a],i)}:t=function(b,a){return s.call(b,a)};d.canvas=function(){var b=g.createElement("canvas");return b.getContext&&b.getContext("2d")};d.canvastext=function(){return e.canvas&&l(g.createElement("canvas").getContext("2d").fillText,
"function")};d.postmessage=function(){return!!j.postMessage};d.websqldatabase=function(){return!!j.openDatabase};d.hashchange=function(){return r("hashchange",j)&&(g.documentMode===i||g.documentMode>7)};d.history=function(){return!!(j.history&&history.pushState)};d.draganddrop=function(){return r("dragstart")&&r("drop")};d.websockets=function(){return"WebSocket"in j};d.borderradius=function(){return z("borderRadius","",function(b){return(""+b).indexOf("orderRadius")!==-1})};d.opacity=function(){var b=
B.join("opacity:.55;")+"";n.cssText=b;return/^0.55$/.test(n.opacity)};d.video=function(){var b=g.createElement("video"),a=!!b.canPlayType;if(a){a=new Boolean(a);a.ogg=b.canPlayType('video/ogg; codecs="theora"');a.h264=b.canPlayType('video/mp4; codecs="avc1.42E01E"')||b.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');a.webm=b.canPlayType('video/webm; codecs="vp8, vorbis"')}return a};d.audio=function(){var b=g.createElement("audio"),a=!!b.canPlayType;a&&(a=new Boolean(a),a.ogg=b.canPlayType('audio/ogg; codecs="vorbis"'),
a.mp3=b.canPlayType("audio/mpeg;"),a.wav=b.canPlayType('audio/wav; codecs="1"'),a.m4a=b.canPlayType("audio/x-m4a;")||b.canPlayType("audio/aac;"));return a};d.localstorage=function(){try{return!!localStorage.getItem}catch(b){return false}};d.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(b){return false}};d.webWorkers=function(){return!!j.Worker};d.applicationcache=function(){return!!j.applicationCache};for(var u in d)t(d,u)&&(o=u.toLowerCase(),e[o]=d[u](),C.push((e[o]?"":"no-")+
o));e.input||x();e.crosswindowmessaging=e.postmessage;e.historymanagement=e.history;e.addTest=function(b,a){b=b.toLowerCase();if(!e[b]){a=!!a();m.className+=" "+(a?"":"no-")+b;e[b]=a;return e}};n.cssText="";q=f=null;e._enableHTML5=true;e._version="1.7";return e}(this,this.document);
if(window.Ext&&window.Ext.form&&window.Ext.form.TriggerField){Ext.ns("Sfdc.html");Sfdc.html.QuickfindInput=Ext.extend(Ext.form.TriggerField,{cls:"quickfindInput",ctCls:"quickfindContainer",enableKeyEvents:true,hideTrigger:true,buffer:false,initComponent:function(){var b=this.scope||this;this.on("keyup",function(a){a=a.getRawValue();a.length>0?this.trigger.show():this.trigger.hide();this.searchFunction&&this.searchFunction.call(b,a)},this,this.buffer?{buffer:this.buffer}:null);Sfdc.html.QuickfindInput.superclass.initComponent.call(this)},
onTriggerClick:function(){this.trigger.hide();this.reset();this.focus();if(this.clearFunction)this.clearFunction.call(this.scope||this)}})};
var QueryString=function(a,c){this.allowMultipleValuesForParam=!!c;this.params={};this.refValue=null;this.hasRef=false;if(a==null)a=location.search.substring(1,location.search.length);else{var b=a.lastIndexOf("#");if(b!==-1){this.refValue=a.substring(b+1);a=a.substring(0,b);this.hasRef=true}}if(a.length!=0){a=a.replace(/\+/g," ");b=a.split("&");for(var d=0;d<b.length;d++){var e=b[d].indexOf("=");if(e>0){var f=decodeURIComponent(b[d].substr(0,e));e=decodeURIComponent(b[d].substr(e+1));this.add(f,e)}}}};
QueryString.prototype.getAllParams=function(){return this.params};QueryString.prototype.getAllowMultipleValuesForParam=function(){return this.allowMultipleValuesForParam};QueryString.prototype.get=function(a,c){var b=this.params[a];return b?b:c?c:null};QueryString.prototype.doesHaveRef=function(){return this.hasRef};QueryString.prototype.add=function(a,c){if(this.allowMultipleValuesForParam){var b=this.params[a];if(b)b[b.length]=c;else{b=[];b[0]=c}this.params[a]=b}else this.params[a]=c};
QueryString.prototype.replace=function(a,c){this.remove(a);this.add(a,c)};QueryString.prototype.addAll=function(a){if(a&&a.hasOwnProperty("params"))for(var c in a.params){var b=a.params[c];if(this.allowMultipleValuesForParam&&Sfdc.isArray(b))for(var d=0;d<b.length;d++)typeof b[d]!=="undefined"&&this.add(c,b[d]);else this.add(c,b)}};
QueryString.prototype.append=function(a,c,b){if(this.allowMultipleValuesForParam)throw"Append is not supported with multi param mode";this.params[a]?this.add(a,this.params[a]+b+c):this.add(a,c)};QueryString.prototype.remove=function(a){this.params[a]=null};
QueryString.prototype.toString=function(){var a="?",c;for(c in this.params){var b=this.params[c];if(b!=undefined)if(this.allowMultipleValuesForParam)for(var d=0;d<b.length;d++){if(typeof b[d]!=="undefined")a=a+c+"="+encodeURIComponent(b[d])+"&"}else a=a+c+"="+encodeURIComponent(b)+"&"}if(this.refValue)a+="#"+this.refValue;return a};QueryString.prototype.concatenateWithUrl=function(a,c){if(!a)return a;var b=QueryString.createQueryString(a,c);b.addAll(this);return QueryString.getURI(a)+b.toString()};
QueryString.getQueryStringIndex=function(a,c){var b=a.indexOf("?"),d=a.lastIndexOf("#");if(d>-1&&(b<0||d<b))return c?d-1:d;return b};QueryString.getURI=function(a){var c=QueryString.getQueryStringIndex(a,false);return c>0?a.substring(0,c):a};QueryString.getHashValue=function(a){var c=a.lastIndexOf("#"),b="";if(c!==-1)b="#"+a.substr(c+1);return b};QueryString.createQueryString=function(a,c){var b=QueryString.getQueryStringIndex(a,true);b=b>=0?a.substring(b+1):"";return new QueryString(b,c)};
QueryString.valueFromHash=function(a,c){if(window.location.href.indexOf("#")!=-1){for(var b=window.location.href.split("#")[1].split(c),d=0;d<b.length;d++)if(b[d]===a)return b[d+1];return null}};QueryString.clearHash=function(){window.location.hash="#"};
QueryString.prototype.equals=function(a){var c=0,b=0,d;for(d in this.params)if(this.params.hasOwnProperty(d)){c++;var e=this.get(d),f=a.get(d);if(!e||!f)if(e!==f)return false;else continue;e instanceof Array||(e=[e]);f instanceof Array||(f=[f]);if(e.length!==f.length)return false;if(e.length===1&&f.length===1)if(e[0]!==f[0])return false;else continue;e.sort();f.sort();for(var g=0;g<=e.length;g++)if(e[g]!==f[g])return false}for(d in a.getAllParams())b++;if(c!=b)return false;if(a.refValue!==this.refValue)return false;
return true};QueryString.urlsEqual=function(a,c){return a.length==c.length&&QueryString.getURI(a)==QueryString.getURI(c)&&QueryString.createQueryString(a,true).equals(QueryString.createQueryString(c,true))};QueryString.addParamToUrl=function(a,c,b){var d=QueryString.createQueryString(a);d.add(c,b);return QueryString.getURI(a)+d.toString()};
var HolidayFunction={};HolidayFunction.setNoEndDate=function(b,c){var a=document.getElementById(c);if(a.disabled=b)a.value=""};
HolidayFunction.setIsRecurrent=function(b,c,a,d,e){a=document.getElementById(a);d=document.getElementById(d);c=document.getElementById(c);e=document.getElementById(e).checked;c.disabled=b;a.disabled=!b;if(b){if(a.value=="")a.value=c.value;d.disabled=e;document.getElementById(ActivityUi.RECURRENCE_PATTERN_DIV).style.display=""}else{d.disabled=true;document.getElementById(ActivityUi.RECURRENCE_PATTERN_DIV).style.display="none"}};
HolidayFunction.setIsAllDay=function(b){document.getElementById(HolidayUi.START_TIME_PARAM).disabled=b;document.getElementById(HolidayUi.END_TIME_PARAM).disabled=b};HolidayFunction.setActivityDate=function(b,c){var a=document.getElementById(b).value,d=DateUtil.getDateFromUserLocale(a);if(d.getTime()!=0){document.getElementById(c).value=a;document.getElementById(Activity.pYEARLY_MONTHOFYEAR).value=d.getMonth();document.getElementById(Activity.pYEARLY_DAYOFMONTH).value=d.getDate()}};
function LC(){}LC.getLabel=function(){var b="",a=this.getLabel.arguments;if(a[0]&&a[1])b=LC.labels[a[0]][a[1]];for(i=2;i<a.length;i++)b=b.replace(RegExp("\\{"+(i-2)+"\\}","g"),a[i]);return b};LC.isEnglishLanguage=function(){return UserContext.initialized&&UserContext.language=="en_US"};LC.isUSLocale=function(){return UserContext.initialized&&UserContext.locale=="en_US"};LC.isEnglishUS=function(){return LC.isEnglishLanguage()&&LC.isUSLocale()};
LC.isThaiTHLocale=function(){return UserContext.locale=="th_TH"};LC.isRtlPage=function(){return getCurrentStyle(document.body,"direction")=="rtl"};LC.BUDDHIST_CAL_OFFSET=543;
function LookupHoverDetail(a,b){this.id=a;this.width=LookupHoverDetail.STANDARD_BUBBLE_WIDTH;this.bubbleOffset=XBrowser.userAgent.isIE6?5:14;this.height=LookupHoverDetail.STANDARD_BUBBLE_HEIGHT;this.hover=document.createElement("div");this.hover.id=a+"Hover";this.hover.className="individualPalette lookupHoverDetail lookupHoverDetailLoading lookupHoverDetailOverridable";this.hover.innerHTML='<div class="topLeft"><div class="bPageBlock"><div class="pbBody">'+LC.getLabel("Global","loading")+'<div><div class="pbFooter"><div class="bg"><div></div></div><div>';
document.body.appendChild(this.hover);var c=this;addEvent(this.hover,"mouseover",function(){c.show()},true);addEvent(this.hover,"mouseout",function(){c.hide()},true);this.hover=new iframeShim(this.hover);this.originalClass="";this.fadingIn=this.fadingOut=null;this.loaderURL=b;this.loaded=false}LookupHoverDetail.STANDARD_BUBBLE_WIDTH=302;LookupHoverDetail.STANDARD_BUBBLE_HEIGHT=262;LookupHoverDetail.SHOW_DELAY=800;LookupHoverDetail.HIDE_DELAY=250;LookupHoverDetail.stopLoading=false;
LookupHoverDetail.hovers={};LookupHoverDetail.getHover=function(a,b){var c=window.Shepherd;if(c&&b)b=c.fixRetUrl(b);if(LookupHoverDetail.hovers[a])return LookupHoverDetail.hovers[a];c=new LookupHoverDetail(a,b);return LookupHoverDetail.hovers[a]=c};LookupHoverDetail.hideAllHovers=function(){var a=LookupHoverDetail.hovers,b;for(b in a)a.hasOwnProperty(b)&&a[b].hide()};
LookupHoverDetail.prototype.show=function(){if(this.fadingOut){clearTimeout(this.fadingOut);this.fadingOut=null}else{var a=this;if(!this.fadingIn)this.fadingIn=setTimeout(function(){a.showNow()},LookupHoverDetail.SHOW_DELAY)}};
LookupHoverDetail.prototype.showNow=function(){if(!this.loaded)if(this.loaderURL!=null){var a=this;XBrowser.getHttpResponse(this.loaderURL,function(b){a.load(b.responseText)},function(b){a.load(b.responseText)})}else return;this.position();this.hover.setStyle("visibility","visible");this.fadingIn=null};LookupHoverDetail.prototype.hide=function(){if(this.fadingIn){clearTimeout(this.fadingIn);this.fadingIn=null}else{var a=this;this.fadingOut=setTimeout(function(){a.hideNow()},LookupHoverDetail.HIDE_DELAY)}};
LookupHoverDetail.prototype.hideNow=function(){this.hover.setStyle("visibility","hidden");this.fadingOut=null};LookupHoverDetail.prototype.load=function(a){this.hover.div.innerHTML=a;Util.evalScriptsUnderElement(this.hover.div);this.originalClass=this.hover.div.firstChild.className;this.height=this.hover.div.offsetHeight;delStyleClass(this.hover.div,"lookupHoverDetailLoading");this.position();this.loaded=true};
LookupHoverDetail.prototype.position=function(){var a=getElementByIdCS(this.id),b=getObjX(a),c=getObjY(a),d=a.offsetWidth,e=a.offsetHeight,f=getScrollX(),g=getScrollY(),h=getWindowWidth(),i=getWindowHeight();a=this.originalClass+" ";if(c+e+this.height<g+i){a+="top";c+=e}else{a+="bottom";c-=this.height}if(b+d-this.bubbleOffset+this.width<f+h){a+="Left";b=b+d/2-this.bubbleOffset}else{a+="Right";b=b+d/2-this.width}this.hover.setStyle("left",b+"px");this.hover.setStyle("top",c+"px");this.hover.div.firstChild.className=
a;if(this.hover.div.firstChild)if(b=Util.hasStyleEndsWith(this.hover.div.firstChild,"Override")){delStyleClass(this.hover.div,"lookupHoverDetailOverridable");delStyleClass(this.hover.div.firstChild,b);addStyleClass(this.hover.div,b)}};
function MRUHoverDetail(a){this.id=a;this.mruItem=getElementByIdCS("mru"+a);this.hover=document.createElement("div");this.hover.id=a+"Hover";this.hover.className="mruHoverDetail mruHoverLoading";this.hover.innerHTML='<div class="bPageBlock secondaryPalette"><div class="pbBody">'+LC.getLabel("Global","loading")+'</div><div class="pbFooter"></div></div>';this.mruItem.appendChild(this.hover);this.originalClass=this.mruItem.className;a=this.mruItem.offsetWidth;if(this.mruItem.currentStyle&&XBrowser.userAgent.isIE6)a-=
30;this.hover.style[LC.isRtlPage()?"right":"left"]=a+"px";this.hover=new iframeShim(this.hover);this.fadingIn=this.fadingOut=null;this.loaded=false}MRUHoverDetail.SHOW_DELAY=800;MRUHoverDetail.HIDE_DELAY=400;MRUHoverDetail.loaderURL=null;MRUHoverDetail.sentRequest=false;MRUHoverDetail.response=null;MRUHoverDetail.hovers={};MRUHoverDetail.openHover=null;
MRUHoverDetail.getHover=function(a){if(MRUHoverDetail.hovers[a])return MRUHoverDetail.hovers[a];var b=new MRUHoverDetail(a);return MRUHoverDetail.hovers[a]=b};
MRUHoverDetail.bulkLoad=function(){if(!MRUHoverDetail.sentRequest&&MRUHoverDetail.loaderURL!=null){MRUHoverDetail.sentRequest=true;XBrowser.getHttpResponse(MRUHoverDetail.loaderURL,function(a){MRUHoverDetail.response=a.responseText;MRUHoverDetail.openHover!=null&&MRUHoverDetail.hovers[MRUHoverDetail.openHover].load()},function(a){MRUHoverDetail.response=a.responseText;MRUHoverDetail.openHover!=null&&MRUHoverDetail.hovers[MRUHoverDetail.openHover].load()})}};
MRUHoverDetail.prototype.show=function(){if(this.fadingOut){clearTimeout(this.fadingOut);this.fadingOut=null}else{var a=this;this.fadingIn=setTimeout(function(){a.showNow()},MRUHoverDetail.SHOW_DELAY)}};
MRUHoverDetail.prototype.showNow=function(){if(!MRUHoverDetail.sentRequest)if(MRUHoverDetail.loaderURL!=null)MRUHoverDetail.bulkLoad();else return;MRUHoverDetail.openHover=this.id;!this.loaded&&MRUHoverDetail.response!=null&&this.load();this.hover.setStyle("display","block");if(this.mruItem.currentStyle&&XBrowser.userAgent.isIE6){var a=LC.isRtlPage()?"right":"left";this.hover.iframe.style[a]=this.hover.div.style[a]}this.mruItem.className=this.originalClass+" secondaryPalette";this.fadingIn=null};
MRUHoverDetail.prototype.hide=function(){if(this.fadingIn){clearTimeout(this.fadingIn);this.fadingIn=null}else{var a=this;this.fadingOut=setTimeout(function(){a.hideNow()},MRUHoverDetail.HIDE_DELAY)}};MRUHoverDetail.prototype.hideNow=function(){MRUHoverDetail.openHover=null;this.hover.setStyle("display","none");this.mruItem.className=this.originalClass;this.fadingOut=null};
MRUHoverDetail.prototype.load=function(){var a="<"+this.id+">",b="</"+this.id+">",c=MRUHoverDetail.response.indexOf(a);b=MRUHoverDetail.response.indexOf(b);if(c!=-1&&b!=-1){this.hover.div.innerHTML=MRUHoverDetail.response.slice(c+a.length,b);Util.evalScriptsUnderElement(this.hover.div);delStyleClass(this.hover.div,"mruHoverLoading");this.loaded=true}};
var TimePickerInputElement={};TimePickerInputElement.FocusInput=function(a){a=document.getElementById(a);a.className="timeInputActive";if(a.value==TimePickerInputElementConstants.EMPTY_TIME_STANDIN){a.value="";a.select()}else a.value!=""&&a.select()};TimePickerInputElement.BlurInput=function(a){a=document.getElementById(a);if(a.value==""){a.className="timeInputInactive";a.value=TimePickerInputElementConstants.EMPTY_TIME_STANDIN}};
function ToggleDealView(){}ToggleDealView.setShowDealViewUserPref=function(a,b){b?UserContext.userPreferences.setBoolean("ShowDealView",a,ToggleDealView.refreshPage):Sfdc.NextGenDetail.openBrowserCompatibilityMsgWindow(false)};ToggleDealView.refreshPage=function(){window.location.reload(true)};ToggleDealView.goBackToClassicView=function(){this.setShowDealViewUserPref(false,true)};
function AppPicker(a,b,d,c,g,e){this.appExchangeUrl=a;this.appStoreUrl=b;this.developerUrl=d;this.picker=c;this.originalIndex=c.selectedIndex;this.urlMap=g;var f=this;e?addEvent(e,"click",function(){f.handleChange()},false):addEvent(c,"change",function(){f.handleChange()},false)}
AppPicker.prototype.handleChange=function(){if(this.picker.options[this.picker.selectedIndex].value=="AppExchange"){var a=window.open(this.appExchangeUrl,"AppExchangePopup");this.picker.selectedIndex=this.originalIndex;a.focus()}else if(this.picker.options[this.picker.selectedIndex].value=="AppStore"){a=window.open(this.appStoreUrl,"AppStorePopup");this.picker.selectedIndex=this.originalIndex;a.focus()}else if(this.picker.options[this.picker.selectedIndex].value=="DeveloperForce"){a=window.open(this.developerUrl,
"DeveloperForcePopup");this.picker.selectedIndex=this.originalIndex;a.focus()}else if(this.picker.options[this.picker.selectedIndex].value=="EMPTY")this.picker.selectedIndex=this.originalIndex;else{a=this.urlMap[this.picker.options[this.picker.selectedIndex].value];var b=a.replace(UserContext.getUrl("/"),"/");if(b.length>=4&&b.substring(0,4)=="/sfc")this.handleSFCTabSwitch(a);else{a.indexOf("?")>=0&&this.parseUrlParamsIntoHiddens(a);this.picker.form.action=this.urlMap[this.picker.options[this.picker.selectedIndex].value];
this.picker.form.submit()}}};AppPicker.prototype.parseUrlParamsIntoHiddens=function(a){var b=a.split("?")[0];a=a.split("?")[1].split("&");for(var d=0;d<a.length;d++){var c=document.createElement("INPUT");c.type="hidden";c.name=a[d].split("=")[0];c.id=a[d].split("=")[0];c.value=a[d].split("=")[1];this.picker.form.appendChild(c)}return b};
AppPicker.prototype.handleSFCTabSwitch=function(a){var b=this.picker.name+"="+this.picker.options[this.picker.selectedIndex].value;a+=a.indexOf("?")>-1?"&":"?";a+=b;document.location.href=a};
function AppPickerAlohaAccesability(a){this.goButton=document.getElementById(a+MenuButtonElement.GO_BUTTON);this.picker=document.getElementById(a+MenuButtonElement.SELECT);this.originalIndex=this.picker.selectedIndex;var b=this;addEvent(this.goButton,"click",function(){b.handleChange()},false);addEvent(this.picker,"change",function(){b.handleChange()},false)}
AppPickerAlohaAccesability.prototype.handleChange=function(){if(this.picker.options[this.picker.selectedIndex].value=="EMPTY")this.picker.selectedIndex=this.originalIndex;else this.originalIndex=this.picker.selectedIndex};
function Fader(a,c,d,e,f,g,h,i,j,k){function l(){b.fadeInHelp()}function m(){b.fadeOutHelp()}var b=this;if(!(a&&c&&d&&e&&f&&g))return null;this.object=a;this.testMin=c;this.testMax=d;this.timestep=e;this.nextStep=f;this.increment=g;this.currVal=h;this.finalMin=i;this.finalMax=j;this.startIn=k;this.outId=this.inId=-1;this.position="out";this.fadeIn=function(){b.startIn&&b.startIn(this.object);if(b.outId>=0){clearInterval(b.outId);b.outId=-1}if(this.inId<0){b.inId=setInterval(l,b.timestep);b.position=
"moving_in"}};this.fadeOut=function(){if(b.inId>=0){clearInterval(b.inId);b.inId=-1}if(b.outId<0){b.outId=setInterval(m,b.timestep);b.position="moving_out"}};this.isMoving=function(){return this.inId>=0||this.outId>=0};this.getPosition=function(){return b.position}}
Fader.prototype.fadeInHelp=function(){var a=this.nextStep(this.currVal,1);if(this.testMax(this.object,a)){a=this.finalMax&&this.finalMax(this.object);if(typeof a=="number")this.currVal=a;clearInterval(this.inId);this.inId=-1;this.position="in"}else{this.increment(this.object,a);this.currVal=a}};
Fader.prototype.fadeOutHelp=function(){var a=this.nextStep(this.currVal,-1);if(this.testMin(this.object,a)){a=this.finalMin&&this.finalMin(this.object);if(typeof a=="number")this.currVal=a;clearInterval(this.outId);this.outId=-1;this.position="out"}else{this.increment(this.object,a);this.currVal=a}};Fader.prototype.stopFade=function(){if(this.inId>=0){clearInterval(this.inId);this.inId=-1}if(this.outId>=0){clearInterval(this.outId);this.outId=-1}this.position="stopped"};
Fader.prototype.jumpIn=function(){this.startIn&&this.startIn(this.object);var a=null;if(this.finalMax)a=this.finalMax(this.object);if(a!==null)this.currVal=a;this.position="in"};Fader.prototype.jumpOut=function(){var a=null;if(this.finalMin)a=this.finalMin(this.object);if(a!==null)this.currVal=a;this.position="out"};
function iframeShim(a){this.div=a;if(XBrowser.userAgent.isIE8||XBrowser.userAgent.isIE7||XBrowser.userAgent.isIE6)if(XBrowser.userAgent.isIE6){a=document.createElement("iframe");a.src=IFrameElement.BLANK_SRC;a.frameBorder="0";a.scrolling="no";a.className="iframeShim";a.style.zIndex=this.div.currentStyle.zIndex-1;var b=Sfdc.Dom.getLocalOffsetXY(this.div),c=b.x,d=this.div.currentStyle.left;a.style.left=c==0&&d?d:c;b=b.y;c=this.div.currentStyle.top;d=this.div.currentStyle.bottom;if(b==0&&(c||d)){a.style.top=
c;a.style.bottom=d}else a.style.top=b;a.style.height=this.div.offsetHeight;a.style.position="absolute";a.style.display=this.div.currentStyle.display;this.iframe=a;this.div.parentNode.insertBefore(this.iframe,this.div);this.setStyle=this.setStyleIE;this.setOpacity=this.setOpacityIE;this.getOpacity=this.getOpacityIE;this.refresh=this.refreshIE}else{this.setStyle=this.setStyleNonIE;this.setOpacity=this.setOpacityIE;this.getOpacity=this.getOpacityIE}else{this.setStyle=this.setStyleNonIE;this.setOpacity=
this.setOpacityNonIE;this.getOpacity=this.getOpacityNonIE}}
iframeShim.prototype={setStyleNonIE:function(a,b){this.div.style[a]=b},setStyleIE:function(a,b){this.div.style[a]=b;if(a!="position")this.iframe.style[a]=b;this.refresh()},refresh:function(){},refreshIE:function(){this.iframe.style.width=this.div.offsetWidth+"px";this.iframe.style.height=this.div.offsetHeight+"px";var a=Sfdc.Dom.getLocalOffsetXY(this.div);this.iframe.style.left=a.x+"px";this.iframe.style.top=a.y+"px"},setOpacityNonIE:function(a){if(a<0)a=0;if(a>1)a=1;this.div.style.opacity=a},setOpacityIE:function(a){if(a<
0)a=0;if(a>1)a=1;this.div.filters.alpha.opacity=a*100},getOpacityNonIE:function(){return getCurrentStyle(this.div,"opacity")},getOpacityIE:function(){return this.div.filters.alpha.opacity/100},getStyle:function(a){return this.div.style[a]}};
function LoadingScreen(c,b,a){this.div=c;this.text=b;this.id=a}
LoadingScreen.prototype={show:function(){this.transparantElement||this.createElements();if(XBrowser.userAgent.isIE6||XBrowser.userAgent.isIE7){var c=this.div.clientHeight+"px";this.transparantElement.style.height=c;this.opaqueElement.style.height=c}this.transparantElement.style.display="block";this.opaqueElement.style.display="block";this.positionLoadingElement(this.loadingDescrElement,this.opaqueElement)},getOpaqueElement:function(){return this.opaqueElement},getTransparentElement:function(){return this.transparantElement},
hide:function(){if(this.transparantElement)this.transparantElement.style.display="none";if(this.opaqueElement)this.opaqueElement.style.display="none"},createElements:function(){if(XBrowser.getCurrentStyle(this.div,"position")=="static")this.div.style.position="relative";this.transparantElement=this.createLoadingElement(this.div);this.transparantElement.className="waitingSearchDiv waitingSearchDivOpacity";this.opaqueElement=this.createLoadingElement(this.div);this.opaqueElement.className="waitingSearchDiv";
if(this.id)this.opaqueElement.id=this.id;this.loadingDescrElement=this.addLoadingDescription(this.text,this.opaqueElement)},createLoadingElement:function(c){var b=document.createElement("div");b.style.width="100%";b.style.height="100%";if(XBrowser.userAgent.isIE6||XBrowser.userAgent.isIE7){b.style.left=0;b.style.height=this.div.clientHeight+"px"}c.appendChild(b);return b},positionLoadingElement:function(c,b){var a=b.offsetHeight/5;if(a>100)a=100;c.style.top=a+"px"},addLoadingDescription:function(c,
b){var a=document.createElement("div");b.appendChild(a);a.className="waitingHolder";var e=document.createElement("img");a.appendChild(e);e.src=UserContext.getUrl("/img/loading.gif");e.className="waitingImage";var d=LC.getLabel("SquidCacheManager","pleaseWait");e.title=d;d=document.createElement("span");a.appendChild(d);d.innerHTML=c;d.className="waitingDescription";if(XBrowser.userAgent.isIE7){a.style.position="absolute";a.style.width="auto"}else a.style.width=e.offsetWidth+d.offsetWidth+20+"px";
return a}};
function alertBlockSubmit(a){window.ffInAlert=true;alert(a);window.ffInAlert=false}function Modal(){}Modal.confirm=function(a){top.ffInAlert=true;a=window.confirm(a);top.ffInAlert=false;return a};Modal.isBlocked=function(){return top.ffInAlert};
var MOUSE_OVER_FADE_MAP=[];function addMouseOver(d,c,h){for(var e=0;e<MOUSE_OVER_FADE_MAP.length;e++)if(MOUSE_OVER_FADE_MAP[e]===d)return;var a;for(e=0;e<d.childNodes.length;e++)if(d.childNodes[e].className==MouseOverElement.DEFAULT_CLASS_INNER){a=d.childNodes[e];break}if(a){(c?new MouseOverFade(c,a,h):new MouseOverFade(d,a,h)).handleMouseOver();MOUSE_OVER_FADE_MAP.push(d)}}
function MouseOverFade(d,c,h){this.mover=new MouseOverFadeHandler(d,c,true,h);var e=this;this.handleMouseOver=function(){e.mover.fadeIn()};this.handleMouseOut=function(){e.mover.fadeOut()};this.init()}
MouseOverFade.prototype.init=function(){addEvent(this.mover.controller,"mouseover",this.handleMouseOver,false);addEvent(this.mover.controller,"mouseout",this.handleMouseOut,false);addEvent(this.mover.div,"mouseover",this.handleMouseOver,false);addEvent(this.mover.div,"mouseout",this.handleMouseOut,false);addEvent(this.mover.controller,"focus",this.handleMouseOver,false);addEvent(this.mover.controller,"blur",this.handleMouseOut,false);addEvent(this.mover.div,"focus",this.handleMouseOver,false);addEvent(this.mover.div,
"blur",this.handleMouseOut,false)};MouseOverFade.createMouseOverHtml=function(d){var c=[];c.push('<div onmouseover="addMouseOver(this, null, \'left\')" onfocus="addMouseOver(this, null, \'left\')" class="mouseOverInfoOuter">');c.push('<img title="" class="infoIcon" alt="" src="/s.gif"/>');c.push('<div style="display: none; opacity: 0;" class="mouseOverInfo">');d&&c.push(d);c.push("</div>");c.push("</div>");return c.join("")};
function MouseOverFadeHandler(d,c,h,e){this.controller=d;this.div=c;this.shim=new iframeShim(c);this.saveOrigPos=h;var a=this;this.setPosition=function(b){if(!b)b=a.shim;b.setStyle("display","block");if(a.saveOrigPos)if(a.origL)b.setStyle("left",a.origL);else a.origL=a.div.style.left;var f=getOffsetLeft(a.div),g=f+a.div.offsetWidth,i=getScrollX()+getWindowWidth()-15;if(e==="left"){g=getOffsetLeft(a.div.parentNode);f=a.div.offsetWidth;g-=f;g>0?b.setStyle("left",-1*f+"px"):b.setStyle("left",-1*(f+g)+
"px")}else if(f<0)b.setStyle("left","0");else g>i&&b.setStyle("left",a.div.offsetLeft-(g-i)-20+"px");if(a.saveOrigPos)if(a.origTop)b.setStyle("top",a.origTop);else a.origTop=a.div.style.top;f=getObjY(a.div);g=f+a.div.offsetHeight;i=getScrollY()+getWindowHeight()-15;if(f<0)b.setStyle("top","0");else g>i&&b.setStyle("top",a.div.offsetTop-(g-i)-15+"px")};this.mover=new Fader(this.shim,function(b){return b.getOpacity()<=0},function(b){return b.getOpacity()>=0.99},30,function(b,f){return b+f*0.2},function(b,
f){b.setOpacity(f)},0,function(b){b.setOpacity(0);b.setStyle("display","none")},function(b){b.setOpacity(0.99);b.setStyle("display","block")},this.setPosition);this.fadeIn=function(){a.mover.fadeIn()};this.fadeOut=function(){a.mover.fadeOut()}};
var FilterLookupPage=function(){};FilterLookupPage.prototype.checked=[];FilterLookupPage.prototype.checkAll=function(a){for(var c=0;;c++){var b=document.getElementById("chkbox"+c);if(!b)break;b.checked=a;FilterLookupPage.prototype.checked[c]=a?b.value:null}};
FilterLookupPage.prototype.transfer=function(a){var c=opener.document.getElementById(opener.filterLookupValueElem),b=c.value;if(a)if(document.getElementById("chkbox0").checked)b=document.getElementById("chkbox0").value;else{if(document.getElementById("chkbox1").checked)b=document.getElementById("chkbox1").value}else{for(a=0;a<FilterLookupPage.prototype.checked.length;a++){var d=FilterLookupPage.prototype.checked[a];if(d!=null){if(b.length>0)b+=", ";if(d.indexOf(",")>=0)d='"'+d+'"';b+=d}}if(b.length>
c.maxLength)b=b.substring(0,c.maxLength)}c.value=b;self.close();return false};FilterLookupPage.prototype.doCheckbox=function(a){var c=document.getElementById("chkbox"+a);FilterLookupPage.prototype.checked[a]=c.checked?c.value:null};FilterLookupPage.prototype.initBoolean=function(){for(i=0;i<2;i++){var a=document.getElementById("chkbox"+i);a.checked=a.value==opener.document.getElementById(opener.filterLookupValueElem).value}};
var AlohaSkin=function(){var i,b,d,g,e,f,j=0,l=function(){b=document.getElementById("bodyTable");if(i=XBrowser.userAgent.isIE7){g=document.getElementById("contentWrapper");e=document.getElementById("tabNavigation");f=document.getElementById("motifCurve");if(!g||!e||!f)return false;b&&addEvent(b,"resize",function(){var a=b.clientWidth;if(a!=j){j=a;AlohaSkin.doSizing(true)}})}else{d=document.getElementById("phHeader");window.sfdcPage.prependToOnResizeQueue(function(){AlohaSkin.doSizing(true)})}return true};
return{resizeComplete:false,resizeDisabled:false,doSizing:function(){if(l()){this.doSizing=i?function(a){e.style.minWidth="";f.style.minWidth="";var c=g.clientWidth-10+"px";f.style.minWidth=c;e.style.minWidth=c;if(!a)document.body.scrollLeft=0}:function(a){var c=document.body.clientWidth,h=c+"px",k=XBrowser.userAgent.isWebkit;b&&(k?b.style.width=c-20+"px":b.style.maxWidth=h);d&&(k?d.style.width=h:d.style.maxWidth=h);if(!a)if(!window.location.hash){a=0;if(AlohaSkin.dontResetVerticalScroll==true)a=
Ext.get(document.body).getScroll().top;window.scrollTo(0,a)}};this.resizeComplete=true;return this.doSizing()}else this.resizeDisabled=true}}}();
function MenuButtonRounded(a,b,c){MenuButton.call(this,a,b);this.minExtensionWidth=c}MenuButtonRounded.prototype=new MenuButton;MenuButtonRounded.prototype.constructor=MenuButtonRounded;MenuButtonRounded.prototype.getMenuWidth=function(){var a=this.parentDiv.offsetWidth,b=parseInt(XBrowser.getCurrentStyle(this.menuDiv,"borderLeftWidth"),10);b=isNaN(b)?0:b;var c=parseInt(XBrowser.getCurrentStyle(this.menuDiv,"borderRightWidth"),10);c=isNaN(c)?0:c;return a-b-c};
MenuButtonRounded.prototype.position=function(){this.menuDiv.style.width="";for(var a=this.getMenuWidth(),b=a,c=this.menuDiv.childNodes,e=0,f=c.length;e<f;e++){var d=c[e];if(d.nodeType==Node.ELEMENT_NODE){d=d.offsetWidth;if(d>a)if(this.minExtensionWidth){if(d-b>=this.minExtensionWidth)a=d}else a=d}}a!==b?addStyleClass(this.menuDiv,"menuWidthExtended"):delStyleClass(this.menuDiv,"menuWidthExtended");this.shim.setStyle("width",a+"px");a=XBrowser.getCurrentStyle(this.parentDiv,"display");if(a=="inline"||
a=="inline-block"){this.parentDiv.style.position="relative";this.shim.setStyle("top",this.buttonDiv.offsetHeight+"px")}};
function TagMenuButton(a,b){MenuButton.call(this,a,false);TagMenuButton.fetched=false;TagMenuButton.requesting=false;this.loaderURL=b;this.buttonWidth=TagMenuButton.BUTTON_WIDTH}TagMenuButton.prototype=new MenuButton;TagMenuButton.BUTTON_WIDTH=33;TagMenuButton.prototype.show=function(){TagMenuButton.fetched||this.getMRUTags(this.muttonId,this.isCached,this.loaderURL);MenuButton.prototype.show.apply(this)};
TagMenuButton.prototype.getMRUTags=function(){if(!TagMenuButton.requesting){TagMenuButton.requesting=true;this.menuDiv.innerHTML="";this.addOption(LC.getLabel("Page_SearchResult","dhtmlLoading"),"");var a=this;XBrowser.postHttpResponse(this.loaderURL,function(b){a.processMRUdata(b.responseText)},"")}};
TagMenuButton.prototype.processMRUdata=function(a){a=Util.evalAjaxServletOutput(a).mruList;TagMenuButton.fetched=true;TagMenuButton.requesting=false;if(a.length==0)this.menuDiv.innerHTML="<span>"+LC.getLabel("BrowseTags","noRecentTags")+"</span>";else{this.menuDiv.innerHTML="";for(var b=0;b<a.length;b++)this.addOption(a[b].value,a[b].href)}this.position()};TagMenuButton.flushCache=function(){TagMenuButton.fetched=false};
function TagLinkEditElement(a,b,c){MenuButton.call(this,a,b);this.tagLinkUrl=c}TagLinkEditElement.prototype=new MenuButton;TagLinkEditElement.prototype.defaultAction=function(){navigateToUrl(this.tagLinkUrl)};TagLinkEditElement.prototype.show_hook=function(){window.sfdcPage.setMenuButtonOpen&&window.sfdcPage.setMenuButtonOpen(this.parentDiv)};TagLinkEditElement.prototype.hide_hook=function(){window.sfdcPage.setMenuButtonClosed&&window.sfdcPage.setMenuButtonClosed()};
TagLinkEditElement.prototype.getMenuWidth=function(){var a=this.buttonDiv.offsetWidth;if(XBrowser.userAgent.isIE)a-=8;return a};TagLinkEditElement.prototype.initAccessibilityMode=function(){};
function BouncedEmailAddressDialog(c,a,b){this.id=c;this.isModal=true;this.formId="bouncedEmailAddressOverlayInputForm";this.errorElementId="errorMsg";this.windowName="";this.width=400;this.linkId=b;this.emailAddress=document.getElementById(BounceEmailConstants.HIDDEN_EMAIL_ADDRESS).value;this.emailBounceReason=document.getElementById(BounceEmailConstants.HIDDEN_BOUNCE_REASON).value;this.emailBounceDate=document.getElementById(BounceEmailConstants.HIDDEN_BOUNCE_DATE).value;this.saveLocation=a;this.addEvents()}
BouncedEmailAddressDialog.HEIGHT=80;BouncedEmailAddressDialog.prototype=new OverlayDialog;BouncedEmailAddressDialog.prototype.showBouncedEmail=function(){this.setTitle(LC.getLabel("Page_BouncedEmailOverlay","page_title"));this.createContent();this.show();this.focusInOverlay()};
BouncedEmailAddressDialog.prototype.createContent=function(){var c=document.getElementById(this.getContentId()),a=[],b=LC.getLabel("Page_BouncedEmailOverlay","emailAddress");a.push('<table border="0">');a.push("<tr><td>");a.push(b);a.push("</td><td>");a.push('<input id="overlayEmailAddress" type="text" size="30" name="emailAddress" title="'+b+'" value="'+this.emailAddress+'"/>');a.push("</td></tr>");a.push("<tr><td>");a.push(LC.getLabel("Page_BouncedEmailOverlay","bounceReason"));a.push("</td><td>");
a.push(this.emailBounceReason);a.push("</td></tr>");a.push("<tr><td>");a.push(LC.getLabel("Page_BouncedEmailOverlay","bounceDate"));a.push("</td><td>");a.push(this.emailBounceDate);a.push("</td></tr>");a.push("</table>");a.push("<div class='buttons'>");b=LC.getLabel("Page_BouncedEmailOverlay","makeValidButton");a.push("<input class='btn' type='button' value='");a.push(b);a.push("' title='");a.push(b);a.push("' onclick=\"");a.push("if(sfdcPage.getDialogById('");a.push(this.id);a.push("').savePage()) { sfdcPage.getDialogById('");
a.push(this.id);a.push("').hide(); }\">");b=LC.getLabel("Buttons","cancel");a.push("<input class='btn' type='button' value='");a.push(b);a.push("' title='");a.push(b);a.push("' onclick=\"");a.push("sfdcPage.getDialogById('");a.push(this.id);a.push("').cancel(); document.getElementById('");a.push(this.linkId);a.push("').focus();\">");a.push("</div>");c.innerHTML=a.join("")};BouncedEmailAddressDialog.prototype.focusInOverlay=function(){document.getElementById("overlayEmailAddress").focus()};
BouncedEmailAddressDialog.prototype.savePage=function(){var c=document.getElementById("overlayEmailAddress");c=this.saveLocation+"&"+EmailAddrEditConstants.pPASS_IN_EMAIL_ADDRESS+"="+escape(c.value);window.location=c;return true};BouncedEmailAddressDialog.getDialog=function(c,a,b){var d=sfdcPage.getDialogById(c);if(d)return d;d=new BouncedEmailAddressDialog(c,a,b);d.register();return d};
var Dialogs={num:0,getNextId:function(){return"simpleDialog"+Dialogs.num++},doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',types:{WARN:{backgroundClass:"backgroundWarn",contentClass:"contentWarn",iconClass:"warningLarge",getIconAlt:function(){return LC.getLabel("Icon","WARNING")}},INFO:{backgroundClass:"backgroundInfo",contentClass:"contentInfo",iconClass:"infoLarge",getIconAlt:function(){return LC.getLabel("Icon","INFO")}},ERROR:{backgroundClass:"backgroundError",
contentClass:"contentError",iconClass:"errorLarge",getIconAlt:function(){LC.getLabel("Icon","ERROR")}},CONFIRM:{backgroundClass:"backgroundConfirm",contentClass:"contentConfirm",iconClass:"confirmLarge",getIconAlt:function(){LC.getLabel("Icon","CONFIRM")}}},showSimpleWarning:function(a,b,c){Dialogs.createSimpleWarning(a,b,c).show()},createSimpleWarning:function(a,b,c){return Dialogs.createSimpleDialog(a,b,Dialogs.types.WARN,c)},showSimpleError:function(a,b,c){Dialogs.createSimpleError(a,b,c).show()},
createSimpleError:function(a,b,c){return Dialogs.createSimpleDialog(a,b,Dialogs.types.ERROR,c)},createSimpleErrorWithAction:function(a,b,c){return Dialogs.createSimpleDialog(a,b,Dialogs.types.ERROR,null,c)},showSimpleInfo:function(a,b,c){Dialogs.createSimpleInfo(a,b,c).show()},createSimpleInfo:function(a,b,c){return Dialogs.createSimpleDialog(a,b,Dialogs.types.INFO,c)},showSimpleConfirmation:function(a,b,c){Dialogs.createSimpleConfirmation(a,b,c).show()},createSimpleConfirmation:function(a,b,c){return Dialogs.createSimpleDialog(a,
b,Dialogs.types.CONFIRM,c)},createSimpleDialog:function(a,b,c,e,f){var d=[];if(f){d=[f];actionLabels=[LC.getLabel("Buttons","ok")]}else if(e){d=[e,null];actionLabels=[LC.getLabel("Buttons","ok"),LC.getLabel("Buttons","cancel")]}else actionLabels=[LC.getLabel("Buttons","ok")];return Dialogs.createDialog({id:Dialogs.getNextId(),title:a,message:b,backgroundClass:c.backgroundClass,contentClass:c.contentClass,iconClass:c.iconClass,iconAlt:c.getIconAlt(),actions:d,actionLabels:actionLabels},true)},createCheckboxConfirmationDialog:function(a,
b,c,e,f,d,g){return Dialogs.createDialog({id:Dialogs.getNextId(),title:a,message:b,backgroundClass:Dialogs.types.CONFIRM.backgroundClass,contentClass:Dialogs.types.CONFIRM.contentClass,iconClass:Dialogs.types.CONFIRM.iconClass,iconAlt:Dialogs.types.CONFIRM.getIconAlt(),actions:[d,g],actionLabels:[e,f],checkboxLabel:c},true)},createCheckboxWarningDialog:function(a,b,c,e,f,d,g){return Dialogs.createDialog({id:Dialogs.getNextId(),title:a,message:b,backgroundClass:Dialogs.types.WARN.backgroundClass,contentClass:Dialogs.types.WARN.contentClass,
iconClass:Dialogs.types.WARN.iconClass,iconAlt:Dialogs.types.WARN.getIconAlt(),actions:[d,g],actionLabels:[e,f],checkboxLabel:c},true)},createDialog:function(a,b){var c=new AccessibleDialog(a);b&&c.register();return c},reloadDialog:function(){for(dialogId in sfdcPage.dialogs){var a=sfdcPage.dialogs[dialogId];a.isOpen&&a.reloadDialog&&a.reloadDialog()}},setOpenDialogHeight:function(a){if(window.curPopupWindow){if(curPopupWindow.innerHeight)curPopupWindow.innerHeight=a}else for(dialogId in sfdcPage.dialogs){var b=
sfdcPage.dialogs[dialogId];b.isOpen&&b.setHeight&&b.setHeight(a)}},setOpenDialogTitle:function(a){if(window.curPopupWindow)curPopupWindow.title=a;else for(dialogId in sfdcPage.dialogs){var b=sfdcPage.dialogs[dialogId];b.isOpen&&b.setTitle&&b.setTitle(a)}}};
function AccessibleDialog(a){this.id=a.id;this.isModal=true;this.width=400;this.title=a.title;this.displayX=true;this.extraClass=a.extraClass;this.message=a.message;this.backgroundClass=a.backgroundClass;this.contentClass=a.contentClass;this.iconClass=a.iconClass;this.iconAlt=a.iconAlt;this.actions=a.actions;this.actionLabels=a.actionLabels;this.checkboxLabel=a.checkboxLabel;if(UserContext.isAccessibleMode)this.popupWindow=null;else this.addEvents()}AccessibleDialog.prototype=new OverlayDialog;
AccessibleDialog.prototype.doAction=function(a){this.hide();if(this.actions[a]&&typeof this.actions[a]=="function")this.actions[a]()};AccessibleDialog.prototype.toggle=function(a){var b=document.getElementById(this.id+"button0");if(b){b.disabled=!a;b.className=a?"btn":"btnDisabled"}};AccessibleDialog.prototype.createDialog=function(){UserContext.isAccessibleMode||OverlayDialog.prototype.createDialog.call(this)};
AccessibleDialog.prototype.createContent=function(){document.getElementById(this.getContentId()).innerHTML=this.getContent()};
AccessibleDialog.prototype.getContent=function(){var a=[];a.push("<table border='0'><tr><td style='vertical-align: top'><img src='/s.gif' class='");a.push(this.iconClass);a.push("' alt='");a.push(this.iconAlt);a.push("'></td><td style='padding-left: 8px; vertical-align: top; line-height: 16px'>");a.push(this.message);if(this.checkboxLabel){a.push("<div style='line-height:12px; margin-top: 12px'>");a.push("<input type='checkbox' id='");a.push(this.id);a.push("checkbox' onclick='");if(!UserContext.isAccessibleMode){a.push('sfdcPage.getDialogById("');
a.push(this.id);a.push('").')}a.push("toggle(this.checked);'/><label for='");a.push(this.id);a.push("checkbox'>");a.push(this.checkboxLabel);a.push("</label></div>");if(UserContext.isAccessibleMode){a.push("<script>function toggle(checked) { ");a.push("window.confirmOnClose = checked;");a.push("var btn = document.getElementById('");a.push(this.id);a.push("button0');");a.push("if (btn) {");a.push("btn.disabled = !checked;");a.push("btn.className = checked ? 'btn' : 'btnDisabled';}");a.push("}<\/script>")}}a.push("</td></tr></table>");
a.push("<div class='buttons'>");for(var b=0;b<this.actionLabels.length;b++){var c=this.checkboxLabel&&b===0;a.push("<input type='button' id='");a.push(this.id);a.push("button");a.push(b);a.push("' onclick='");UserContext.isAccessibleMode&&a.push("window.opener.");a.push('sfdcPage.getDialogById("');a.push(this.id);a.push('").doAction(');a.push(b);a.push(")' class='btn");c&&a.push("Disabled");a.push("' value='");a.push(this.actionLabels[b]);a.push("'");this.checkboxLabel&&b===0&&a.push(" disabled='disabled'");
a.push("/>")}a.push("</div>");return a.join("")};AccessibleDialog.prototype.hide=function(){if(UserContext.isAccessibleMode){if(this.popupWindow){try{this.popupWindow.confirmOnClose=false;this.popupWindow.close()}catch(a){}this.popupWindow=null}}else OverlayDialog.prototype.hide.call(this)};
AccessibleDialog.prototype.show=function(){if(UserContext.isAccessibleMode){if(!this.height)this.height=300;this.createAccessiblePopupWindow();if(this.popupWindow){this.popupWindow.focus();this.popupWindow.confirmOnCloseLabel=LC.getLabel("Global","dialogCloseConfirm");curPopupWindow=this.popupWindow}}else OverlayDialog.prototype.show.call(this)};AccessibleDialog.prototype.writeAccessiblePopupHeaderIncludes=function(){};
AccessibleDialog.prototype.createAccessiblePopupWindow=function(){if(this.popupWindow=window.open("","modalDialog","width="+this.width+",height="+this.height+",dialog=yes")){this.popupWindow.Jiffy=window.Jiffy;var a=this.popupWindow.document;a.writeln(Dialogs.doctype);a.writeln("<html class="+this.backgroundClass+"><head><title>");a.writeln(this.title);a.writeln("</title>");DynamicCss.writeCss(null,a,true);a.writeln("");this.writeAccessiblePopupHeaderIncludes(a);a.writeln("</head><body class='accessibleDialogPopup "+
this.contentClass+"'>");a.writeln(this.getContent());a.writeln("</body></html>");a.close()}};function IFrameDialog(a,b,c,e,f,d){d=d||{};d.id=a;d.title=b;AccessibleDialog.call(this,d);this.url=c;this.height=e;this.width=f;this.contentId=this.id+"ContentId"}Util.extend(IFrameDialog,AccessibleDialog);IFrameDialog.prototype.getContent=function(){return'<iframe frameborder="no" id="'+this.contentId+'" style="border:0;height:'+this.height+'px;width: 100%;" src="'+this.url+'"></iframe>'};
IFrameDialog.prototype.display=function(){UserContext.isAccessibleMode||this.createContent();this.show()};IFrameDialog.prototype.createAccessiblePopupWindow=function(){this.popupWindow=window.open(this.url,"modalDialog","width="+this.width+",height="+this.height+",dialog=yes")};IFrameDialog.prototype.hide=function(){var a=document.getElementById(this.contentId);if(a)a.parentNode.style.visibility="";AccessibleDialog.prototype.hide.apply(this,arguments)};
function PersonalSettingsDialog(){IFrameDialog.apply(this,arguments)}Util.extend(PersonalSettingsDialog,IFrameDialog);
PersonalSettingsDialog.prototype.setHeight=function(a){if(!UserContext.isAccessibleMode)if(window.Ext){var b=Ext.get(this.contentId),c=b.parent();c.syncFx();c.scale(undefined,a+c.getPadding("tb"),{duration:0.35,stopFx:true,easing:"easeOutStrong",callback:function(){b.setHeight(a)}})}else{this.dialog.style.height=a+"px";document.getElementById(this.contentId).style.height=a+"px";this.height=a}};
PersonalSettingsDialog.prototype.hide=function(){IFrameDialog.prototype.hide.apply(this,arguments);XBrowser.userAgent.isIE&&removeEvent(document.body,"mousewheel",XBrowser.preventDefaultEvent);if(this.refreshOnClose)window.location=window.location};PersonalSettingsDialog.prototype.show=function(){IFrameDialog.prototype.show.apply(this,arguments);XBrowser.userAgent.isIE&&addEvent(document.body,"mousewheel",XBrowser.preventDefaultEvent)};
PersonalSettingsDialog.prototype.reloadDialog=function(){var a=document.getElementById(this.contentId).contentWindow;a||(a=iframe.contentDocument?iframe.contentDocument.defaultView:null);a.location.reload(true)};PersonalSettingsDialog.prototype.position=function(){IFrameDialog.prototype.position.apply(this,arguments);this.dialog.style.top="60px"};
PersonalSettingsDialog.prototype.getContentWindow=function(){if(UserContext.isAccessibleMode)return this.popupWindow;else{var a=document.getElementById(this.contentId).contentWindow;a||(a=iframe.contentDocument?iframe.contentDocument.defaultView:null);return a}};PersonalSettingsDialog.prototype.setRefreshOnClose=function(){this.refreshOnClose=true};
function FunctionalDialog(b,a,c,d){this.id=b;this.isModal=a;this.isMovable=d;this.extraClass="functionalDialog";this.width=OverlayDialog.MAX_WIDTH;this.maxHeight=OverlayDialog.MAX_HEIGHT;this.setupDefaultButtons();this.title=c;this.hasSummaryElement=true;this.addEvents()}FunctionalDialog.prototype=new OverlayDialog;FunctionalDialog.MAX_HEIGHT=600;FunctionalDialog.MIN_HEIGHT=120;
FunctionalDialog.prototype.setMaxHeight=function(b){this.maxHeight=b>FunctionalDialog.MAX_HEIGHT?FunctionalDialog.MAX_HEIGHT:b};FunctionalDialog.prototype.setInnerHeight=function(){var b=this.getContentElement(),a=b.offsetHeight+(Math.min(this.maxHeight,getWindowHeight()-40)-this.dialog.offsetHeight);b.style.height=Math.max(FunctionalDialog.MIN_HEIGHT,a)+"px"};
FunctionalDialog.prototype.createContent=function(){var b=document.getElementById(this.id+"Content"),a=[];a.push("<h2 id='");a.push(this.id);a.push("Header'>");a.push(this.header);a.push("</h2>");if(this.info){a.push("<p id='");a.push(this.id);a.push("Info'>");a.push(this.info);a.push("</p>")}a.push("<div class='");this.hasSummaryElement?a.push("scrollableArea"):a.push("scrollableAreaBottomBorder");a.push("' id='");a.push(this.id);a.push("Inner'></div>");if(this.hasSummaryElement){a.push("<div id='");
a.push(this.id);a.push("Split' class='split'><img src='"+UserContext.getUrl("/img/overlaypointer.gif")+"' class='pointer'></div><div class='summaryArea' id='");a.push(this.id);a.push("Summary'></div>")}this.createButtons(a);b.innerHTML=a.join("")};FunctionalDialog.prototype.setContentInnerHTML=function(b){this.getContentElement().innerHTML=b};FunctionalDialog.prototype.importContentNode=function(b){this.setContentInnerHTML("");this.getContentElement().appendChild(b)};
FunctionalDialog.prototype.getContentElement=function(){return document.getElementById(this.id+"Inner")};FunctionalDialog.prototype.setSummaryInnerHTML=function(b){this.getSummaryElement().innerHTML=b};FunctionalDialog.prototype.importSummaryNode=function(b){this.setSummaryInnerHTML("");this.getSummaryElement().appendChild(b)};FunctionalDialog.prototype.getSummaryElement=function(){return document.getElementById(this.id+"Summary")};
FunctionalDialog.prototype.hideSummaryElement=function(){if(this.hasSummaryElement){this.hasSummaryElement=false;var b=this.getSummaryElement(),a=document.getElementById(this.id+"Split"),c=this.getContentElement();if(b&&a&&c){b.style.display="none";a.style.display="none";c.className="scrollableAreaBottomBorder"}}};
function GoogleDocNameInputDialog(b,c,d,a){this.id=b;this.url=c;this.escapeParams=d;this.parentId=a;this.isModal=true;this.formId="nameInputForm";this.errorElementId="errorMsg";this.windowName="createDoc";this.width=600;this.addEvents();LC.getLabel("GoogleDocs","DOCUMENT");LC.getLabel("GoogleDocs","SPREADSHEET");LC.getLabel("GoogleDocs","PRESENTATION");LC.getLabel("GoogleDocs","LOWER_DOCUMENT");LC.getLabel("GoogleDocs","LOWER_SPREADSHEET");LC.getLabel("GoogleDocs","LOWER_PRESENTATION")}
GoogleDocNameInputDialog.HEIGHT=80;GoogleDocNameInputDialog.prototype=new OverlayDialog;GoogleDocNameInputDialog.prototype.hide=function(){OverlayDialog.prototype.hide.apply(this,[]);this.createContent()};GoogleDocNameInputDialog.prototype.enter=function(){this.dependent=1;var b=this.validate();if(b){this.win=b;this.processStep()}else this.dependent=0};GoogleDocNameInputDialog.prototype.cancel=function(){if(this.dependent)try{this.win.close()}catch(b){}this.hide()};
GoogleDocNameInputDialog.prototype.setDocTypeAndShow=function(b,c){this.docType=b;this.docTypeStr=c;this.setTitle(LC.getLabel("GoogleDocCreatorPage","nameText",c));this.createContent();this.show();this.focusInOverlay()};
GoogleDocNameInputDialog.prototype.createContent=function(){if(this.docType){var b=document.getElementById(this.getContentId()),c=LC.getLabel("GoogleDocs",this.docType),d=LC.getLabel("GoogleDocs","LOWER_"+this.docType),a=[];a.push('<form enctype="multipart/form-data" method="POST" id="'+GoogleDocCreator.FORM_NAME+'">');a.push("<table align=center>");a.push("<tbody>");a.push('<tr><td colspan="2">');a.push('<input type="radio" id="create_method" name="'+GoogleDocCreator.METHOD+'" value="0" checked>');
a.push('<label for="create_method" onclick="document.getElementById(\'create_method\').checked=true">'+LC.getLabel("GoogleDocCreator","CreateByNew",d)+"</label>");a.push("</td></tr>");a.push('<tr><td align=right><label for="'+GoogleDocCreator.DOC_NAME+'">');a.push(LC.getLabel("GoogleDocCreator","EntityName",c));a.push('</label>: </td><td class="inlineEditCompoundDiv"><span class="inlineEditRequiredMark">*</span><input id="'+GoogleDocCreator.DOC_NAME+'" type="text" width="64" name="'+GoogleDocCreator.DOC_NAME+
'" onchange="document.getElementById(\'create_method\').checked=true" onclick="document.getElementById(\'create_method\').checked=true"/></td></tr>');a.push('<tr><td>&nbsp;</td><td><div class="errorMsg" id="'+this.errorElementId+'" style= "display:none"></div>');a.push("</td></tr>");a.push("</tbody>");a.push("<tbody>");a.push('<tr><td colspan="2">');a.push('<input type="radio" id="upload_method" name="'+GoogleDocCreator.METHOD+'" value="1">');a.push('<label for="upload_method" onclick="document.getElementById(\'upload_method\').checked=true">'+
LC.getLabel("GoogleDocCreator","CreateByUpload")+"</label>");a.push("</td></tr>");a.push('<tr><td align=right><label for="'+GoogleDocCreator.DOC_UPLOAD+'">');a.push(LC.getLabel("GoogleDocCreator","FileLocation"));a.push('</label>: </td><td class="inlineEditCompoundDiv"><span class="inlineEditRequiredMark">*</span><input id="'+GoogleDocCreator.DOC_UPLOAD+'" type="file" width="64" name="'+GoogleDocCreator.DOC_UPLOAD+'" onchange="document.getElementById(\'upload_method\').checked=true" onclick="document.getElementById(\'upload_method\').checked=true"/> ');
this.help[this.docType]&&a.push(decodeURIComponent(this.help[this.docType]));a.push("</td></tr>");a.push('<tr><td align=right><label for="'+GoogleDocCreator.DOC_UPLOAD_NAME+'">');a.push(LC.getLabel("GoogleDocCreator","NewName",c));a.push('</label>: </td><td class="inlineEditCompoundDiv"><input id="'+GoogleDocCreator.DOC_UPLOAD_NAME+'" type="text" width="64" name="'+GoogleDocCreator.DOC_UPLOAD_NAME+'" onchange="document.getElementById(\'upload_method\').checked=true" onclick="document.getElementById(\'upload_method\').checked=true"/>');
a.push(LC.getLabel("GoogleDocCreator","Different"));a.push("</td></tr>");a.push("<tr><td>&nbsp;</td><td>");a.push('<div class="errorMsg" id="'+GoogleDocCreator.DOC_UPLOAD+'_error" style= "display:none"></div>');a.push("</td></tr>");a.push("</tbody>");a.push("</table>");a.push('<input type="hidden" id="'+GoogleDocCreator.PARENT_ID+'" name="'+GoogleDocCreator.PARENT_ID+'" value="'+this.parentId+'"/>');a.push('<input type="hidden" id="'+GoogleDocCreator.DOC_TYPE+'" name="'+GoogleDocCreator.DOC_TYPE+
'" value="'+this.docType+'"/>');a.push("</form>");b.innerHTML=a.join("");this.setupDefaultButtons();this.overrideButton(0,LC.getLabel("GoogleDocCreatorPage","pageTitle"),function(e){sfdcPage.getDialogById(e).enter();return false});this.overrideButton(1,LC.getLabel("Buttons","cancel"),function(e){sfdcPage.getDialogById(e).cancel();return true});b.appendChild(this.createDomButtons())}};
GoogleDocNameInputDialog.prototype.processStep=function(){for(var b=document.getElementById(this.getContentId()).getElementsByTagName("input"),c=0;c<b.length;c++)if(b[c].value!=LC.getLabel("Buttons","cancel")){if(b[c].value==LC.getLabel("GoogleDocCreatorPage","pageTitle"))b[c].className="btnDisabled";b[c].disabled=true}var d=this;this.checkId=window.setInterval(function(){d.checkStatus()},250)};
GoogleDocNameInputDialog.prototype.checkStatus=function(){if(this.win.closed||!this.dependent){window.clearTimeout(this.checkId);this.checkId=this.win=0;this.hide()}};
GoogleDocNameInputDialog.prototype.createDomButtons=function(){var b=document.createElement("div");b.className="buttons";var c=document.createElement("input");c.className="btn";c.type="button";for(var d=0;d<this.buttons.length;d++){var a=c.cloneNode(true),e=this.buttons[d].display,f=this.buttons[d].action;a.dialogId=this.id;a.value=e;a.action=this.buttons[d].action;a.onclick=typeof f=="string"?function(){eval(this.action)&&sfdcPage.getDialogById(this.dialogId).hide()}:typeof f=="function"?function(){this.action(this.dialogId)&&
sfdcPage.getDialogById(this.dialogId).hide()}:function(){sfdcPage.getDialogById(this.dialogId).hide()};b.appendChild(a)}return b};GoogleDocNameInputDialog.prototype.focusInOverlay=function(){XBrowser.userAgent.isIE6?setTimeout('document.getElementById(GoogleDocCreator["DOC_NAME"]).focus()',100):document.getElementById(GoogleDocCreator.DOC_NAME).focus()};
GoogleDocNameInputDialog.prototype.checkExtension=function(b){if(!this.MIME)return true;var c=b.lastIndexOf(".")+1;if(c>-1)return this.MIME[b.substr(c).toUpperCase()]!=undefined;return false};
GoogleDocNameInputDialog.prototype.validate=function(){for(var b=document.getElementById(GoogleDocCreator.FORM_NAME),c=0,d=0;d<b[GoogleDocCreator.METHOD].length;d++)if(b[GoogleDocCreator.METHOD][d].checked){c=b[GoogleDocCreator.METHOD][d].value;break}b=document.getElementById(GoogleDocCreator.DOC_NAME).value;d=document.getElementById(GoogleDocCreator.DOC_UPLOAD).value;document.getElementById(this.errorElementId).style.display="none";document.getElementById(GoogleDocCreator.DOC_UPLOAD+"_error").style.display=
"none";if((b==null||trim(b)=="")&&c==GoogleDocCreator.CREATE){document.getElementById(this.errorElementId).innerHTML=LC.getLabel("GoogleDocCreatorPage","errorMsgNoValue");document.getElementById(this.errorElementId).style.display="";this.focusInOverlay();return false}else if(c==GoogleDocCreator.UPLOAD&&(d==null||d=="")){document.getElementById(GoogleDocCreator.DOC_UPLOAD+"_error").innerHTML=LC.getLabel("GoogleDocCreatorPage","errorMsgNoValue");document.getElementById(GoogleDocCreator.DOC_UPLOAD+"_error").style.display=
"";return false}else if(c==GoogleDocCreator.UPLOAD&&!this.checkExtension(d)){document.getElementById(GoogleDocCreator.DOC_UPLOAD+"_error").innerHTML=LC.getLabel("GoogleDocCreatorPage","errorMsgType");document.getElementById(GoogleDocCreator.DOC_UPLOAD+"_error").style.display="";return false}else{d={};d[GoogleDocCreator.METHOD]=c;d[GoogleDocCreator.DOC_NAME]=b;d[GoogleDocCreator.PARENT_ID]=document.getElementById(GoogleDocCreator.PARENT_ID).value;d[GoogleDocCreator.DOC_TYPE]=document.getElementById(GoogleDocCreator.DOC_TYPE).value;
this.secret=Math.floor(Math.random()*42E6);d.secret=this.secret;b="?"+XBrowser.buildPost(d);b=encodeURIComponent(b);if(this.escapeParams)b=encodeURIComponent(b);win=window.open(this.url+b,this.windowName+this.secret,"width=900, height=600, location=yes, menubar=yes, status=yes, toolbar=yes, scrollbars=yes, resizable=yes");if(c==GoogleDocCreator.CREATE)this.dependent=0;return win}};
GoogleDocNameInputDialog.getDialog=function(b,c,d,a){var e=sfdcPage.getDialogById(b);if(e)return e;e=new GoogleDocNameInputDialog(b,c,d,a);e.register();return e};
function InlineEditDialog(){this.id="InlineEditDialog";this.isModal=true;this.extraClass="inlineEditDialog";this.width=null;this.title="";this.setupButtons();this.currentField=this.editDivPool=this.errorDiv=this.activeDiv=null;this.displayX=true;this.fields={};this.addEvents()}InlineEditDialog.prototype=new OverlayDialog;InlineEditDialog.prototype.setInnerHeight=function(){};InlineEditDialog.prototype.enter=function(){sfdcPage.getInlineEditData().closeCurrentField()};
InlineEditDialog.prototype.setupButtons=function(){this.buttons=[];this.buttons[0]={display:LC.getLabel("Buttons","ok"),action:"sfdcPage.getInlineEditData().closeCurrentField()"};this.buttons[1]={display:LC.getLabel("Buttons","cancel"),action:"sfdcPage.getInlineEditData().resetCurrentField()"}};
InlineEditDialog.prototype.createContent=function(){addEvent(this.dialog,"click",function(c){eventCancelBubble(getEvent(c))},false);var a=document.getElementById(this.getContentId()),b=[];this.createButtons(b);a.innerHTML=b.join("");this.activeDiv=document.createElement("div");this.activeDiv.className="activeField";this.errorDiv=document.createElement("div");this.editDivPool=document.createElement("div");this.editDivPool.style.display="none";a.insertBefore(this.activeDiv,a.lastChild);a.insertBefore(this.errorDiv,
a.lastChild);a.insertBefore(this.editDivPool,a.lastChild)};InlineEditDialog.prototype.addField=function(a,b,c){this.fields[a]={title:c,div:b};this.editDivPool.appendChild(b)};InlineEditDialog.prototype.setActiveField=function(a){if(this.currentField){if(this.currentField==a)return;this.editDivPool.appendChild(this.fields[this.currentField].div)}var b=this.fields[a];this.setTitle(b.title);this.currentField=a;this.activeDiv.appendChild(b.div)};
InlineEditDialog.prototype.setMaxWidth=function(a){if(a>OverlayDialog.MAX_WIDTH)a=OverlayDialog.MAX_WIDTH;if(this.dialog.currentStyle)this.dialog.style.width=a+"px";else this.dialog.style.maxWidth=a+"px"};InlineEditDialog.prototype.cancel=function(){sfdcPage.getInlineEditData().resetCurrentField();this.hide()};
function OverlayDialogElement(a){this.windowName=this.id=a;this.setupDefaultButtons();this.addEvents();this.buttonContents=this.contents="";this.hasButtonsBar=true}OverlayDialogElement.prototype=new OverlayDialog;
OverlayDialogElement.prototype.createContent=function(){var a=document.getElementById(this.getContentId()),b=[];b.push(this.contents);if(this.hasButtonsBar)if(this.buttonContents.length==0)this.createButtons(b);else{b.push("<div id='"+this.id+"_buttons' class='buttons'>");b.push(this.buttonContents);b.push("</div>")}a.innerHTML=b.join("")};OverlayDialogElement.getDialog=function(a,b){var c=sfdcPage.getDialogById(a);if(c)return c;c=new OverlayDialogElement(a);b&&b(c);c.register();return c};
function FilePreviewOverlayDialogElement(a){OverlayDialogElement.call(this,a);this.oldOverflowY=this.oldOverflowX=null;this.iPadPhoneScrollReg=false}FilePreviewOverlayDialogElement.prototype=new OverlayDialog;FilePreviewOverlayDialogElement.prototype.createContent=OverlayDialogElement.prototype.createContent;
FilePreviewOverlayDialogElement.prototype.show=function(){chatter&&chatter.getEventBus().fireEvent("UIComponent:OverlayDialog","onBeforeOverlayShow");this.dialog.style.display="block";if(this.isModal){this.background||this.createBackground();this.background.style.display="block";this.processSelectElems()}this.dialog.style.visibility="visible";this.position();if(isIPad||isIPhone){this.resizeBackground();this.reposition();var a=this;if(this.iPadPhoneScrollReg===false){addEvent(window,"scroll",function(){a.position();
a.reposition()},false);this.iPadPhoneScrollReg=true}}var b=Ext.getBody();this.oldOverflowX=b.getStyle("overflow-x");this.oldOverflowY=b.getStyle("overflow-y");b.addClass("bodyForDocViewerPanel");b.setStyle("overflow-x","hidden");b.setStyle("overflow-y","hidden");this.isOpen=true};FilePreviewOverlayDialogElement.prototype.reposition=function(){this.dialog.style.top=parseInt(this.dialog.style.top)+document.body.scrollTop+"px"};
FilePreviewOverlayDialogElement.prototype.createBackground=function(){this.background=document.createElement("div");this.background.className="docViewerPanel";document.body.appendChild(this.background);var a=this;if(!Ext.isChrome&&!Ext.isSafari&&!Sfdc.userAgent.isIE9){addEvent(this.background,"mousedown",function(b){a.smash(b)},false);addEvent(this.background,"click",function(b){getEventTarget(b)===a.background?a.background.focus():a.smash(b)},false)}document.getElementById("docViewerOverlay").style.visibility=
"visible";document.getElementById("docViewerOverlay").style.display="block";this.dialog=document.body.removeChild(this.dialog);this.background.appendChild(this.dialog)};FilePreviewOverlayDialogElement.prototype.resizeEvent=function(){this.created&&this.position()};
FilePreviewOverlayDialogElement.prototype.hide=function(){var a=Ext.getBody();a.removeClass("bodyForDocViewerPanel");this.oldOverflowX&&a.setStyle("overflow-x",this.oldOverflowX);this.oldOverflowY&&a.setStyle("overflow-y",this.oldOverflowY);OverlayDialog.prototype.hide.call(this)};FilePreviewOverlayDialogElement.getDialog=function(a,b){var c=sfdcPage.getDialogById(a);if(c)return c;c=new FilePreviewOverlayDialogElement(a);b&&b(c);c.register();return c};
OverlayDialogElement.showFilePreview=function(a,b,c,g,h,i,e,d,j,k){if(d){FilePreviewOverlayDialogElement.getDialog(a,OverlayDialogElement.initFilePreviewDialog).setTitle("");if(document.getElementById("docViewerOverlayX")){b=new AccessiblePreviewContentDialog(a+"_accessibilityMode",document.getElementById(b).innerHTML);b.content=document.getElementById("docViewerOverlay").innerHTML;b.created=true;b.register();b.show();e=b.popupWindow.document.getElementById(e);b.popupWindow.document.getElementById("docViewerOverlayX").style.visibility=
"hidden"}else{window.resizeTo(730,630);window.opener.OverlayDialogElement.showFilePreview(a,b,c,g,h,i,e,d,j,k)}}else{a=FilePreviewOverlayDialogElement.getDialog(a,OverlayDialogElement.initFilePreviewDialog);if(d=getElementsByClassName("overlayBackground",document.body,"div"))for(var f=0;f<d.length;f++)if(d[f].style.display!="none"){a.isModal=false;break}document.getElementById("docViewerContainerParent").style.height="484px";document.getElementById("docViewerOverlay").style.width="730px";a.show();
b&&document.getElementById(b)?a.setTitle("<div>"+document.getElementById(b).innerHTML+"</div>"):a.setTitle("<div></div>")}typeof insertFlexComponent!="undefined"&&insertFlexComponent(c+"/flex/DocViewer","shepherd_prefix=/sfc/servlet.shepherd&v="+g+"&mode="+h+"&in_tests="+i,"100%","100%","#f3f3f3",e,"renditionLarge",false,{adobeFlashVersionLbl:LC.getLabel("ContentFlashPlayer","adobeFlashVersion"),downloadAdobeLbl:LC.getLabel("ContentFlashPlayer","downloadAdobe"),downloadAdobeLinkLbl:LC.getLabel("ContentFlashPlayer",
"downloadAdobeLink"),closeDialogLbl:LC.getLabel("ContentFlashPlayer","closeDialog")},{fileType:j,isImage:k})};OverlayDialogElement.onFlexInit=function(){var a=Ext.get("docViewerOverlayContent");if(a)(a=a.child("*[id=renditionLarge]"))&&a.dom.focus()};OverlayDialogElement.initFilePreviewDialog=function(a){if(a){a.isModal=true;a.width=730;a.hasButtonsBar=false;a.displayX=true;a.allowKeyboardEsc=true;a.extraClass="docViewerOverlay";a.setTitle("Document Preview");a.contents='<div class="docViewerContainerParent" id="docViewerContainerParent"><div class="docViewerContainer" id="docViewerContainer"></div></div>'}};
function FieldSelectDialog(a,b,d,e,f,g,c){this.id=a;this.isModal=b;this.isMovable=true;this.buttons=[];this.selectId=e;this.info=f;this.width=OverlayDialog.MAX_WIDTH;if(c==null)c="";this.buttons[0]={id:c+"fieldSelectClose",display:LC.getLabel("Buttons","close"),action:null};this.title=d;this.addEvents();this.manualTab=false;this.innerHeight=g}FieldSelectDialog.prototype=new OverlayDialog;FieldSelectDialog.prototype.setController=function(a){this.controller=a;this.controller.setScrollDiv(document.getElementById(this.selectId))};
FieldSelectDialog.prototype.setInnerHeight=function(){this.getContentElement().style.height=this.innerHeight+"px"};FieldSelectDialog.prototype.setManualTabControl=function(a){this.manualTab=a};FieldSelectDialog.prototype.handleKeyPress=function(a){if(this.manualTab&&this.isOpen){a=getEvent(a);if(a.keyCode==KEY_TAB){if(a.preventDefault)a.preventDefault();else a.returnValue=false;return this.tab(a.shiftKey)}}OverlayDialog.prototype.handleKeyPress.call(this,a)};FieldSelectDialog.prototype.tab=function(a){this.controller.switchFocus(a)};
FieldSelectDialog.prototype.createContent=function(){var a=document.getElementById(this.getContentId()),b=[];if(this.info){b.push("<p id='");b.push(this.id);b.push("Info'>");b.push(this.info);b.push("</p>")}b.push("<div class='fieldSelectorScrollableArea'  id='");b.push(this.getInnerId());b.push("'></div>");this.createButtons(b);a.innerHTML=b.join("");this.getContentElement().appendChild(document.getElementById(this.selectId))};FieldSelectDialog.prototype.getContentElement=function(){return document.getElementById(this.getInnerId())};
FieldSelectDialog.prototype.getInnerId=function(){return this.id+"Inner"};FieldSelectDialog.prototype.show=function(){for(var a=this.getContentElement().firstChild;a.firstChild.nodeName!="TD";)a=a.firstChild;for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);this.controller.reset();this.controller.showSelects();OverlayDialog.prototype.show.call(this);this.controller.focusTop();this.controller.scrollRight()};
FieldSelectDialog.prototype.hide=function(){OverlayDialog.prototype.hide.call(this);this.controller.hideSelects();this.controller.reFocusToFieldPickerIcon&&this.controller.reFocusToFieldPickerIcon()};
function ListPaginator(a){this.init(a)}ListPaginator.prototype=new Paginator;ListPaginator.opts=[10,25,50,100,200];ListPaginator.rppId="_rpp";ListPaginator.selectionId="_selection";ListPaginator.target="_target";
ListPaginator.prototype.init=function(a){this.listDomId=a.listDomId;this.id=this.listDomId+"_paginator";Paginator.addPaginator(this);this.containerIds=a.containerIds;this.handler=a.handler;this.ref="Paginator.instances['"+this.id+"']";this.listRef="ListViewport.instances['"+this.listDomId+"']";var b=this;addEvent(document.body,"mousedown",function(c){c=getEventTarget(c);c.id!=b.id+ListPaginator.rppId+ListPaginator.target&&c.parentNode.id!=b.id+ListPaginator.rppId+ListPaginator.target&&ListPaginator.hideSelector(b.id+
ListPaginator.rppId+ListPaginator.target);c.id!=b.id+ListPaginator.selectionId+ListPaginator.target&&c.parentNode.id!=b.id+ListPaginator.selectionId+ListPaginator.target&&ListPaginator.hideSelector(b.id+ListPaginator.selectionId+ListPaginator.target)},true);this.selectCount=this.selectedOnThisPage=0;this.setState(a)};ListPaginator.prototype.setSelectCount=function(a){this.selectCount=a;this.draw()};
ListPaginator.prototype.setState=function(a){this.currentPage=parseInt(a.currentPage)||this.currentPage||1;this.recordsPerPage=parseInt(a.recordsPerPage)||this.recordsPerPage||50;this.totalRecords=parseInt(a.totalRecords);this.capped=a.capped;this.hasCheckbox=a.hasCheckbox;var b;if(this.capped)this.totalPages=null;else{b=Math.ceil(this.totalRecords/this.recordsPerPage);this.totalPages=this.currentPage>b?this.currentPage:b}this.startingRecord=(this.currentPage-1)*this.recordsPerPage+1;if(!a.nodraw){var c=
this;if(this.totalRecords===0)window.sfdcPage.appendToOnloadQueue(function(){c.draw(true)});else{this.shorterThenOriginal=this.currentPage>b?true:false;window.sfdcPage.appendToOnloadQueue(function(){c.draw()})}}};
ListPaginator.prototype.draw=function(a){var b=[];b.push("<div class='paginator'>");b.push("<span class='left'>");if(a)b.push("&nbsp;");else{b.push(this.getRecordCounts());this.hasCheckbox&&b.push(this.getSelectedCount())}b.push("</span>");a?b.push("&nbsp;"):b.push(this.getPrevNextLinks());b.push("<span class='right'>");a?b.push("&nbsp;"):b.push(this.getPageXofY());b.push("</span>");b.push("</div>");b.push("<div class='clearingBox'/>");for(a=0;a<this.containerIds.length;a++){var c=document.getElementById(this.containerIds[a]);
c&&Sfdc.Dom.updateHTML(c,b.join(""))}};ListPaginator.keyHandle=function(a){if(window.ActiveXObject&&a.keyCode==KEY_ENTER)getEventTarget(a).onchange()};
ListPaginator.prototype.getPageXofY=function(){var a=[];a.push(LC.getLabel("Paginator","page"));if(this.totalPages){a.push("<input class='pageInput' maxlength='4' onchange=\"");a.push(this.ref);a.push('.goToPage(this.value)"');a.push(' onkeydown="');a.push('ListPaginator.keyHandle(event)"');a.push(" value='");a.push(this.currentPage);a.push("'>");a.push(LC.getLabel("Paginator","of",this.totalPages))}else{a.push("&nbsp;");a.push(this.currentPage)}return a.join("")};
ListPaginator.prototype.getRecordCounts=function(){if(this.totalRecords===0)return"0";else{var a=this.getRppSelector(),b=/selectArrow/,c=true;c=a&&a.match(b)?true:false;b=[];c?b.push("<span class='selectorTarget'"):b.push("<span ");b.push(" id='");b.push(this.id+ListPaginator.rppId+ListPaginator.target);b.push("'");if(c){b.push(' onmousedown="');b.push("ListPaginator.showSelector('");b.push(this.id+ListPaginator.rppId+ListPaginator.target);b.push("')\"");b.push(' onmouseover="');b.push("ListPaginator.hoverSelector(this)");
b.push('"');b.push(' onmouseout="');b.push("ListPaginator.unhoverSelector(this)");b.push('"')}b.push(">");if(!this.shorterThenOriginal){b.push(this.startingRecord);b.push("-");this.lastRecord=0;this.lastRecord=this.capped?this.startingRecord+this.recordsPerPage-1:Math.min(this.startingRecord+this.recordsPerPage-1,this.totalRecords);b.push(this.lastRecord);if(this.capped){b.push(" ");b.push(LC.getLabel("Paginator","of",this.totalRecords+"+"))}else{b.push(" ");b.push(LC.getLabel("Paginator","of",this.totalRecords))}}b.push(a);
b.push("</span>");return b.join("")}};
ListPaginator.prototype.getPrevNextLinks=function(){var a=[],b="";a.push("<span class='prevNextLinks'>");a.push("<span class='prevNext'>");if(this.currentPage!=1){b=this.ref+".goToPage(1)";a.push('<a href="javascript:');a.push(b);a.push('">');a.push("<img src='"+UserContext.getUrl("/s.gif")+"' title='"+LC.getLabel("Paginator","first_page")+"' alt='"+LC.getLabel("Paginator","first_page")+"' class='first'>");a.push("</a>")}else a.push("<img src='"+UserContext.getUrl("/s.gif")+"' class='firstoff'>");
a.push("</span>");a.push("<span class='prevNext'>");if(this.currentPage!=1){b=this.ref+".goToPage("+(this.currentPage-1)+")";a.push('<a href="javascript:');a.push(b);a.push('">');a.push("<img src='"+UserContext.getUrl("/s.gif")+"' title='"+LC.getLabel("Paginator","previous")+"' alt='"+LC.getLabel("Paginator","previous")+"' class='prev'>");a.push(LC.getLabel("Paginator","previous"));a.push("</a>")}else{a.push("<img src='"+UserContext.getUrl("/s.gif")+"' class='prevoff'>");a.push(LC.getLabel("Paginator",
"previous"))}a.push("</span>");a.push("<span class='prevNext'>");if(this.capped||this.totalPages&&this.currentPage!=this.totalPages){b=this.ref+".goToPage("+(this.currentPage+1)+")";a.push('<a href="javascript:');a.push(b);a.push('">');a.push(LC.getLabel("Paginator","next"));a.push("<img src='"+UserContext.getUrl("/s.gif")+"' title='"+LC.getLabel("Paginator","next")+"' alt='"+LC.getLabel("Paginator","next")+"' class='next'>");a.push("</a>")}else{a.push(LC.getLabel("Paginator","next"));a.push("<img src='"+
UserContext.getUrl("/s.gif")+"' class='nextoff'>")}a.push("</span>");a.push("<span class='prevNext'>");if(this.totalPages&&this.currentPage!=this.totalPages){b=this.ref+".goToPage("+this.totalPages+")";a.push('<a href="javascript:');a.push(b);a.push('">');a.push("<img src='"+UserContext.getUrl("/s.gif")+"' title='"+LC.getLabel("Paginator","last_page")+"' alt='"+LC.getLabel("Paginator","last_page")+"' class='last'>");a.push("</a>")}else a.push("<img src='"+UserContext.getUrl("/s.gif")+"' class='lastoff'>");
a.push("</span>");a.push("</span>");return a.join("")};
ListPaginator.prototype.getSelectedCount=function(){var a=[];a.push("<span class='selectorTarget selectCount");this.selectCount>0&&a.push(" selectCountHi");a.push("' id='");a.push(this.id+ListPaginator.selectionId+ListPaginator.target);a.push("'");a.push(' onmousedown="');a.push("ListPaginator.showSelector('");a.push(this.id+ListPaginator.selectionId+ListPaginator.target);a.push("')\"");a.push(' onmouseover="');a.push("ListPaginator.hoverSelector(this)");a.push('"');a.push(' onmouseout="');a.push("ListPaginator.unhoverSelector(this)");
a.push('"');a.push(">");a.push(this.selectCount);a.push(" ");a.push(LC.getLabel("Paginator","selected"));a.push(this.getSelectionSelector());a.push("<img class='selectArrow' src='"+UserContext.getUrl("/s.gif")+"' />");a.push("</span>");return a.join("")};ListPaginator.prototype.goToPage=function(a){if(isNaN(a)||a<1)a=1;else if(this.totalPages&&a>this.totalPages)a=this.totalPages;this.handler&&this.handler(a)};
ListPaginator.prototype.getRppSelector=function(){var a=[];a.push("<table cellpadding='0' cellspacing='0' class='selector rpp' id='");a.push(this.id+ListPaginator.rppId+"'>");for(var b=ListPaginator.opts,c=0;c<b.length;c++){var d=b[c]==this.recordsPerPage?"optSelected":"optUnselected";a.push("<tr");a.push(" class='opt ");a.push(d);a.push("'");a.push(' onmouseover="');a.push("if (this.className.indexOf('optHover') < 0) { this.className += ' optHover' }");a.push('"');a.push(' onmouseout="');a.push("this.className = this.className.replace('optHover', '')");
a.push('"');a.push(' onmousedown="');a.push(this.listRef);a.push(".getListData({");a.push("rowsPerPage: ");a.push(b[c]);a.push(", rolodexIndex: ");a.push(this.listRef);a.push(".rolodexIndex");a.push("})");a.push('">');a.push("<td class='optUnselected'>");a.push(LC.getLabel("Paginator","display"));a.push("</td>");a.push("<td class='rppOpt'>");a.push(b[c]);a.push("</td>");a.push("<td class='optUnselected'>");a.push(LC.getLabel("Paginator","rpp"));a.push("</td>");a.push("</tr>")}a.push("</table>");a.push("<img class='selectArrow' src='"+
UserContext.getUrl("/s.gif")+"' />");return a.join("")};
ListPaginator.prototype.getSelectionSelector=function(){var a=[],b=this.listRef+".grid.getSelectionModel()";b=[{label:LC.getLabel("Paginator","select_page","+"+(this.lastRecord-this.startingRecord+1-this.selectedOnThisPage)),handler:b+".selectAll()"},{label:LC.getLabel("Paginator","deselect_page","-"+this.selectedOnThisPage),handler:b+".clearSelections()"},{label:LC.getLabel("Paginator","clear_all_selections","-"+this.selectCount),handler:b+".clearAllSelections()"}];a.push("<div class='selector selection' id='");
a.push(this.id+ListPaginator.selectionId+"'>");for(var c=0;c<b.length;c++){a.push("<div");a.push(" class='opt'");a.push(' onmouseover="');a.push("if (this.className.indexOf('optHover') < 0) { this.className += ' optHover' }");a.push('"');a.push(' onmouseout="');a.push("this.className = this.className.replace('optHover', '')");a.push('"');a.push(' onmousedown="');a.push(b[c].handler);a.push('">');a.push(b[c].label);a.push("</div>")}a.push("</div>");return a.join("")};
ListPaginator.showSelector=function(a){if((a=document.getElementById(a))&&a.className.indexOf(" selectorOpen")<0)a.className+=" selectorOpen"};ListPaginator.hideSelector=function(a){if(a=document.getElementById(a))a.className=a.className.replace(" selectorOpen","")};ListPaginator.hoverSelector=function(a){if(a.className.indexOf(" selectorHover")<0)a.className+=" selectorHover"};ListPaginator.unhoverSelector=function(a){a.className=a.className.replace(" selectorHover","")};
function VideoDialog(a,b){SimpleDialog.apply(this,[a,b])}VideoDialog.prototype=new SimpleDialog;VideoDialog.prototype.parent=SimpleDialog.prototype;VideoDialog.prototype.hide=function(){this.parent.hide.call(this);this.parent.setContentInnerHTML.call(this,"")};
SearchOverlayDialogs=function(){};SearchOverlayDialogs.showDialog=function(a,b,c,e,d,g){var f=document.getElementById(a);if(f){if(f.style.visibility=="visible")return;document.body.removeChild(f)}(g?new SearchAccessibleDialog(a,b,c,e,d):new SearchNonaccessibleDialog(a,b,c,e,d)).display()};
SearchOverlayDialogs.showDialogAddSearchString=function(a,b,c,e,d,g,f){var h=QueryString.getURI(c);c=QueryString.createQueryString(c,true);f=GhostTextInputWrapperElement.getSearchString(f);c.add(SearchRelatedList.pSEARCH_STR,f);SearchOverlayDialogs.showDialog(a,b,h+c.toString(),e,d,g)};function SearchAccessibleDialog(a,b,c,e,d){this.id=a;this.contentId=a+"ContentId";this.height=e;this.url=c;if(d!="")this.width=parseInt(d);this.register();addEvent(window,"focus",function(){closeDialog()})}
SearchAccessibleDialog.prototype=new SimpleDialog;SearchAccessibleDialog.prototype.display=function(){for(dialogId in sfdcPage.dialogs){var a=sfdcPage.dialogs[dialogId];a.isOpen&&a.popupWindow.close()}this.popupWindow=window.open(this.url,this.id,"height="+this.height+",width="+this.width+",location=0,status=0");this.popupWindow.focus();this.isOpen=true};SearchAccessibleDialog.prototype.isDialogOpen=function(){return this.isOpen};
SearchAccessibleDialog.prototype.resize=function(a,b){this.popupWindow.resizeTo(b,a+100)};SearchAccessibleDialog.prototype.close=function(){this.popupWindow.close()};function SearchNonaccessibleDialog(a,b,c,e,d){this.id=a;this.contentId=a+"ContentId";this.displayX=this.isMovable=true;this.height=e;this.url=c;if(d!="")this.width=parseInt(d);this.setTitle(b);this.register()}SearchNonaccessibleDialog.prototype=new SimpleDialog;
SearchNonaccessibleDialog.prototype.display=function(){var a=[];a.push('<iframe frameborder="no" id="'+this.contentId+'" style="border:0;height:'+this.height+"px;width:"+(XBrowser.userAgent.isIE6?"93%":"100%")+';" src="'+this.url+'"></iframe>');this.setContentInnerHTML(a.join(""));this.show();this.setWidth(this.width)};SearchNonaccessibleDialog.prototype.resize=function(a,b){document.getElementById(this.contentId).style.height=a+"px";this.setWidth(b)};SearchNonaccessibleDialog.superclass=SimpleDialog.prototype;
SearchNonaccessibleDialog.prototype.hide=function(){var a=this.getContentElement().firstChild.contentWindow;a.closePopup&&a.closePopup();SearchNonaccessibleDialog.superclass.hide.call(this)};SearchNonaccessibleDialog.prototype.close=function(){this.hide()};function closeDialog(a){for(dialogId in sfdcPage.dialogs){var b=sfdcPage.dialogs[dialogId];b.isOpen&&b.close()}if(a)if(XBrowser.userAgent.isSafari3)window.location.href=window.location.href;else window.location.reload()}
function resizeDialog(a,b){for(dialogId in sfdcPage.dialogs){var c=sfdcPage.dialogs[dialogId];c.isOpen&&c.resize(a,b)}};
function PrintableViewPage(){}PrintableViewPage.prototype=new DetailPage;PrintableViewPage.prototype.getEntityId=function(){var a=window.location.href.split("?")[0].split("/");return a[a.length-2]};
function PrintableListPage(){}PrintableListPage.prototype=new ListPage;
function VFInlineEditData(a){sfdcPage.registerInlineEditData(a);this.showButtons=a[VisualforceConstants.SHOW_BUTTONS];this.hideButtons=a[VisualforceConstants.HIDE_BUTTONS];this.picklistInfo=a[VisualforceConstants.PICKLIST_INFO];this.checkError=true;InlineEditData.call(this,a)}
VFInlineEditData.registerField=function(a){var b=a[InlineEditConstants.VF_ENABLED],c=sfdcPage.getInlineEditData(b);if(c){if(!InlineEditField.overlay){InlineEditField.overlay=new InlineEditDialog;InlineEditField.overlay.register()}var d=a[InlineEditConstants.FIELD_DATA][0];a=a[VisualforceConstants.PICKLIST_INFO];c.createField(d);a&&c.updatePicklist(b,d[InlineEditConstants.FIELD_ID],a,d.picklistId);c.openErrorField()}else new VFInlineEditData(a)};VFInlineEditData.prototype=new InlineEditData;
VFInlineEditData.prototype.evalPicklist=function(a){if(a.indexOf("var")==0)a=a.substr(3,a.length);eval(a)};VFInlineEditData.prototype.init=function(){InlineEditData.prototype.init.call(this);var a=sfdcPage.getDetailPage(this[InlineEditConstants.VF_ENABLED]),b=this,c=this.showButtons,d=this.hideButtons;sfdcPage.appendToOnloadQueue(function(){b.initializeButtons(a,c,true)},"Setup show edit buttons");sfdcPage.appendToOnloadQueue(function(){b.initializeButtons(a,d,false)},"Setup hide edit buttons")};
VFInlineEditData.prototype.createFields=function(){InlineEditData.prototype.createFields.call(this);var a,b,c;for(c=0;c<this.allFieldData.length;c++){b=this.allFieldData[c];if(a=this.fields[b.fieldId]){a.visualforce_label=b[VisualforceConstants.LABEL];a.visualforce_resetFunction=b[VisualforceConstants.RESET_FUNCTION];a.visualforce_changedStyleClass=b[VisualforceConstants.CHANGED_STYLE_CLASS];a.visualforce_entityId=b[InlineEditConstants.ENTITY_ID]}}this.checkError&&this.openErrorField()};
VFInlineEditData.prototype.createField=function(a){for(var b=a[InlineEditConstants.FIELD_ID],c=false,d=[],f={},e=0;e<this.allFieldData.length;e++){var i=this.allFieldData[e][InlineEditConstants.FIELD_ID];if(i==b){this.allFieldData[e]=a;c=true}d[e]=this.allFieldData[e];f[i]=this.fields[i]}this.checkError=false;this.fields={};this.allFieldData=[];this.allFieldData.push(a);this.createFields();e=this.fields[b];this.fields=f;this.fields[b]=e;this.allFieldData=d;c||this.allFieldData.push(a);this.checkError=
true};
VFInlineEditData.prototype.openErrorField=function(){var a,b,c,d;for(index=0;index<this.allFieldData.length;index++)b=this.allFieldData[index][VisualforceConstants.ERROR]||b;if(b){var f=sfdcPage.currentFieldForInlineEditDialog,e=this.currentField;this.currentField=null;for(index=0;index<this.allFieldData.length;index++){b=this.allFieldData[index];c=this.fields[b.fieldId];(d=b[VisualforceConstants.CURRENT_VALUE])&&!c.changed&&this.updateFieldForError(c,d,b.FCK_LIBRARY);b[VisualforceConstants.ERROR]&&!c.error&&
c.setError(b[VisualforceConstants.ERROR]);if(c&&c.error&&!c.compound&&!c.group)if(!a||a.tableCell.offsetTop>c.tableCell.offsetTop)a=c}this.currentField=e;sfdcPage.currentFieldForInlineEditDialog=f;if(a&&a.state==InlineEditState.EDIT){(b=sfdcPage.getInlineEditData(sfdcPage.currentFieldForInlineEditDialog))&&b.closeCurrentField();this.openField(a)}}};VFInlineEditData.prototype.updateFieldForError=function(a,b,c){if(c)a.currentValue=b;this.openField(a);if(!c)a.editElement.value=b;a.closeField()};
VFInlineEditData.prototype.updatePicklist=function(a,b,c,d){var f=typeof pl=="undefined"?null:pl,e;if(this.picklistInfo&&!sfdcPage.getRegisteredPickList(a)){this.evalPicklist(this.picklistInfo);sfdcPage.registerPickList(a,pl);this.fields[b].waitForLoad=false}if(sfdcPage.getRegisteredPickList(a)){e=sfdcPage.getRegisteredPickList(a);this.evalPicklist(c);e["vals_"+d]=pl["vals_"+d];sfdcPage.registerPickList(a,e);this.fields[b].waitForLoad=false}else this.picklistInfo=c;if(f)pl=f};
VFInlineEditData.prototype.resetField=function(a){InlineEditData.prototype.resetField.call(this,a);this.removeInputElement(a);if(a.visualforce_resetFunction){var b=a.visualforce_resetFunction;if(typeof b!=="function"){b=new Function(b);a.visualforce_resetFunction=b}b()}};VFInlineEditData.prototype.revert=function(){InlineEditData.prototype.revert.apply(this)};VFInlineEditData.prototype.getField=function(a){return a?this.fields[a]:null};
VFInlineEditData.prototype.closeCurrentField=function(){if(this.currentField){var a=this.currentField.isDifferentValue(this.currentField.getValueFromEdit()),b=this.currentField;InlineEditData.prototype.closeCurrentField.apply(this,arguments);this.createInputElement(b,a)}};VFInlineEditData.prototype.loadDynamicData=function(){if(!this.sentRequest){this.sentRequest=true;this.evalPicklist(this.picklistInfo);InlineEditData.prototype.dynamicDataLoaded.apply(this)}};
VFInlineEditData.prototype.createInputElement=function(a,b){if(b||a.error){var c=a.inputElement;if(!c){c=document.createElement("input");c.id=a.id+"_value";c.style.display="none";c.type="hidden";a.tableCell.appendChild(c);a.inputElement=c}c.name=a.id;var d={};a.addSaveData(d);d=d[a.caseSafe18Id?a.caseSafe18Id:a.id];if(Object.prototype.toString.apply(d)==="[object Array]"){var f="",e;for(e in d)if(d.hasOwnProperty(e))f+=d[e]+";";d=f}c.value=d;a.visualforce_changedStyleClass&&addStyleClass(a.readDiv,
a.visualforce_changedStyleClass)}else this.removeInputElement(a)};VFInlineEditData.prototype.removeInputElement=function(a){if(a.inputElement)a.inputElement.name=null;a.visualforce_changedStyleClass&&delStyleClass(a.readDiv,a.visualforce_changedStyleClass)};
VFInlineEditData.prototype.initializeButtons=function(a,b,c){function d(g,k,l,j){for(var h=0;h<k.length;h++)for(var o=k[h].getElementsByTagName("input"),m=0;m<o.length;m++){button=o[m];if(button.type=="button"||button.type=="submit")if(button.id===g)l[j?"editButtons":"detailButtons"].push(button)}}function f(g,k,l,j,h){d(g,k,j,h);d(g,l,j,h);if(g=document.getElementById(g))j[h?"editButtons":"detailButtons"].push(g)}for(var e=getElementsByClassName("pbButton"),i=getElementsByClassName("pbButtonb"),
n=0;n<b.length;n++)f(b[n],e,i,a,c)};
InlineEditField.CompoundField=function(){this.compound=true;this.overlay=null;this.width=0;this.editElements=[];this.elementToFocus=null};InlineEditField.CompoundField.prototype=new InlineEditField;InlineEditField.CompoundField.prototype.openField=function(){this.created||this.createEditDiv();this.showEdit()};
InlineEditField.CompoundField.prototype.createEditDiv=function(){var a=this.getFieldLabel();this.overlay=InlineEditField.overlay;this.editDiv=document.createElement("div");this.editDiv.className="inlineEditCompoundDiv";this.editDiv.id=this.id+InlineEditConstants.INNER_ID+"edit";this.overlay.addField(this.id,this.editDiv,a);this.createEditElements();this.createUndoButton();this.created=true};
InlineEditField.CompoundField.prototype.reset=function(){this.currentValue=this.initialValue;delStyleClass(this.readDiv,"inlineEditModified");this.changed=false;this.undoButton.style.display="none";this.editDiv.appendChild(this.undoButton);this.readDiv.innerHTML=this.initialHTML;if(sfdcPage.getInlineEditData(this.id).isCurrentField(this)){this.hideEdit();sfdcPage.getInlineEditData(this.id).currentField=null}this.clearError();this.updateEditElement()};
InlineEditField.CompoundField.prototype.showEdit=function(){this.overlay.setActiveField(this.id);this.overlay.setMaxWidth(this.width);this.updateEditElement();this.overlay.show();if(this.elementToFocus){this.elementToFocus.focus();this.elementToFocus.type=="text"&&this.elementToFocus.select()}};
InlineEditField.CompoundField.prototype.hideEdit=function(){this.overlay.hide();if(this.changed){this.undoButton.parentNode!=this.readDiv&&this.readDiv.appendChild(this.undoButton);this.undoButton.style.display="inline"}else this.undoButton.style.display="none"};InlineEditField.CompoundField.prototype.closeField=function(){var a=this.getValueFromEdit();if(this.isDifferentValue(a)){if(!this.changed){this.changed=true;addStyleClass(this.readDiv,"inlineEditModified")}this.currentValue=a;this.updateReadElement()}this.hideEdit()};
InlineEditField.CompoundField.prototype.updateReadElement=function(){this.readDiv.innerHTML=this.formatValue()};InlineEditField.CompoundField.prototype.formatValue=function(){};function PersonNameField(a,b,c,e,f,d){this.init(a,b,c,e,f);this.hasSalutation=d.hasSalutation;this.salutationPid=d.picklistId;this.reverse=d.reverse;this.labels=d.labels;this.waitForLoad=true;this.currentIndex=this.initialIndex=0;this.width=360}PersonNameField.S=ColumnTypeConstants.PERSONNAME_SALUTATION_OFFSET;
PersonNameField.F=ColumnTypeConstants.PERSONNAME_FIRSTNAME_OFFSET;PersonNameField.L=ColumnTypeConstants.PERSONNAME_LASTNAME_OFFSET;PersonNameField.prototype=new InlineEditField.CompoundField;PersonNameField.prototype.getComponentId=function(a){var b;switch(a){case PersonNameField.S:b=EditElement.FIELD_NAME_SALUTATION;break;case PersonNameField.F:b=EditElement.FIELD_NAME_FIRST;break;case PersonNameField.L:b=EditElement.FIELD_NAME_LAST}return b+this.id};
PersonNameField.prototype.createEditElements=function(){var a=[];a.push("<table border=0>");if(this.reverse){this.createLastNameElement(a);this.createFirstNameElement(a)}else{this.createFirstNameElement(a);this.createLastNameElement(a)}a.push("</table>");this.editDiv.innerHTML=a.join("");this.editElements[PersonNameField.F]=getElementByIdCS(this.getComponentId(PersonNameField.F));this.editElements[PersonNameField.L]=getElementByIdCS(this.getComponentId(PersonNameField.L));if(this.hasSalutation){a=
this.getComponentId(PersonNameField.S);(new picklist(a,this.salutationPid,null,this.initialValue[PersonNameField.S],' id="'+a+'" title="'+this.labels[PersonNameField.S]+'"',true,true)).onLoad();this.editElements[PersonNameField.S]=getElementByIdCS(a);this.currentIndex=this.initialIndex=this.editElements[PersonNameField.S].selectedIndex}this.elementToFocus=this.editElements[PersonNameField.L]};
PersonNameField.prototype.createFirstNameElement=function(a){a.push("<tr><td class='labelCol'><label for='");a.push(this.getComponentId(PersonNameField.F));a.push("'>");a.push(this.labels[PersonNameField.F]);a.push("</label></td><td>");this.hasSalutation&&!this.reverse&&this.createSalutationElement(a);a.push("<input type='text' id='");a.push(this.getComponentId(PersonNameField.F));a.push("' value=\"");a.push(this.cleanValue(this.currentValue[PersonNameField.F]));a.push("\" size='12' maxLength='");
a.push(ColumnTypeConstants.DEFAULT_FIRSTNAME_LENGTH);a.push("'>");this.hasSalutation&&this.reverse&&this.createSalutationElement(a);a.push("</td></tr>")};
PersonNameField.prototype.createSalutationElement=function(a){a.push("<span><select id='");a.push(this.getComponentId(PersonNameField.S));a.push("' title='");a.push(this.labels[PersonNameField.S]);a.push("'><option selected value=\"");a.push(this.cleanValue(this.currentValue[PersonNameField.S][1]));a.push('">');a.push(this.cleanValue(this.currentValue[PersonNameField.S][0]));a.push("</select></span>")};
PersonNameField.prototype.createLastNameElement=function(a){a.push("<tr><td class='labelCol'><label for='");a.push(this.getComponentId(PersonNameField.L));a.push("'>");a.push(this.labels[PersonNameField.L]);a.push("</label></td><td>");a.push("<span class='inlineEditRequiredMark'>*</span><input type='text' id='");a.push(this.getComponentId(PersonNameField.L));a.push("' value=\"");a.push(this.cleanValue(this.currentValue[PersonNameField.L]));a.push("\" size='20' maxLength='");a.push(ColumnTypeConstants.DEFAULT_LASTNAME_LENGTH);
a.push("'>");a.push("</td></tr>")};PersonNameField.prototype.formatValue=function(){var a=this.currentValue,b;if(this.reverse)b=a[PersonNameField.L]+" "+a[PersonNameField.F];else{b=this.hasSalutation&&a[PersonNameField.S][0]!=LC.getLabel("SelectElement","Required")?a[PersonNameField.S][0]+" ":"";b+=a[PersonNameField.F]+" "+a[PersonNameField.L]}return this.cleanValue(b)};
PersonNameField.prototype.isDifferentValue=function(a){return this.currentValue[PersonNameField.L]!=a[PersonNameField.L]||this.currentValue[PersonNameField.F]!=a[PersonNameField.F]||this.hasSalutation&&this.currentValue[PersonNameField.S][1]!=a[PersonNameField.S][1]};
PersonNameField.prototype.getValueFromEdit=function(){if(this.hasSalutation){this.currentIndex=this.editElements[PersonNameField.S].selectedIndex;var a=this.editElements[PersonNameField.S].options[this.currentIndex];return[[a.text,a.value],this.editElements[PersonNameField.F].value,this.editElements[PersonNameField.L].value]}else return[null,this.editElements[PersonNameField.F].value,this.editElements[PersonNameField.L].value]};
PersonNameField.prototype.updateEditElementImpl=function(){this.currentIndex=this.initialIndex;if(this.hasSalutation)this.editElements[PersonNameField.S].selectedIndex=this.currentIndex;this.editElements[PersonNameField.F].value=this.currentValue[PersonNameField.F];this.editElements[PersonNameField.L].value=this.currentValue[PersonNameField.L]};
PersonNameField.prototype.addSaveData=function(a){if(this.hasSalutation)a[this.getComponentId(PersonNameField.S)]=this.currentValue[PersonNameField.S][1];a[this.getComponentId(PersonNameField.F)]=this.currentValue[PersonNameField.F];a[this.getComponentId(PersonNameField.L)]=this.currentValue[PersonNameField.L]};function AddressField(a,b,c,e,f,d){this.init(a,b,c,e,f);this.showState=d.showState||this.currentValue[AddressField.STATE];this.labels=d.labels;this.width=400}AddressField.STREET=ColumnTypeConstants.ADDRESS_STREET_OFFSET;
AddressField.CITY=ColumnTypeConstants.ADDRESS_CITY_OFFSET;AddressField.STATE=ColumnTypeConstants.ADDRESS_STATE_OFFSET;AddressField.ZIP=ColumnTypeConstants.ADDRESS_POSTAL_CODE_OFFSET;AddressField.COUNTRY=ColumnTypeConstants.ADDRESS_COUNTRY_OFFSET;AddressField.prototype=new InlineEditField.CompoundField;
AddressField.prototype.getComponentId=function(a){var b;switch(a){case AddressField.STREET:b=EditElement.FIELD_NAME_STREET;break;case AddressField.CITY:b=EditElement.FIELD_NAME_CITY;break;case AddressField.STATE:b=EditElement.FIELD_NAME_STATE;break;case AddressField.ZIP:b=EditElement.FIELD_NAME_ZIP;break;case AddressField.COUNTRY:b=EditElement.FIELD_NAME_COUNTRY}return this.id+b};
AddressField.prototype.getMaxLengthOfComponent=function(a){switch(a){case AddressField.STREET:return ColumnTypeConstants.DEFAULT_STREET_LENGTH;case AddressField.CITY:return ColumnTypeConstants.DEFAULT_CITY_LENGTH;case AddressField.STATE:return ColumnTypeConstants.DEFAULT_STATE_LENGTH;case AddressField.ZIP:return ColumnTypeConstants.DEFAULT_ZIP_LENGTH;case AddressField.COUNTRY:return ColumnTypeConstants.DEFAULT_COUNTRY_LENGTH}return 255};
AddressField.prototype.createEditElements=function(){var a=[];a.push("<table border=0>");if(UserContext.locale.indexOf("ja")==0||UserContext.locale.indexOf("zh")==0||UserContext.locale.indexOf("ko")==0){this.createInputElement(a,AddressField.COUNTRY);this.createInputElement(a,AddressField.ZIP);this.showState&&this.createInputElement(a,AddressField.STATE);this.createInputElement(a,AddressField.CITY);this.createStreetElement(a)}else if(UserContext.locale.indexOf("de")==0){this.createStreetElement(a);
this.createInputElement(a,AddressField.ZIP);this.createInputElement(a,AddressField.CITY);this.showState&&this.createInputElement(a,AddressField.STATE);this.createInputElement(a,AddressField.COUNTRY)}else if(UserContext.locale.indexOf("CH")!=-1){this.createStreetElement(a);this.createInputElement(a,AddressField.CITY);this.createInputElement(a,AddressField.COUNTRY);this.showState&&this.createInputElement(a,AddressField.STATE);this.createInputElement(a,AddressField.ZIP)}else{this.createStreetElement(a);
this.createInputElement(a,AddressField.CITY);this.showState&&this.createInputElement(a,AddressField.STATE);this.createInputElement(a,AddressField.ZIP);this.createInputElement(a,AddressField.COUNTRY)}a.push("</table>");this.editDiv.innerHTML=a.join("");a=null;if(this.showState){a=this.getComponentId(AddressField.STATE);this.editElements[a]=getElementByIdCS(a)}a=this.getComponentId(AddressField.CITY);this.editElements[a]=getElementByIdCS(a);a=this.getComponentId(AddressField.ZIP);this.editElements[a]=
getElementByIdCS(a);a=this.getComponentId(AddressField.COUNTRY);this.editElements[a]=getElementByIdCS(a);a=this.getComponentId(AddressField.STREET);this.editElements[a]=getElementByIdCS(a);this.elementToFocus=this.editElements[a]};
AddressField.prototype.createStreetElement=function(a){a.push("<tr><td class='labelCol'><label for='");a.push(this.getComponentId(AddressField.STREET));a.push("'>");a.push(this.labels[AddressField.STREET]);a.push("</label></td><td>");a.push("<textarea wrap='soft' type='text' id='");a.push(this.getComponentId(AddressField.STREET));a.push("' rows='");a.push(EditElement.STREET_NUM_ROWS);a.push("' cols='");a.push(EditElement.STREET_NUM_COLS);a.push("' maxlength='");a.push(this.getMaxLengthOfComponent(AddressField.STREET));
a.push("'>");a.push(this.cleanValueNoBR(this.currentValue[AddressField.STREET]));a.push("</textarea>");a.push("</td></tr>")};
AddressField.prototype.createInputElement=function(a,b){a.push("<tr><td class='labelCol'><label for='");a.push(this.getComponentId(b));a.push("'>");a.push(this.labels[b]);a.push("</label></td><td>");a.push("<input type='text' id='");a.push(this.getComponentId(b));a.push("' value=\"");a.push(this.cleanValue(this.currentValue[b]));a.push("\" size='20' maxLength='");a.push(this.getMaxLengthOfComponent(b));a.push("'>");a.push("</td></tr>")};
AddressField.prototype.formatValue=function(){var a=[];if(UserContext.locale.indexOf("ja")==0||UserContext.locale.indexOf("zh")==0||UserContext.locale.indexOf("ko")==0){if(this.cleanValue(this.currentValue[AddressField.COUNTRY])!=""){a.push(this.cleanValue(this.currentValue[AddressField.COUNTRY]));a.push("<br>")}if(this.cleanValue(this.currentValue[AddressField.ZIP])!=""){a.push(this.cleanValue(this.currentValue[AddressField.ZIP]));a.push("&nbsp;")}if(this.showState&&this.cleanValue(this.currentValue[AddressField.STATE])!=
""){a.push(this.cleanValue(this.currentValue[AddressField.STATE]));a.push("&nbsp;")}a.push(this.cleanValue(this.currentValue[AddressField.CITY]));a.push("<br>");a.push(this.cleanValue(this.currentValue[AddressField.STREET]))}else if(this.cleanValue(this.currentValue[AddressField.STATE])==""&&(UserContext.locale.indexOf("sv")==0||UserContext.locale.indexOf("da")==0||UserContext.locale.indexOf("fi")==0||UserContext.locale.indexOf("no")==0)){a.push(this.cleanValueNoBR(this.currentValue[AddressField.STREET]));
a.push("<br>");a.push(this.cleanValue(this.currentValue[AddressField.ZIP]));this.cleanValue(this.currentValue[AddressField.ZIP])!=""&&this.cleanValue(this.currentValue[AddressField.CITY])!=""&&a.push("&nbsp;");a.push(this.cleanValue(this.currentValue[AddressField.CITY]));if(this.cleanValue(this.currentValue[AddressField.COUNTRY])!=""){a.push("<br>");a.push(this.cleanValue(this.currentValue[AddressField.COUNTRY]))}}else if(UserContext.locale.indexOf("de")==0){a.push(this.cleanValue(this.currentValue[AddressField.STREET]));
a.push("<br>");a.push(this.cleanValue(this.currentValue[AddressField.ZIP]));this.cleanValue(this.currentValue[AddressField.ZIP])!=""&&this.cleanValue(this.currentValue[AddressField.CITY])!=""&&a.push("&nbsp;");a.push(this.cleanValue(this.currentValue[AddressField.CITY]));if(this.cleanValue(this.currentValue[AddressField.COUNTRY])!=""||this.cleanValue(this.currentValue[AddressField.STATE])!=""){a.push("<br>");if(this.showState&&this.cleanValue(this.currentValue[AddressField.STATE])!=""){a.push(this.cleanValue(this.currentValue[AddressField.STATE]));
a.push("&nbsp;")}a.push(this.cleanValue(this.currentValue[AddressField.COUNTRY]))}}else if(UserContext.locale.indexOf("CH")!=-1){a.push(this.cleanValue(this.currentValue[AddressField.STREET]));this.cleanValue(this.currentValue[AddressField.STREET])!=""&&this.cleanValue(this.currentValue[AddressField.CITY])!=""&&a.push("<br>");a.push(this.cleanValue(this.currentValue[AddressField.CITY]));if(this.cleanValue(this.currentValue[AddressField.COUNTRY])!=""||this.cleanValue(this.currentValue[AddressField.STATE])!=
""||this.cleanValue(this.currentValue[AddressField.ZIP])!=""){a.push("<br>");if(this.cleanValue(this.currentValue[AddressField.COUNTRY])!=""){a.push(this.cleanValue(this.currentValue[AddressField.COUNTRY]));a.push("&nbsp;-&nbsp;")}if(this.cleanValue(this.currentValue[AddressField.STATE])!=""&&this.showState){a.push(this.cleanValue(this.currentValue[AddressField.STATE]));a.push("&nbsp;")}a.push(this.cleanValue(this.currentValue[AddressField.ZIP]))}}else{a.push(this.cleanValue(this.currentValue[AddressField.STREET]));
a.push("<br>");a.push(this.cleanValue(this.currentValue[AddressField.CITY]));if(this.cleanValue(this.currentValue[AddressField.CITY])!=""&&(this.cleanValue(this.currentValue[AddressField.STATE])!=""||this.cleanValue(this.currentValue[AddressField.ZIP])!=""||this.cleanValue(this.currentValue[AddressField.COUNTRY])!=""))a.push(",&nbsp;");if(this.showState&&this.cleanValue(this.currentValue[AddressField.STATE])!=""){a.push(this.cleanValue(this.currentValue[AddressField.STATE]));a.push("&nbsp;")}a.push(this.cleanValue(this.currentValue[AddressField.ZIP]));
if(this.cleanValue(this.currentValue[AddressField.COUNTRY])!=""){a.push("<br>");a.push(this.cleanValue(this.currentValue[AddressField.COUNTRY]))}}return a.join("")};
AddressField.prototype.isDifferentValue=function(a){return this.currentValue[AddressField.STREET]!=a[AddressField.STREET]||this.currentValue[AddressField.CITY]!=a[AddressField.CITY]||this.currentValue[AddressField.ZIP]!=a[AddressField.ZIP]||this.currentValue[AddressField.COUNTRY]!=a[AddressField.COUNTRY]||this.showState&&this.currentValue[AddressField.STATE]!=a[AddressField.STATE]};
AddressField.prototype.getValueFromEdit=function(){var a=[];if(this.showState)a[AddressField.STATE]=this.editElements[this.getComponentId(AddressField.STATE)].value;a[AddressField.STREET]=this.editElements[this.getComponentId(AddressField.STREET)].value;a[AddressField.CITY]=this.editElements[this.getComponentId(AddressField.CITY)].value;a[AddressField.ZIP]=this.editElements[this.getComponentId(AddressField.ZIP)].value;a[AddressField.COUNTRY]=this.editElements[this.getComponentId(AddressField.COUNTRY)].value;
return a};
AddressField.prototype.updateEditElementImpl=function(){if(this.showState)this.editElements[this.getComponentId(AddressField.STATE)].value=this.currentValue[AddressField.STATE];this.editElements[this.getComponentId(AddressField.STREET)].value=this.currentValue[AddressField.STREET];this.editElements[this.getComponentId(AddressField.CITY)].value=this.currentValue[AddressField.CITY];this.editElements[this.getComponentId(AddressField.ZIP)].value=this.currentValue[AddressField.ZIP];this.editElements[this.getComponentId(AddressField.COUNTRY)].value=this.currentValue[AddressField.COUNTRY]};
AddressField.prototype.addSaveData=function(a){if(this.showState)a[this.getComponentId(AddressField.STATE)]=this.currentValue[AddressField.STATE];a[this.getComponentId(AddressField.STREET)]=this.currentValue[AddressField.STREET];a[this.getComponentId(AddressField.CITY)]=this.currentValue[AddressField.CITY];a[this.getComponentId(AddressField.ZIP)]=this.currentValue[AddressField.ZIP];a[this.getComponentId(AddressField.COUNTRY)]=this.currentValue[AddressField.COUNTRY]};
function MultiEnumField(a,b,c,e,f,d){this.init(a,b,c,e,f);this.width=400;this.picklistId=d.picklistId;this.controllerId=d.controller;this.controllerLabel=d.controllerLabel;this.height=d.height;this.waitForLoad=true;this.initialSelections=[]}MultiEnumField.H=0;MultiEnumField.U=1;MultiEnumField.S=2;MultiEnumField.prototype=new InlineEditField.CompoundField;
MultiEnumField.prototype.getComponentId=function(a){var b;switch(a){case MultiEnumField.H:b="";break;case MultiEnumField.U:b=EditElement.UNSELECTED_ID_SUFFIX;break;case MultiEnumField.S:b=EditElement.SELECTED_ID_SUFFIX}return this.id+b};
MultiEnumField.prototype.createEditElements=function(){var a=[];a.push(" style='display: none;' size='");a.push(this.height);a.push("' multiple='multiple' id='");a.push(this.getComponentId(MultiEnumField.H));a.push("'");a=a.join("");var b=[];b.push("<span><select");b.push(a);b.push("></select></span><table border='0' cellspacing='0' cellpadding='0' class='multiSelectPicklistTable'><tr class='multiSelectPicklistRow'>");b.push("<td><span><select multiple='multiple' id='");b.push(this.getComponentId(MultiEnumField.U));
b.push("' size='");b.push(this.height);b.push("'></select></span></td><td class='multiSelectPicklistCell'>");b.push("<img onclick='MultiSelectPicklist.handleMSPSelect(\"");b.push(this.getComponentId(MultiEnumField.H));b.push("\");' class='picklistArrow"+(LC.isRtlPage()?"Left":"Right")+"' src='"+UserContext.getUrl("/s.gif")+"'>");b.push("<br/><br/>");b.push("<img onclick='MultiSelectPicklist.handleMSPUnSelect(\"");b.push(this.getComponentId(MultiEnumField.H));b.push("\");' class='picklistArrow"+(LC.isRtlPage()?
"Right":"Left")+"' src='"+UserContext.getUrl("/s.gif")+"'>");b.push("</td><td>");b.push("<span><select multiple='multiple' id='");b.push(this.getComponentId(MultiEnumField.S));b.push("' size='");b.push(this.height);b.push("'></select></span></td>");if(this.controllerId){var c=LC.getLabel("DependentElement","dependsOn",this.controllerLabel);b.push("<td><div class='"+(XBrowser.userAgent.isIE6||XBrowser.userAgent.isIE7?"mouseOverInfoDependentFields":"mouseOverInfoOuter")+"'><img title='"+c+"' alt='"+
c+"' class='infoIcon' src='"+UserContext.getUrl("/s.gif")+"'><div style='display: none;' class='mouseOverInfo'>");b.push("</div></div></td>")}b.push("</tr></table>");this.editDiv.innerHTML=b.join("");new multiPicklist(this.getComponentId(MultiEnumField.H),this.picklistId,this.controllerId,Util.convertOptionsForPicklistData(this.initialValue),a,this.getFieldLabel(),this.height,!this.required,false,-1);MultiSelectPicklist.loadMSP(this.id);this.group||this.load()};
MultiEnumField.prototype.retrieveFields=function(){this.editElements[MultiEnumField.H]=getElementByIdCS(this.getComponentId(MultiEnumField.H));this.editElements[MultiEnumField.U]=getElementByIdCS(this.getComponentId(MultiEnumField.U));this.editElements[MultiEnumField.S]=getElementByIdCS(this.getComponentId(MultiEnumField.S))};
MultiEnumField.prototype.load=function(){picklist.picklists[this.getComponentId(MultiEnumField.H)].onLoad();this.retrieveFields();for(var a=this.editElements[MultiEnumField.H].options,b=0;b<a.length;b++)this.initialSelections[b]=a[b].selected};
MultiEnumField.prototype.showEdit=function(){this.retrieveFields();this.overlay.setActiveField(this.id);this.overlay.show();MultiSelectPicklist.resizeMSP(this.editElements[MultiEnumField.S],this.editElements[MultiEnumField.U]);this.width=this.editDiv.childNodes[1].offsetWidth+50;this.overlay.setMaxWidth(this.width);this.overlay.position()};
MultiEnumField.prototype.formatValue=function(){for(var a=[],b=0;b<this.currentValue.length;b++){a.push(this.cleanValue(this.currentValue[b][0]));b+1!=this.currentValue.length&&a.push("; ")}if(a.length==0)return this.getDeletedValue();return a.join("")};MultiEnumField.prototype.isDifferentValue=function(a){if(a.length!=this.initialValue.length)return true;for(var b=0;b<this.initialValue.length;b++)if(a[b][0]!=this.initialValue[b][0]||a[b][1]!=this.initialValue[b][1])return true;return false};
MultiEnumField.prototype.getValueFromEdit=function(){this.retrieveFields();for(var a=[],b=this.editElements[MultiEnumField.H].options,c=0;c<b.length;c++)b[c].selected&&a.push([b[c].text,b[c].value]);return a};MultiEnumField.prototype.updateEditElementImpl=function(){this.retrieveFields();for(var a=this.editElements[MultiEnumField.H].options,b=0;b<a.length;b++)a[b].selected=this.initialSelections[b];if(this.editElements[MultiEnumField.H].onchange)this.editElements[MultiEnumField.H].onchange()};
MultiEnumField.prototype.addSaveData=function(a){var b=[];if(!this.created&&this.required&&this.controllerId&&!this.initialValue)b.push(picklistNAMarker);else for(var c=this.created?this.getValueFromEdit():this.currentValue,e=0;e<c.length;e++)b.push(c[e][1]);a[this.id]=b};function MultiLineTextField(a,b,c,e,f,d){this.init(a,b,c,e,f);this.maxLength=d.maxLength;this.width=window.ActiveXObject?380:500}MultiLineTextField.prototype=new InlineEditField.CompoundField;
MultiLineTextField.prototype.createEditElements=function(){var a=[];a.push("<textarea type='text' wrap='soft' maxlength='");a.push(this.maxLength);a.push("'");a.push(" rows='6'");a.push(" cols='52'");a.push(" id='");a.push(this.id);a.push("'>");a.push(this.cleanValueNoBR(this.currentValue));a.push("</textarea>");a.push("<div class='textCounterMiddle'>");a.push("<div class='textCounter'");a.push(" id='");a.push(this.id);a.push("_counter'>");a.push("</div>");a.push("</div>");this.editDiv.innerHTML=
a.join("");this.elementToFocus=this.editElement=getElementByIdCS(this.id);this.attachCountHandler()};MultiLineTextField.prototype.attachCountHandler=function(){var a=this.id,b=this.maxLength,c=LC.getLabel("Edit","CharactersRemaining"),e=LC.getLabel("Edit","CharactersOver"),f=function(){handleTextAreaElementChange(a,b,c,e)},d=window.ActiveXObject?["propertychange","focus"]:["keydown","keyup","change","click","mousedown","focus"],g;for(g in d)addEvent(this.editElement,d[g],f,true)};
MultiLineTextField.prototype.addSaveData=function(a){a[this.id]=this.currentValue};MultiLineTextField.prototype.isDifferentValue=function(a){return this.initialValue!=a};MultiLineTextField.prototype.getValueFromEdit=function(){return this.editElement.value};MultiLineTextField.prototype.formatValue=function(){return this.currentValue===""&&this.initialValue!==""?this.getDeletedValue():this.cleanValue(this.currentValue)};
MultiLineTextField.prototype.updateEditElementImpl=function(){this.editElement.value=this.currentValue};
InlineEditField.SimpleField=function(){this.group=this.editElement=null;this.saveOnEnter=true};InlineEditField.SimpleField.prototype=new InlineEditField;InlineEditField.SimpleField.prototype.addSaveData=function(a){a[this.id]=this.currentValue};InlineEditField.SimpleField.prototype.openField=function(){this.created||this.createEditDiv();this.showEdit()};
InlineEditField.SimpleField.prototype.createEditDiv=function(){this.editDiv=document.createElement("div");this.editDiv.className=this.required?"inlineEditRequiredDiv":"inlineEditDiv";if(this.group)this.editDiv.className+=" inlineEditGroup";this.editDiv.id=this.id+InlineEditConstants.INNER_ID+"edit";this.errorDiv?this.tableCell.insertBefore(this.editDiv,this.errorDiv):this.tableCell.appendChild(this.editDiv);this.createEditElements();if(this.error&&!this.group)this.editElement.className=EditElement.ERROR_CLASS;
this.mayUndo()&&this.createUndoButton();if(!this.group){var a=this;addEvent(this.editElement,"keypress",function(b){a.handleKeyPress(b)},true)}this.created=true};
InlineEditField.SimpleField.prototype.handleKeyPress=function(a){a=getEvent(a);var b=a.keyCode;if(b==KEY_ESC){this.reset();eventCancelBubble(a)}else if(b==KEY_ENTER&&this.saveOnEnter){var c=sfdcPage.getInlineEditData(this.id);c.closeCurrentField(null,false);eventCancelBubble(a);c[InlineEditConstants.VF_ENABLED]&&a.preventDefault();setTimeout(function(){sfdcPage.focusOnSave(c[InlineEditConstants.VF_ENABLED])},10)}};
InlineEditField.SimpleField.prototype.showEdit=function(){this.editElement.disabled&&document.selection&&document.selection.empty&&document.selection.empty();this.readDiv.style.display="none";if(this.undoButton){this.undoButton.parentNode!=this.editDiv&&this.editDiv.appendChild(this.undoButton);this.undoButton.style.display="inline"}this.editDiv.style.display="block";if(!(this.editElement.disabled||this.editElement.readOnly)){this.editElement.focus();this.editElement.type=="text"&&this.editElement.select()}};
InlineEditField.SimpleField.prototype.hideEdit=function(){this.editElement.blur();this.editDiv.style.display="none";this.changed&&this.undoButton&&this.readDiv.appendChild(this.undoButton);this.readDiv.style.display="block"};InlineEditField.SimpleField.prototype.closeField=function(){this.updateFieldValue(this.getValueFromEdit());this.group||this.hideEdit()};
InlineEditField.SimpleField.prototype.updateFieldValue=function(a,b){if(this.isDifferentValue(a)){if(!this.changed){this.changed=true;addStyleClass(this.readDiv,"inlineEditModified")}this.currentValue=a;b||this.updateDependents();this.updateReadElement()}else this.changed&&this.reset(true)};InlineEditField.SimpleField.prototype.isDifferentValue=function(a){return this.initialValue!=a};
InlineEditField.SimpleField.prototype.reset=function(a){this.currentValue=this.initialValue;a&&this.updateDependents();delStyleClass(this.readDiv,"inlineEditModified");this.changed=false;if(this.undoButton){this.undoButton.style.display="none";this.editDiv.appendChild(this.undoButton)}this.readDiv.innerHTML=this.initialHTML;if(sfdcPage.getInlineEditData(this.id).isCurrentField(this)){this.hideEdit();sfdcPage.getInlineEditData(this.id).currentField=null}this.clearError();this.updateEditElement()};
InlineEditField.SimpleField.prototype.getValueFromEdit=function(){return this.editElement.value};InlineEditField.SimpleField.prototype.updateReadElement=function(){this.readDiv.innerHTML=this.formatValue()};InlineEditField.SimpleField.prototype.formatValue=function(){return this.currentValue===""&&this.initialValue!==""?this.getDeletedValue():this.cleanValue(this.currentValue)};InlineEditField.SimpleField.prototype.updateEditElementImpl=function(){this.editElement.value=this.currentValue};
InlineEditField.SimpleField.prototype.setError=function(a){InlineEditField.prototype.setError.call(this,a);this.editElement&&addStyleClass(this.editElement,EditElement.ERROR_CLASS)};InlineEditField.SimpleField.prototype.clearError=function(){InlineEditField.prototype.clearError.call(this);this.editElement&&delStyleClass(this.editElement,EditElement.ERROR_CLASS)};
function BooleanField(a,b,c,d,f){if(a){this.init(a,b,c,d,f);this.checkboxImage=getElementByIdCS(this.id+EditElement.CHECKBOX_SUFFIX);this.checkLabel=LC.getLabel("Images","checkbox_checked");this.uncheckLabel=LC.getLabel("Images","checkbox_unchecked")}}BooleanField.prototype=new InlineEditField.SimpleField;
BooleanField.prototype.createEditElements=function(){var a=[];a.push("<input type='checkbox' id='");a.push(this.id);a.push("'");this.currentValue&&a.push(" checked='checked'");a.push(">");this.editDiv.innerHTML=a.join("");this.editElement=getElementByIdCS(this.id)};BooleanField.prototype.createDummy=function(){var a=document.createElement("input");a.type="hidden";a.id=this.id;a.value=this.currentValue?"1":"0";this.tableCell.appendChild(a);this.created=true};
BooleanField.prototype.getValueFromEdit=function(){return this.editElement.checked};BooleanField.prototype.updateReadElement=function(){if(this.currentValue){this.checkboxImage.src=UserContext.getUrl("/img/checkbox_checked.gif");this.checkboxImage.title=this.checkLabel;this.checkboxImage.alt=this.checkLabel}else{this.checkboxImage.src=UserContext.getUrl("/img/checkbox_unchecked.gif");this.checkboxImage.title=this.uncheckLabel;this.checkboxImage.alt=this.uncheckLabel}};
BooleanField.prototype.formatValue=function(){var a=[];a.push('<img src="');a.push(this.currentValue?UserContext.getUrl("/img/checkbox_checked.gif"):UserContext.getUrl("/img/checkbox_unchecked.gif"));a.push('" width="21" height="16" alt="');a.push(this.currentValue?this.checkLabel:this.uncheckLabel);a.push('" class="checkImg">');return a.join("")};BooleanField.prototype.updateEditElementImpl=function(){this.editElement.checked=this.currentValue;if(this.editElement.onclick)this.editElement.onclick()};
BooleanField.prototype.addSaveData=function(a){a[this.id]=this.currentValue?"1":"0"};BooleanField.prototype.reset=function(){this.currentValue=this.initialValue;delStyleClass(this.readDiv,"inlineEditModified");this.changed=false;this.updateReadElement();if(!this.group)if(sfdcPage.getInlineEditData(this.id).isCurrentField(this)){this.hideEdit();sfdcPage.getInlineEditData(this.id).currentField=null}if(this.undoButton)this.undoButton.style.display="none";this.clearError();this.updateEditElement()};
function TextField(a,b,c,d,f,e){this.init(a,b,c,d,f);this.maxLength=e.maxLength?e.maxLength:255}TextField.prototype=new InlineEditField.SimpleField;TextField.prototype.createEditElements=function(){var a=[];a.push("<input type='text' id='");a.push(this.id);a.push("' value=\"");a.push(this.cleanValue(this.currentValue));a.push("\" size='20' maxLength='");a.push(this.maxLength);a.push("'>");this.editDiv.innerHTML=a.join("");this.editElement=getElementByIdCS(this.id)};
function NumberField(a,b,c,d,f){this.init(a,b,c,d,f)}NumberField.prototype=new InlineEditField.SimpleField;NumberField.prototype.createEditElements=function(){var a=[];a.push("<input type='text' id='");a.push(this.id);a.push("' value=\"");a.push(this.cleanValue(this.currentValue));a.push('">');this.editDiv.innerHTML=a.join("");this.editElement=getElementByIdCS(this.id)};function DateField(a,b,c,d,f,e){this.init(a,b,c,d,f);this.hasTime=e.hasTime}DateField.prototype=new InlineEditField.SimpleField;
DateField.prototype.createEditElements=function(){var a=[];a.push("<input type='text' id='");a.push(this.id);a.push("' value=\"");a.push(this.cleanValue(this.currentValue));a.push('" onFocus="DatePicker.pickDate(true, \'');a.push(this.id);a.push("', ");a.push(this.hasTime);a.push(');">');this.editDiv.innerHTML=a.join("");this.editElement=getElementByIdCS(this.id)};DateField.prototype.hideEdit=function(){InlineEditField.SimpleField.prototype.hideEdit.apply(this);DatePicker.datePicker.hide()};
function PhoneField(a,b,c,d,f,e){this.init(a,b,c,d,f);this.formatPhone=e.formatPhone;this.addDir=e.addDir}PhoneField.prototype=new InlineEditField.SimpleField;
PhoneField.prototype.createEditElements=function(){var a=[];a.push("<input type='text' id='");a.push(this.id);a.push("' value=\"");a.push(this.cleanValue(this.currentValue));a.push('"');this.addDir&&a.push(" dir='ltr'");if(this.formatPhone){a.push(" onblur='formatPhone(this);'");a.push(" onkeydown='formatPhoneOnEnter(this, event);'")}a.push(">");this.editDiv.innerHTML=a.join("");this.editElement=getElementByIdCS(this.id)};
function ForeignKeyField(a,b,c,d,f,e){this.init(a,b,c,d,f);this.domains=e.domain;this.useNewLookups=e.useNewLookups;this.lookupEntityPrefix=e.lookupEntityPrefix;this.lookupFieldEnumOrId=e.lookupFieldEnumOrId;this.mruServletUri=e.mruServletUri;this.mruAutoComplete=[];if(typeof e.mruAutoComplete!=="undefined")this.mruAutoComplete=e.mruAutoComplete;this.lookupControllerIds=e.controllerIds;this.validationServletURI=e.validationServletURI;this.domainElement=this.oldElement=this.idElement=null;this.initialDomain=
0;this.lookupAutoCompleter=null;this.matchBlanks=e.matchBlanks}ForeignKeyField.prototype=new InlineEditField.SimpleField;ForeignKeyField.ID=0;ForeignKeyField.OLD=1;ForeignKeyField.DOMAIN=2;ForeignKeyField.MULTIDOMAIN=3;
ForeignKeyField.prototype.getComponentId=function(a){var b;switch(a){case ForeignKeyField.ID:b=EditElement.pID_SUFFIX;break;case ForeignKeyField.OLD:b=EditElement.pOLD_NAME_SUFFIX;break;case ForeignKeyField.DOMAIN:b=EditElement.pTYPE_SUFFIX;break;case ForeignKeyField.MULTIDOMAIN:b=MultiLookupInputElement.MULTI_LOOKUP_SELECT_SUFFIX}return this.id+b};
ForeignKeyField.prototype.createEditElements=function(){var a=this.cleanValue(this.getFieldLabel()+" "+LC.getLabel("Icons","lookup")),b=[];b.push("<span class='lookupInput bEditBlock'>");if(this.domains.length>1){var c='getElementByIdCS("'+this.getComponentId(ForeignKeyField.DOMAIN)+'").value=getElementByIdCS("'+this.getComponentId(ForeignKeyField.MULTIDOMAIN)+'").options[getElementByIdCS("'+this.getComponentId(ForeignKeyField.MULTIDOMAIN)+'").selectedIndex].value;getElementByIdCS("'+this.getComponentId(ForeignKeyField.ID)+
'").value = "";getElementByIdCS("'+this.id+'").value = "";';b.push(Util.createDynamicSelect({id:this.getComponentId(ForeignKeyField.MULTIDOMAIN),name:this.getComponentId(ForeignKeyField.MULTIDOMAIN),onchange:c},this.domains,false))}b.push("<input type='hidden' id='");b.push(this.getComponentId(ForeignKeyField.ID));b.push("' name='");b.push(this.getComponentId(ForeignKeyField.ID));b.push("' value='");b.push(this.currentValue[1]);b.push("'><input type='hidden' id='");b.push(this.getComponentId(ForeignKeyField.OLD));
b.push("' name='");b.push(this.getComponentId(ForeignKeyField.OLD));b.push("' value=\"");b.push(this.cleanValue(this.currentValue[0]));b.push("\"><input type='hidden' id='");b.push(this.getComponentId(ForeignKeyField.DOMAIN));b.push("' name='");b.push(this.getComponentId(ForeignKeyField.DOMAIN));b.push("' value='");b.push(this.domains[0][1]);b.push("'><input type='text' size='20' maxlength='255' id='");b.push(this.id);b.push("' name='");b.push(this.id);b.push("' value=\"");b.push(this.cleanValue(this.currentValue[0]));
this.mruAutoComplete.length>0&&b.push('"\' autocomplete="off"\'');b.push('">');this.dependentIds&&this.dependentIds.length>0&&b.push("<img class='closeIcon' alt='"+LC.getLabel("Global","clear")+"' title='"+LC.getLabel("Global","clear")+"' src='/s.gif'>");b.push("<a href='' id='");b.push(this.id);b.push("Icon' title='");b.push(a);b.push("'><img onmouseover=\"this.className='lookupIconOn';\" alt='");b.push(a);b.push("' onmouseout=\"this.className='lookupIcon';\" class='lookupIcon' src='"+UserContext.getUrl("/s.gif")+
"'></a>");(a=this.getMouseOverInfoText())&&b.push(MouseOverFade.createMouseOverHtml(a));b.push("</span>");this.editDiv.innerHTML=b.join("");var d=this;if((b=getElementsByClassName("closeIcon",this.editDiv,"img"))&&b.length==1){d.clearButton=b[0];addEvent(d.clearButton,"mouseover",function(){this.className="closeIconOn"},true);addEvent(d.clearButton,"mouseout",function(){this.className="closeIcon"},true);addEvent(d.clearButton,"focus",function(){this.className="closeIconOn"},true);addEvent(d.clearButton,
"blur",function(){this.className="closeIcon"},true);addEvent(d.clearButton,"click",function(){d.updateFieldValue(["",""],true);d.updateEditElement();d.editElement.value=LC.getLabel("Global","click_lookup_icon");d.isEmpty=true;d.updateClearButtonStatus()},true)}addEvent(getElementByIdCS(this.id+"Icon"),"click",function(f){setLastMousePosition(f);d.openLookup();if(f.preventDefault)f.preventDefault();else f.returnValue=false},false);this.editElement=getElementByIdCS(this.id);this.idElement=getElementByIdCS(this.getComponentId(ForeignKeyField.ID));
this.oldElement=getElementByIdCS(this.getComponentId(ForeignKeyField.OLD));if(this.dependentIds&&this.dependentIds.length>0){this.editElement.readOnly=true;addStyleClass(this.editElement,"readonly");if(d.editElement.value==""){this.updateClearButtonStatus();d.editElement.value=LC.getLabel("Global","click_lookup_icon");d.isEmpty=true}}if(this.domains.length>1){this.domainElement=getElementByIdCS(this.getComponentId(ForeignKeyField.MULTIDOMAIN));for(b=0;b<this.domains.length;b++)if(this.initialValue[1].indexOf(this.domains[b][1])==
0){this.initialDomain=b;break}this.domainElement.selectedIndex=this.initialDomain}this.mruAutoComplete.length>0&&this.addAutoCompleter()};ForeignKeyField.prototype.afterLoad=function(){if(sfdcPage.getReferredDomIds){var a=sfdcPage.getReferredDomIds(this.id);if(a)for(var b=0;b<a.length;b++){var c=sfdcPage.getFieldById(a[b]);if(c&&c.domains)c.validationServletURI=this.validationServletURI}}};
ForeignKeyField.prototype.getMouseOverInfoText=function(){var a=this.idsToLabels(this.dependentIds),b=this.idsToLabels(this.lookupControllerIds),c=[];if(a){c.push(LC.getLabel("Global","click_lookup_icon_info"));c.push("<br/>");c.push(escapeHTML(LC.getLabel("DependentElement","controls",a.join(", "))));b&&c.push("<br/>")}b&&c.push(escapeHTML(LC.getLabel("DependentElement","dependsOnMultiple",b.join(", "))));return c.join("")};
ForeignKeyField.prototype.idsToLabels=function(a){var b;if(a){b=[];for(var c=0;c<a.length;c++){var d=sfdcPage.getFieldById(a[c]);d&&b.push(d.getFieldLabel())}}return b&&b.length>0?b:null};
ForeignKeyField.prototype.addAutoCompleter=function(){var a=this.mruAutoComplete;if(!(a.length>1)){a=a[0][0];a={lknm:this.id,acEntity:a};if(this.lookupEntityPrefix&&this.lookupFieldEnumOrId){a.aclkent=this.lookupEntityPrefix;a.aclkfield=this.lookupFieldEnumOrId}this.lookupAutoCompleter=new LookupAutoCompleteInputElement(this.id,this.mruServletUri,1,a,this.matchBlanks,this.lookupControllerIds?this.id:null,false);var b=this;this.lookupAutoCompleter.addOnAfterTabDownListener(function(c){b.closeOnTab(c)})}};
InlineEditField.SimpleField.prototype.closeOnTab=function(a){this.closeField();sfdcPage.getInlineEditData(this.id).currentField=null;InlineEditField.SimpleField.captureEvent(a)};InlineEditField.SimpleField.captureEvent=function(a){if(XBrowser.userAgent.isIE){a.returnValue=false;a.cancelBubble=false}else{a.preventDefault();a.stopPropagation()}};
ForeignKeyField.prototype.closeField=function(a){this.lookupAutoCompleter&&this.lookupAutoCompleter.clearSuggestions();InlineEditField.SimpleField.prototype.closeField.call(this,a);this.clearError();this.validationServletURI&&this.currentValue[0]&&!a&&this.performValidation()};
ForeignKeyField.prototype.performValidation=function(){var a=new QueryString;a.add(LookupValidationServlet.pLKENTITY_NAME,this.lookupEntityPrefix);a.add(LookupValidationServlet.pLKFIELD_NAME,this.lookupFieldEnumOrId);a.add(LookupValidationServlet.pENTITY_NAME,this.domains.length>1?this.domainElement.options[this.domainElement.selectedIndex].value:this.domains[0][1]);a.add(LookupUi.pSEARCH_VALUE,this.currentValue[0]);if(sfdcPage.getReferredDomIds){var b=sfdcPage.getReferredDomIds(this.id);b&&a.add(LookupValidationServlet.pDEPDATA_NAME,
dpdLkUtil.serialize(b,this.id))}a.add(EditElement.pBASE_NAME,this.id);var c=this;XBrowser.getHttpResponse(this.validationServletURI+a.toString(),function(d){if(d=d.responseText)(d=Util.evalAjaxServletOutput(d))&&d[LookupValidationServlet.pFILTER_RESULTS]&&c.applyValidationChanges(d[LookupValidationServlet.pFILTER_RESULTS])});return true};
ForeignKeyField.prototype.reset=function(){InlineEditField.SimpleField.prototype.reset.apply(this,arguments);if(this.initialValue[0]==""){this.editElement.value=LC.getLabel("Global","click_lookup_icon");this.isEmpty=true;this.updateClearButtonStatus()}else if(this.initialValue[0]!=""&&this.isEmpty){this.isEmpty=false;this.updateClearButtonStatus()}};ForeignKeyField.prototype.lookupPickCalled=function(){this.isEmpty=false;this.updateClearButtonStatus()};
ForeignKeyField.prototype.updateClearButtonStatus=function(){if(this.clearButton)if(this.editElement.value!=""&&!this.isEmpty){this.clearButton.style.display="inline-block";delStyleClass(this.editElement,"emptyDependentLookup")}else{this.clearButton.style.display="none";addStyleClass(this.editElement,"emptyDependentLookup")}};
ForeignKeyField.prototype.updateFieldValue=function(a,b){var c=a;if(a[0]===""||this.isEmpty)c=["",Udd.EMPTY_KEY];InlineEditField.SimpleField.prototype.updateFieldValue.call(this,c,b)};ForeignKeyField.prototype.applyValidationChanges=function(a){a.error?this.setError(a.error):this.clearError()};
ForeignKeyField.prototype.openLookup=function(){var a;a=this.domains.length>1?this.domainElement.options[this.domainElement.selectedIndex].value:this.domains[0][1];var b="";if(this.lookupEntityPrefix)b="&lkent="+this.lookupEntityPrefix+"&lkfield="+this.lookupFieldEnumOrId;if(sfdcPage.getReferredDomIds){var c=sfdcPage.getReferredDomIds(this.id);if(c)b+="&dplp="+dpdLkUtil.serialize(c,this.id)}if(sfdcPage.getEnhancedLookupParams)b+=sfdcPage.getEnhancedLookupParams(this.id);c=this.isEmpty?"":escapeUTF(this.editElement.value);
if(this.useNewLookups){if(!window.lookupElement)window.lookupElement=new LookupElement;window.lookupElement.openLookup(UserContext.getUrl("/_ui/common/data/LookupPage?lknm=")+this.id+"&lktp="+a+b,670,"1","&lksrch="+c)}else openLookup(UserContext.getUrl("/_ui/common/data/LookupPage?lknm=")+this.id+"&lktp="+a+b,670,"1","&lksrch="+c)};ForeignKeyField.prototype.getValueFromEdit=function(){return[this.editElement.value,this.idElement.value]};
ForeignKeyField.prototype.isDifferentValue=function(a){return this.initialValue[0]!=a[0]||this.initialValue[1]!=a[1]};ForeignKeyField.prototype.formatValue=function(){return this.currentValue[0]===""&&this.initialValue[1]!==Udd.EMPTY_KEY?this.getDeletedValue():this.cleanValue(this.currentValue[0])};
ForeignKeyField.prototype.updateEditElementImpl=function(){if(this.domains.length>1)this.domainElement.selectedIndex=this.initialDomain;this.editElement.value=this.currentValue[0];this.oldElement.value=this.currentValue[0];this.idElement.value=this.currentValue[1]};
ForeignKeyField.prototype.addSaveData=function(a){a[this.id]=this.currentValue[0];a[this.getComponentId(ForeignKeyField.ID)]=this.currentValue[1];if(this.created){a[this.getComponentId(ForeignKeyField.OLD)]=this.oldElement.value;if(this.isDifferentValue(this.getValueFromEdit()))a[this.id+EditElement.pMOD_SUFFIX]=1}else a[this.getComponentId(ForeignKeyField.OLD)]=this.currentValue[0]};
function StaticEnumField(a,b,c,d,f,e){this.init(a,b,c,d,f);this.picklistData=e.picklistData.slice();this.currentIndex=this.initialIndex=-1;this.showNone=!c;for(a=0;a<this.picklistData.length;a++)if(this.picklistData[a][0]==this.initialValue){this.currentIndex=this.initialIndex=a;break}if(this.initialIndex==-1)this.showNone=true;if(this.showNone){this.picklistData.unshift([LC.getLabel("SelectElement","Required"),""]);this.initialIndex++;this.currentIndex++}}StaticEnumField.prototype=new InlineEditField.SimpleField;
StaticEnumField.prototype.createEditElements=function(){this.editDiv.innerHTML=Util.createDynamicSelect({id:this.id},this.picklistData,false);this.editElement=getElementByIdCS(this.id);this.editElement.selectedIndex=this.initialIndex};StaticEnumField.prototype.getValueFromEdit=function(){return this.currentIndex=this.editElement.selectedIndex};
StaticEnumField.prototype.formatValue=function(){var a=this.editElement.options[this.currentIndex].text;return a==LC.getLabel("SelectElement","Required")?this.getDeletedValue():this.cleanValue(a)};StaticEnumField.prototype.isDifferentValue=function(a){return this.initialIndex!=a};StaticEnumField.prototype.updateEditElementImpl=function(){this.currentIndex=this.initialIndex;this.editElement.selectedIndex=this.currentIndex};
StaticEnumField.prototype.addSaveData=function(a){a[this.id]=this.created?this.editElement.options[this.currentIndex].value:this.picklistData[this.currentIndex][1]};function DynamicEnumField(a,b,c,d,f,e){if(a){this.init(a,b,c,d,f);this.currentValue=this.initialValue=[f[0],f[1]];this.filterValue=f[2];this.picklistId=e.picklistId;this.controllerId=e.controller;this.controllerLabel=e.controllerLabel;this.waitForLoad=true;this.currentIndex=this.initialIndex=0;this.canceled=true}}
DynamicEnumField.prototype=new InlineEditField.SimpleField;DynamicEnumField.prototype.isDifferentValue=function(a){return this.initialValue[1]!=a};
DynamicEnumField.prototype.createEditElements=function(){var a=[];this.controllerId&&a.push("<span style='white-space: nowrap;'>");a.push("<span><select id='");a.push(this.id);a.push("'><option selected value=\"");a.push(this.cleanValue(this.currentValue[1]));a.push('">');a.push(this.cleanValue(this.currentValue[0]));a.push("</select></span>");if(this.controllerId){var b=LC.getLabel("DependentElement","dependsOn",this.controllerLabel);a.push("<div class='"+(XBrowser.userAgent.isIE6||XBrowser.userAgent.isIE7?
"mouseOverInfoDependentFields":"mouseOverInfoOuter")+"'><img title='"+b+"' alt='"+b+"' class='infoIcon' src='"+UserContext.getUrl("/s.gif")+"'><div style='display: none;' class='mouseOverInfo'>");a.push("</div></div>")}this.editDiv.innerHTML=a.join("");a=' id="'+this.id+'"';if(!picklist.picklists)picklist.picklists={};b=null;if(this.required&&this.controllerId){var c=this;b=function(d){if(d)if((d=d.container.firstChild)&&c.editDiv&&c.editDiv.className)if(d.disabled){if(c.editDiv.className.indexOf("disabledPickList")<
0)c.editDiv.className+=" disabledPickList"}else c.editDiv.className=c.editDiv.className.replace("disabledPickList","")}}new picklistForInlineEditing(this.id,this.picklistId,this.controllerId,Util.convertOptionsForPicklistData([this.initialValue]),a,!this.required,true,this.filterValue,b);this.group||this.load()};
DynamicEnumField.prototype.createDummy=function(){var a=document.createElement("input");a.type="hidden";a.id=this.id;a.value=this.currentValue[1];this.tableCell.appendChild(a);this.created=true};DynamicEnumField.prototype.load=function(){picklist.picklists[this.id].onLoad();this.editElement=getElementByIdCS(this.id);this.currentIndex=this.initialIndex=this.editElement.selectedIndex;this.canceled=false};
DynamicEnumField.prototype.getValueFromEdit=function(){this.editElement=getElementByIdCS(this.id);this.currentIndex=this.editElement.selectedIndex;return this.editElement.options[this.currentIndex].value};DynamicEnumField.prototype.formatValue=function(){this.editElement=getElementByIdCS(this.id);var a=this.editElement.options[this.currentIndex].text;return a==LC.getLabel("SelectElement","Required")?this.initialValue[1]===""?"":this.getDeletedValue():this.cleanValue(a)};
DynamicEnumField.prototype.reset=function(){if(this.group){this.currentValue=this.initialValue;delStyleClass(this.readDiv,"inlineEditModified");this.changed=false;this.canceled=true;this.readDiv.innerHTML=this.initialHTML;if(this.undoButton)this.undoButton.style.display="none";this.clearError();this.updateEditElement()}else InlineEditField.SimpleField.prototype.reset.apply(this,arguments)};
DynamicEnumField.prototype.updateEditElementImpl=function(){this.editElement=getElementByIdCS(this.id);this.currentIndex=this.initialIndex;this.editElement.selectedIndex=this.currentIndex;if(this.editElement.onchange)this.editElement.onchange()};DynamicEnumField.prototype.addSaveData=function(a){a[this.id]=(!this.created||this.canceled)&&this.required&&this.controllerId&&!this.initialValue[1]?picklistNAMarker:typeof this.currentValue=="string"?this.currentValue:this.currentValue[1]};
function EncryptedTextField(a,b,c,d,f,e){this.init(a,b,c,d,f);this.maxLength=e.maxLength;this.masked=e.masked;this.encryptedElement=null}EncryptedTextField.prototype=new InlineEditField.SimpleField;
EncryptedTextField.prototype.createEditElements=function(){var a=[];a.push("<input type='text' id='");a.push(this.id);a.push("' value=\"");a.push(this.cleanValue(this.currentValue));a.push("\" size='20' maxLength='");this.masked?a.push("255"):a.push(this.maxLength);a.push("'>");this.editDiv.innerHTML=a.join("");this.editElement=getElementByIdCS(this.id);if(this.masked)this.encryptedElement=new EncryptedTextInputElement(this.editElement.id,this.maxLength,this.masked)};
EncryptedTextField.prototype.reset=function(){InlineEditField.SimpleField.prototype.reset.apply(this,arguments);if(this.masked&&this.encryptedElement)this.encryptedElement.wasCleared=false};
function HtmlStringPlusClobField(a,b,c,d,f,e){this.init(a,b,c,d,f);this.saveOnEnter=false;this.maxLength=e.maxLength;this.numCols=e.numCols;this.numRows=e.numRows;this.isHtml=e.isHtml;this.basePath=e.basePath;this.caseSafe18Id=e.caseSafe18Id;this.instanceName=(this.visualforce=e[InlineEditConstants.VF_ENABLED])?this.visualforce+"_"+this.caseSafe18Id:this.caseSafe18Id;if(this.visualforce){if(VisualforceConstants.FCK_LIBRARY==="")VisualforceConstants.FCK_LIBRARY=e.FCK_LIBRARY;VFRTAEditor.getOrCreateRTAEditor()}}
HtmlStringPlusClobField.prototype=new InlineEditField.SimpleField;HtmlStringPlusClobField.RICH_TEXT_EDITOR_ROW_MULTIPLIER=17;HtmlStringPlusClobField.prototype.createEditElements=function(){this.visualforce?this.createEditElementsForVF():this.createEditElementsForUI();if(XBrowser.userAgent.isChrome||XBrowser.userAgent.isSafari)this.editDiv.style.width="100%"};
HtmlStringPlusClobField.prototype.createEditElementsForUI=function(){var a=[];a.push("<textarea  id='");a.push(this.instanceName);a.push("' ");a.push("maxlength='");a.push(this.maxLength);a.push("' ");a.push("name='");a.push(this.instanceName);a.push("' ");a.push("cols='");a.push(this.numCols);a.push("' ");a.push("rows='");a.push(this.numRows);a.push("' ");a.push("type='text' wrap='soft'>");a.push(this.cleanValueNoBR(this.currentValue));a.push("</textarea>");this.editDiv.innerHTML=a.join("");this.createFCKEditor();
this.elementToFocus=this.editElement=getElementByIdCS(this.instanceName)};
HtmlStringPlusClobField.prototype.createFCKEditor=function(){var a=new FCKeditor(this.instanceName,null,this.numRows>0?this.numRows*HtmlStringPlusClobField.RICH_TEXT_EDITOR_ROW_MULTIPLIER:0);a.BasePath=this.basePath;a.Config.CustomConfigurationsPath="/apexpages/richtext.config.js";a.ToolbarSet="SalesforceBasic";a.Config.SkinPath=a.BasePath+"editor/skins/sfdc/";a.Config.DefaultLanguage=UserContext.language;a.Config.ImageUpload=true;a.ReplaceTextarea()};
HtmlStringPlusClobField.prototype.showEdit=function(){InlineEditField.SimpleField.prototype.showEdit.apply(this);this.visualforce&&this.showEditForVF()};HtmlStringPlusClobField.prototype.hideEdit=function(){InlineEditField.SimpleField.prototype.hideEdit.apply(this);this.visualforce&&this.hideEditForVF()};HtmlStringPlusClobField.prototype.getValueFromEdit=function(){var a=this.getRTAEditor();return this.visualforce&&!a.isReady()?this.currentValue:this.sanatizeRawValue(a.GetHTML(true))};
HtmlStringPlusClobField.prototype.sanatizeRawValue=function(a){return a.replace(/\<br \/\>/g,"<br>")};HtmlStringPlusClobField.prototype.formatValue=function(){return this.currentValue===""&&this.initialValue!==""||this.currentValue=="<br>"&&this.initialValue!==""?this.getDeletedValue():this.currentValue};HtmlStringPlusClobField.prototype.isDifferentValue=function(a){var b=this.removeWhiteSpace(this.initialValue),c=this.removeWhiteSpace(a);return this.initialValue!=a&&b!=c};
HtmlStringPlusClobField.prototype.removeWhiteSpace=function(a){return a.replace(/\s|&nbsp;/g,"")};HtmlStringPlusClobField.prototype.reset=function(){InlineEditField.SimpleField.prototype.reset.apply(this,arguments);var a=this.getRTAEditor();a&&a.SetHTML(this.initialValue)};HtmlStringPlusClobField.prototype.addSaveData=function(a){a[this.caseSafe18Id]=this.currentValue};HtmlStringPlusClobField.prototype.getRTAEditor=function(){return this.visualforce?VFRTAEditor.getOrCreateRTAEditor():FCKeditorAPI.GetInstance(this.instanceName)};
HtmlStringPlusClobField.prototype.createEditElementsForVF=function(){this.elementToFocus=this.editElement=document.createElement("div");this.editDiv.appendChild(this.editElement)};
HtmlStringPlusClobField.prototype.showEditForVF=function(){var a=this.getRTAEditor(),b=this;a.appendToOnloadQueue(function(){b.editElement.style.height=(b.numRows>0?b.numRows*HtmlStringPlusClobField.RICH_TEXT_EDITOR_ROW_MULTIPLIER:FCKeditor.MinHeight)+"px";b.editElement.style.width="100%";a.setContainerElement(b.editElement);a.setPosition(Sfdc.Dom.getElementXY(b.editElement));a.SetHTML(b.currentValue);a.setId(b.instanceName);a.show()},VFRTAEditor.Operator.openField)};
HtmlStringPlusClobField.prototype.hideEditForVF=function(){var a=this.getRTAEditor();a.appendToOnloadQueue(function(){a.hide();a.SetHTML("")},VFRTAEditor.Operator.closeField)};
function Gack(){}Gack.sendGack=function(a){if(window.devMode)alert("Gack: "+a);else window.status=a};Gack.handleException=function(a){Gack.sendGack(a.sfdcDesc+" - "+a.name+" - "+a.description)};Gack.MaxJSErrors=1;Gack.hideJSErrorFromUser=false;Gack.logJSError=function(a){try{var c="JS Error: "+a.substr(0,100),b=XBrowser.buildPost({subject:c,msg:a});b!=null&&b.indexOf("JS%20Error%3A")!=-1&&XBrowser.postHttpResponse(UserContext.getUrl("/servlet/servlet.GackSender"),function(){},b)}catch(d){}};
Gack.defineErrorHandling=function(){var a=0;window.onerror=function(c,b,d){if(a<Gack.MaxJSErrors){Gack.logJSError(c+" URL: "+b+" Line: "+d+" "+navigator.userAgent);a++}return Gack.hideJSErrorFromUser}};
window.Sfdc||(Sfdc={});
(function(c,j){var m=Sizzle,h=j.document,k=[],n=0;c.isDebug=function(a){if(a&&a.getAttribute("debug")==="true")return true;return false}(h.head||h.getElementsByTagName("head")[0]);c.ns=function(){for(var a=Array.prototype.slice.call(arguments),b=j,d=/[^a-zA-Z\d\.\_\$]/g,f=0,g=a.length;f<g;f++){var e=a[f];if(!(e===null||e===void 0||e==="")){if(d.test(e))throw"Invalid Namespace";e=e.split(".");b=j;for(var i=0,l=e.length;i<l;i++)b=b[e[i]]?b[e[i]]:b[e[i]]={}}}return b};c.provide=function(a,b){if(a&&b)for(var d=
a.split("."),f=j,g=null,e=0,i=d.length;e<i;e++){g=f[d[e]];if(d[e+1]){if(g===void 0||g===null)g=f[d[e]]={}}else if(g===void 0||g===null){if(b.$constructor){b.$constructor.prototype=b;b=b.$constructor}return f[d[e]]=b}f=g}};c.require=function(){};c.register=function(){};c.apply=function(a,b,d){if(d)for(var f in b)a[f]=b[f];else for(var g in b)a.hasOwnProperty(g)||(a[g]=b[g]);return a};c.onReady=function(){function a(){if(!d){if(!h.body)return setTimeout(a,13);for(var e,i=0;(e=g[i++])!==void 0;)e();
g=[];if(h.removeEvent)h.removeEvent("onreadystatechange",a);else h.removeEventListener&&h.removeEventListener("DOMContentLoaded",a,false)}d=true}function b(){if(d)return true;try{h.documentElement.doScroll("left")}catch(e){setTimeout(b,13);return}a()}var d=false,f=false,g=[];return function(e){if(c.isFunction(e)){if(!(d||f)){h.readyState==="complete"&&a();if(h.addEventListener){h.addEventListener("DOMContentLoaded",a,false);j.addEventListener("load",a,false)}else if(h.attachEvent){h.attachEvent("onreadystatechange",
a);j.attachEvent("onload",a);var i=false;try{i=j.frameElement===null}catch(l){}h.documentElement.doScroll&&i&&b()}f=true}if(d)return e();g.push(e)}}}();c.onload=function(){var a=false,b=[],d=j.onload;j.onload=function(){d&&d();a=true;for(var f=0,g=b.length;f<g;f++)b[f]()};return function(f){if(a){f();this.onload=function(g){g()}}else b.push(f)}}();c.isObject=function(a){if(a===void 0||a===null)return false;return typeof a==="object"&&a.constructor!==Array};c.isString=function(a){if(a===null||a===
void 0)return false;return a.constructor===String};c.isFunction=function(a){return Object.prototype.toString.call(a)==="[object Function]"};c.isNumber=function(){};c.select=function(a,b){return m(a,b)};c.get=function(a,b){if(!c.isString(a))return a;var d=h;if(/^[\.#\\]/.test(a))return c.select(a,b)[0]||null;if(b)d=b.getElementById?b:b.ownerDocument;else b=h;d=d.getElementById(a);if(d===null||d.getAttribute("id")===a)return d;if(b.all)return b.all[a];return null};c.defineApp=function(a,b){if(!(b===
void 0||b===null)){var d=0,f=null,g=c.ns("SfdcApp"),e=a.split(".");e[0].toUpperCase()==="SfdcApp".toUpperCase()&&e.shift();do{(f=g[e[d]])||(f=g[e[d]]={});g=f}while(e[++d]);g[e[d-1]]=b}};c.assert=function(a,b){if(a===void 0||a===null||a===false){c.error(b);throw Error(b);}return a};c.isObject=function(a){if(a===void 0||a===null)return false;return typeof a==="object"&&a.constructor!==Array};c.isArray=function(a){if(a===void 0||a===null)return false;return a.constructor===Array};c.isDefAndNotNull=function(a){return a!==
void 0&&a!==null};c.on=function(a,b,d,f){c.Event.add(a,b,d,f);return c};c.un=function(a,b,d,f){c.Event.remove(a,b,d,f);return c};c.getConst=function(a,b){c.assert(j[a]!==void 0,"That Constants group does not exist.");return j[a][b]};c.getUID=function(a){var b=a.uidSfdc;return b?b:a.uidSfdc=c.newUID()};c.newUID=function(){return++n};c.log=function(a,b,d){a!==void 0&&k.push({msg:a,level:b,args:d});return k};c.isEmpty=function(a){return a===null||a===void 0||a===""||c.isArray(a)&&!a.length}})(Sfdc,window);
function ListViewport(a,c,b,d,e,f,g,h,j,l){if(a){this.domId=a;this.listId=d||a;this.type=c;this.payload=b;this.inlineEditData=this.filter=null;this.customizable=typeof e=="undefined"?true:e;this.rowsPerPage=f||null;this.height=g||null;this.width=h||null;this.bottomBuffer=10;this.draggable=j;this.vf=l;this.offPageIds=this.printLink=this.listButtons=this.exception=this.rolodexState=this.pageState=this.listSelect=this.bottomNav=this.listBody=this.rolodex=this.filterLinks=this.subNav=this.topNav=this.listViewport=
this.wrapper=null;this.allowColumnResize=this.allowColumnMove=true;this.divisionLabel=null;this.inOverlay=false;this.shouldSizeToViewport=!XBrowser.userAgent.isIpadSafari||this.vf||this.inOverlay;this.showFeedListView=false;this.feedLoading=this.loading=this.initialEntityButtons=null;this.initialRenderDone=false;this.searchContainer=this.searchBox=this.printURL=this.retURL=this.linkTemplates=this.grid=this.paginator=this.saving=null;this.lastSearchTerm="";this.url=UserContext.getUrl("/_ui/common/list/ListServlet");
this.userPrefUrl=UserContext.getUrl("/_ui/common/request/servlet/PerEntityUserPreferenceServlet");this.rolodexIndex=this.xhr=null;this.trace=(new QueryString).get("trace");ListViewport.addListViewport(this);var k=this;window.sfdcPage.prependToOnloadQueue(function(){k.init()});window.sfdcPage.appendToOnloadQueue(function(){k.redefineSidebarPin()});window.sfdcPage.appendToOnResizeQueue(function(){k.resize()})}}ListViewport.prototype.getShowRefreshLink=function(){return true};
ListViewport.DEFAULT_COLUMN_WIDTH=125;ListViewport.INIT_MARK="ListViewportInit";ListViewport.UPDATE_PAGE_MARK="UpdatePageStart";ListViewport.prototype.shrinkStore=function(){this.grid&&this.grid.getStore().filterBy(function(a){return this.indexOf(a)==0})};ListViewport.prototype.unshrinkStore=function(){this.grid&&this.grid.getStore().clearFilter()};
ListViewport.prototype.sizeIfNoData=function(){if(this.grid.getStore().getTotalCount()==0)this.grid.getGridEl().query(".x-grid-empty")[0].style.width=this.grid.getColumnModel().getTotalWidth()+"px"};
ListViewport.prototype.init=function(){Jiffy.mark(ListViewport.INIT_MARK);var a=this;Scontrol.prototype.getSelectedRecordIdsFromForm=function(){return a.grid.getSelectionModel().selections.keys};if(this.vf)this.reRender=window[this.domId.replace(":","_")+"_reRender"];if(this.shouldSizeToViewport&&!Ext.isIE6&&!Ext.isIE7){document.body.style.overflowY="scroll";document.body.style.overflowX="auto"}this.getReferences();this.initializeLinkTemplates();this.wireSearchBox();var c=Ext.get(this.toggleButton);
if(c)this.showFeedListView=c.child(".chatterToggle").hasClass("selected")?true:false;if(this.payload)this.initialEntityButtons=this.payload.entityButtons;if(this.showFeedListView){this.feedContainer.style.display="";this.payload.filter&&this.payload.inlineEditData&&this.loadFilter(this.payload.filter,this.payload.inlineEditData);this.retURL=this.payload.retURL;if(this.payload.csrfToken)this.csrfToken=this.payload.csrfToken;this.updateFilterLinks(this.payload.extraFilterLinks);this.updateButtons(this.listButtons,
this.initialEntityButtons,[],true);this.rolodex.style.display="none";this.listBody.style.display="none";this.bottomNav.style.display="none";if(this.printLink)this.printLink.style.display="none";if(this.printLinkDisabled)this.printLinkDisabled.style.display="";this.getFeedListView(this.listSelect?this.listSelect.value:this.listId)}else{this.feedContainer.style.display="none";c=new QueryString;if(this.pageState.value==""&&this.rolodexState.value==""&&!c.get("page")&&!c.get("rolodexIndex")){Sfdc.Dom.cleanListeners(this.listBody);
this.loading.show();this.updatePage(this.payload)}else this.getListData({listid:this.listSelect?this.listSelect.value:this.listId,action:"newfilter",page:this.pageState.value||c.get("page"),rolodexIndex:this.rolodexState.value||c.get("rolodexIndex"),rowsPerPage:this.rowsPerPage})}Jiffy.measure("listInitFinished",ListViewport.INIT_MARK)};
ListViewport.prototype.getActionsListFromCellHTML=function(a){var c=this.grid.getColumnModel().getIndexById(ListView.ACTION_COLUMN);a=this.grid.getView().getCell(a,c);var b=[];(new Ext.Element(Ext.DomHelper.createDom({tag:"div",html:a.innerHTML}))).first().select("> *:any(a|span|div)").each(function(d){if(d.dom){var e=new Ext.Element(Ext.DomHelper.createDom({tag:"div"}));e.appendChild(d.dom);e.select("[id^=ext-gen]").each(function(f){f.dom&&f.dom.removeAttribute&&f.dom.removeAttribute("id")});b.push(e.dom.innerHTML)}});
return b};ListViewport.prototype.updateActionColumnInStore=function(a){var c=this.getActionsListFromCellHTML(a);c&&c.length&&this.grid.getStore().getAt(a).set(ListView.ACTION_COLUMN,c)};
ListViewport.prototype.getReferences=function(){this.wrapper=document.getElementById(this.domId+"_wrapper");this.listViewport=document.getElementById(this.domId+"_listViewport");this.topNav=document.getElementById(this.domId+"_topNav");this.subNav=document.getElementById(this.domId+"_subNav");this.filterLinks=document.getElementById(this.domId+"_filterLinks");this.rolodex=document.getElementById(this.domId+"_rolodex");this.listBody=document.getElementById(this.domId+"_listBody");this.bottomNav=document.getElementById(this.domId+
"_bottomNav");this.listSelect=document.getElementById(this.domId+"_listSelect");this.pageState=document.getElementById(this.domId+"_pageState");this.rolodexState=document.getElementById(this.domId+"_rolodexState");this.exception=document.getElementById(this.domId+"_exception");this.listButtons=document.getElementById(this.domId+"_listButtons");this.printLink=document.getElementById(this.domId+"_printLink");this.printLinkDisabled=document.getElementById(this.domId+"_printLinkDisabled");this.offPageIds=
document.getElementById(this.domId+"_offPageIds");this.divisionLabel=document.getElementById(this.domId+"_divisionLabel");this.searchContainer=document.getElementById(this.domId+"_search");this.toggleButton=document.getElementById(this.domId+"_toggleButton");this.feedBody=document.getElementById(this.domId+"_feedBody");this.feedContainer=document.getElementById(this.domId+"_feedContainer");this.loading=new LoadingScreen(this.listBody,LC.getLabel("Global","loading"),this.domId+"_loading");this.saving=
new LoadingScreen(this.listBody,LC.getLabel("Buttons","saving"),this.domId+"_saving");this.feedLoading=new LoadingScreen(this.feedContainer,LC.getLabel("Global","loading"),this.domId+"_feedLoading")};
ListViewport.prototype.initializeLinkTemplates=function(){this.linkTemplates={newLink:(new Ext.Template('<a id="create-new-view" href="',this.getNewLink(),'">',LC.getLabel("Filter","new"),"</a>")).compile(),editLink:(new Ext.Template('<a href="',this.getEditLink(),'">',LC.getLabel("Filter","edit"),"</a>")).compile(),cloneLink:(new Ext.Template('<a href="',this.getEditLink(),'">',LC.getLabel("Filter","clone"),"</a>")).compile(),deleteLink:(new Ext.Template("<a onclick=\"return confirm('",LC.getLabel("Filter",
"DeleteConfirm"),"')\" ",'href="',UserContext.getUrl("/setup/own/deleteredirect.jsp?id={filterId}&delID={filterId}&retURL={delRetURL}&_CONFIRMATIONTOKEN={csrfToken}{dtpParam}"),'">',LC.getLabel("Buttons","del"),"</a>")).compile(),refreshLink:(new Ext.Template('<input type="button" id="{domId}_refresh" src="s.gif" href="javascript:void(0)"','onclick="javascript:{jsref}.refreshList()"','class="btn refreshListButton"',"title='",LC.getLabel("Filter","refresh"),"'","/>")).compile()}};
ListViewport.prototype.getNewLink=function(){return UserContext.getUrl("/ui/list/FilterEditPage?ftype={filterType}&retURL={retURL}{dtpParam}")};ListViewport.prototype.getEditLink=function(){return UserContext.getUrl("/ui/list/FilterEditPage?id={filterId}&retURL={retURL}{dtpParam}")};
ListViewport.prototype.refreshList=function(){if(this.showFeedListView)this.getFeedListView(this.listSelect?this.listSelect.value:this.listId);else{this.grid.getSelectionModel().clearAllSelections();if(this.refreshLink){Ext.fly(this.refreshLink).addClass("refreshListButtonNeeded");this.refreshLink.title=LC.getLabel("Filter","refresh")}this.getListData({page:this.paginator.currentPage,rolodexIndex:this.rolodexIndex})}};
ListViewport.prototype.search=function(a){if(a!=this.lastSearchTerm){this.lastSearchTerm=a;this.getListData({fromSearch:true,search:a,rolodexIndex:this.rolodexIndex})}};
ListViewport.prototype.toggleFeedListView=function(a){if(a!=this.showFeedListView){this.showFeedListView=!this.showFeedListView;XBrowser.postHttpResponse(this.userPrefUrl,function(){},XBrowser.buildPost({val:this.showFeedListView?"1":"0",which:"DISPLAY_FEED_LIST_VIEW",entity:this.filter.entityType}));a=Ext.get(this.toggleButton);if(this.showFeedListView){a.child(".chatterToggle").replaceClass("clickable","selected");a.child(".chatterToggle").child(".toggleLink").set({title:LC.getLabel("Filter","feedViewToggleToolTip")+
" - "+LC.getLabel("MultiSelectElement","Selected")});a.child(".listToggle").replaceClass("selected","clickable");a.child(".listToggle").child(".toggleLink").set({title:LC.getLabel("Filter","listViewToggleToolTip")})}else{a.child(".listToggle").replaceClass("clickable","selected");a.child(".listToggle").child(".toggleLink").set({title:LC.getLabel("Filter","listViewToggleToolTip")+" - "+LC.getLabel("MultiSelectElement","Selected")});a.child(".chatterToggle").replaceClass("selected","clickable");a.child(".chatterToggle").child(".toggleLink").set({title:LC.getLabel("Filter",
"feedViewToggleToolTip")})}this.showFeedOrListView(this.listSelect?this.listSelect.value:this.listId)}};
ListViewport.prototype.showFeedOrListView=function(a){if(this.showFeedListView){this.feedContainer.style.display="";if(this.printLinkDisabled)this.printLinkDisabled.style.display="";if(this.printLink)this.printLink.style.display="none";if(this.rolodex)this.rolodex.style.display="none";this.listBody.style.display="none";this.bottomNav.style.display="none";this.updateButtons(this.listButtons,this.initialEntityButtons,[],true);this.getFeedListView(a,this.filter.entityType)}else{this.feedContainer.style.display=
"none";if(this.printLinkDisabled)this.printLinkDisabled.style.display="none";if(this.printLink)this.printLink.style.display="";if(this.rolodex)this.rolodex.style.display="";this.listBody.style.display="";this.bottomNav.style.display="";this.getListData({listid:a,action:"newfilter"})}};
ListViewport.prototype.getListDataPost=function(a){var c=new QueryString;return{action:a.action||"filter",filterId:a.listid||(this.filter?this.filter.id:this.listId),filterType:this.filter?this.filter.type:this.type,page:a.page||1,rowsPerPage:a.rowsPerPage!=null?a.rowsPerPage:this.rowsPerPage||"",search:a.search!=null?a.search:"",sort:a.sort!=null?a.sort:"",rolodexIndex:a.rolodexIndex!=null?a.rolodexIndex:-1,vf:this.vf,retURL:this.retURL!==null?this.retURL:window.location.pathname,isdtp:c.get("isdtp")}};
ListViewport.prototype.getListData=function(a){this.loading.show();if(this.xhr){this.xhr.onreadystatechange=function(){};this.xhr.abort()}a=a||{};a=this.getListDataPost(a);if(a.action=="newfilter"){this.filterLinks&&Sfdc.Dom.updateHTML(this.filterLinks,"&nbsp;");if(this.rolodex)this.rolodex.style.visibility="hidden";this.listButtons&&Sfdc.Dom.updateHTML(this.listButtons,"");document.body.focus()}if(this.trace)a.trace=this.trace;var c=this;this.xhr=XBrowser.postHttpResponse(this.url,function(b){c.xhrHandler(b.responseText)},
XBrowser.buildPost(a))};ListViewport.prototype.xhrHandler=function(a){var c;try{c=Util.evalAjaxServletOutput(a)}catch(b){window.location.reload()}this.updatePage(c)};
ListViewport.prototype.updatePage=function(a){Jiffy.mark(ListViewport.UPDATE_PAGE_MARK,false);if(a.exTitle&&a.exDesc)this.handleException(a);else{if(this.trace&&a.trace){var c=Ext.get("sqltrace");Ext.DomHelper.overwrite(c,a.trace)}if(a.filter&&a.inlineEditData){this.loadFilter(a.filter,a.inlineEditData);Jiffy.measure("inlineEditDataLoaded",ListViewport.UPDATE_PAGE_MARK)}this.retURL=a.retURL;this.rowsPerPage=a.rowsPerPage;if(a.csrfToken)this.csrfToken=a.csrfToken;if(a.dtpParam)this.dtpParam=a.dtpParam;
this.drawListData(a.listData,a.columnWidths);Jiffy.measure("drawListDataFinished",ListViewport.UPDATE_PAGE_MARK);this.updateFilterLinks(a.extraFilterLinks);this.updateButtons(this.listButtons,a.entityButtons,a.listButtons,true);this.updatePrintLink(a.printURL);this.updateSortState(a.sortState);this.updateRolodex(a.rolodexIndex,a.sortState);this.updatePaginator(a);this.updateStateFields();this.updateDivisionLabel(a.divisionLabel);Jiffy.measure("updatesFinished",ListViewport.UPDATE_PAGE_MARK);this.resize();
Jiffy.measure("resizeFinished",ListViewport.UPDATE_PAGE_MARK);this.exception.style.display="";this.loading.hide();this.reRender&&this.xhr&&this.reRender();if(this.xhr){this.xhr.onreadystatechange=function(){};this.xhr=null}Jiffy.measure("updatePageFinished",ListViewport.UPDATE_PAGE_MARK)}};
ListViewport.prototype.handleException=function(a){var c=[];c.push("<div class='title'>");c.push(a.exTitle);c.push("</div>");c.push("<br/>");c.push(a.exDesc);Sfdc.Dom.updateHTML(this.exception,c.join(""));this.exception.style.display="block";if(this.filterLinks)this.filterLinks.style.display="none";if(this.listButtons)this.listButtons.style.display="none";if(this.printLink)this.printLink.style.visibility="hidden";if(this.rolodex&&this.rolodex.style.visibility!="hidden")this.rolodex.style.visibility=
"hidden";this.paginator||this.updatePaginator(a);this.paginator.draw(true);this.loading.hide()};ListViewport.prototype.updateDivisionLabel=function(a){a&&this.divisionLabel&&Sfdc.Dom.updateHTML(this.divisionLabel,a)};ListViewport.prototype.getDefaultText=function(){return LC.getLabel("ReportBuilder","quickFindDefaultText")};
ListViewport.prototype.wireSearchBox=function(){if(this.searchContainer){this.searchBox=new Sfdc.html.QuickfindInput({renderTo:Ext.get(this.searchContainer),searchFunction:this.search,clearFunction:this.search.createDelegate(this,[""]),scope:this,emptyText:this.getDefaultText(),buffer:300});this.searchBox.on("keydown",function(a,c){c.getCharCode()==c.ENTER&&c.stopEvent()})}};
ListViewport.prototype.updateButtons=function(a,c,b,d){if(a){var e=!!c.length,f=!!b.length,g=[];document.all&&g.push('<span style="display:none" id="',this.domId,'_REMOVE">.</span>');var h=[];e&&h.push(c.join(""));f&&h.push(b.join(""));(d=d&&this.getShowRefreshLink())&&h.push(this.linkTemplates.refreshLink.apply(this.getLinkTemplateData()));g.push(this.pipeButtonSets(h).join(""));Sfdc.Dom.updateHTML(a,g.join(""));document.all&&document.getElementById(this.domId+"_REMOVE").removeNode(true);Util.evalScriptsUnderElement(a);
a.style.display="";this.refreshLink=d?document.getElementById(this.domId+"_refresh"):null}};ListViewport.prototype.pipeButtonSets=function(a){var c=[];c.push('<ul class="piped">');for(i=0;i<a.length;i++)i==a.length-1?c.push('<li class="lastItem">'+a[i]+"</li>"):c.push("<li>"+a[i]+"</li>");c.push("</ul>");return c};
ListViewport.prototype.updatePrintLink=function(a){if(this.printLink){a=a.split("?");var c=[];c.push("javascript:printWin('");c.push(a[0]);c.push("/x?");c.push(a[1]);c.push("')");this.printLink.href=c.join("");this.printLink.style.visibility=""}};ListViewport.prototype.updateStateFields=function(){this.pageState.value=this.paginator.currentPage;this.rolodexState.value=this.rolodexIndex};
ListViewport.prototype.getLinkTemplateData=function(){return{filterType:this.filter.type,filterId:this.filter.id,domId:this.domId,jsref:"ListViewport.instances['"+this.domId+"']",retURL:encodeURIComponent(this.retURL),delRetURL:this.vf?this.retURL:"%2F"+this.filter.entityType,csrfToken:this.csrfToken,dtpParam:this.dtpParam?"&isdtp="+this.dtpParam:""}};
ListViewport.prototype.updateFilterLinks=function(a){if(this.filterLinks){var c=this.getLinkTemplateData(),b=[],d=false;if(this.customizable){if(this.filter.editable){b.push(this.linkTemplates.editLink.apply(c));b.push(this.linkTemplates.deleteLink.apply(c))}else this.filter.isCloneable&&b.push(this.linkTemplates.cloneLink.apply(c));this.filter.isCreateNewDisplayed&&b.push(this.linkTemplates.newLink.apply(c));if(d=a&&a.length>0)b=b.concat(a)}Sfdc.Dom.updateHTML(this.filterLinks,b.join(" | "));this.filterLinks.style.display=
"";d&&Util.evalScriptsUnderElement(this.filterLinks)}};ListViewport.prototype.updateSortState=function(a){var c=this.grid.getView(),b=c.sortState;if(c.sortState=a){b=this.grid.getColumnModel().findColumnIndex(a.field);b!=-1&&c.updateSortIcon(b,a.dir)}else b&&b.field&&c.mainHd.select("td").removeClass(c.sortClasses)};
ListViewport.prototype.updateRolodex=function(a,c){this.rolodexIndex=a;if(this.rolodex){var b=this.rolodex.childNodes,d=this.grid.getColumnModel(),e=d.findColumnIndex(c.field);if(e!=-1&&d.getColumnById(d.getColumnId(e)).useRolodex){if(this.rolodex.style.visibility=="hidden")this.rolodex.style.visibility=""}else if(this.rolodex.style.visibility!="hidden")this.rolodex.style.visibility="hidden";for(d=0;d<b.length;d++)b[d].firstChild.className=d==a||a==-1&&d==b.length-1?"listItemSelected":"listItemPad"}};
ListViewport.prototype.updatePaginator=function(a){if(this.paginator)this.paginator.setState({currentPage:a.page,recordsPerPage:a.rowsPerPage,totalRecords:a.totalRowCount,capped:a.capped,hasCheckbox:this.hasCheckbox});else this.paginator=this.createPaginator(a)};
ListViewport.prototype.createPaginator=function(a){var c=this;return new ListPaginator({listDomId:this.domId,containerIds:[this.domId+"_bottomNav"],recordsPerPage:a.rowsPerPage,totalRecords:a.totalRowCount,capped:a.capped,currentPage:a.page,hasCheckbox:this.hasCheckbox,handler:function(b){c.getListData({page:b,fromPaginator:true,rolodexIndex:c.rolodexIndex})}})};ListViewport.prototype.xhrErrorHandler=function(){};
ListViewport.prototype.loadFilter=function(a,c){this.filter=a;c.viewport=this;c.shownColumns=a.shownColumns;this.inlineEditData=this.createNewListInlineEditData(c)};ListViewport.prototype.createNewListInlineEditData=function(a){return new ListInlineEditData(a)};
ListViewport.prototype.buildDataStore=function(a){for(var c=a[ListView.ID_COLUMN],b=a[ListView.ACTION_COLUMN],d=Array(c.length),e=this.filter.shownColumns,f=0;f<d.length;f++){d[f]=[];d[f].push(c[f]);if(b[f]!=null)this.hasActions=true;d[f].push(b[f]);for(var g,h=0;h<e.length;h++){g=e[h].columnName;d[f].push(this.formatColumnValue(a,g,f))}}return d};ListViewport.prototype.formatColumnValue=function(a,c,b){return a[c][b]};
ListViewport.prototype.getSelectionModel=function(){return new Sfdc.grid.CheckboxSelectionModel({menuDisabled:true,width:21})};ListViewport.prototype.drawListData=function(a,c){this.drawListDataWithActionWidth(a,c,1,false)};
ListViewport.prototype.drawListDataWithActionWidth=function(a,c,b,d){this.hasActions=false;var e=this.buildDataStore(a),f=this.filter.shownColumns;this.hasCheckbox=this.filter.showCheckBox||this.inlineEditData.isMassEditable;var g=this.getSelectionModel(),h=[],j=[];this.hasCheckbox&&j.push(g);h.push({name:ListView.ID_COLUMN});j.push({header:"ID",hidden:true,dataIndex:ListView.ID_COLUMN,id:ListView.ID_COLUMN});h.push({name:ListView.ACTION_COLUMN});j.push(this.buildActionColumn(b,d));b=c||[];for(d=
0;d<f.length;d++){if(!b[d])b[d]=ListViewport.DEFAULT_COLUMN_WIDTH;h.push({name:f[d].columnName});j.push(this.buildColumnConfig(f[d],b[d]))}for(d=this.hasCheckbox?1:0;d<j.length;++d)if(j[d].header)j[d].tooltip=j[d].tooltip||j[d].header;if(this.grid){if(this.filter.id+"_grid"!=this.grid.id){this.grid.getSelectionModel().clearAllSelections();g=new Ext.data.SimpleStore({id:0,fields:h});j=new Ext.grid.ColumnModel(j);this.grid.reconfigure(g,j);this.grid.id=this.filter.id+"_grid"}}else{f={emptyText:this.getNoResultsText(),
sortClasses:["ASC","DESC"],deferEmptyText:false};if(this.spaceToAllocateForVertScrollBar()!==undefined)f.scrollOffset=this.spaceToAllocateForVertScrollBar();b=this.getGridListeners();this.grid=new Ext.grid.GridPanel({viewport:this,id:this.filter.id+"_grid",cm:new Ext.grid.ColumnModel(j),sm:g,autoHeight:!this.shouldSizeToViewport,store:new Ext.data.SimpleStore({id:0,fields:h}),view:new Sfdc.grid.GridView(f),listeners:b,width:this.shouldSizeToViewport?this.listBody.offsetWidth-this.getBorderOffsetWidth():
"auto",enableColumnMove:this.allowColumnMove,enableColumnResize:this.allowColumnResize});this.grid.addEvents("cellMouseOver","cellMouseOut","headerMouseOver","headerMouseOut");this.showRPPWarning()}this.grid.render(this.listBody.id);g=this.grid.getColumnModel();h=g.getIndexById(ListView.ACTION_COLUMN);j=this.grid.getColumnModel().getColumnById(ListView.ACTION_COLUMN);var l=j.renderer;if(this.hasActions&&a&&j.renderer&&typeof chatter!=="undefined")j.renderer=function(k){var o=[],m=a[ListView.ACTION_COLUMN],
n=a[ListView.ACTION_COLUMN_LABELS];if(m&&m.length&&n&&n.length&&n.length===m.length){k={};for(var p=0;p<n.length;p++){var q=n[p];k[q]||(k[q]=m[p])}for(var r in k)if(k.hasOwnProperty(r))if((m=k[r])&&l){o.push(l(m));if(o.length>=3)break}}else o.push(l(k));return"<div style='height:1px;visibility:hidden'>"+o.join("<br />")+"</div>"};!this.resizeAllActionColumns()&&e.length>0?this.grid.getStore().loadData([e[0]]):this.grid.getStore().loadData(e);this.hasActions||this.grid.view.setScrollOffset();this.grid.view.sizeColumnToContent(h);
g=g.getTotalWidth();h=this.grid.getInnerWidth();g<h&&!c&&this.grid.view.fitColumns();j.renderer=l;if(!this.resizeAllActionColumns()){this.grid.getStore().suspendEvents();this.grid.getStore().loadData(e);this.grid.getStore().resumeEvents()}this.grid.body.on("mouseover",function(k){this.grid.processEvent("mouseover",k)},this);this.grid.body.on("mouseout",function(k){this.grid.processEvent("mouseout",k)},this);this.draggable&&this.initdd()};
ListViewport.prototype.buildActionColumn=function(a,c){return{header:LC.getLabel("Global","action"),dataIndex:ListView.ACTION_COLUMN,id:ListView.ACTION_COLUMN,width:a,hidden:!this.hasActions&&!c,menuDisabled:true,fixed:true,css:"font-weight: bold;",renderer:function(b){return b?b.join(" | "):""}}};
ListViewport.prototype.buildColumnConfig=function(a,c){var b=this.inlineEditData.getColumnById(a.columnName);b=b?b.getFieldId():a.columnName;b={header:a.label,width:c,dataIndex:a.columnName,id:b.replace(/\./g,"_"),menuDisabled:true,isSortable:a.isSortable,useRolodex:a.useRolodex,renderer:function(d){return typeof d=="object"?d[0]:d}};if(a.columnName=="ENTITY_SUBSCRIPTION_ID"){b.header='<img src="/s.gif" class="chatterFollowUnfollowAction" '+((Ext.QuickTips.isEnabled?"ext:qtip":"title")+'="'+a.label+
'"')+"/>";b.tooltip=a.label}return b};
ListViewport.prototype.getGridListeners=function(){var a={};a.columnmove={fn:this.extHandler.columnMove,scope:this};a.columnresize={fn:this.extHandler.columnResize,scope:this};a.headerclick={fn:this.extHandler.headerClick,scope:this};a.headermouseover={fn:this.extHandler.headerMouseOver,scope:this};a.headermouseout={fn:this.extHandler.headerMouseOut,scope:this};a.click={fn:this.extHandler.click,scope:this};a.celldblclick={fn:this.extHandler.cellDblClick,scope:this};a.cellmouseover={fn:this.extHandler.cellMouseOver,
scope:this};a.cellmouseout={fn:this.extHandler.cellMouseOut,scope:this};return a};
ListViewport.prototype.initdd=function(){var a=this;this.drag=new Ext.dd.DragZone(this.grid.getEl(),{containerScroll:true,scroll:false,rowId:"",getDragData:function(c){var b=c.getTarget("div.x-grid3-row");if(b){c=a.getFilterColumns()[0];var d=".x-grid3-col-"+c.id;b=Ext.get(b).select(d,true).elements[0];d=document.createElement("div");d.className="dragElement";c=a.drag.row.data[c.dataIndex];Sfdc.Dom.updateHTML(d,typeof c=="object"?c[0]:c);return{ddel:d,rowId:a.drag.row.id,repairXY:b.getXY()}}},getRepairXY:function(){return this.dragData.repairXY}});
this.grid.on("rowmousedown",function(c,b){a.drag.row=c.getStore().getAt(b)})};ListViewport.prototype.getHOffset=function(){var a=0;a+=Ext.fly(this.topNav).getHeight();a+=Ext.fly(this.subNav).getHeight();a+=Ext.fly(this.bottomNav).getHeight();a+=Ext.fly(this.listViewport).getBorderWidth("tb");a+=Ext.fly(this.listBody).getBorderWidth("tb");return a};
ListViewport.prototype.getResizeHeight=function(){var a=0;if(this.vf)a=this.height||c.getHeight(true);else if(this.inOverlay){var c=Ext.fly(this.wrapper).parent();a=Ext.fly(this.subNav).child("div.linkBar").getHeight();a=c.getHeight()-a}else a=document.documentElement.clientHeight-Ext.fly(this.wrapper).getTop()-this.bottomBuffer;return a};
ListViewport.prototype.getBorderOffsetWidth=function(){return UserContext&&UserContext.uiSkin==UiSkin.ALOHA.apiValue?Ext.fly(this.listBody).getBorderWidth("lr"):Ext.fly(this.listViewport).getBorderWidth("lr")};ListViewport.prototype.resizeElement=function(a,c,b){if(a){if(c)a.style.height=c;if(b)a.style.width=b}};
ListViewport.prototype.resize=function(a){if(this.shouldSizeToViewport){var c=this.getHOffset();c=this.getResizeHeight()-c;if(a&&c<a)c=a;var b=(c<0?0:c)+"px";if(!this.initialRenderDone&&this.grid&&(!this.vf||Ext.version!="2.1")){this.initialRenderDone=true;this.resizeElement(this.listBody,b,null);this.grid.setHeight(c);return}}try{this.shrinkStore()}catch(d){}a=Ext.fly(this.wrapper).parent();if(this.grid)this.grid.el.dom.style.display="none";if(this.shouldSizeToViewport){var e=this.width||a.getWidth(true);
a=e+"px";this.resizeElement(this.listBody,b,null);this.resizeElement(this.wrapper,null,a);this.resizeElement(this.exception,b,a)}if(this.grid){this.grid.el.dom.style.display="";this.grid.suspendEvents();if(this.shouldSizeToViewport){this.grid.setHeight(c);this.grid.setWidth(e-this.getBorderOffsetWidth())}this.grid.resumeEvents();this.unshrinkStore();this.sizeIfNoData()}};
ListViewport.prototype.redefineSidebarPin=function(){var a=this;if(Sidebar.prototype.theSidebar)Sidebar.prototype.theSidebar.pin=function(){Sidebar.prototype.pin.apply(Sidebar.prototype.theSidebar);a.resize()}};ListViewport.prototype.beforeSave=function(){this.saving.show()};
ListViewport.prototype.afterSave=function(a,c){if(a&&a.length>0){if(this.refreshLink){Ext.fly(this.refreshLink).addClass("refreshListButtonNeeded");this.refreshLink.title=LC.getLabel("Filter","refreshNeeded")}var b=c.getDisplayValue();if(b==="")b="&nbsp;";for(var d=c.getFieldId(),e=new Ext.CompositeElement,f=0;f<a.length;f++){var g=Ext.get(getElementByIdCS(a[f]+"_"+d));if(g){e.add(g.parent());g.update(b);if((g=this.grid.getStore().getById(a[f]))&&g.data[c.columnName])g.data[c.columnName]=b}}b=this.grid.getSelectionModel().getCount()>
0?"#dfe8f6":"#ffffff";e.highlight("#ffffcc",{endColor:b,duration:2.5,concurrent:true})}this.saving.hide()};ListViewport.prototype.getFilterColumns=function(){return this.grid.getColumnModel().getColumnsBy(function(a){return a.id!="checkbox"&&a.id!=ListView.ID_COLUMN&&a.id!=ListView.ACTION_COLUMN})};ListViewport.prototype.resizeAllActionColumns=function(){return false};ListViewport.prototype.spaceToAllocateForVertScrollBar=function(){};
ListViewport.prototype.extHandler={columnMove:function(){if(this.filter.id!==Udd.EMPTY_KEY){for(var a=this.getFilterColumns(),c=[],b=0;b<a.length;b++)c.push(a[b].dataIndex);a={action:"reorderColumns",filterId:this.filter.id,cols:c};this.customizable&&XBrowser.postHttpResponse(this.url,function(){},XBrowser.buildPost(a))}a=this.grid.getView();a.updateSortIcon(this.grid.getColumnModel().findColumnIndex(a.sortState.field),a.sortState.dir)},columnResize:function(){if(this.filter.id!==Udd.EMPTY_KEY){for(var a=
this.getFilterColumns(),c=[],b=0;b<a.length;b++)c.push(a[b].width);XBrowser.postHttpResponse(this.url,function(){},XBrowser.buildPost({action:"setColumnWidths",filterId:this.filter.id,widths:c}));this.sizeIfNoData()}},cellDblClick:function(a,c,b){if(this.inlineEditData.isEditable){a=a.getColumnModel().getDataIndex(b);if((b=this.inlineEditData.getColumnById(a))&&b.state==InlineEditState.EDIT){var d=this.grid.getSelectionModel();if(d.getCount()==0||d.selectRow(c,this.inlineEditData.isMassEditable)){d=
this.grid.getStore().getAt(c);c=d.get(ListView.ID_COLUMN);b=d.get(b.columnName);this.inlineEditData.openColumn(c,a,typeof b=="object"?b[1]:null)}}}},cellMouseOver:function(a,c,b){if(this.inlineEditData.isEditable)if(a=this.inlineEditData.getColumnById(a.getColumnModel().getDataIndex(b))){a=a.state.cssClass;Ext.fly(this.grid.getView().getCell(c,b)).replaceClass(a,a+"On")}},cellMouseOut:function(a,c,b){if(this.inlineEditData.isEditable)if(a=this.inlineEditData.getColumnById(a.getColumnModel().getDataIndex(b))){a=
a.state.cssClass;Ext.fly(this.grid.getView().getCell(c,b)).replaceClass(a+"On",a)}},headerMouseOver:function(a,c){var b=a.getColumnModel().getColumnId(c);if((b=a.getColumnModel().getColumnById(b))&&b.isSortable){this.grid.getView().getHeaderCell(c);Ext.fly(this.grid.getView().getHeaderCell(c)).addClass("over")}},headerMouseOut:function(a,c){var b=a.getColumnModel().getColumnId(c);if((b=a.getColumnModel().getColumnById(b))&&b.isSortable){this.grid.getView().getHeaderCell(c);Ext.fly(this.grid.getView().getHeaderCell(c)).removeClass("over")}},
headerClick:function(a,c){var b=a.getColumnModel(),d=b.getColumnById(b.getColumnId(c));b=a.getView();if(!(!d.isSortable||b.headersDisabled))if(d=d.dataIndex)if(b.sortState&&b.sortState.field==d&&b.sortState.dir=="ASC"){this.getListData({sort:"-"+d,page:this.paginator.currentPage,rolodexIndex:this.rolodexIndex});b.updateSortIcon(c,"DESC");b.sortState.dir="DESC"}else{this.getListData({sort:d,page:this.paginator.currentPage,rolodexIndex:b.sortState&&b.sortState.field==d?this.rolodexIndex:-1});b.updateSortIcon(c,
"ASC");b.sortState={field:d,dir:"ASC"}}},click:function(a){if(this.hasActions&&typeof chatter!=="undefined"&&a&&a.target){var c=Ext.get(a.target);if(c.hasClass("chatterFollowUnfollowAction")&&!Ext.isEmpty(c.dom.getAttribute("entityid"))){var b=this;chatter.getFollowUnfollowListAction().toggle(c.dom,function(){var d=b.grid.getView().findRowIndex(c.dom);if(d!==false){var e=b.grid.getStore().getAt(d);if(e){e.beginEdit();b.updateActionColumnInStore(d);if(e.modified)e.modified[ListView.ACTION_COLUMN]=
undefined;e.endEdit()}}})}}}};ListViewport.prototype.verify=function(a){if(this.grid.getSelectionModel().selections.length>0)return true;else{alert(a);return false}};
ListViewport.prototype.showRPPWarning=function(){if(!(this.vf||this.rowsPerPage<=100||UserContext.userPreferences.getBoolean("HideRPPWarning")))if(!ListViewport.dialog){var a=this;ListViewport.dialog=new SimpleDialog("RPPWarning");ListViewport.dialog.displayX=true;ListViewport.dialog.setWidth(520);ListViewport.dialog.extraClass="RPPDialog";ListViewport.dialog.setTitle(LC.getLabel("RPPDialog","title"));ListViewport.dialog.createContent=function(){var c=document.getElementById(this.getContentId()),
b=[];b.push("<h2 id='");b.push(ListViewport.dialog.id);b.push("Header'>");b.push(ListViewport.dialog.header);b.push("</h2>");b.push("<div id='");b.push(ListViewport.dialog.id);b.push("Inner'>");b.push("<div class='message warningM4'><table cellspacing='0' cellpadding='0' border='0' class='messageTable'><tr><td>");b.push("<img title='Warning' class='msgIcon' src='/s.gif' alt='");b.push(LC.getLabel("Icon","WARNING"));b.push("'/></td>");b.push("<td class='headerCell'><h4>");b.push(LC.getLabel("RPPDialog",
"yourRPP",a.rowsPerPage));b.push("</h4></td></tr>");b.push("<tr><td></td><td><div>");b.push(LC.getLabel("RPPDialog","message"));b.push("</div>");b.push("</td></tr></table></div>");b.push("<div class='radioDiv'>");b.push("<div class='radio'><input type='radio' name='RPPRadio' id='RPPChange' checked='checked'><label for='RPPChange'>");b.push(LC.getLabel("RPPDialog","change"));b.push("</label>");b.push("<select class='RPPSelect' name='RPPSelect' id='RPPSelect'>");for(var d=[10,25,50,100],e=0;e<d.length;e++){b.push("<option value='");
b.push(d[e]);b.push("'");d[e]==100&&b.push(" selected");b.push(">");b.push(d[e]);b.push("</option>")}b.push("</select></div>");b.push("<div class='radio'><input type='radio' name='RPPRadio' id='RPPNoChange'><label for='RPPNoChange'>");b.push(LC.getLabel("RPPDialog","nochange"));b.push("</label></div>");b.push("</div>");b.push("<div class='buttons'>");b.push("<input class='btn' type='button' value='");b.push(LC.getLabel("Buttons","save"));b.push("' id='RPPSaveButton'><input class='btn' type='button' value='");
b.push(LC.getLabel("Buttons","cancel"));b.push("' id='RPPCancelButton'>");b.push("</div>");b.push("</div>");Sfdc.Dom.updateHTML(c,b.join(""));document.getElementById("RPPChange").onclick=function(){document.getElementById("RPPSelect").disabled=""};document.getElementById("RPPNoChange").onclick=function(){document.getElementById("RPPSelect").disabled="true"};document.getElementById("RPPCancelButton").onclick=function(){ListViewport.dialog.hide()};document.getElementById("RPPSaveButton").onclick=function(){document.getElementById("RPPNoChange").checked?
UserContext.userPreferences.setBoolean("HideRPPWarning",true):a.getListData({rowsPerPage:document.getElementById("RPPSelect").value,rolodexIndex:a.rolodexIndex});ListViewport.dialog.hide()};ListViewport.dialog.show()};ListViewport.dialog.register()}};ListViewport.prototype.getNoResultsText=function(){return LC.getLabel("List","none")};
ListViewport.prototype.getFeedListView=function(a,c){var b=this;b.feedLoading.show();Jiffy.mark("startListViewFeed");var d="/listviewfeed/"+a;if(c)d=d+"?entity="+c;chatter.getToolbox().get({url:d,timeout:18E5,success:function(e,f){Jiffy.mark("startFeedListViewRender");chatter.getToolbox().updateHTML(Ext.Element.get(b.feedBody),f.html,true);b.feedLoading.hide();Jiffy.measure("endListViewFeedRender","startFeedListViewRender");Jiffy.measure("endListViewFeed","startListViewFeed")}})};
ListViewport.instances={};ListViewport.addListViewport=function(a){ListViewport.instances[a.domId]=a};
AutoCompleteInputElement=function(a,b,c,e,d,g,h,j){this.id=a;this.element=document.getElementById(a);if(this.id&&this.element){this.matchBlanks=d;this.lkId=h;if(g)this.id=g;AutoCompleteInputElement.instanceRefs[this.id]=this;this.servletURI=b;this.minSuggestLen=c>=0?c:0;this.cache={};this.triedQueries={};this.selected=-1;this.requestParams=e;this.lastInput=null;this.enabled=true;this.disableOnEsc=false;this.shouldCaptureKeyStroke=typeof j==="undefined"?true:j;this.displayHeader=true;var f=this;addEvent(this.element,
"keyup",function(i){f.handleInput(i)});addEvent(this.element,"keydown",function(i){f.handleNav(i)});this.acBoxFocused=false;addEvent(this.element,"blur",function(){f.focused=false;if(!f.acBoxFocused){var i=f.getOnBlurDelay();i>0?setTimeout(function(){f.clearSuggestions()},i):f.clearSuggestions()}});addEvent(this.element,"focus",function(){f.focused=true})}};AutoCompleteInputElement.BOX_ID="_autoCompleteBoxId";AutoCompleteInputElement.BOX_CSS_CLASS="autoCompleteBoxScrolling";
AutoCompleteInputElement.ROW_ID="_autoCompleteRowId_";AutoCompleteInputElement.ROW_CSS_CLASS="autoCompleteRow";AutoCompleteInputElement.ROW_CSS_CLASS_SELECTED="autoCompleteSelectedRow";AutoCompleteInputElement.ROW_CSS_CLASS_MOUSE_OVER="autoCompleteHoverRow";AutoCompleteInputElement.TITLE_ROW_CSS_CLASS="autoCompleteSectionRow";AutoCompleteInputElement.BOX_TABLE_ID="_autoCompleteTableId";AutoCompleteInputElement.MAX_SUGGESTIONS=10;AutoCompleteInputElement.ROW_HEIGHT=1.5;
AutoCompleteInputElement.ROW_HEIGHT_UNITS="em";AutoCompleteInputElement.ONBLUR_DELAY_MS=200;AutoCompleteInputElement.regexChars=/([\/.*+?|()[\]{}\\^$])/g;AutoCompleteInputElement.instanceRefs={};AutoCompleteInputElement.prototype.getOnBlurDelay=function(){return AutoCompleteInputElement.ONBLUR_DELAY_MS};
AutoCompleteInputElement.prototype.positionACBox=function(a){if(this.element&&this.acBox)if(!(a&&!this.isACBoxVisible())){a=this.getACXPosition(this.element);var b=this.getACYPosition(this.element);this.acBox.setStyle("left",a+"px");this.acBox.setStyle("top",b+"px");this.acBox.setStyle("width",this.element.clientWidth+"px");if(typeof Ext==="object"){a=Ext.get("massEdit");a!==null&&this.acBox.setStyle("zIndex",parseFloat(a.getStyle("z-index"),10)+10)}}};
AutoCompleteInputElement.prototype.getACXPosition=function(a){return getObjX(a)};AutoCompleteInputElement.prototype.getACYPosition=function(a){return getObjY(a)+a.offsetHeight};AutoCompleteInputElement.prototype.setACBoxHeight=function(a){var b=this.getMaxSuggestionsToDisplay();if(a>b){this.acBox.setStyle("height",b*AutoCompleteInputElement.ROW_HEIGHT+AutoCompleteInputElement.ROW_HEIGHT_UNITS);this.scrolling=true}else{this.acBox.setStyle("height","auto");this.scrolling=false}};
AutoCompleteInputElement.prototype.updateWidth=function(){var a=this.getMinimumWidth(),b=-1;if(this.acBox.div.childNodes)b=this.acBox.div.childNodes[0].clientWidth;a>b?this.acBox.setStyle("width",a+"px"):this.acBox.setStyle("width",b+"px")};AutoCompleteInputElement.prototype.getMinimumWidth=function(){return this.element.clientWidth};AutoCompleteInputElement.prototype.clearACBox=function(){if(this.isACBoxVisible()){this.hideACBox();this.scrolling=false;this.acBox.setStyle("height","auto");this.deselect()}};
AutoCompleteInputElement.prototype.isACBoxInitialized=function(){return this.acBox!=null};AutoCompleteInputElement.prototype.isACBoxVisible=function(){return this.isACBoxInitialized()&&this.acBox.getStyle("display")!="none"};AutoCompleteInputElement.prototype.updateACBox=function(a,b){if(this.element)if(!a||a.length==0)this.acBox&&this.clearACBox();else{this.acBox||this.initACBox();this.displayACBox(a,b);this.scrollDiv();this.updateWidth()}};
AutoCompleteInputElement.prototype.showACBox=function(){this.acBox.setStyle("display","block");this.hook_show()};AutoCompleteInputElement.prototype.hideACBox=function(){this.acBox.setStyle("display","none");this.hook_hide()};AutoCompleteInputElement.prototype.hook_show=function(){};AutoCompleteInputElement.prototype.hook_hide=function(){};AutoCompleteInputElement.prototype.displayACBox=function(a,b){this.setACBox(this.constructACBox(a,b));this.positionACBox();this.setACBoxHeight(!a?0:a.length);this.showACBox()};
AutoCompleteInputElement.prototype.constructACBox=function(a,b){var c=[];c.push("<table id='"+this.id+AutoCompleteInputElement.BOX_TABLE_ID+"' width='100%' cellpadding='0' cellspacing='0' border='0'>");a&&a.length>0&&this.addHeader(c);this.addSuggestions(c,a,b);this.addFooter(c,!a?0:a.length);c.push("</table>");return c=this.hook_decorateHtml(c)};AutoCompleteInputElement.prototype.hook_decorateHtml=function(a){return a};
AutoCompleteInputElement.prototype.addSuggestions=function(a,b,c){!b||b.length==0||this.innerAddSuggestions(a,b,c,0)};
AutoCompleteInputElement.prototype.innerAddSuggestions=function(a,b,c,e){for(var d=0;d<b.length;d++){var g=b[d];if(g&&g.name){var h=d+e;a.push("<tr><td>");a.push("<div ");a.push('onmouseover="');a.push("AutoCompleteInputElement.mouseOver('"+this.id+"', "+h+')"');a.push('onmouseout="');a.push("AutoCompleteInputElement.mouseOut('"+this.id+"', "+h+')"');a.push('onclick="');a.push("AutoCompleteInputElement.click('"+this.id+"', "+h+')"');if(this.compareSuggestions(c,g)){a.push("class='"+AutoCompleteInputElement.ROW_CSS_CLASS_SELECTED+
"' ");this.select(h)}else a.push("class='"+AutoCompleteInputElement.ROW_CSS_CLASS+"' ");a.push("id='"+AutoCompleteInputElement.getRowIdStatic(this.id,h)+"'>");a.push(this.getSuggestionHtml(g));a.push("</div>");a.push("</td></tr>")}}};AutoCompleteInputElement.prototype.addHeader=function(a){this.displayHeader&&a.push('<tr><td><div class="'+AutoCompleteInputElement.TITLE_ROW_CSS_CLASS+'">'+LC.getLabel("Sidebar_Search","result_source")+"</div></td></tr> ")};
AutoCompleteInputElement.prototype.addFooter=function(){};AutoCompleteInputElement.prototype.select=function(a){if(this.selected!=a){if(this.selected>=0){var b=this.getRow(this.selected);if(b)b.className=AutoCompleteInputElement.ROW_CSS_CLASS}this.selected=a;if(b=this.getRow(this.selected))b.className=AutoCompleteInputElement.ROW_CSS_CLASS_SELECTED}};
AutoCompleteInputElement.prototype.selectPrev=function(){if(this.hasValidSelection()){var a=this.selected-1;if(a<0)this.deselect();else{this.select(a);this.scrollDiv()}}};AutoCompleteInputElement.prototype.selectNext=function(){if(this.hasValidSelection()){if(this.selected+1!=this.curSuggestions.length){this.select((this.selected+1)%this.curSuggestions.length);this.scrollDiv()}}else this.isACBoxVisible()&&this.select(0)};
AutoCompleteInputElement.prototype.scrollDiv=function(){if(this.hasValidSelection()&&this.scrolling)this.acBox.div.scrollTop=this.acBox.div.scrollHeight*((this.selected+1)/this.curSuggestions.length)-this.acBox.div.clientHeight*0.5};AutoCompleteInputElement.prototype.deselect=function(){return this.select(-1)};
AutoCompleteInputElement.prototype.hasValidSelection=function(){return this.element&&this.selected>=0&&this.curSuggestions&&this.curSuggestions.length&&this.selected<this.curSuggestions.length&&this.isACBoxVisible()};
AutoCompleteInputElement.prototype.initACBox=function(){if(this.element){this.acBox=document.createElement("div");var a=this;addEvent(this.acBox,"mouseover",function(){a.acBoxFocused=true});addEvent(this.acBox,"mouseout",function(){a.acBoxFocused=false;if(!a.onClickFired){a.element.focus();a.focused=true;if(XBrowser.userAgent.isIE)a.element.value=a.element.value}});this.acBox.id=this.id+AutoCompleteInputElement.BOX_ID;this.acBox.className=AutoCompleteInputElement.BOX_CSS_CLASS;this.addACBoxToPage(this.acBox);
this.acBox=new iframeShim(this.acBox);this.acBox.setStyle("width",this.getMinimumWidth()+"px");if(!AutoCompleteInputElement.hasResizeHandler){addEvent(window,"resize",AutoCompleteInputElement.resizeHandler);AutoCompleteInputElement.hasResizeHandler=true}}};AutoCompleteInputElement.prototype.addACBoxToPage=function(a){document.body.appendChild(a)};AutoCompleteInputElement.prototype.setACBox=function(a){this.acBox||this.initACBox();this.acBox.div.innerHTML=a.join("")};
AutoCompleteInputElement.prototype.complete=function(){if(!this.element)return false;if(!this.hasValidSelection())return false;var a=this.curSuggestions[this.selected];this.setAppliedFlag(true);this.innerComplete(a);this.clearACBox();this.resizeTextArea();return true};AutoCompleteInputElement.prototype.innerComplete=function(a){if(!(!this.element||!a||a.length==0)){this.element.value=a.name;a.lookupPickJs&&eval(a.lookupPickJs)}};
AutoCompleteInputElement.prototype.setAppliedFlag=function(a){a=a?"1":"0";if(this.acAppliedField)this.acAppliedField.value=a;else{var b=document.getElementById(EditPageConstants.pEDIT_PAGE);if(b){var c=this.id+AbstractAutoCompleteServlet.AUTOCOMPLETE_USED_SUFFIX;field=document.createElement("input");field.type="hidden";field.id=c;field.name=c;field.value=a;b.appendChild(field);this.acAppliedField=field}}};
AutoCompleteInputElement.prototype.getRow=function(a){return document.getElementById(AutoCompleteInputElement.getRowIdStatic(this.id,a))};AutoCompleteInputElement.prototype.disableAC=function(){if(this.enabled){this.enabled=false;this.clearSuggestions()}};AutoCompleteInputElement.prototype.enableAC=function(){if(!this.enabled){this.enabled=true;this.displaySuggestions(true)}};
AutoCompleteInputElement.prototype.retrieveFromServlet=function(a){if(!a||a.length<this.minSuggestLen)return false;if(this.triedQueries[this.getCacheKey(a)])return false;this.triedQueries[this.getCacheKey(a)]=true;var b=new QueryString;b.add(AbstractAutoCompleteServlet.pINPUT,a);b.add("time",(new Date).getTime());if(this.requestParams)for(var c in this.requestParams)b.add(c,this.requestParams[c]);this.lkId&&sfdcPage.getReferredDomIds&&b.add(MRUAutoCompleteServlet.DEPDATA_PARAM,dpdLkUtil.serialize(sfdcPage.getReferredDomIds(this.lkId),
this.lkId));var e=this;XBrowser.getHttpResponse(this.servletURI+b.toString(),function(d){if(d=d.responseText)if((d=e.parseResponse(d))&&d[AbstractAutoCompleteServlet.SUGGESTIONS]){e.saveToCache(a,d[AbstractAutoCompleteServlet.SUGGESTIONS]);e.displaySuggestions(true)}});return true};AutoCompleteInputElement.prototype.parseResponse=function(a){return Util.evalAjaxServletOutput(a)};
AutoCompleteInputElement.prototype.displaySuggestions=function(a){if(!(!this.element||!this.focused||!this.enabled||!this.additionalDisplayConditionsValid())){var b=trim(this.element.value);if(a||b!=this.lastInput||!this.isACBoxVisible()){this.setAppliedFlag(false);this.lastInput=b;a=null;if(b=="")this.handleEmptyInput();else{if(this.hasValidSelection())a=this.curSuggestions[this.selected];this.curSuggestions=this.getSuggestions(b);this.updateACBox(this.curSuggestions,a)}}}};
AutoCompleteInputElement.prototype.handleEmptyInput=function(){this.clearSuggestions()};AutoCompleteInputElement.prototype.clearSuggestions=function(){if(this.element){this.curSuggestions=null;this.clearACBox()}};AutoCompleteInputElement.prototype.getSuggestions=function(a){a=this.findInput(a);if(!(this.element&&a.length>=this.minSuggestLen))return[];var b=this.checkCacheOrRetrieve(a);if(!b)return[];return this.getValidSuggestions(a,b)};
AutoCompleteInputElement.prototype.getValidSuggestions=function(a,b){for(var c=[],e=0;e<b.length;e++){var d=b[e];this.isValidSuggestion(a,d)&&c.push(d)}return c};AutoCompleteInputElement.prototype.getMaxSuggestionsToDisplay=function(){return AutoCompleteInputElement.MAX_SUGGESTIONS};AutoCompleteInputElement.prototype.getCacheKey=function(){return"dummy"};AutoCompleteInputElement.prototype.saveToCache=function(a,b){this.cache[this.getCacheKey(a)]=b};
AutoCompleteInputElement.prototype.clearCache=function(){this.cache={};this.triedQueries={}};AutoCompleteInputElement.prototype.checkCacheOrRetrieve=function(a){var b=this.getCacheKey(a);this.cache[b]||this.retrieveFromServlet(a);return this.cache[b]};AutoCompleteInputElement.prototype.handleInput=function(a){this.focused=true;var b=false;if(this.inKeyIME){this.inKeyIME=false;if(a.keyCode==KEY_ENTER){b=true;this.displaySuggestions()}}!b&&!AutoCompleteInputElement.isNav(a)&&this.displaySuggestions()};
AutoCompleteInputElement.prototype.handleNav=function(a){if(AutoCompleteInputElement.isNav(a))if(a.keyCode==KEY_ESC){this.clearSuggestions();this.disableOnEsc&&this.disableAC();AutoCompleteInputElement.captureKeystroke(a)}else if(a.keyCode==KEY_ARROW_U)this.selectPrev();else if(a.keyCode==KEY_ARROW_D)this.selectNext();else if(a.keyCode==KEY_TAB){this.complete();if(typeof this.onAfterTabDown==="function")this.onAfterTabDown(a)}else a.keyCode==KEY_ENTER&&this.handleEnter(a);else if(a.keyCode==KEY_PROCESS)this.inKeyIME=
true;this.resizeTextArea()};AutoCompleteInputElement.prototype.handleEnter=function(a){this.complete()&&this.shouldCaptureKeyStroke&&AutoCompleteInputElement.captureKeystroke(a)};AutoCompleteInputElement.getRowIdStatic=function(a,b){return""+a+AutoCompleteInputElement.ROW_ID+b};AutoCompleteInputElement.getInstance=function(a){return AutoCompleteInputElement.instanceRefs[a]};
AutoCompleteInputElement.mouseOver=function(a,b){var c=AutoCompleteInputElement.getInstance(a);if(c&&b>=0)if(b!=c.selected){c=AutoCompleteInputElement.getRowIdStatic(a,b);document.getElementById(c).className=AutoCompleteInputElement.ROW_CSS_CLASS_MOUSE_OVER}};AutoCompleteInputElement.mouseOut=function(a,b){var c=AutoCompleteInputElement.getInstance(a);if(c&&b>=0)if(b!=c.selected){c=AutoCompleteInputElement.getRowIdStatic(a,b);document.getElementById(c).className=AutoCompleteInputElement.ROW_CSS_CLASS}};
AutoCompleteInputElement.click=function(a,b){var c=AutoCompleteInputElement.getInstance(a);c.select(b);c.complete();c.onClickFired=true};AutoCompleteInputElement.matches=function(a,b){if(!a||!b)return false;a=AutoCompleteInputElement.normalize(a);b=AutoCompleteInputElement.normalize(b);if(a.length>b.length)return false;return b.indexOf(a)===0};AutoCompleteInputElement.normalize=function(a){return trim(a.toLowerCase())};
AutoCompleteInputElement.isNav=function(a){if(!a||!a.keyCode)return false;return a.keyCode==KEY_ARROW_D||a.keyCode==KEY_ARROW_U||a.keyCode==KEY_ESC||a.keyCode==KEY_TAB||a.keyCode==KEY_ENTER};AutoCompleteInputElement.blurHandler=function(a){(a=AutoCompleteInputElement.getInstance(a))&&a.isACBoxVisible()&&a.clearSuggestions()};AutoCompleteInputElement.captureKeystroke=function(a){if(a){Sfdc.Event.preventDefault(a);Sfdc.Event.stopPropogation(a)}};AutoCompleteInputElement.resizeHandler=function(){for(var a in AutoCompleteInputElement.instanceRefs)AutoCompleteInputElement.instanceRefs[a].positionACBox(true)};
AutoCompleteInputElement.prototype.isValidSuggestion=function(a,b){var c=this.getRegexForInput(a);return b.name.match(c)};AutoCompleteInputElement.escapeRegex=function(a){if(!a||a.length==0)return a;return a.replace(AutoCompleteInputElement.regexChars,"\\$1")};
AutoCompleteInputElement.prototype.getRegexForInput=function(a){var b=AutoCompleteInputElement.normalize(a);AutoCompleteInputElement.regexCache[b]||(AutoCompleteInputElement.regexCache[b]=this.matchBlanks?RegExp(["(\\b|^|\\W)(",AutoCompleteInputElement.escapeRegex(a),")"].join(""),"gi"):RegExp(["(^)(",AutoCompleteInputElement.escapeRegex(a),")"].join(""),"gi"));return AutoCompleteInputElement.regexCache[b]};AutoCompleteInputElement.regexCache={};
AutoCompleteInputElement.prototype.getSuggestionHtml=function(a){var b=[],c=escapeHTML(this.findInput(this.lastInput));a=escapeHTML(a.name);c=this.getRegexForInput(c);a=a.replace(c,'$1<strong class="autocompleteMatch">$2</strong>');b.push("&nbsp;");b.push(a);return b.join("")};AutoCompleteInputElement.prototype.findInput=function(a){return ltrim(a)};AutoCompleteInputElement.prototype.setResizer=function(a){this.resizeCallback=a};
AutoCompleteInputElement.prototype.resizeTextArea=function(){this.resizeCallback&&this.resizeCallback()&&this.positionACBox()};AutoCompleteInputElement.prototype.additionalDisplayConditionsValid=function(){return true};AutoCompleteInputElement.prototype.compareSuggestions=function(a,b){return a&&b&&a.lookupPickID&&b.lookupPickID&&b.lookupPickID==a.lookupPickID};
function ApexPage(){}ApexPage.prototype=new GenericSfdcPage;
function ApexDetailPage(){this.currentFieldForInlineEditDialog=null;this.domSuffixes={};this.picklists={};this.VFContainer={};this.relatedListCount={};this.getDetailPage=function(a){if(a)for(var b in this.domSuffixes){var c=RegExp(b+"(.*)").exec(a);if(c&&(c[1].length===0||c[1].charAt(0)==="_"))return this.domSuffixes[b]}};this.registerPickList=function(a,b){this.picklists[a]=b};this.getRegisteredPickList=function(a){return this.picklists[a]};this.postProcessSaveData=function(a,b){var c={},d;for(d in a)if(a.hasOwnProperty(d)){var e=
d.replace(b,"");c[e]=a[d]}return c};this.updateRelatedListPanel=function(a){(a=this.getDetailPage(a))&&a.getRelatedListPanel().addListsToPanel(true)}}ApexDetailPage.prototype=new DetailPage;ApexDetailPage.prototype.registerInlineDetail=function(a,b,c){a=new DetailPage(a);a.reRenderFunction=b;a.visualforce=c;this.domSuffixes[c]=a;this.relatedListCount[c]=0};
ApexDetailPage.prototype.registerInlineEditData=function(a){var b=new DetailPage;a=a[InlineEditConstants.VF_ENABLED];b.visualforce=a;this.domSuffixes[a]=b;this.VFContainer[a]=b};
ApexDetailPage.prototype.renderDetail=function(a){var b=this.domSuffixes[a];if(b){var c=b.reRenderFunction;if(typeof c!=="function"){c=new Function(c);b.reRenderFunction=c}if(a=document.getElementById(a+VisualforceConstants.UPDATE_VALUE)){a.value="true";var d=document.createElement("input");d.id="rls";d.style.display="none";d.type="hidden";d.name="rls";d.value=b.getEntityId();a.parentNode.appendChild(d)}this.cleanOverLay(b);c()}};
ApexDetailPage.prototype.cleanOverLay=function(a){if(a!=null){a=a.inlineEditData.fields;var b=InlineEditField.overlay,c;if(b)for(var d in a)if((c=a[d])&&c.editDiv&&b.fields[d]){var e=b.fields[d];if(e){c=b[b.currentField===d?"activeDiv":"editDivPool"];e.div.parentNode==c&&c.removeChild(e.div)}if(b.currentField===d)b.currentField=null;b.fields[d]=null}}};ApexDetailPage.prototype.loadDetailJS=function(a){if((a=document.getElementById(a+"JS"))&&a.innerHTML)(XBrowser.userAgent.isIE?window.execScript:window.eval)(a.innerHTML)};
ApexDetailPage.prototype.focusOnSave=function(a){if((a=this.domSuffixes[a])&&a.editButtons[0])a.editButtons[0].focus();else this.editButtons[0]&&this.editButtons[0].focus()};
ApexDetailPage.prototype.initInlineEdit=function(a){var b=this.domSuffixes[a[InlineEditConstants.VF_ENABLED]];if(b){b.inlineEditData=a;if(a.isEditable){var c=this;c.appendToOnloadQueue(function(){b.inlineEditData.init()},"Initialize inline edit");c.appendToOnloadQueue(function(){c.initializeButtons(b)},"Setup detail buttons")}}else DetailPage.prototype.initInlineEdit.call(this,a)};
ApexDetailPage.prototype.getInlineEditData=function(a){var b=this.getDetailPage(a?a:this.currentFieldForInlineEditDialog);return b?b.inlineEditData:DetailPage.prototype.getInlineEditData.call(this,a)};ApexDetailPage.prototype.save=function(a){(a=this.domSuffixes[a])?a.save():DetailPage.prototype.save.call(this)};ApexDetailPage.prototype.revert=function(a){(a=this.domSuffixes[a])?a.revert():DetailPage.prototype.revert.call(this)};
ApexDetailPage.prototype.activateInlineEditMode=function(a){(a=this.getDetailPage(a))?a.activateInlineEditMode():DetailPage.prototype.activateInlineEditMode.call(this)};ApexDetailPage.prototype.getReferredDomIds=function(a){var b=this.getDetailPage(a);return b?b.getReferredDomIds(a):GenericSfdcPage.prototype.getReferredDomIds.call(this,a)};ApexDetailPage.prototype.deactivateInlineEditMode=function(a){(a=this.getDetailPage(a))?a.deactivateInlineEditMode():DetailPage.prototype.deactivateInlineEditMode.call(this)};
ApexDetailPage.prototype.unRegisterDialog=function(a){var b=this.getDetailPage(a.id);b?b.unRegisterDialog(a):DetailPage.prototype.unRegisterDialog.call(this,a)};ApexDetailPage.prototype.getDialogById=function(a){var b=this.getDetailPage(a);return b?b.getDialogById(a):DetailPage.prototype.getDialogById.call(this,a)};
ApexDetailPage.prototype.initializeButtons=function(a){function b(c){var d=document.getElementById(c),e=d.getElementsByTagName("input");for(c=0;c<e.length;c++){var f=e[c];if(f.type==="button")f.name===InlineEditConstants.SAVE_BUTTON||f.name===InlineEditConstants.CANCEL_BUTTON?a.editButtons.push(f):a.detailButtons.push(f)}d=d.getElementsByTagName("div");for(c=0;c<d.length;c++){e=d[c];e.className==="menuButton"&&a.detailButtons.push(e)}}if(!this.VFContainer[a[InlineEditConstants.VF_ENABLED]]){b(DetailElement.TOP_BUTTON_ROW+
a[InlineEditConstants.VF_ENABLED]);b(DetailElement.BOTTOM_BUTTON_ROW+a[InlineEditConstants.VF_ENABLED])}};ApexDetailPage.prototype.setError=function(a,b){var c=this.domSuffixes[b];c?c.setError(a):DetailPage.prototype.setError.call(this,a)};
ApexDetailPage.prototype.dblClickField=function(a,b){var c=XBrowser.userAgent.isIE?event:a;if(getEventTarget(getEvent(c)).nodeName.toLowerCase()!="a"){var d=this.getFieldById(b.id);this.currentFieldForInlineEditDialog&&d!==this.currentFieldForInlineEditDialog&&sfdcPage.getInlineEditData(this.currentFieldForInlineEditDialog).closeCurrentField();sfdcPage.getDetailPage(b.id).dblClickField(c,b)}};
ApexDetailPage.prototype.clickField=function(a,b){var c=XBrowser.userAgent.isIE?event:a;sfdcPage.getDetailPage(b.id).clickField(c,b)};ApexDetailPage.prototype.getRelatedListCount=function(a){if(a&&a.visualforce&&this.relatedListCount.hasOwnProperty(a.visualforce))return this.relatedListCount[a.visualforce];return DetailPage.prototype.getRelatedListCount.call(this,a)};
ApexDetailPage.prototype.getRelatedListById=function(a){var b=this.getDetailPage(a);return b?b.getRelatedListById(a):DetailPage.prototype.getRelatedListById.call(this,a)};ApexDetailPage.prototype.registerRelatedListPanel=function(a,b){var c=this.getDetailPage(a);c?c.registerRelatedListPanel(a,b):DetailPage.prototype.registerRelatedListPanel.call(this,a,b)};ApexDetailPage.prototype.getRelatedListPanel=function(a){return(a=this.getDetailPage(a))?a.getRelatedListPanel():DetailPage.prototype.getRelatedListPanel.call(this)};
ApexDetailPage.prototype.registerRelatedList=function(a,b,c,d,e,f,h,i,j,k){var g=this.getDetailPage(a);if(g){DetailPage.prototype.registerRelatedList.apply(g,arguments);this.relatedListCount[g.visualforce]+=1}else DetailPage.prototype.registerRelatedList.call(this,a,b,c,d,e,f,h,i,j,k)};ApexDetailPage.prototype.makeRLAjaxRequest=function(a,b,c){var d=this.processRelatedList(b),e=d[0];b=d[1];if(e)e.makeRLAjaxRequest(a,b,c);else{a||(a=d[2]);DetailPage.prototype.makeRLAjaxRequest.call(this,a,b,c)}};
ApexDetailPage.prototype.processRelatedList=function(a){var b=null,c=null,d=null;if(typeof a==="string"){c=(b=this.getDetailPage(a))?a.replace(b.visualforce+"_",""):a;d=c.substring(0,a.search("_"))}else if(Object.prototype.toString.apply(a)==="[object Array]"){d=a[0];c=[];b=this.getDetailPage(d);d=d.substring(0,a.search("_"));for(var e in a)b?c.push(e.replace(b.visualforce+"_","")):c.push(e)}return[b,c,d]};
ApexDetailPage.prototype.getFieldValueById=function(a){var b=this.getDetailPage(a),c=null;if(b)c=DetailPage.prototype.getFieldValueById.call(b,a);c||(c=DetailPage.prototype.getFieldValueById.call(this,a));c||(c=GenericSfdcPage.prototype.getFieldValueById.call(this,a));return c};
ApexDetailPage.prototype.getEntityId=function(a){var b=this.getDetailPage(a);if(b){var c=b.getFieldById(a);if(typeof c.visualforce_entityId!=="undefined")return c.visualforce_entityId;return b.getEntityId(a)}else return this.entityId?this.entityId:GenericSfdcPage.prototype.getEntityId.call(this,a)};
ApexDetailPage.prototype.handleRLAjaxResponse=function(a){var b,c;try{b=Util.evalAjaxServletOutput(a)}catch(d){window.location.reload()}if(c=this.getDetailPage(b.visualforce))b.exElem?c.handleRLAjaxException(b.exElem):c.handleRLAjaxResponse(a);else DetailPage.prototype.handleRLAjaxResponse.call(this,a)};
Sfdc.provide("Sfdc.Labels",window.LC);Sfdc.provide("Sfdc.UserContext",window.UserContext);Sfdc.provide("Sfdc.Perf",window.Jiffy);Sfdc.provide("Sfdc.Animation",window.Animation);Sfdc.provide("Sfdc.Date",window.DateUtil);Sfdc.provide("Sfdc.Dialogs.AccessibleDialog",window.AccessibleDialog);Sfdc.provide("Sfdc.Dialogs.IFrameDialog",window.IFrameDialog);window.XBrowser&&Sfdc.provide("Sfdc.userAgent",window.XBrowser.userAgent);Sfdc.provide("Sfdc.Supports",window.Modernizr);
Sfdc.provide("Sfdc.Ajax",{get:function(d,a,b){b=b||{};b.method="GET";if(a)b.success=a;return this.request(d,b)},crossDomainRequest:function(d,a,b){b=b||{};b.isCrossDomain=true;if(!b.onBrowserNotSupportXDR)b.onBrowserNotSupportXDR=function(){};return this.get(d,a,b)},post:function(d,a,b){b=b||{};b.method="POST";if(a)b.success=a;return this.request(d,b)},jsonp:function(d,a){Sfdc.apply(a,{success:function(){},onScriptLoad:function(){},data:{},cache:false,callback:null});if(a.cache===false){a.data=a.data||
{};a.data._=(new Date).getTime()}var b=a.callback||"jsonp"+Sfdc.newUID();window[b]=function(e){Sfdc.isFunction(a.success)&&a.success(e);if(!a.callback)try{window[b]=null;delete window[b]}catch(g){Sfdc.log("Couldn't delete jsonp callback function",Sfdc.Logging.LogLevel.INFO,g)}};a.data.callback=b;d=Sfdc.Url.generateUrl(d,a.data);Sfdc.Resource.addJavaScript(d,function(){if(Sfdc.isFunction(a.onScriptLoad))a.onScriptLoad(this);Sfdc.Dom.removeChild(this)})},request:function(d,a){function b(){if(c.readyState===
4){var f=c.status;f>=200&&f<300||f===304?a.success.call(a.context,c.responseText,c,a):a.failure.call(a.context,c.responseText,c,a);a.complete.call(a.context,c.responseText,c,a);a.complete=a.success=a.failure=a.beforerequest=null}}var e=a.isCrossDomain||false,g=typeof XDomainRequest!="undefined",i=e&&g;a=Sfdc.apply(a,{method:"GET",async:true,beforerequest:function(){return true},success:function(){},failure:function(){},complete:function(){},contentType:null,headers:null,data:null,processData:true,
context:window,escape:function(f){return f}});a.method=a.method.toUpperCase();var c=this._createXmlHttpObject();if(e&&!g&&!("withCredentials"in c))a.onBrowserNotSupportXDR();else{if(i)return this._handleXDR(d,a);if(a.data)if(a.method==="GET"||a.method==="HEAD")d=Sfdc.Url.generateUrl(d,a.data,{escape:a.escape});else if(!Sfdc.isString(a.data)&&a.processData)a.data=Sfdc.Url.generateQueryString("",a.data,{includeMark:false,escape:a.escape,allowMultipleOfParam:true});if(a.async)c.onreadystatechange=b;
if(!(Sfdc.isFunction(a.beforerequest)&&!a.beforerequest.call(a.context))){c.open(a.method,d,a.async);if(a.headers)for(var h in a.headers)c.setRequestHeader(h,a.headers[h]);if(a.contentType)c.setRequestHeader("Content-Type",a.contentType);else a.data&&a.method==="POST"&&c.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=ISO-8859-13");c.send(a.data);if(!a.async){b();e=c.responseText;c.onreadystatechange=function(){};c=null;return e}return c}}},_createXmlHttpObject:function(){if(window.XMLHttpRequest)return new window.XMLHttpRequest;
else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){}return null},_handleXDR:function(d,a){var b=new XDomainRequest;if(!(Sfdc.isFunction(a.beforerequest)&&!a.beforerequest.call(a.context))){if(b){b.onerror=function(){a.failure.call(a.context,b.responseText,b,a)};b.ontimeout=function(){a.failure.call(a.context,b.responseText,b,a)};b.onprogress=function(){};b.onload=function(){a.success.call(a.context,b.responseText,b,a)};b.open("get",d);b.send()}return b}}});
Sfdc.provide("Sfdc.Array",{indexOf:function(a,c){if(Array.prototype.indexOf)return a.indexOf(c);for(var b=a.length-1;b>=0;b--)if(a[b]===c)return b;return-1},toArray:function(a){return Array.prototype.slice.call(a,0)}});
Sfdc.provide("Sfdc.Cookie",{setCookie:function(c,b,a,e,d,f,g){document.cookie=c+"="+(g||encodeURIComponent)(b)+(a?"; expires="+a.toGMTString():"")+(e?"; path="+e:"; path=/")+(d?"; domain="+d:"")+(f===true?"; secure":"")},getCookie:function(c,b){b=b||decodeURIComponent;var a=document.cookie,e=c+"=",d=a.indexOf("; "+e);if(d==-1){d=a.indexOf(e);if(d!==0)return null}else d+=2;var f=document.cookie.indexOf(";",d);if(f==-1)f=a.length;return b(a.substring(d+e.length,f))},deleteCookie:function(c,b,a){if(this.getCookie(c)){var e=
new Date((new Date).getTime()+-1E4);this.setCookie(c,"",e,b,a)}},getLoginCookieValue:function(){var c=document.cookie,b=c.indexOf("login=");if(b==-1)return"";b+=6;var a=c.indexOf(";",b);if(a==-1)a=c.length;return c.substring(b,a)}});
Sfdc.provide("Sfdc.Data",function(b){var e={};return{set:function(a,c,d){b.assert(a,"An element must be provided for Sfdc.Data.set(el, name, val);");b.assert(c,"A name must be defined for Sfdc.Data.set(el, name, val);");a=b.getUID(b.get(a));e[a]||(e[a]={});e[a][c]=d},get:function(a,c){b.assert(a,"An element must be provided for Sfdc.Data.get(el, name);");var d=e[b.getUID(b.get(a))];if(d){if(c===undefined)return d;return d[c]}},clear:function(a,c){this.set(a,c,null)}}}(Sfdc));
Sfdc.provide("Sfdc.Debug",{describe:function(b,a){a=a||alert;var c=[],d;for(d in b)c.push([d,b[d]].join(" = "));a(c.join(", "))},log:function(b,a){if(window.console)b.constructor==Array?window.console.log.apply(this,arguments):window.console.log(Sfdc.String.format(b,a))},warn:function(b,a){window.console&&window.console.warn(Sfdc.String.format(b,a))},error:function(b,a){window.console&&window.console.error(Sfdc.String.format(b,a))},logUsage:function(b,a){if(Sfdc.isDefAndNotNull(a))Sfdc.isArray(a)||
(a=[a]);else{a=[];for(var c in b)b.hasOwnProperty(c)&&Sfdc.isFunction(b[c])&&a.push(c)}c=0;for(var d=a.length;c<d;c++)Sfdc.isFunction(b[a[c]])&&Sfdc.Function.wrap(b,a[c],function(e){return function(){Sfdc.Debug.log("logging usage: "+e)}}(a[c]))}});
Sfdc.provide("Sfdc.Dom",{setText:function(a,b){Sfdc.assert(a,"No element specified!");a=Sfdc.get(a);this.updateHTML(a,"");a.appendChild(document.createTextNode(b));return this},getText:function(a){Sfdc.assert(a,"No element specified!");a=Sfdc.get(a);if(a.innerText!==undefined)return a.innerText;return a.textContent},hideByDisplay:function(a){Sfdc.assert(a,"No Element specified.");a=Sfdc.get(a);Sfdc.isArray(a)||(a=[a]);for(var b,c;b=a.pop();){c=this.getStyle(b,"display");c!=="none"&&Sfdc.Data.set(b,
"original-display",c);this.setStyle(b,"display","none")}return this},hideByVisibility:function(a){Sfdc.assert(a,"No Element specified.");a=Sfdc.get(a);Sfdc.isArray(a)||(a=[a]);this.set(a,{style:{visibility:"hidden"}});return this},show:function(a){Sfdc.assert(a,"No Element specified.");a=Sfdc.get(a);Sfdc.isArray(a)||(a=[a]);for(var b,c,d;b=a.pop();){c=this.getStyles(b,["visibility","display"]);d={};if(c.visibility==="hidden")d.visibility="visible";if(c.display==="none"){d.display=Sfdc.Data.get(b,
"original-display");if(!d.display)d.display=b.nodeName==="SPAN"?"inline":"block"}this.setStyles(b,d)}return this},isVisible:function(a,b){a=Sfdc.get(a);var c=this.getStyles(a,["visibility","display"]);c=!(c.visibility==="hidden"||c.display==="none");if(!c||!b)return c;return a.parentNode&&a.parentNode.tagName.toUpperCase()!=="BODY"?this.isVisible(a.parentNode,b):true},get:function(a,b){a=Sfdc.get(a);if(Sfdc.isArray(b)){for(var c={},d=0,e=b.length;d<e;d++)c[b[d]]=a[b[d]];return c}return a[b]},set:function(a,
b,c){var d;if(Sfdc.isArray(a)){var e=0;for(d=a.length;e<d;e++)this.set(a[e],b,c)}else{a=Sfdc.get(a);if(Sfdc.isObject(b)){for(e in b)if(b.hasOwnProperty(e))if(e==="style")this.setStyles(a,b[e]);else{c=b[e];d=typeof c;Sfdc.assert(d!=="function"&&d!=="object","You cannot set functions, objects or arrays to an element. It has the tendency to create memory leaks.");a[e]=b[e]}return this}d=typeof c;Sfdc.assert(d!=="function"&&d!=="object","You cannot set functions, objects or arrays to an element. It has the tendency to create memory leaks.");
a[b]=c;return this}},setStyle:function(a,b,c){a=Sfdc.get(a);if(b==="opacity"&&(Sfdc.userAgent.isIE6||Sfdc.userAgent.isIE7||Sfdc.userAgent.isIE8)){b="filter";c="alpha(opacity="+c*100+")"}a.style[b]=c;return this},setStyles:function(a,b){a=Sfdc.get(a);for(var c in b)b.hasOwnProperty(c)&&this.setStyle(a,c,b[c]);return this},getStyle:function(a,b){a=Sfdc.get(a);if(a.currentStyle){if(b==="opacity")return(a.currentStyle.filter||"100").replace(/[^\d]/g,"")/100;return a.currentStyle[b]}else if(document.defaultView&&
document.defaultView.getComputedStyle){var c=document.defaultView.getComputedStyle(a,null);return c?c.getPropertyValue(Sfdc.String.dashify(b)):null}},getStyles:function(a,b){a=Sfdc.get(a);for(var c={},d=0,e=b.length,f;d<e;d++){f=b[d];c[f]=this.getStyle(a,f)}return c},getElementXY:function(a){a=Sfdc.get(a);if(a.getBoundingClientRect){var b=a.getBoundingClientRect();return{x:Math.round(b.left+Sfdc.Window.getScrollX()),y:Math.round(b.top+Sfdc.Window.getScrollY())}}else{for(b={x:0,y:0};a!==null;){b.x+=
a.offsetLeft;b.y+=a.offsetTop;a=a.offsetParent}return b}},setElementXY:function(a,b){a=Sfdc.get(a);var c=this.getElementXY(a),d=this.getStyle(a,"left"),e=this.getStyle(a,"top"),f=this.getStyle(a,"position")=="relative";d=!isNaN(d)?d:f?0:a.offsetLeft;e=!isNaN(e)?e:f?0:a.offsetTop;this.setStyles(a,{left:b[0]-c.x+d+"px",top:b[1]-c.y+e+"px"})},getPositionXY:function(a,b,c){Sfdc.assert(a,"Trying to get positionXY of a non existent element");a=Sfdc.get(a);b=(b||"tl").toLowerCase();var d=this.getWidth(a),
e=this.getHeight(a),f=Math.round;switch(b){case "c":b=[f(d*0.5),f(e*0.5)];break;case "t":b=[f(d*0.5),0];break;case "l":b=[0,f(e*0.5)];break;case "r":b=[d,f(e*0.5)];break;case "b":b=[f(d*0.5),e];break;case "tl":b=[0,0];break;case "tr":b=[d,0];break;case "bl":b=[0,e];break;case "br":b=[d,e];break;default:throw"Unsupported position option";}a=c?{x:0,y:0}:this.getElementXY(a);return[a.x+b[0],a.y+b[1]]},alignTo:function(a,b,c,d){Sfdc.assert(a,"Trying to align a non existent element");Sfdc.assert(b,"Trying to align with a non existent element");
var e=(c||"tl-bl").toLowerCase().split("-");c=Sfdc.Dom.getPositionXY(a,e[0],true);b=Sfdc.Dom.getPositionXY(b,e[1]);d=d||[0,0];this.setElementXY(a,[b[0]-c[0]+d[0],b[1]-c[1]+d[1]])},getLocalOffsetXY:function(a){var b={x:a.offsetLeft,y:a.offsetTop},c;try{c=a.offsetParent}catch(d){return b}for(;c&&this.getStyle(c,"position")=="static";){b.x+=c.offsetLeft;b.y+=c.offsetTop;try{c=c.offsetParent}catch(e){break}}return b},deepCopy:function(a,b){var c=b.createElement(a.tagName);if(typeof a.attributes!="undefined"&&
a.attributes!==null)for(var d=0;d<a.attributes.length;d++)c.setAttribute(a.attributes[d].name,a.attributes[d].value);a.nodeValue!==null&&c.appendChild(b.createTextNode(a.nodeValue));if(typeof a.childNodes!="undefined"&&a.childNodes!==null)for(d=0;d<a.childNodes.length;d++)c.appendChild(deepCopy(a.childNodes[d],b));return c},importNode:function(a,b){Sfdc.assert(a,"Node to import is a required parameter.");if(b.importNode)return b.importNode(a,false);else{for(var c=b.createElement(a.tagName),d=0;d<
a.attributes.length;d++)a.attributes[d].specified&&c.setAttribute(a.attributes[d].name,a.attributes[d].value);return c}},_purgeElement:function(a,b){if(b!==false)b=true;if(a){var c=a.attributes,d,e,f;if(c){e=c.length;for(d=0;d<e;d+=1)if(c[d]){f=c[d].name;if(typeof a[f]==="function")a[f]=null}}if(b)if(c=a.childNodes){e=c.length;for(d=0;d<e;d+=1)this._purgeElement(a.childNodes[d],b)}}},cleanListeners:function(a,b){if(a&&(Sfdc.userAgent.isIE6||Sfdc.userAgent.isIE7||Sfdc.userAgent.isIE8)){if(b!==false)b=
true;if(Sfdc.isArray(a))for(var c=0,d=a.length;c<d;c++)this._purgeElement(a[c],b);else this._purgeElement(a,b)}return this},updateHTML:function(a,b){a=Sfdc.get(a);if(Sfdc.isDefAndNotNull(a)&&Sfdc.isDefAndNotNull(b)){this.cleanListeners(a.childNodes);a.innerHTML=b}return this},insertHTML:function(a,b){var c=[],d=document.createElement("DIV");d.innerHTML=b;for(var e;e=d.firstChild;){c.push(e);a.appendChild(e)}return c},removeChild:function(a){if(a&&a.parentNode){this.cleanListeners(a);a.parentNode.removeChild(a)}return this},
hasClass:function(a,b){if(a.classList)return a.classList.contains(b);return(" "+a.className+" ").indexOf(" "+b+" ")>=0},addClass:function(a,b){Sfdc.isArray(b)||(b=[b]);if(a.classList)for(var c=b.length-1;c>=0;c--)a.classList.add(b[c]);else if(a.className.length==0)a.className+=b.join(" ");else{var d=[];for(c=b.length-1;c>=0;c--)this.hasClass(a,b[c])||d.push(b[c]);if(d.length>0)a.className+=" "+d.join(" ")}return this},removeClass:function(a,b){Sfdc.isArray(b)||(b=[b]);if(a.classList){for(var c=b.length;c>=
0;c--)a.classList.remove(b[c]);return this}var d=Sfdc.String.trim,e=d(a.className).split(/\s+/),f;for(c=b.length-1;c>=0;c--){f=d(b[c]);f=Sfdc.Array.indexOf(e,f);f!=-1&&e.splice(f,1)}a.className=e.join(" ");return this},toggleClass:function(a,b){if(a.classList){a.classList.toggle(b);return this}if(this.hasClass(a,b))return this.removeClass(a,b);return this.addClass(a,b)},is:function(a){if(!Sfdc.isDefAndNotNull(a))return false;Sfdc.isArray(a)},getParent:function(a,b){var c=a.parentNode;if(!b)return c;
for(;c;){if(this.isMatch(c,b))return c;c=c.parentNode}return null},getPrevious:function(a,b){var c=a.previousElementSibling;if(!c)for(c=a.previousSibling;c&&c.nodeType!==1;)c=c.previousSibling;if(!b)return c;for(;c;){if(this.isMatch(c,b))return c;c=this.getPrevious(c)}return null},getNext:function(a,b){var c=a.nextElementSibling;if(!c)for(c=a.nextSibling;c&&c.nodeType!==1;)c=c.nextSibling;if(!b)return c;for(;c;){if(this.isMatch(c,b))return c;c=this.getNext(c)}return null},isMatch:function(a,b){Sfdc.isArray(a)||
(a=[a]);return Sizzle.filter(b,a).length===1},getWidth:function(a){return Math.max(a.offsetWidth,a.clientWidth)||0},getHeight:function(a){return Math.max(a.offsetHeight,a.clientHeight)||0}});
Sfdc.provide("Sfdc.EncodeDecode",function(){return{base64Decode:function(a){var d=[],f,g,h="",b,c="",e=0;a=a.replace(RegExp("[^A-Za-z0-9+/=]","g"),"");do{f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++));g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++));b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++));c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(e++));
f=f<<2|g>>4;g=(g&15)<<4|b>>2;h=(b&3)<<6|c;d.push(String.fromCharCode(f));b!=64&&d.push(String.fromCharCode(g));c!=64&&d.push(String.fromCharCode(h))}while(e<a.length);a=d.join("");d="";for(b=0;b<a.length;){c=a.charCodeAt(b++);if(c<128)d+=String.fromCharCode(c);else if(c>191&&c<224){e=a.charCodeAt(b++);d+=String.fromCharCode((c&31)<<6|e&63)}else{e=a.charCodeAt(b++);f=a.charCodeAt(b++);d+=String.fromCharCode((c&15)<<12|(e&63)<<6|f&63)}}return d}}}(Sfdc));
Sfdc.provide("Sfdc.Event",function(e){var h={};return{getMouseX:function(a){a=this.getEvent(a);if(a.pageX)return a.pageX;return e.Window.getScrollX()+a.clientX},getMouseY:function(a){a=this.getEvent(a);if(a.pageY)return a.pageY;return e.Window.getScrollY()+a.clientY},getSrcElement:function(a){a=this.getEvent(a);if(a.srcElement)return a.srcElement;return a.currentTarget},getEvent:function(a){return a||window.event},getEventTarget:function(a,b){a=this.getEvent(a);if(!a)return null;var c=window.event?
a.srcElement:a.target;if(!b||Sizzle.filter(b,[c]).length)return c;return e.Dom.getParent(c,b)},getEventToElement:function(a){a=this.getEvent(a);return a.relatedTarget?a.relatedTarget:a.toElement},stopPropogation:function(a){a=this.getEvent(a);e.assert(a,"No event object was passed to stopPropogation().");a.cancelBubble=true;a.stopPropagation&&a.stopPropagation()},preventDefault:function(a){a=this.getEvent(a);e.assert(a,"No event object was passed to preventDefault().");if(a.preventDefault)a.preventDefault();
else a.returnValue=false},stop:function(a){a=this.getEvent(a);e.assert(a,"No event object was passed to stop().");this.preventDefault(a);this.stopPropogation(a)},isKeyAction:function(a,b){a=this.getEvent(a);return(a.which||a.keyCode)===b},isCustomEvent:function(a){return a.indexOf(":")!==-1},fireEvent:function(a,b,c){if(this.isCustomEvent(b)){c=c||{};var d=e.Data.get(a,b);b={eventName:b};for(var f in d)if(d.hasOwnProperty(f)&&e.isFunction(d[f]))d[f].apply(c.context||a,[b].concat(c.data||[]));return true}if(document.createEvent&&
a.dispatchEvent){c=document.createEvent("HTMLEvents");c.initEvent(b,true,true);return a.dispatchEvent(c)}else return document.createEventObject&&a.fireEvent?a.fireEvent("on"+b,document.createEventObject()):null},add:function(){var a;a=window.addEventListener?function(b,c,d,f){e.assert(c&&b,"Bad parameters passed to Sfdc.on");var g=f?function(){d.apply(f,arguments)}:d;h[e.getUID(d)]=[b,c,g,d];b.addEventListener(c,g,false)}:window.attachEvent?function(b,c,d,f){e.assert(c&&b,"Bad parameters passed to Sfdc.on");
var g=function(){d.call(f||b,window.event)};h[e.getUID(d)]=[b,c,g,d];b.attachEvent("on"+c,g,false)}:function(b,c,d,f){e.assert(c&&b,"Bad parameters passed to Sfdc.on");var g=f?function(){d.apply(f,aruguments)}:d,i=b["on"+c];b["on"+c]=function(j){i&&i();g(j||window.event)};h[e.getUID(d)]=[b,c,g,d]};return function(b,c,d,f){if(e.Event.isCustomEvent(c)){var g=d;if(f)g=function(){d.apply(f,arguments)};var i=e.Data.get(b,c)||{};i[e.getUID(d)]=g;e.Data.set(b,c,i)}else a(b,c,d,f)}}(),mouseExited:function(a,
b){for(var c=e.Event.getEventToElement(a);c&&c!=document.body;){if(c==b)return false;c=c.parentNode}return true},remove:function(){var a=function(){};if(window.removeEventListener)a=function(b,c,d,f){e.assert(c&&b,"Bad parameters passed to Sfdc.un");var g=h[e.getUID(d)];if(g){b.removeEventListener(c,g[2],f);delete h[e.getUID(d)]}else b.removeEventListener(c,d,f)};else if(window.detachEvent)a=function(b,c,d){e.assert(c&&b,"Bad parameters passed to Sfdc.un");var f=h[e.getUID(d)];if(f){b.detachEvent("on"+
c,f[2]);delete h[e.getUID(d)]}else b.detachEvent("on"+c,d)};return function(b,c,d,f){if(e.Event.isCustomEvent(c))(b=e.Data.get(b,c))&&b[e.getUID(d)]&&delete b[e.getUID(d)];else a(b,c,d,f)}}(),cleanEvents:function(){var a,b;for(b in h)if(h.hasOwnProperty(b)){a=h[b];if(a.length>=3)e.un(a[0],a[1],a[3]||a[2])}e.un(window,"unload",e.Event.cleanEvents);h={}},keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESC:27,SPACE:32,PAGEDOWN:33,PAGEUP:34,ARROW_L:37,ARROW_U:38,ARROW_R:39,ARROW_D:40,SHIFT:16,CTRL:17,ALT:18,CAPSLOCK:20,
KEY_0:48,KEY_1:49,KEY_2:50,KEY_3:51,KEY_4:52,KEY_5:53,KEY_6:54,KEY_7:55,KEY_8:56,KEY_9:57,KEY_A:65,KEY_B:66,KEY_C:67,KEY_D:68,KEY_E:69,KEY_F:70,KEY_G:71,KEY_H:72,KEY_I:73,KEY_J:74,KEY_K:75,KEY_L:76,KEY_M:77,KEY_N:78,KEY_O:79,KEY_P:80,KEY_Q:81,KEY_R:82,KEY_S:83,KEY_T:84,KEY_U:85,KEY_V:86,KEY_W:87,KEY_X:88,KEY_Y:89,KEY_Z:90,WINDOWS_L:91,WINDOWS_R:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,
NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,PAUSE:19,END:35,HOME:36,INSERT:45,DELETE:46,NUMLOCK:144,SCROLLLOCK:145,SEMICOLON:e.userAgent.isFirefox?59:186,EQUALS:61,COMMA:188,DASH:109,PERIOD:190,FORWARDSLASH:191,GRAVE:192,OPENBRACKET:219,BACKSLASH:220,CLOSEBRACKET:221,APOSTROPHE:222,PROCESS:229}}}(Sfdc));
Sfdc.provide("Sfdc.Forms",{submitFormActionURL:function(a,b){a.action=b;a.submit()},setElementsEnabledBasedOnCheckbox:function(a,b){function c(d,h){var g=document.getElementById(h);if(g)g.style.display=d.checked?"":"none"}var f=document.getElementById(a);if(f!==null&&b!==null)for(var e=0;e<b.length;e++)c(f,b[e])},borrowForm:function(a,b,c){a=document.getElementById(a);var f=a.action,e=a.target;if(b!==null)a.action=b;if(c!==null)a.target=c;if(a.onsubmit)a.onsubmit();a.submit();a.action=f;a.target=
e},formatPhone:function(a){a.value=trim(a.value);var b=a.value,c="",f=-1;if(0<b.length&&"+"!=b.charAt(0)){var e=0;if("1"==b.charAt(0))b=b.substring(1,b.length);for(i=0;i<b.length;i++){var d=b.charAt(i);if(d>="0"&&d<="9"){if(e===0)c+="(";else if(e==3)c+=") ";else if(e==6)c+="-";c+=d;e++}if(!(d>="0"&&d<="9")&&d!=" "&&d!="-"&&d!="."&&d!="("&&d!=")"){f=i;break}}if(f>=0)c+=" "+b.substring(f,b.length);if(e==10&&c.length<=40)a.value=c}return true}});
Sfdc.provide("Sfdc.Function",function(d){return{wrap:function(b,c,a,e){d.assert(b,"Specify an object to operate on.");d.assert(d.isFunction(a),"Must wrap with another function.");var g=b[c];b[c]=g&&d.isFunction(g)?function(h,f){return e?function(){var i=h.apply(f,arguments);a.apply(f,arguments);return i}:function(){a.apply(f,arguments);return h.apply(f,arguments)}}(g,b):a},delay:function(b,c,a,e){e=e||[];a=a||window;return{timeoutId:setTimeout(function(){b.apply(a,e)},c),cancel:function(){clearTimeout(this.timeoutId)}}},
delayCallback:function(b,c,a){return function(){d.Function.delay(b,c,a,arguments)}},bind:function(b,c,a){d.assert(d.isFunction(b)&&c,"A function must be provided for it to be bound to a context.");a=a||[];if(Function.prototype.bind)return b.bind.apply(b,[c].concat(a));var e=function(){return b.apply(c||window,a.concat(d.Array.toArray(arguments)))};e.prototype=b.prototype;return e}}}(Sfdc));
Sfdc.provide("Sfdc.History",function(){function o(a,k){var h,j;if(Sfdc.isArray(a)){h=0;for(j=a.length;h<j;)k(a[h++])}else for(h in a)a.hasOwnProperty(h)&&k(h,a[h])}function w(a){function k(c,b,e){o(c,function(d){d.cb.call(d.scope,b,e,d.data)})}function h(c){var b={};if(!c)return b;o(c.split("&"),function(e){e=e.split("=");b[e[0]]=e[1]});return b}var j=[],f=null,m=null;this.updateState=function(c){var b="";if(m===null)m=h(p.getState());if(Sfdc.isString(c))m=h(c);else o(c,function(e,d){m[e]=d});o(m,
function(e,d){b+=e+"="+d+"&"});b=b.slice(0,b.length-1);p.setState(b)};this.handleState=function(c,b){j.length!==0&&k(j,c,b);c=h(c);b=h(b);f!==null&&o(c,function(e,d){var n=b[e];d!==n&&f[e]!==t&&k(f[e],d,n)});m=c};this.addListener=function(c){if(typeof c[0]==="string"){var b=c[0],e=c[1],d=c[2];c=c[3];if(f===null)f={};f[b]||(f[b]=[]);f[b].push({cb:e,data:d||null,scope:c||null})}else if(typeof c[0]==="function")j.push({cb:c[0],data:c[1]||null,scope:c[2]||null})};o(a,this.addListener)}var t,q,g=window,
u=[],p;p=function(){var a=null,k=null,h=false,j=null,f,m=true,c=function(){var b=document.createElement("iframe"),e=document.createElement("p"),d=function(){var i=b.contentWindow.document.getElementById("hidden-state-field");return i===null?null:i.innerText},n=function(i){var l=b.contentWindow.document;e.innerText=i;l.open();l.write('<html><body><span id="hidden-state-field">'+e.innerHTML+"</span></body></html>");l.close()};a=function(){return d().slice(3)};k=function(i){n("#!/"+i)};b.style.display=
"none";document.body.appendChild(b);(function(){var i,l,r,s,v=b.contentWindow;if(!v||!v.document)setTimeout(d,13);else{l=d();i=g.location.hash;h&&i.length===0?n("#!/"+g.location.search.slice(1)):n(i);setInterval(function(){r=d();s=g.location.hash;if(l!==r){g.location.hash=r;var x=r.slice(3),y=l!==null?l.slice(3):l;j(x,y);f=a();l=i=r}else if(s!==i){i=s;n(s)}},100)}})()};return{setState:function(b){k(b)},getState:function(){return a()},isBrowserSupported:function(){return m},init:function(b,e){j=b;
if(e.useQuery!==t)h=e.useQuery;if(Sfdc.userAgent.isIE7)c(e);else{if(Boolean(g.history&&g.history.pushState&&e.usePushState)){a=function(){return g.location.search.slice(1)};k=function(d){g.history.pushState({},"Sfdc.History","?"+d);g.onpopstate()};g.onpopstate=function(){var d=a();j(d,f);f=a()}}else{a=function(){var d=g.location.href.split("#")[1];return d?d.slice(2):""};k=function(d){g.location.hash="!/"+d};if(g.onhashchange!==t||window.hasOwnProperty("onhashchange")){if(a()===""&&h)g.location.hash=
"!/"+g.location.search.slice(1);g.onhashchange=function(){var d=a();j(d,f);f=a()}}else m=false}f=a();j(f,null);f=a()}}}}();return{onChange:function(){var a=arguments;q?q.addListener(a):u.push(a)},update:function(a){q.updateState(a)},isBrowserSupported:function(){return p.isBrowserSupported()},init:function(a){a=a||{};if(a.window)g=a.window;if(u.length!==0){q=new w(u);p.init(q.handleState,a);this.init=function(){}}}}}());
Sfdc.provide("Sfdc.JSON",{parseSafe:function(a,d){return Sfdc.JSON._parse(a,d,false)},parse:function(a,d){return Sfdc.JSON._parse(a,d,true)},stringify:function(a,d,e){if(typeof JSON!=="undefined"&&JSON.stringify){if(Array.prototype.toJSON){var b=Array.prototype,c=b.toJSON;delete b.toJSON;var f=JSON.stringify(a,d,e);b.toJSON=c;return f}return JSON.stringify(a,d,e)}if(a===undefined)return"";if(a===null)return"null";switch(a.constructor){case String:return'"'+a.replace(/\"/g,'\\"').replace(/\r|\n|\f/g,
"\\n")+'"';case Array:b=[];for(c=0;c<a.length;c++)b.push(arguments.callee(a[c]));return"["+b.join(",")+"]";case Object:b=[];for(c in a)a.hasOwnProperty(c)&&b.push(arguments.callee(c)+":"+arguments.callee(a[c]));return"{"+b.join(",")+"}";default:return a.toString()}},_resolveRefs:function(a,d,e){if(Sfdc.isArray(a)){for(var b=e||[],c=0;c<a.length;c++)b.push(this._resolveRefs(a[c],d));return b}else if(Sfdc.isObject(a)){b=a.serId;if(b!==undefined){a=a.value;c=Sfdc.isArray(a)?[]:{};d[b]=c;return this._resolveRefs(a,
d,c)}b=a.serRefId;if(b!==undefined)return d[b];b=e||{};for(c in a)b[c]=this._resolveRefs(a[c],d);return b}else return a},_parse:function(a,d,e){if(typeof JSON!=="undefined"&&JSON.parse)return JSON.parse(a);if(e)a=eval("("+a+")");else return false;if(d)return Sfdc.JSON._resolveRefs(a,{});return a}});
Sfdc.provide("Sfdc.LocalStorage",function(i,m){function d(){if(i.localStorage){g=n;c=new j(i.localStorage)}else if(document.body.addBehavior){g=o;c=new k(p,q,m)}else{g=r;c=new l}d=function(){}}function j(a){this.ls=a}function l(){}function k(a,b,h){var e=h.createElement("span");e.id=a;e.addBehavior("#default#userData");h.body.appendChild(e);e.load(a);this.el=e;this.userDataPath=a;this.userDataName=b;try{this.data=Sfdc.JSON.parse(e.getAttribute(b));if(!this.data)this.data={}}catch(s){this.data={}}}
var r=0,n=1,o=3,c={},g=0,p="sfdc_user_data",q="user_data",f={clear:function(){d();try{c.clear()}catch(a){return f.onError(a)}},getItem:function(a){d();try{return c.getItem(a)}catch(b){return f.onError(b)}},length:function(){d();return c.length()},removeItem:function(a){d();try{c.removeItem(a)}catch(b){return f.onError(b)}},setItem:function(a,b){d();try{c.setItem(a,b)}catch(h){return f.onError(h)}},getMode:function(){d();return g},onError:function(a){throw{name:"StorageError",message:a.message};}};
j.prototype={clear:function(){this.ls.clear()},getItem:function(a){return this.ls.getItem(a)},length:function(){return this.ls.length},removeItem:function(a){return this.ls.removeItem(a)},setItem:function(a,b){return this.ls.setItem(a,b)}};l.prototype={clear:function(){},getItem:function(){return null},length:function(){return 0},removeItem:function(){},setItem:function(){}};k.prototype={clear:function(){this.data={};this.saveData()},getItem:function(a){return this.data.hasOwnProperty(a)?this.data[a]:
null},removeItem:function(a){delete this.data[a];this.saveData()},setItem:function(a,b){this.data[a]=b;this.saveData()},length:function(){var a=0,b;for(b in this.data)if(this.data.hasOwnProperty(b))a+=1;return a},saveData:function(){this.el.setAttribute(this.userDataName,Sfdc.JSON.stringify(this.data));this.el.save(this.userDataPath)}};return f}(window,document));
Sfdc.provide("Sfdc.Logging",function(f){function i(b){if(!h){var c=f.Logging.LogLevel.GACK;try{var d=f.Logging.formatError(b);f.log(d.subject,c,d);f.logServer("WINDOWERROR",d,c)}catch(e){}}}var h=false;return{startWindowErrorListener:function(){if(window.onerror&&window.onerror.cache)for(var b=window.onerror.cache,c=0,d=b.length;c<d;c++)i(b[c]);f.Function.wrap(window,"onerror",function(e,a,g){i({msg:e,url:a,lines:g})});f.Logging.startWindowErrorListener=function(){h=false}},stopWindowErrorListener:function(){h=
true},formatError:function(b){var c={};if(f.isString(b.msg)){c.subject=b.msg;if(f.isDefAndNotNull(b.url)){var d=b.url.split("/").pop();c.trace=this._createTraceLine("","",d,b.lines)}}else{d=f.userAgent;try{var e=b.message,a;if(d.isFirefox)a=this._parseFFError(b.stack.split("\n"));else if(d.isChrome)a=this._parseChromeError(b.stack.split("\n"));else if(d.isSafari)a=this._parseSafariError(b);c.subject=e;if(a)c.trace=a.join("\\n")}catch(g){if(b.message)c.subject=b.message}}return c},_parseFFError:function(b){for(var c=
[],d=b.length,e=0;e<d;e++){var a=b[e];if(a){var g=a.substring(0,a.indexOf("@"));a=a.split("/");a=a[a.length-1];a=a.split(":");c.push(this._createTraceLine("",g,a[0],a[1]))}}return c},_parseChromeError:function(b){for(var c=[],d=b.length,e=0;e<d;e++){var a=f.String.trim(b[e]);if(a&&a.indexOf("at")===0){a=a.split(" ");if(a.length===3)objAndFunc=a[1].split(".");a=a[a.length===3?2:1].split("/");a=a[a.length-1].split(":");c.push(this._createTraceLine(objAndFunc[0],objAndFunc[1],a[0],a[1]))}}return c},
_parseSafariError:function(b){var c=b.sourceURL.split("/");return this._createTraceLine("","",c[c.length-1],b.line)},_createTraceLine:function(b,c,d,e){return[b,c,d,e].join(":")}}}(Sfdc));Sfdc.provide("Sfdc.Logging.LogLevel",{INFO:"INFO",WARNING:"WARNING",ERROR:"ERROR",GACK:"GACK"});
Sfdc.provide("Sfdc.Resource",function(){var c;return{addCSS:function(d){c||(c=document.head||document.getElementsByTagName("head")[0]);var a=document.createElement("link");a.setAttribute("type","text/css");a.setAttribute("href",d);a.setAttribute("rel","stylesheet");c.appendChild(a)},addJavaScript:function(d,a){var b=document.createElement("script");if(a)if(window.ActiveXObject)b.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded"){b.onreadystatechange=function(){};
a.call(b)}};else b.onload=a;b.type="text/javascript";b.src=d;document.body.appendChild(b)}}}(Sfdc));
Sfdc.provide("Sfdc.String",{ltrim:function(a){return a.replace(/^\s*/,"")},rtrim:function(a){return a.replace(/\s*$/,"")},trim:function(a){return a.replace(/^\s*(\S*(?:\s+\S+)*)\s*$/,"$1")},dashify:function(a){return a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},escapeUTF:function(a){var c="";for(i=0;i<a.length;i++){var b=a.charCodeAt(i);if(b<=127)c+=escape(a.charAt(i));else if(b<=2047)c+="%"+(b>>6|192).toString(16)+"%"+(b&63|128).toString(16);else if(b>=2048)c+="%"+(b>>12|224).toString(16)+
"%"+(b>>6&63|128).toString(16)+"%"+(b&63|128).toString(16)}return c},getIntValue:function(a,c){if(c===0)throw Error("Radix not equal to 0 must be supplied");var b=parseInt(a,c||10);return isNaN(b)?0:b},format:function(a,c){return a.replace(/{([^{}]*)}/g,function(b,e){var d=c[e];return typeof d==="string"||typeof d==="number"?d:b})}});
Sfdc.provide("Sfdc.Url",{getHash:function(a){return(a||window).location.hash.substring(1)},setHash:function(a,b){if(typeof a=="undefined"||a==="")return false;else{(b||window).location.hash=a;return true}},navigateTo:function(a,b){b=b||window;if(/^#/.test(a))this.setHash(a,b);else b.location.href=a},getUrlParameters:function(a,b){if(a==="")return{};if(a.indexOf("?")>-1)a=a.split("?")[1];var c={};b=Sfdc.apply(b||{},{unescape:decodeURIComponent,allowMultipleOfParam:false});for(var g=a.split("&"),e=
0,h=g.length,f=null,d;e<h;e++){f=g[e].split("=");d=f[0];f=b.unescape(f[1]);if(b.allowMultipleOfParam&&Sfdc.isDefAndNotNull(c[d]))if(Sfdc.isArray(c[d]))c[d].push(f);else c[d]=[c[d],f];else c[d]=f}return c},generateQueryString:function(a,b,c){var g=[],e={},h=null;c=Sfdc.apply(c||{},{includeMark:true,escape:encodeURIComponent,fullUrl:false,allowMultipleOfParam:false},false);var f=a.split("?");e=f.length>1?f[1]:"";if(!b)return c.fullUrl?a:e;e=this.getUrlParameters(e,c);if(c.allowMultipleOfParam)for(var d in b)if(e.hasOwnProperty(d))if(Sfdc.isArray(e[d]))e[d].push(b[d]);
else e[d]=[e[d],b[d]];else e[d]=b[d];else e=Sfdc.apply(e,b,true);for(d in e)if(e.hasOwnProperty(d)){h=e[d];if(Sfdc.isDefAndNotNull(h))if(c.allowMultipleOfParam&&Sfdc.isArray(h)){a=0;for(b=h.length;a<b;a++)g.push(d+"="+c.escape(h[a]))}else g.push(d+"="+c.escape(h))}if(c.fullUrl)return f[0]+"?"+g.join("&");return c.includeMark?"?"+g.join("&"):g.join("&")},generateUrl:function(a,b,c){c=Sfdc.apply(c||{},{fullUrl:true},true);return this.generateQueryString(a,b,c)},stripDomainFromUrl:function(a){var b=
a.indexOf("://");if(-1!=b){a=a.substring(b+3);a=a.substring(a.indexOf("/"))}return a},getDomainFromUrl:function(a){if(!Sfdc.isString(a))return"";var b=a.indexOf("://");if(-1!==b){b+=3;var c=a.indexOf("/",b);return a.substring(b,c===-1?a.length:c)}return""}});
Sfdc.provide("Sfdc.Window",{getScrollX:function(){if(window.pageXOffset)return window.pageXOffset;if(document.documentElement&&document.documentElement.scrollLeft)return document.documentElement.scrollLeft;if(document.body.scrollHeight)return document.body.scrollLeft},getScrollY:function(){if(window.pageYOffset)return window.pageYOffset;if(document.documentElement&&document.documentElement.scrollTop)return document.documentElement.scrollTop;if(document.body.scrollWidth)return document.body.scrollTop},
getWindowHeight:function(){if(typeof window.innerHeight=="number")return window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)return document.body.clientHeight},getWindowWidth:function(){if(typeof window.innerWidth=="number")return window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)return document.documentElement.clientWidth;else if(document.body&&
document.body.clientWidth)return document.body.clientWidth}});
Sfdc.onReady(function(){Sfdc.on(window,"unload",Sfdc.Event.cleanEvents);Sfdc.isDebug&&Sfdc.ClientLogging.addRelay(new Sfdc.ClientLogging.ConsoleLogger,true)});
Sfdc.ns("SfdcApp.MruHovers");
SfdcApp.MruHovers={SECTION_SELECTOR:"*[data-hovdata]",SECTION_ATTRIBUTE:"data-hovdata",getSectionData:function(d){var b=d.getAttribute(this.SECTION_ATTRIBUTE);if(!b)return{};b=b.split(",");for(var a,e,f,c={},g=0;g<b.length;g++)if(b[g]){a=b[g];f=a.indexOf("=");e=a.substring(0,f);a=a.substring(f+1);Sfdc.assert(e&&a,"both key and value has to be defined");c[e]=a}Sfdc.assert(Sfdc.isString(c.dir),"section requires a direction sectionId="+d.id);return c},registerHovers:function(){var d=[],b,a;d=Sfdc.select(this.SECTION_SELECTOR);
if((a=d.length)&&!Sfdc.Data.get(d[0],"registered"))for(;a--;){b=d[a];Sfdc.Data.set(b,"registered",true);SfdcApp.MruHovers.registerSection(null,b,true)}},registerSection:function(d,b){function a(j,k){return function(){MRUHoverDetail.getHover(j)[k]()}}var e,f,c,g,h,i;if(Sfdc.Dom.hasClass(b,"mruList")){i=this.getSectionData(b);MRUHoverDetail.loaderURL="/ui/common/MRUHoverLoader?";g=/hov-id(\S+)/;e=Sfdc.select(".hov-enable",b);for(f=e.length;f--;){c=e[f];h=g.exec(c.className)[1];Sfdc.on(c,"mouseover",
a(h,"show"));Sfdc.on(c,"mouseout",a(h,"hide"));Sfdc.on(c,"focus",a(h,"show"));Sfdc.on(c,"blur",a(h,"hide"));c.firstChild.id="mru"+h;MRUHoverDetail.loaderURL+="hoverIds="+h+"&"}if(i.retURL)url+="&"+i.retURL;MRUHoverDetail.loaderURL+="noChatter=true"}}};Sfdc.on(window,"load",function(){SfdcApp.MruHovers.registerHovers()});
NonUddListViewport.prototype=new ListViewport;NonUddListViewport.constructor=ListViewport;NonUddListViewport.superclass=ListViewport.prototype;function NonUddListViewport(a,b,c){ListViewport.apply(this,[a,undefined,b,undefined,false]);this.allowColumnMove=false;this.url=c}NonUddListViewport.prototype.updateFilterLinks=function(){};
LookupAutoCompleteInputElement=function(a,c,b,d,g,h,j){var e=getElementByIdCS(a+MultiLookupInputElement.MULTI_LOOKUP_SELECT_SUFFIX);if(e&&LookupAutoCompleteInputElement.isMultiLookup(a)){var k=LookupAutoCompleteInputElement.supportedLookups[a];this.inputElement=getElementByIdCS(a);this.lookupTypes={};this.activeLookup=null;e=e.options[e.selectedIndex].value;for(var i in k){var f=LookupAutoCompleteInputElement.cloneRequestParams(d),l=0,m;for(m in{acEntity:true,aclkent:true,aclkfield:true}){var n=k[i][l];
if(n)f[m]=n;l++}f=new AutoCompleteInputElement(a,c,b,f,g,a+i,h,j);if(this.activeLookup===null&&e&&e==i)this.activeLookup=f;else f.disableAC();this.lookupTypes[i]=f}this.inputElement.autocomplete=this.activeLookup?"off":"on"}else this.activeLookup=new AutoCompleteInputElement(a,c,b,d,g,null,h,j);LookupAutoCompleteInputElement.instances[a]=this};
LookupAutoCompleteInputElement.prototype.addOnAfterTabDownListener=function(a){if(this.lookupTypes)for(type in this.lookupTypes)LookupAutoCompleteInputElement.addOnAfterTabDown(LookupTypes[type],a);else LookupAutoCompleteInputElement.addOnAfterTabDown(this.activeLookup,a)};LookupAutoCompleteInputElement.addOnAfterTabDown=function(a,c){var b=a.onAfterTabDown;a.onAfterTabDown=typeof a.onAfterTabDown!=="function"?c:function(){b();c()}};
LookupAutoCompleteInputElement.prototype.clearSuggestions=function(){this.activeLookup.isACBoxVisible()&&this.activeLookup.clearSuggestions()};LookupAutoCompleteInputElement.prototype.clearCache=function(){this.activeLookup.clearCache&&this.activeLookup.clearCache()};
LookupAutoCompleteInputElement.prototype.setLookupType=function(a){a=this.lookupTypes[a];if(this.activeLookup!==a){if(this.activeLookup){if(!a)this.inputElement.autocomplete="on";this.activeLookup.disableAC()}if(a){if(!this.activeLookup)this.inputElement.autocomplete="off";a.enableAC()}this.activeLookup=a}};LookupAutoCompleteInputElement.supportedLookups={};LookupAutoCompleteInputElement.instances={};
LookupAutoCompleteInputElement.registerSupportedEntities=function(a,c){var b={},d;for(d in c)b[d]=c[d];LookupAutoCompleteInputElement.supportedLookups[a]=b};LookupAutoCompleteInputElement.isMultiLookup=function(a){return LookupAutoCompleteInputElement.supportedLookups[a]!=null};LookupAutoCompleteInputElement.cloneRequestParams=function(a){var c={},b;for(b in a)c[b]=a[b];return c};
LookupAutoCompleteInputElement.handleLookupTypeChange=function(a,c){var b=getElementByIdCS(a+EditElement.pTYPE_SUFFIX),d=getElementByIdCS(a+MultiLookupInputElement.MULTI_LOOKUP_SELECT_SUFFIX),g=getElementByIdCS(a+EditElement.pID_SUFFIX),h=getElementByIdCS(a+EditElement.pMOD_SUFFIX);d=d.options[d.selectedIndex].value;b.value=d;if(c)g.options.length=0;else g.value="";h.value="1";if(LookupAutoCompleteInputElement.isMultiLookup(a))(b=LookupAutoCompleteInputElement.instances[a])&&b.setLookupType(d)};
function TagAutoComplete(a,b,c){var d=new QueryString("");d.add(TagConstants.pTAG_SCOPE_MODE,b);b=UserContext.getUrl(TagConstants.LOOKUP_TAGS_PAGE)+d.toString();AutoCompleteInputElement.apply(this,[a.id,b,1,{},true]);this.recordHeight=18;this.keyPressCallback=c;this.disableOnEsc=true;this.displayHeader=false}TagAutoComplete.prototype=new AutoCompleteInputElement;
TagAutoComplete.prototype.parseResponse=function(a){var b=a.split(", ");b.sort(function(d,g){var e=d.toLowerCase(),f=g.toLowerCase();if(e==f)return 0;return e>f?1:-1});a=[];for(var c=0;c<b.length;c++)a.push(new Suggestion(b[c]));b=[];b[AbstractAutoCompleteServlet.SUGGESTIONS]=a;return b};TagAutoComplete.prototype.findInput=function(a){if(!a)return a;a=a.split(",");return ltrim(a[a.length-1])};
TagAutoComplete.prototype.innerComplete=function(a){var b=this.element.value.split(",");if(b.length<=1)b=[a.name];else b[b.length-1]=" "+a.name;this.element.value=b.join(",")+", "};AutoCompleteInputElement.prototype.additionalDisplayConditionsValid=function(){return true};
TagAutoComplete.prototype.checkCursorAtEnd=function(){if(!this.element)return false;var a;if(XBrowser.userAgent.isIE){var b=document.selection.createRange().duplicate();if(b.text&&b.text.length>0)return false;var c=b.duplicate();c.moveToElementText(this.element);try{b.setEndPoint("EndToEnd",c);a=b.text}catch(d){return true}}else{if(this.element.selectionStart!=this.element.selectionEnd)return false;a=this.element.value.substring(this.element.selectionStart)}return TagAutoComplete.EMPTY.exec(a)};
function Suggestion(a){this.name=a}TagAutoComplete.BOX_ID="_autoCompleteBoxId";TagAutoComplete.ROW_ID="_autoCompleteRowId";TagAutoComplete.BOX_CSS_CLASS="autoCompleteBox";TagAutoComplete.MAX_SUGGESTIONS=15;TagAutoComplete.FRAME_ID="_autoCompleteFrameId";TagAutoComplete.EMPTY=/^\s*$/;TagAutoComplete.normalize=function(a){return a.replace(/\s|-|_/g,"").toLowerCase()};TagAutoComplete.prototype.compareSuggestions=function(a,b){return a&&b&&a.name&&b.name&&a.name==b.name};
TagAutoComplete.prototype.handleEnter=function(a){if(this.complete())AutoCompleteInputElement.captureKeystroke(a);else if(this.keyPressCallback){this.clearSuggestions();this.keyPressCallback(a)}};
SidebarSearchAutoCompleteElement=function(a,b,c,d,e,f,g){AutoCompleteInputElement.apply(this,[a,b,c,d,e]);this.autoSelectFirstSuggestion=false;if(this.picklistId=f)this.picklist=document.getElementById(f);this.searchForm=document.getElementById(g)};SidebarSearchAutoCompleteElement.prototype=new AutoCompleteInputElement;
SidebarSearchAutoCompleteElement.prototype.getRegexForInput=function(a){var b=AutoCompleteInputElement.normalize(a);AutoCompleteInputElement.regexCache[b]||(AutoCompleteInputElement.regexCache[b]=RegExp(["(\\b|^|\\W)(",AutoCompleteInputElement.escapeRegex(a),")"].join(""),"gi"));return AutoCompleteInputElement.regexCache[b]};
SidebarSearchAutoCompleteElement.prototype.isValidSuggestion=function(a,b){var c=this.getRegexForInput(a);c=b.name.match(c);if(!this.picklist)return c;var d=this.getPicklistKeyprefix();if(d==SearchRelatedList.pENTITY_ALL)return c;return c&&b.mruIds&&SidebarSearchAutoCompleteElement.startsWith(b.mruIds[0],d)};SidebarSearchAutoCompleteElement.prototype.getPicklistKeyprefix=function(){if(!this.picklist)return null;return this.picklist.options[this.picklist.selectedIndex].value};
SidebarSearchAutoCompleteElement.prototype.innerComplete=function(a){if(!(!this.element||!a||!a.name||!a.mruIds||a.mruIds.length==0)){var b=this.element.value;this.element.value=a.name;if(a.mruIds.length>1){if(this.picklist)this.picklist.value=a.mruIds[0].substring(0,3);this.searchForm&&this.searchForm.submit()}else this.navigateToRecord(a,b)}};
SidebarSearchAutoCompleteElement.prototype.navigateToRecord=function(a,b){if(a.detailURL){var c=QueryString.getURI(a.detailURL),d=QueryString.createQueryString(a.detailURL),e=this.getPicklistKeyprefix();e&&d.add(this.picklistId,e);d=this.addSearchMacLogParams(d,a,b,this.selected,"sidebar");navigateToUrl(d.concatenateWithUrl(c))}};
SidebarSearchAutoCompleteElement.prototype.addSearchMacLogParams=function(a,b,c,d,e){if(b.mruIds.length==1){a.add(UnifiedSearchUI.MAC_REDIRECT_FLAG_PARAM_NAME,1);a.add(UnifiedSearchUI.MAC_RECORD_ID_PARAM_NAME,b.mruIds[0]);a.add(UnifiedSearchUI.MAC_RECORD_NAME_PARAM_NAME,b.name);a.add(UnifiedSearchUI.MAC_SEARCH_STRING_PARAM_NAME,c);a.add(UnifiedSearchUI.MAC_POSITION_PARAM_NAME,d);a.add(UnifiedSearchUI.MAC_SEARCH_AREA_PARAM_NAME,e)}return a};
SidebarSearchAutoCompleteElement.prototype.getSuggestionHtml=function(a){var b=[],c=escapeHTML(this.lastInput),d=escapeHTML(a.name);c=this.getRegexForInput(c);d=d.replace(c,'$1<strong class="autocompleteMatch">$2</strong>');b.push(a.mruIcon);b.push("&nbsp;");b.push(d);return b.join("")};SidebarSearchAutoCompleteElement.startsWith=function(a,b){if(!b||!a)return false;return b.length<=a.length&&a.indexOf(b)===0};
AutoCompleteInputElement.prototype.compareSuggestions=function(a,b){return a&&b&&a.detailURL&&b.detailURL&&a.detailURL==b.detailURL};
Sfdc.provide("Sfdc.CometD",function(c){function f(){var a=new org.cometd.LongPollingTransport;a=org.cometd.Transport.derive(a);a.xhrSend=function(b){b.headers&&b.headers.contentType&&delete b.headers.contentType;return c.Ajax.request(b.url,{async:b.sync!==true,method:"POST",contentType:"application/json;charset=UTF-8",data:b.body,headers:b.headers,success:b.onSuccess,failure:function(d,e){b.onError(e.status,d)}})};return a}function g(){var a=new org.cometd.CallbackPollingTransport;a=org.cometd.Transport.derive(a);
a.jsonpSend=function(b){c.Ajax.jsonp(b.url,{jsonp:"jsonp",data:{message:b.body},success:b.onSuccess,failure:function(d,e){b.onError(e.status,d)},escape:encodeURIComponent})};return a}org.cometd.JSON.toJSON=c.JSON.stringify;org.cometd.JSON.fromJSON=c.JSON.parse;return function(a){a=new org.cometd.Cometd(a);window.WebSocket&&a.registerTransport("websocket",new org.cometd.WebSocketTransport);a.registerTransport("long-polling",new f);a.registerTransport("callback-polling",new g);return a}}(Sfdc));
Sfdc.provide("Sfdc.cometd",{init:function(){Sfdc.cometd=new Sfdc.CometD;return Sfdc.cometd.init.apply(Sfdc.cometd,arguments)}});
Sfdc.provide("Sfdc.ClientLogging",function(a){var g=a.log(),c=[];a.log=function(){a.ClientLogging.log.apply(a.ClientLogging,arguments)};a.warn=function(d,b){return a.log(d,a.Logging.LogLevel.WARNING,b)};a.error=function(d,b){return a.log(d,a.Logging.LogLevel.ERROR,b)};a.Function.wrap(a,"gack",function(d,b,e){return a.log(b,a.Logging.LogLevel.GACK,e)});return{log:function(d,b,e){for(var f=0,i=c.length,h;f<i;f++)if((h=c[f])!==null)h.log(d,b,e);g.push({msg:d,level:b,args:e})},addRelay:function(d,b){for(var e=
0,f=c.length;e<f;e++)if(c[e]instanceof d.constructor)return false;c.push(d);b&&this.flush(d);return true},removeRelay:function(d){for(var b=0,e=c.length;b<e;b++)if(c[b]instanceof d)c[b]=null},flush:function(d){for(var b=0,e=g.length,f;b<e;b++){f=g[b];d.log(f.msg,f.level,f.args)}}}}(Sfdc));
Sfdc.provide("Sfdc.ClientLogging.ConsoleLogger",{$constructor:function(){},log:function(a,g){if(!window.console||!Sfdc.isDefAndNotNull(a))return false;switch(g){case Sfdc.Logging.LogLevel.INFO:window.console.log(a);break;case Sfdc.Logging.LogLevel.WARNING:window.console.warn(a);break;case Sfdc.Logging.LogLevel.ERROR:window.console.error(a);break;case Sfdc.Logging.LogLevel.GACK:window.console.error(a);break;default:window.console.log(a)}}});
Sfdc.provide("Sfdc.ClientLogging.SeleniumLogger",{$constructor:function(){},log:function(a,g){var c=top;if(!c.LOG||!Sfdc.isDefAndNotNull(a))return false;switch(g){case Sfdc.Logging.LogLevel.INFO:c.LOG.log("info",a);break;case Sfdc.Logging.LogLevel.WARNING:c.LOG.log("warning",a);break;case Sfdc.Logging.LogLevel.ERROR:c.LOG.log("error",a);break;case Sfdc.Logging.LogLevel.GACK:c.LOG.log("error",a);break;default:c.LOG.log("info",a)}}});
Sfdc.provide("Sfdc.ServerLogging",function(b){var f=null;queue=[];relays={};var c={URL:"/_ui/common/request/servlet/JsLoggingServlet",LOG_NAME:"logName",LOG_LEVEL:"logLevel",LOG_ATTRS:"logAttrs",LOG_LINES:"logLines",MAX_BUFFER_SIZE:100,FLUSH_SIZE:100,FLUSH_INTERVAL:1500,AUTO_FLUSH:true};b.Function.wrap(b,"gack",function(){var a=Array.prototype.slice.call(arguments,0);a[1]=b.Logging.formatError(a[1]);a[2]=b.Logging.LogLevel.GACK;b.ServerLogging.log.apply(b.ServerLogging,a)});b.logServer=function(){b.ServerLogging.log.apply(b.ServerLogging,
arguments)};return{log:function(a,d,g){b.assert(a&&d,"You must provide a relay key and a data object to log.");g=g||b.Logging.LogLevel.INFO;var e=this.getRelay(a);if(!(e&&e.log(a,d,g))){e={};e[c.LOG_NAME]=a;e[c.LOG_LEVEL]=g;e[c.LOG_ATTRS]=d;queue.push(e);queue.length>c.MAX_BUFFER_SIZE&&queue.shift();this.startFlushTimer()}},getRelay:function(a){return relays[a]},addRelay:function(a,d){relays[a]=d},removeRelay:function(a){delete relays[a]},flush:function(){if(f){clearTimeout(f);f=null}if(queue.length===
0)return 0;var a=queue.splice(0,c.FLUSH_SIZE),d={};d[c.LOG_LINES]=b.JSON.stringify(a);b.Ajax.post(c.URL,null,{data:d});queue.length>0&&this.startFlushTimer();return a.length},setConfig:function(a){b.apply(c,a,true)},startFlushTimer:function(){if(!(f||!c.AUTO_FLUSH))if(c.FLUSH_INTERVAL>0){var a=this;f=setTimeout(function(){a.flush()},c.FLUSH_INTERVAL)}else this.flush()},getLogQueue:function(){return queue}}}(Sfdc));
var TagHeader=function(){};TagHeader.MAX_TAG_LIST_CHARS=80;TagHeader.LINE_HEIGHT=1.3;TagHeader.LINE_HEIGHT_UNITS="em";TagHeader.RESIZE_THRESHOLD=3;
TagHeader.init=function(a,b,e){this.id=a;this.desktopParam=b;this.csrfToken=e;this.editTagsText=document.getElementById(TagConstants.TAG_EDIT_TEXT_ID);if(this.editTagsText==null)Gack.logJSError("Tag header dom elements did not get properly set up by the server.");else{this.dropDown=document.getElementById(TagConstants.TAG_DROP_DOWN_ID);this.dropDownContents=document.getElementById(TagConstants.TAG_DROP_DOWN_CONTENTS_ID);this.tagEditArea=document.getElementById(TagMode.PERSONAL+TagConstants.EDIT_AREA_ID);
this.pubTagEditArea=document.getElementById(TagMode.PUBLIC+TagConstants.EDIT_AREA_ID);this.tagDisplayList=document.getElementById(TagMode.PERSONAL+TagConstants.TAG_DISPLAY_LIST);this.pubTagDisplayList=document.getElementById(TagMode.PUBLIC+TagConstants.TAG_DISPLAY_LIST);this.tagEditList=document.getElementById(TagMode.PERSONAL+TagConstants.TAG_EDIT_LIST);this.pubTagEditList=document.getElementById(TagMode.PUBLIC+TagConstants.TAG_EDIT_LIST);this.hiddenTagList=document.getElementById(TagMode.PERSONAL+
TagConstants.HIDDEN_TAG_LIST);this.hiddenTagIdList=document.getElementById(TagMode.PERSONAL+TagConstants.HIDDEN_TAG_ID_LIST);this.hiddenPubTagList=document.getElementById(TagMode.PUBLIC+TagConstants.HIDDEN_TAG_LIST);this.hiddenPubTagIdList=document.getElementById(TagMode.PUBLIC+TagConstants.HIDDEN_TAG_ID_LIST);this.tags=this.getTags(this.hiddenTagList);this.tagIds=this.getTags(this.hiddenTagIdList);this.pubTags=this.getTags(this.hiddenPubTagList);this.pubTagIds=this.getTags(this.hiddenPubTagIdList);
this.display();this.tagHeader=document.getElementById(TagConstants.TAG_HEADER);this.tagHeader.style.display="block";this.loading=new LoadingScreen(this.dropDown,LC.getLabel("TagHeader","saving"));if(this.tagEditArea)this.tagEditArea.textLines=1;if(this.pubTagEditArea)this.pubTagEditArea.textLines=1;this.editTags=document.getElementById(TagConstants.TAG_EDIT_ID);this.tagSaveBtn=document.getElementById(TagConstants.TAG_SAVE_ID);this.tagCancelBtn=document.getElementById(TagConstants.TAG_CANCEL_ID);var c=
this;addEvent(this.editTags,"click",function(){c.openDropDown()},false);addEvent(this.tagSaveBtn,"click",function(){c.save()},false);addEvent(this.tagCancelBtn,"click",function(){c.cancel()},false);if(this.tagEditArea!=null&&!UserContext.isAccessibleMode){this.autoCompleter=new TagAutoComplete(this.tagEditArea,TagMode.PERSONAL,function(f){c.keyPress(f)});this.autoCompleter.setResizer(function(){return c.checkAndResize(c.tagEditArea)})}if(this.pubTagEditArea!=null&&!UserContext.isAccessibleMode){this.pubAutoCompleter=
new TagAutoComplete(this.pubTagEditArea,TagMode.PUBLIC,function(f){c.keyPress(f)});this.pubAutoCompleter.setResizer(function(){return c.checkAndResize(c.pubTagEditArea)})}}};
TagHeader.display=function(){var a;a=this.setupDisplayList(this.tagDisplayList,this.tags,this.tagIds,TagMode.PERSONAL,0);this.setupDisplayList(this.pubTagDisplayList,this.pubTags,this.pubTagIds,TagMode.PUBLIC,a);if(this.tags.length==0&&this.pubTags.length==0){this.editTagsText.innerHTML=LC.getLabel("TagHeader","add_tags");this.editTagsText.setAttribute("title",LC.getLabel("TagHeader","add_tags"))}else{this.editTagsText.innerHTML=LC.getLabel("TagHeader","edit_tags");this.editTagsText.setAttribute("title",
LC.getLabel("TagHeader","edit_tags"))}};
TagHeader.setupDisplayList=function(a,b,e,c,f){if(a==null)return f;a.innerHTML="";if(b.length==0)document.getElementById(c+TagConstants.TAG_DISPLAY_CONTAINER).style.display="none";else{document.getElementById(c+TagConstants.TAG_DISPLAY_CONTAINER).style.display="inline";for(var g=b.length,d=0;d<b.length;d++)if(!(f+b[d].length>TagHeader.MAX_TAG_LIST_CHARS)){g<b.length&&a.appendChild(document.createTextNode(", "));TagHeader.addTagLink(a,b[d],e[d],c);f+=b[d].length;g--}if(g==b.length){TagHeader.addTagLink(a,
b[0],e[0],c);g--}if(g>0){e=document.createElement("span");e.innerHTML=" "+LC.getLabel("TagHeader","tag_list_more",g);e.title=b.slice(b.length-g,b.length).join(", ");a.appendChild(e)}}return f};
TagHeader.addTagLink=function(a,b,e){var c=document.createElement("a"),f=new QueryString("");f.add(TagConstants.TAG_ID_LIST,e);if(b&&b.length>1){f.add(TagConstants.TAG_SEARCH_FIELD,b);f.add("lsc",TagConstants.ROLODEX_SEARCH_VALUE)}e=UserContext.getUrl(TagConstants.TAG_SEARCH_RESULTS_URL)+f.toString();if(this.desktopParam)e="javascript:srcUp('"+e+this.desktopParam+"');";c.href=e;c.setAttribute("title",LC.getLabel("TagHeader","tag_list_tag_tip",b));c.innerHTML=b;a.appendChild(c);return c};
TagHeader.openDropDown=function(){var a=this;this.newTags=[].concat(this.tags);this.newPublicTags=[].concat(this.pubTags);this.updateEditArea();this.dropDownStartHeight=XBrowser.getActualHeight(a.tagHeader);a.tagHeader.style.display="none";a.dropDown.style.display="block";a.resetAndResize();Animation.animateResizeHeight(a.dropDown,a.dropDownStartHeight,-1,function(){a.dropDownContents.style.visibility="visible";a.autoCompleter&&a.autoCompleter.positionACBox();a.pubAutoCompleter&&a.pubAutoCompleter.positionACBox();
var b=a.tagEditArea?a.tagEditArea:a.pubTagEditArea;b.focus();TagHeader.moveCursorToEndIE(b)})};TagHeader.hideDropDown=function(){var a=this;a.dropDownContents.style.visibility="hidden";Animation.animateResizeHeight(a.dropDown,XBrowser.getActualHeight(a.dropDown),a.dropDownStartHeight,function(){a.tagHeader.style.display="block";a.dropDown.style.display="none";a.removeError()})};TagHeader.cancel=function(){this.hideDropDown();this.setTags()};
TagHeader.save=function(){if(this.tagEditArea)var a=this.newTags.concat(this.getTags(this.tagEditArea));if(this.pubTagEditArea)var b=this.newPublicTags.concat(this.getTags(this.pubTagEditArea));var e=UserContext.getUrl(TagConstants.SAVE_TAGS_PAGE),c=this;this.removeError();this.loading.show();var f=new QueryString("");f.add("id",this.id);a&&f.add("tags",a.join(", "));b&&f.add("pTags",b.join(", "));this.csrfToken&&f.add(CSRFConstants.CSRF_TOKEN,this.csrfToken);a=f.toString();XBrowser.postHttpResponse(e,
function(g){var d=g.responseXML;if(!d||XBrowser.userAgent.isIE&&!d.xml)if(g.status==200)window.location=window.location;else{c.loading.hide();c.displayError(c.generateError(LC.getLabel("TagHeader","unknown_error")));return}if(g=d.getElementsByTagName("ok")[0]){XBrowser.userAgent.isFirefox&&d.normalize();d=g.getElementsByTagName(TagConstants.TAG_NAMES_ELEM)[0];d=d.firstChild&&d.firstChild.nodeValue?d.firstChild.nodeValue:"";c.tags=eval("new Array("+d+")");d=g.getElementsByTagName(TagConstants.TAG_IDS_ELEM)[0];
d=d.firstChild&&d.firstChild.nodeValue?d.firstChild.nodeValue:"";c.tagIds=eval("new Array("+d+")");d=g.getElementsByTagName(TagConstants.PUBLIC_TAG_NAMES_ELEM)[0];d=d.firstChild&&d.firstChild.nodeValue?d.firstChild.nodeValue:"";c.pubTags=eval("new Array("+d+")");d=g.getElementsByTagName(TagConstants.PUBLIC_TAG_IDS_ELEM)[0];d=d.firstChild&&d.firstChild.nodeValue?d.firstChild.nodeValue:"";c.pubTagIds=eval("new Array("+d+")");c.setTags();c.display();c.hideDropDown();c.loading.hide();TagMenuButton.flushCache()}else{if(g=
d.getElementsByTagName("saveerror"))for(d=0;d<g.length;d++){var h=g[d],i=h.getElementsByTagName("tagmode");i=i&&i[0]?i[0].firstChild.nodeValue:"";h=(h=h.getElementsByTagName("errormessage")[0])?h.firstChild.nodeValue:c.generateError(LC.getLabel("TagHeader","unknown_error"));c.displayError(h,i)}else c.displayError(c.generateError(LC.getLabel("TagHeader","unknown_error")));c.loading.hide()}},a.substring(1,a.length),function(){c.loading.hide();c.displayError(c.generateError(LC.getLabel("TagHeader","server_error")))})};
TagHeader.displayError=function(a,b){if(this.tagEditArea&&b==TagMode.PERSONAL)this.tagEditArea.className=EditElement.ERROR_CLASS;else if(this.pubTagEditArea&&b==TagMode.PUBLIC)this.pubTagEditArea.className=EditElement.ERROR_CLASS;var e=document.getElementById(b+TagConstants.TAG_EDIT_ERROR_ID);e.innerHTML=a;e.style.display=b?"inline":"block";b||this.resetAndResize()};
TagHeader.removeError=function(){if(this.tagEditArea)this.tagEditArea.className="";if(this.pubTagEditArea)this.pubTagEditArea.className="";this.removeErrorMessage("");this.removeErrorMessage(TagMode.PERSONAL);this.removeErrorMessage(TagMode.PUBLIC)};TagHeader.removeErrorMessage=function(a){if(a=document.getElementById(a+TagConstants.TAG_EDIT_ERROR_ID)){a.innerHTML="";a.style.display="none"}};
TagHeader.generateError=function(a){return LC.getLabel("Global","colonSeparatedWords",LC.getLabel("Global","error"),a)};TagHeader.keyPress=function(a){if(a=a?a:event?event:null)if(a.keyCode==KEY_ENTER){this.save();AutoCompleteInputElement.captureKeystroke(a)}else if(a.keyCode==KEY_ESC){this.cancel();AutoCompleteInputElement.captureKeystroke(a)}};
TagHeader.resetAndResize=function(){if(this.tagEditArea!=null){this.tagEditArea.style.height=TagHeader.LINE_HEIGHT+TagHeader.LINE_HEIGHT_UNITS;this.tagEditArea.textLines=1;this.checkAndResize(this.tagEditArea)}if(this.pubTagEditArea!=null){this.pubTagEditArea.style.height=TagHeader.LINE_HEIGHT+TagHeader.LINE_HEIGHT_UNITS;this.pubTagEditArea.textLines=1;this.checkAndResize(this.pubTagEditArea)}};
TagHeader.checkAndResize=function(a){for(var b=false;a.scrollHeight-a.clientHeight>TagHeader.RESIZE_THRESHOLD;){a.textLines++;a.style.height=a.textLines*TagHeader.LINE_HEIGHT+TagHeader.LINE_HEIGHT_UNITS;a.rows=a.textLines;b=true}return b};TagHeader.setTags=function(){this.updateHiddenTags(this.tags,this.hiddenTagList);this.updateHiddenTags(this.tagIds,this.hiddenTagIdList);this.updateHiddenTags(this.pubTags,this.hiddenPubTagList);this.updateHiddenTags(this.pubTagIds,this.hiddenPubTagIdList)};
TagHeader.remove=function(a,b){if(a==TagMode.PERSONAL)this.newTags.splice(b,1);else a==TagMode.PUBLIC&&this.newPublicTags.splice(b,1);this.updateEditArea(true)};TagHeader.updateEditArea=function(a){if(this.tagEditArea!=null){this.updateEditAreaItems(this.newTags,TagMode.PERSONAL,this.tagEditList);if(!a)this.tagEditArea.value=""}if(this.pubTagEditArea!=null){this.updateEditAreaItems(this.newPublicTags,TagMode.PUBLIC,this.pubTagEditList);if(!a)this.pubTagEditArea.value=""}};
TagHeader.updateEditAreaItems=function(a,b,e){if(a.length==0)e.innerHTML=LC.getLabel("TagHeader","no_tags");else{for(var c="",f=0;f<a.length;f++)if(a[f]){if(c.length>0)c+=", ";c+="<span class='tag'>"+a[f]+" [ <span class='tagRemove' onclick='javascript:TagHeader.remove(\""+b+'", '+f+")' title='"+LC.getLabel("TagHeader","remove_tag",a[f])+"'>X</span> ]</span>"}e.innerHTML=c}};TagHeader.updateHiddenTags=function(a,b){if(b!=null){var e=a.join(", ");b.value=e}};
TagHeader.getTags=function(a){if(a!=null){a=a.value.split(",");for(var b=[],e=0;e<a.length;e++){var c=trim(a[e]);c.length>0&&b.push(c)}return b}else return[]};TagHeader.moveCursorToEndIE=function(a){if(XBrowser.userAgent.isIE){var b=document.selection.createRange().duplicate();b.moveToElementText(a);b.setEndPoint("StartToEnd",b);b.select()}};
UnifiedSearchAutoCompleteElement=function(a,b,c,d,g,i,q,h,j,l,m,k,n,o){SidebarSearchAutoCompleteElement.apply(this,[a,b,c,d,g,i,q]);j=j?j:[];var p=j[UnifiedSearchUI.GLOBAL_SEARCH_SUGGESTED_SCOPES];if(l&&m&&k){this.searchScopeDialogJS="SearchOverlayDialogs.showDialogAddSearchString('"+l+"', '"+m+"', '"+k+"',"+n+", "+UnifiedSearchUI.SEARCH_SCOPE_DIALOG_WIDTH+", "+o+", '"+a+"');";this.searchOptionsLabel=LC.getLabel("Page_UnifiedSearch","changeScope")+LC.getLabel("Sidebar","ellipses");b=k.indexOf("?");
if(b!=-1)this.searchNoScopeDialogJS="SearchOverlayDialogs.showDialogAddSearchString('"+l+"', '"+m+"', '"+k.substring(0,b)+"',"+n+", "+UnifiedSearchUI.SEARCH_SCOPE_DIALOG_WIDTH+", "+o+", '"+a+"');"}else this.disableSearchScopeDialog=true;var e=this;addEvent(this.element,"focus",function(f){e.handleEvent(f)});addEvent(this.element,"click",function(f){e.handleEvent(f)});XBrowser.userAgent.isFirefox&&addEvent(this.element,"input",function(f){e.handleInput(f)});if(this.clearButton=getElementByIdCS(UnifiedSearchUI.GLOBAL_SEARCH_CLEAR_BUTTON_ID)){addEvent(this.clearButton,
"mouseover",function(){addStyleClass(e.clearButton,UnifiedSearchAutoCompleteElement.CLEAR_BUTTON_HOVER_CLASS)});addEvent(this.clearButton,"mouseout",function(){delStyleClass(e.clearButton,UnifiedSearchAutoCompleteElement.CLEAR_BUTTON_HOVER_CLASS)});addEvent(this.clearButton,"mousedown",function(){addStyleClass(e.clearButton,UnifiedSearchAutoCompleteElement.CLEAR_BUTTON_PRESS_CLASS)});addEvent(this.clearButton,"mouseup",function(f){e.clearScope(f);setVis(e.clearButton,false);delStyleClass(e.clearButton,
UnifiedSearchAutoCompleteElement.CLEAR_BUTTON_PRESS_CLASS)})}this.scopeHiddenInputNames=h?h:[];this.headerSearchLeftCorner=this.element.parentNode.parentNode;var r=this.element.getGhostText();this.element.setGhostTextFunction(function(){return r});h=this.element.parentNode;h.removeChild(this.element);this.element.setGhostTextIfEmpty();h.insertBefore(this.element,this.clearButton);var s=this.searchScopeDialogJS;this.suggestedScopeDone=false;p&&!this.disableSearchScopeDialog&&addEvent(this.searchForm,
"submit",function(f){var t=GhostTextInputWrapperElement.getSearchString(a);if(!e.suggestedScopeDone&&p&&t.indexOf("#")===-1){eval(s);AutoCompleteInputElement.captureKeystroke(f)}})};UnifiedSearchAutoCompleteElement.prototype=new SidebarSearchAutoCompleteElement;UnifiedSearchAutoCompleteElement.DROPDOWN_ACTIVATED_CLASS="dropdownActivated";UnifiedSearchAutoCompleteElement.DEFAULT_CLEAR_BUTTON_CLASS=UnifiedSearchUI.GLOBAL_SEARCH_CLEAR_BUTTON_DEFAULT_CLASS;
UnifiedSearchAutoCompleteElement.CLEAR_BUTTON_HOVER_CLASS=UnifiedSearchAutoCompleteElement.DEFAULT_CLEAR_BUTTON_CLASS+"Hover";UnifiedSearchAutoCompleteElement.CLEAR_BUTTON_PRESS_CLASS=UnifiedSearchAutoCompleteElement.DEFAULT_CLEAR_BUTTON_CLASS+"Press";UnifiedSearchAutoCompleteElement.WILDCARD="*";UnifiedSearchAutoCompleteElement.MAX_SUGGESTIONS_TO_DISPLAY=10;UnifiedSearchAutoCompleteElement.ONBLUR_DELAY_MS=0;UnifiedSearchAutoCompleteElement.prototype.parent=SidebarSearchAutoCompleteElement.prototype;
UnifiedSearchAutoCompleteElement.prototype.getOnBlurDelay=function(){return UnifiedSearchAutoCompleteElement.ONBLUR_DELAY_MS};UnifiedSearchAutoCompleteElement.prototype.setClearButtonVisibility=function(){var a=this.showClearButton();if(a&&this.clearButton.style.visibility=="hidden")setVis(this.clearButton,true);else!a&&this.clearButton.style.visibility=="visible"&&setVis(this.clearButton,false)};
UnifiedSearchAutoCompleteElement.prototype.handleInput=function(a){this.setClearButtonVisibility();this.parent.handleInput.call(this,a)};UnifiedSearchAutoCompleteElement.prototype.handleEvent=function(){if(!this.isACBoxVisible())if(!(this.disableSearchScopeDialog&&!this.isSearchStringValid()))if(this.isSearchStringEmpty()){this.displayACBox([]);this.updateWidth()}else this.displaySuggestions(false)};
UnifiedSearchAutoCompleteElement.prototype.innerComplete=function(a){if(!(!this.element||!a||!a.name||!a.mruIds||a.mruIds.length==0)){var b=this.element.value,c=this.selected;this.shouldRenderWildcardSearchSuggestion()&&c--;this.element.value=a.name;a.detailURL?this.navigateToRecord(a,b,c):this.parent.innerComplete.call(this,a)}};
UnifiedSearchAutoCompleteElement.prototype.navigateToRecord=function(a,b,c){if(a.detailURL){a=this.addSearchMacLogParams(QueryString.createQueryString(a.detailURL),a,b,c,"header").concatenateWithUrl(a.detailURL);this.requestParams.isdtp?navigateToUnifiedSearchDetailUrl(a):navigateToUrl(a)}};
UnifiedSearchAutoCompleteElement.prototype.getMaxSuggestionsToDisplay=function(){return!this.wildCardSuggestionAdded?UnifiedSearchAutoCompleteElement.MAX_SUGGESTIONS_TO_DISPLAY:UnifiedSearchAutoCompleteElement.MAX_SUGGESTIONS_TO_DISPLAY+1};UnifiedSearchAutoCompleteElement.prototype.handleEmptyInput=function(){this.setClearButtonVisibility();this.clearSuggestions();if(this.disableSearchScopeDialog)this.hook_hide();else{this.displayACBox([]);this.updateWidth()}};
UnifiedSearchAutoCompleteElement.prototype.getValidSuggestions=function(a,b){for(var c=Math.min(UnifiedSearchUI.MAX_VALID_MRU_SUGGESTIONS,b.length),d=[],g=0;g<b.length&&d.length<c;g++){var i=b[g];this.isValidSuggestion(a,i)&&d.push(i)}return d.sort(UnifiedSearchAutoCompleteElement.sortOrderComparator)};
UnifiedSearchAutoCompleteElement.prototype.updateACBox=function(a,b){if(!a||a.length==0)if(!this.disableSearchScopeDialog||this.isSearchStringValid()){this.displayACBox(a,b);this.scrollDiv();this.updateWidth()}else this.isACBoxVisible()&&this.hideACBox();else this.parent.updateACBox.call(this,a,b)};
UnifiedSearchAutoCompleteElement.prototype.handleEnter=function(a){var b=this.getRow(this.selected);if(b&&b.onclick){b.onclick();AutoCompleteInputElement.captureKeystroke(a)}else return this.parent.handleEnter.call(this,a)};
UnifiedSearchAutoCompleteElement.prototype.hook_show=function(){addStyleClass(this.headerSearchLeftCorner,UnifiedSearchAutoCompleteElement.DROPDOWN_ACTIVATED_CLASS);UnifiedSearchAutoCompleteElement.toggleDisplay(UnifiedSearchUI.HEADER_SEARCH_OPTIONS_CONTAINER_ID,false);XBrowser.userAgent.isSafari&&this.updateWidthAfterDisplay()};
UnifiedSearchAutoCompleteElement.prototype.hook_hide=function(){delStyleClass(this.headerSearchLeftCorner,UnifiedSearchAutoCompleteElement.DROPDOWN_ACTIVATED_CLASS);UnifiedSearchAutoCompleteElement.toggleDisplay(UnifiedSearchUI.HEADER_SEARCH_OPTIONS_CONTAINER_ID,true)};UnifiedSearchAutoCompleteElement.prototype.selectPrev=function(){if(!this.curSuggestions||this.selected>this.curSuggestions.length-1){var a=this.selected-1;a<0?this.deselect():this.select(a)}else this.parent.selectPrev.call(this)};
UnifiedSearchAutoCompleteElement.prototype.selectNext=function(){if(!this.curSuggestions||this.selected+1>this.curSuggestions.length-1){var a=this.selected+1;this.getRow(a)||(a=0);this.select(a)}else this.parent.selectNext.call(this)};
UnifiedSearchAutoCompleteElement.prototype.hook_decorateHtml=function(a){a.push('<div class="usid-roundedCornerDropdown usid-brDropdown" id="usid-brDropdown"></div>');a.push('<div class="usid-bottomSpacer" id="usid-spacerDropdown"></div>');a.push('<div class="usid-roundedCornerDropdown usid-blDropdown" id="usid-blDropdown"></div>');return a};
UnifiedSearchAutoCompleteElement.prototype.shouldRenderWildcardSearchSuggestion=function(){return this.isSearchStringValid()&&this.element.value.length<UnifiedSearchUI.GLOBAL_NAV_HEADER_SEARCH_BOX_LENGTH&&/\w$/.test(this.element.value)};
UnifiedSearchAutoCompleteElement.prototype.renderWildcardSearchSuggestion=function(a,b){a.push("<tr><td><div ");a.push('onmouseover="');a.push("AutoCompleteInputElement.mouseOver('"+this.id+"', "+b+')"');a.push('onmouseout="');a.push("AutoCompleteInputElement.mouseOut('"+this.id+"', "+b+')"');a.push('onclick="');a.push("UnifiedSearchAutoCompleteElement.performWildcardedSearch('"+this.id+"');\"");a.push('class="'+AutoCompleteInputElement.ROW_CSS_CLASS+'" id="'+AutoCompleteInputElement.getRowIdStatic(this.id,
b)+'">');a.push('<span class="footerRow">'+LC.getLabel("Page_UnifiedSearch","searchFor")+"&nbsp;");a.push('<span class="queryText">'+escapeHTML(this.element.value)+UnifiedSearchAutoCompleteElement.WILDCARD+"</span>");a.push('<span class="greyedText">&nbsp;'+LC.getLabel("Page_UnifiedSearch","searchForWildcardPost")+"</span>");a.push('</span></div><div class="hr"></div></td></tr>')};
UnifiedSearchAutoCompleteElement.prototype.addHeader=function(a){this.shouldRenderWildcardSearchSuggestion()&&this.renderWildcardSearchSuggestion(a,0);a.push("<tr><td>");a.push('<div class="'+AutoCompleteInputElement.TITLE_ROW_CSS_CLASS+'">'+LC.getLabel("Sidebar_Search","result_source")+"</div>");a.push("</td></tr> ")};
UnifiedSearchAutoCompleteElement.prototype.innerAddSuggestions=function(a,b,c,d){if(this.shouldRenderWildcardSearchSuggestion()){this.parent.innerAddSuggestions.call(this,a,b,c,d+1);this.curSuggestions.unshift("");this.wildCardSuggestionAdded=true}else{this.parent.innerAddSuggestions.call(this,a,b,c,d);this.wildCardSuggestionAdded=false}};
UnifiedSearchAutoCompleteElement.prototype.addFooter=function(a,b){var c=false,d=b;if(d==0&&this.shouldRenderWildcardSearchSuggestion()){this.renderWildcardSearchSuggestion(a,b);b++}if(!this.disableSearchScopeDialog){a.push("<tr><td>");if(!c&&d>0){a.push('<div class="hr"></div>');c=true}a.push("<div ");a.push('onmouseover="');a.push("AutoCompleteInputElement.mouseOver('"+this.id+"', "+b+')"');a.push('onmouseout="');a.push("AutoCompleteInputElement.mouseOut('"+this.id+"', "+b+')"');a.push('onclick="');
a.push(this.searchScopeDialogJS+'"');a.push('class="'+AutoCompleteInputElement.ROW_CSS_CLASS+'" id="'+AutoCompleteInputElement.getRowIdStatic(this.id,b)+'">');a.push('<span class="footerRow">'+this.searchOptionsLabel+"</span>");a.push("</div></td></tr>");b++}if(this.isSearchStringValid()){a.push("<tr><td>");!c&&d>0&&a.push('<div class="hr"></div>');a.push("<div ");a.push('onmouseover="');a.push("AutoCompleteInputElement.mouseOver('"+this.id+"', "+b+')"');a.push('onmouseout="');a.push("AutoCompleteInputElement.mouseOut('"+
this.id+"', "+b+')"');a.push('onclick="');a.push("UnifiedSearchButton.submit('"+this.searchForm.id+"');\"");a.push('class="'+AutoCompleteInputElement.ROW_CSS_CLASS+'" id="'+AutoCompleteInputElement.getRowIdStatic(this.id,b)+'">');a.push('<span class="footerRow">'+LC.getLabel("Page_UnifiedSearch","searchFor")+"&nbsp;");a.push('<span class="queryText">'+escapeHTML(this.element.value)+"</span>");a.push("</span></div></td></tr>")}};
UnifiedSearchAutoCompleteElement.prototype.clearScope=function(){this.element.setGhostText();this.clearSuggestions()};UnifiedSearchAutoCompleteElement.prototype.showClearButton=function(){return!this.isSearchStringEmpty()&&!this.element.isGhost&&this.element.value.length>0};UnifiedSearchAutoCompleteElement.prototype.isSearchStringValid=function(){return!this.isSearchStringEmpty()&&!this.element.isGhost&&this.element.value.length>1};
UnifiedSearchAutoCompleteElement.prototype.isSearchStringEmpty=function(){return!this.element||trim(this.element.value)==""};UnifiedSearchAutoCompleteElement.prototype.updateWidthAfterDisplay=function(){var a=this.getMinimumWidth(),b=0,c=getElementByIdCS(this.id+AutoCompleteInputElement.BOX_TABLE_ID);if(c)b=c.clientWidth;this.acBox.setStyle("width",Math.max(a,b)+"px")};UnifiedSearchAutoCompleteElement.prototype.getMinimumWidth=function(){return this.element.clientWidth+23};
UnifiedSearchAutoCompleteElement.prototype.addACBoxToPage=function(){getElementByIdCS(UnifiedSearchUI.GLOBAL_SEARCH_CONTAINER_ID).appendChild(this.acBox)};UnifiedSearchAutoCompleteElement.prototype.positionACBox=function(a){if(this.element&&this.acBox)if(!(a&&this.isACBoxVisible())){this.acBox.setStyle("width",this.getMinimumWidth()+"px");if(typeof Ext==="object"){a=Ext.get("massEdit");a!==null&&this.acBox.setStyle("zIndex",parseFloat(a.getStyle("z-index"),10)+10)}}};
UnifiedSearchAutoCompleteElement.performWildcardedSearch=function(a){a=AutoCompleteInputElement.getInstance(a);if(/\w$/.test(a.element.value))a.element.value+=UnifiedSearchAutoCompleteElement.WILDCARD;UnifiedSearchButton.submit(a.searchForm.id)};UnifiedSearchAutoCompleteElement.toggleDisplay=function(a,b){var c=getElementByIdCS(a);if(c)b?c.style.display="block":c.style.display="none"};UnifiedSearchAutoCompleteElement.sortOrderComparator=function(a,b){return a.sortOrder-b.sortOrder};

