var WebPages_Enum={wpUnknown:1,wpWelcome:2,wpResetPassword:3,wpIncludeFile:4,wpEditUsers:5,wpSystemSettings:6,wpCustomers:7,wpCustomerDetail:8,wpDatabases:9,wpDatabaseDetail:10,wpPayments:11,wpPaymentDetail:12,wpInvoiceDetail:14,wpImportPayments_Obsolete:15,wpEventLog:16,wpUserEventLog:17,wpSearch:18,wpPaymentTotals:19,wpChurnReport:20,wpCohortAnalysisReport:21,wpDownloadFile:22,wpLicenseReconciliationReport:23,wpServerMetricReport:24,wpCreditMemoDetail:26,wpVUInvoices:29,wpVUIncludeFile:30,wpVUViewInvoice:31,wpJTUserEventLog:33,wpVUViewCreditMemo:34,wpSystemEventLog:35,wpPortalUsageReport:36,wpVUViewStatement:37,wpOverbillingReport:38,wpNewCustomerActivityReport:39,wpEmptySettings:40,wpReports:41,wpMySettings:42,wpBouncedEmail:43,wpTaxRates:44,wpProducts:45,wpEmail:47,wpUnpaidInvoices:48,wpPortalRedirect:49,wpVUViewInvoices:50,wpTaxRateReconciliationReport:51,wpExpensesSummary:54,wpExpenseApprovals:55,wpExpenseDetail:56,wpUploadAttachedFile:58,wpExpenseSettings:59,wpExpenseSettingsTrips:60,wpExpenseSettingsTypes:61,wpExpenseSettingsImportBlocklist:62,wpExpenseSettingsVendors:63,wpExpenseSettingsQuickbooksCustomers:64,wpExpenseSettingsUseTax:65,wpSystemSettingsProducts:66,wpLegacyPricingReport:67,wpQuoteJobAndOrderUsageReport:68,wpExpenseReportDetail:69,wpSalesByState:70,wpAutopaySettings:71,wpBTBillingId:72,wpBTProfileEventLog:73,wpAutopayReport:74,wpBTDisbursementReport:75,wpBTDisbursementDetail:76,wpEditRoles:77,wpUsersAndRoles:78,wpTaxJarTransactionsReport:79,wpAdditionalUsersReport:80,wpStateTaxAgencies:81,wpTaskReport:82,wpUser2FactorAuthConfig:83,wpSunsettingReport_Obsolete:84,wpPricingStructures:85,wpJTCRMQBSynch:86,wpSalesPersons:87,wpOnboarders:88,wpProductSalesReport:89,wpProductSalesAssignment:90},Edition_Enum={edBasic:1,edStandard:2,edInventory:3,edEnterprise:4,edEditionNone:5},SessionKillReason_Enum={skrLogout:0,skrNewLogin:1,skrAdminKilled:2,skrActivelyLoggedOut:4},EventObjectType_Enum={eotCustomer:1,eotInvoice:2,eotUser:3,eotTaxRate:4,eotDatabase:5,eotProduct:6,eotEdition:7,eotPayment:8,eotDatabaseProduct:9,eotCartItem:10,eotInvoicePayment:11,eotEmailTemplate:12,eotBundle:13,eotCreditMemo:14,eotCreditMemoPayment:15,eotPaymentRefund:16,Obsolete_eotPaypalBillingProfileSnapshot:17,eotMBSILL:18,eotExpense:19,eotFile:20,eotExpenseDetail:21,eotDatabaseCompanyAddress:22,eotDatabaseContact:23,eotExpenseReport:24,eotExpenseReportDetail:25,eotBillingCustomerProcessorId:26,eotDisbursement:27,eotJTCRMRole:28,eotStateTaxAgency:29,eotTask:30,eotPricingStructure:31,eotDatabasePricingStructure:32,eotAccountingSettings:33,eotDatabaseAddress:34,eotSalesperson:35,eotOnboarder:36},EventFieldType_Enum={eftxChange:1,eftxAssigned:2,eftxAssignee:3},Term_Enum={trmMonthly:1,trmQuarterly:2,trmAnnual:3},PaymentDueOption_Enum={pdoAll:1,pdoDue:2,pdoSoon:3},TaskStatus_Enum={tsActive:1,tsComplete:2},TaskStatusFilter_Enum={tsfActiveOnly:1,tsfCompleteOnly:2,tsfActiveOrComplete:3},SearchSubjectAreas_Enum={ssjDatabase:1,ssjCustomer:2,ssjInvoice:3,ssjPayment:4,ssjBillingCustomerProcessorId:6,ssjCreditMemo:7},PaymentType_Enum={ptSale:1,ptCredit:2,ptAuthorization:3,ptVoid:4},DisplayedProductGroup_Enum={dpgSubscription:1,dpgJTDownload:2,dpgLegacy:3},CommonConstants_Enum={ccMAX_REPORTING_MONTHS_COUNT:99},SMREditionUsage_Enum={seuAll:1,seuCGUsage:2,seuJTUsage:3},SMRExpirationStatus_Enum={sesAll:1,sesExpired:2,sesNotExpired:3},SMRBillingDBStatus_Enum={bdbsAll:1,bdbsHasBillingDB:2,bdbsNoBillingDB:3},EditionFilter_Enum={efAny:1,efEditionOnly:2,efNonEditionOnly:3},SubscriptionStatus_Enum={ssAny:1,ssActiveOnly:2,ssInactiveOnly:3},DeprecationStatus_Enum={dsAny:1,dsDeprecatedOnly:2,dsNonDeprecatedOnly:3},TableHeaderScrollImpl_Enum={thsiFixedPosition:1,thsiJavascript:2,thsiJavascriptAndFixedPositioning:3},CRMProductType_Enum={crmptJobTracker:0,crmptCounterGo:1,crmptSystemize:2,crmptNVInventory:3},AttributeUsage_Enum={File:1},AttributeDataTypes_Enum={SelectFromList:1,EnterNumber:2,EnterDate:3,EnterText:4,AutoNumber:5,MultilineText:6,Separator:7,Link:8,EnterCurrency:15},VirtualUserType_Enum={vutJobTracker:1,vutBilling:2},RoleType_Enum={rtJTCRM:1},PermissionType_Enum={ptJTCRM:1},JTCRMSecuredObject_Enum={mjtMinSecuredObjectId:1,soSystemSettings:1,soBouncedEmail:2,soExportedDatabaseObjects:3,soUnexportedDatabaseObjects:4,soAutopaySettings:5,soEmailTemplates:6,soProducts:7,soTaxRates:8,soExpenseConfiguration:9,soApprovals:10,soReportsBookkeeping:11,soReportsCustomerActivity:12,soReportsFinancials:13,soReportsOperations:14,soReportsProductSales:15,mjtMaxSecuredObjectId:15,soRoleSettings:100,soUserSettings:101},ExpensesSummaryViews_Enum={esvRequiresInput:1,esvAll:2},AccessRight_Enum={mjtARCreate:1,mjtARRead:2,mjtARUpdate:4,mjtARDelete:8,mjtARExecute:16},Expense_Approval_Status_Enum={easNeedsUserInput:0,easWaitingForApproval:1,easRejected:2,easApproved:3,easApprovedAndExported:4},Attached_File_Data_Type_Enum={afdtImage:0,afdtPDF:1,afdtDoc:2,afdtOther:3},SalesByStateTimeSelection_Enum={sbstsCustom:1,sbstsLastYear:2,sbstsYearToDate:3,sbstsLastFull12Months:4,sbstsLastMonth:5,sbstsLastQuarter:6,sbstsMonthToDate:7,sbstsQuarterToDate:8},AmexVendorFilterType_Enum={avftExactlyMatches:0,avftContains:1,avftStartsWidth:2},AutopayStatus_Enum={apsNone:0,apsPending:1,apsSuccess:2,apsTransientFailure:3,apsPermanentFailure:4},FilteredVUserType_Enum={fvutAny:1,fvutJTOnly:2,fvutBillingOnly:3},TimePeriodTypeFilter_Enum={tptfMonth:1,tptfQuarter:2,tptfYear:3},TimePeriodQuarters_Enum={tpqFirst:1,tpqSecond:2,tpqThird:3,tpqFourth:4},ActiveStatusFilter_Enum={asfAny:1,asfActiveOnly:2,asfInactiveOnly:3},NewPriceTargetFilterOption_Enum={nptfoCGOnly:1,nptfoJTSysOnly:2,nptfoAll:3},PaymentProcessorType_Enum={pptPayflow:0,pptBraintree:1,pptManual:2},ChurnReportPeriodType_Enum={crptMonth:1,crptQuarter:2,crptYear:3},ChurnReportRevenueCategory_Enum={crrcNew:1,crrcCancel:2,crrcIncrease:3,crrcDecrease:4,crrcUnchanged:5},JTCRMQBSynchTabs_Enum={jtcrmqbstTaxRates:1,jtcrmqbstDatabases:2,jtcrmqbstProducts:3,jtcrmqbstInvoices:4,jtcrmqbstCreditMemos:5,jtcrmqbstPayments:6,jtcrmqbstDeposits:7,jtcrmqbstExpenseTypes:8,jtcrmqbstQBVendors:9,jtcrmqbstExpenses:10,jtcrmqbstExpenseReports:11},ActiveAccountingSystem_Enum={aasNoAccountingSystem:1,aasQuickBooksOnline:2,aasQuickBooksDesktop:3},FilterProperty_Enum={fpDBIsActive:1,fpActiveProducts:2,fpDatabaseState:3,fpTaxRateName:4};var g_emailSubstStrDigits="[ccDigits]",g_emailSubstStrInvAmount="[invAmt]",g_emailSubstStrCCType="[ccType]",g_emailSubstStrInvDate="[invDate]",g_emailSubstStrBillingURL="[billingURL]",JTCRMQBSYNCH_TAB_CONTROL_ID="tabJTCRMQBSynch";var FontAwesomeBoundaries_Enum={FontAwesome_Last:62176},IoniconRawBoundaries_Enum={Ionicon_RawFirst:61697,Ionicon_RawLast:62711},IoniconOffsetValues_Enum={Ionicon_Offset:FontAwesomeBoundaries_Enum.FontAwesome_Last+1-IoniconRawBoundaries_Enum.Ionicon_RawFirst},IoniconBoundaries_Enum={Ionicon_First:IoniconRawBoundaries_Enum.Ionicon_RawFirst+IoniconOffsetValues_Enum.Ionicon_Offset,Ionicon_Last:IoniconRawBoundaries_Enum.Ionicon_RawLast+IoniconOffsetValues_Enum.Ionicon_Offset},FoundationIconsRawBoundaries_Enum={FoundationIcons_RawFirst:61696,FoundationIcons_RawLast:61979},FoundationIconsOffsetValues_Enum={FoundationIcons_Offset:IoniconBoundaries_Enum.Ionicon_Last+1-FoundationIconsRawBoundaries_Enum.FoundationIcons_RawFirst},FoundationIconsBoundaries_Enum={FoundationIcons_First:FoundationIconsRawBoundaries_Enum.FoundationIcons_RawFirst+FoundationIconsOffsetValues_Enum.FoundationIcons_Offset,FoundationIcons_Last:FoundationIconsRawBoundaries_Enum.FoundationIcons_RawLast+FoundationIconsOffsetValues_Enum.FoundationIcons_Offset},SZIconsRawBoundaries_Enum={SZIcons_RawFirst:59648,SZIcons_RawLast:59800},SZIconsOffsetValues_Enum={SZIcons_Offset:FoundationIconsBoundaries_Enum.FoundationIcons_Last+1-SZIconsRawBoundaries_Enum.SZIcons_RawFirst},SZIconsBoundaries_Enum={SZIcons_First:SZIconsRawBoundaries_Enum.SZIcons_RawFirst+SZIconsOffsetValues_Enum.SZIcons_Offset,SZIcons_Last:SZIconsRawBoundaries_Enum.SZIcons_RawLast+SZIconsOffsetValues_Enum.SZIcons_Offset},MorawareIconsRawBoundaries_Enum={MorawareIcons_RawFirst:65,MorawareIcons_RawLast:1000},MorawareIconsOffsetValues_Enum={MorawareIcons_Offset:SZIconsBoundaries_Enum.SZIcons_Last+1-MorawareIconsRawBoundaries_Enum.MorawareIcons_RawFirst},MorawareIconsBoundaries_Enum={MorawareIcons_First:MorawareIconsRawBoundaries_Enum.MorawareIcons_RawFirst+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,MorawareIcons_Last:MorawareIconsRawBoundaries_Enum.MorawareIcons_RawLast+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset},FontIconId_Enum={fiiSignOut:61579,fiiChevronCircleLeft:61751,fiiChevronCircleRight:61752,fiiVerticalEllipsis:61762,fiiExternalLink:61582,fiiArrowSolidCircleLeft:61608,fiiArrowSolidCircleRight:61609,fiiArrowSolidCircleUp:61610,fiiArrowSolidCircleDown:61611,fiiArrowCircleRight:61838,fiiArrowDown:61813,fiiArrowUp:61814,fiiArrowLeft:61815,fiiArrowRight:61816,fiiBomb:61922,fiiBinoculars:61925,fiIPlug:61926,fiiSoccerBall:61923,fiiToggleOff:61956,fiiToggleOn:61957,fiiCircleUser:62142,fiiPlusInCircle:61525,fiiEye:61550,fiiEyeSlash:61552,fiiCheck:61452,fiiX:61453,fiiMinimize:62161,fiiRestore:62162,fiiSnowflake:62172,fiiCog:61459,fiiRoad:61464,fiiSliders:61918,fiiWrench:61613,fiiFilter:61616,fiiArrowsExpand:61541,fiiArrowsCollapse:61542,fiiPlus:61543,fiiMinus:61544,fiiAsterisk:61545,fiiCircledLeftArrow:61608,fiiHamburgerMenu:61641,fiiBulletList:61642,fiiNumberedList:61643,fiiTruck:61649,fiiDownArrowInFilledCircle:61611,fiiLightningBolt:61671,fiiPaste:61674,fiiDownloadCloud:61677,fiiUploadCloud:61678,fiiMD:61680,fiiCutlery:61685,fiiHollowDocument:61686,fiiFilledDocument:61787,fiiEUROCurrency:61779,fiiPoundCurrency:61780,fiiUSD:61781,fiiFilledLinedDocument:61788,fiiFillingInbox:61804,fiiDribble:61821,fiiPaw:61872,fiiAutomobile:61881,fiiCar:61881,fiiTaxi:61882,fiiBus:61959,fiiBed:62006,fiiTrain:62008,fiiSubway:62009,fiiDatabase:61888,fiiPDF:61889,fiiXDocument:61891,fiiCodePen:61899,fiiHollowDuplicateDocumentFlatCorners:62029,fiiHollowDuplicateDocument:61637,fiiSave:61639,fiiSolidOpenFolder:61564,fiiUpDownArrow:61565,fiiLeftChevrons:61696,fiiRightChevrons:61697,fiiUpChevrons:61698,fiiDownChevrons:61699,fiiUpChevron:61559,fiiDownChevron:61560,fiiLeftChevron:61523,fiiRightChevron:61524,fiiShoppingCart:61562,fii4Arrows:61511,fiiCheckBoxChecked:61510,fiiCheckBoxUnchecked:61590,fiiStepBackward:61512,fiiFastBackward:61513,fiiBackward:61514,fiiPlay:61515,fiiPause:61516,fiiStop:61517,fiiForward:61518,fiiFastForward:61520,fiiStepForward:61521,fiiCircledX:61532,fiiCircleChecked:61533,fiiBanned:61534,fiiLeftArrow:61536,fiiRightArrow:61537,fiiUpArrow:61538,fiiDownArrow:61539,fiiRedo:61470,fiiRotateRight:61470,fiiRefresh:61473,fiiHeadphones:61477,fiiRotateLeft:61666,fiiUndo:61666,fiiHistory:61914,fiiMinusInSquare:61767,fiiPlusInSquare:61846,fiiEraser:61741,fiiHollowTrash:61460,fiiHome:61461,fiiPaypalCC:61940,fiiSolidTrash:61944,fiiGraph:61953,fiiSpy:61979,fiiMapSignpost:62071,fiiMapHollow:62072,fiiMapFilled:62073,fiiCommenting:62074,fiiCommentingHollow:62075,fiiLink:61633,fiiBrokenLink:61735,fiiInfoI:61737,fiiScissors:61636,fiiBarcode:61482,fiiSingleTag:61483,fiiMultipleTags:61484,fiiLetterA:61489,fiiMoveTo:61584,fiiConvertJob:61556,fiiEdit:61508,fiiShareSquare:61509,fiiPencil:61504,fiiBoxedPencil:61771,fiiFileImage:61893,fiiDownload:61465,fiiUpload:61587,fiiAddPerson:62004,fiiRemovePerson:62005,fiiBattery4:62016,fiiBattery3:62017,fiiBattery2:62018,fiiBattery1:62019,fiiBattery0:62020,fiiArrowsRightLeft:61676,fiiArrowSortDown:61655,fiiArrowSortUp:61656,fiiArrowSortLeft:61657,fiiArrowSortRight:61658,fiiBell:61683,fiiZoomIn:61454,fiiZoomOut:61456,fiiFilledLetter:61664,fiiChevronLeft:61700,fiiChevronRight:61701,fiiChevronUp:61702,fiiChevronDown:61703,fiiDesktopMonitor:61704,fiiCellPhone:61707,fiiSolidBullet:61713,fiiHollowBullet:61708,fiiFloppyDisk:61639,fiiPlane:61554,fiiCalendar:61555,fiiClock:61463,fiiGenericCreditCard:61597,fiiFlag:61725,fiiProperties:61474,fiiListAlt:61474,fiiLock:61475,fiiUnlock:61596,fiiCalculator:61932,fiiSolitaryQuestionMark:61736,fiiSolitaryExclamationMark:61738,fiiSolitaryExclamation:61738,fiiFilledCircleX:61527,fiiCheckCircle:61528,fiiQuestionMarkInFilledCircle:61529,fiiLCaseIInFilledCircle:61530,fiiExclamationInFilledCircle:61546,fiiExclamationInFilledTriangle:61553,fiiSpinner:61712,fiiFilledCircle:61713,fiiBook:61485,fiiBookmark:61486,fiiHollowBookmark:61591,fiiPrinter:61487,fiiList:61498,fiiFullSun:61603,fiiHollowSun:61829,fiiCrescentMoon:61830,fiiMagnifyingGlass:61442,fiiStar:61445,fiiHollowStar:61446,fiiSolitaryPerson:61447,fiiCamera:61571,fiiKey:61572,fiiMultiCogs:61573,fiiEllipsis:61761,fiiHandshake:62133,fiiDarkEnvelope:62134,fiiHollowEnvelope:62135,fiiHollowUser:62144,fiiMultipleUsers:61632,fiiShower:62156,fiiBathtub:62157,fiiQuestionCircleO:62108,fiiBlind:62109,fiiHandPointRight:61604,fiiHandPointLeft:61605,fiiHandPointUp:61606,fiiHandPointDown:61607,fiiHourGlassEmpty:62032,fiiHourGlassTopHalf:62033,fiiHourGlassHalfAndHalf:62034,fiiHourGlassBottomHalf:62035,fiiHourGlassFull:62036,fiiHandRockOrGrab:62037,fiiHandStop:62038,fiiHandScissors:62039,fiiHandLizzard:62040,fiiHandSpock:62041,fiiHandPointer:62042,fiiHandPeace:62043,fiiCalendarPlus:62065,fiiCalendarMinus:62066,fiiCalendarEx:62067,fiiCalendarCheck:62068,fiiMapMarker:61505,fiiCaretDown:61655,fiiUnlink:61735,fiiFlashOff_Ionicon:61750+IoniconOffsetValues_Enum.Ionicon_Offset,fiiAndroidHand_Ionicon:62179+IoniconOffsetValues_Enum.Ionicon_Offset,fiiLockClosed_Ionicon:61952+IoniconOffsetValues_Enum.Ionicon_Offset,fiiLockOpened_Ionicon:62036+IoniconOffsetValues_Enum.Ionicon_Offset,fiiRefresh_Ionicon:61953+IoniconOffsetValues_Enum.Ionicon_Offset,fiiClock_Ionicon:62062+IoniconOffsetValues_Enum.Ionicon_Offset,fiiStopwatch_Ionicon:62205+IoniconOffsetValues_Enum.Ionicon_Offset,fiiSunBurst_Ionicon:62109+IoniconOffsetValues_Enum.Ionicon_Offset,fiiLessThan_Ionicon:61732+IoniconOffsetValues_Enum.Ionicon_Offset,fiiCalculator_Ionicon:62061+IoniconOffsetValues_Enum.Ionicon_Offset,fiiHeart_Ionicon:61761+IoniconOffsetValues_Enum.Ionicon_Offset,fiiVolumeHigh_Ionicon:62039+IoniconOffsetValues_Enum.Ionicon_Offset,fiiVolumeLow_Ionicon:62040+IoniconOffsetValues_Enum.Ionicon_Offset,fiiVolumeMedium_Ionicon:62041+IoniconOffsetValues_Enum.Ionicon_Offset,fiiVolumeMute_Ionicon:62042+IoniconOffsetValues_Enum.Ionicon_Offset,fiiArrowsOut_Ionicon:62046+IoniconOffsetValues_Enum.Ionicon_Offset,fiiArrowsIn_Ionicon:62055+IoniconOffsetValues_Enum.Ionicon_Offset,fiiPicture_Ionicon:61767+IoniconOffsetValues_Enum.Ionicon_Offset,fiiPictures_Ionicon:61768+IoniconOffsetValues_Enum.Ionicon_Offset,fiiPin_Ionicon:62118+IoniconOffsetValues_Enum.Ionicon_Offset,fiiSliderSelectorChecked_Ionicon:62292+IoniconOffsetValues_Enum.Ionicon_Offset,fiiSliderSelectorUnchecked_Ionicon:62293+IoniconOffsetValues_Enum.Ionicon_Offset,fiiPaperclip_Ionicon:62311+IoniconOffsetValues_Enum.Ionicon_Offset,fiiHollowCheckUnchecked_Ionicon:62322+IoniconOffsetValues_Enum.Ionicon_Offset,fiiHollowCheckChecked_Ionicon:62323+IoniconOffsetValues_Enum.Ionicon_Offset,fiiFilledCheckChecked_Ionicon:62324+IoniconOffsetValues_Enum.Ionicon_Offset,fiiDoubleCheck_Ionicon:62338+IoniconOffsetValues_Enum.Ionicon_Offset,fiiSingleCheck_Ionicon:62339+IoniconOffsetValues_Enum.Ionicon_Offset,fiiAddUser_Ionicon:62367+IoniconOffsetValues_Enum.Ionicon_Offset,fiiUser_Ionicon:62368+IoniconOffsetValues_Enum.Ionicon_Offset,fiiAndroidSunny_Ionicon:62384+IoniconOffsetValues_Enum.Ionicon_Offset,fiiAndroidWalk_Ionicon:62395+IoniconOffsetValues_Enum.Ionicon_Offset,fiiBaseballHollow_Ionicon:62429+IoniconOffsetValues_Enum.Ionicon_Offset,fiiBaseballFilled_Ionicon:62430+IoniconOffsetValues_Enum.Ionicon_Offset,fiiBasketballHollow_Ionicon:62431+IoniconOffsetValues_Enum.Ionicon_Offset,fiiBasketballFilled_Ionicon:62432+IoniconOffsetValues_Enum.Ionicon_Offset,fiiFileBox_Ionicon:62443+IoniconOffsetValues_Enum.Ionicon_Offset,fii_HollowSmallController_Ionicon:62520+IoniconOffsetValues_Enum.Ionicon_Offset,fii_FilledSmallController_Ionicon:62521+IoniconOffsetValues_Enum.Ionicon_Offset,fii_HollowLargeController_Ionicon:62522+IoniconOffsetValues_Enum.Ionicon_Offset,fii_FilledLargeController_Ionicon:62523+IoniconOffsetValues_Enum.Ionicon_Offset,fii_HollowSingleTag_Ionicon:62604+IoniconOffsetValues_Enum.Ionicon_Offset,fii_FilledSingleTag_Ionicon:62605+IoniconOffsetValues_Enum.Ionicon_Offset,fii_HollowMultiTag_Ionicon:62606+IoniconOffsetValues_Enum.Ionicon_Offset,fii_FilledMultiTag_Ionicon:62607+IoniconOffsetValues_Enum.Ionicon_Offset,fiiRainyOutline_Ionicon:62612+IoniconOffsetValues_Enum.Ionicon_Offset,fiiRainySolid_Ionicon:62613+IoniconOffsetValues_Enum.Ionicon_Offset,fii_LightEqualizer_Ionicon:62630+IoniconOffsetValues_Enum.Ionicon_Offset,fii_DarkEqualizer_Ionicon:62631+IoniconOffsetValues_Enum.Ionicon_Offset,fiiCircledMinusRemove_Ionicon:62563+IoniconOffsetValues_Enum.Ionicon_Offset,fiiSave_Foundation:61868+FoundationIconsOffsetValues_Enum.FoundationIcons_Offset,fiiBookmark_Foundation:61725+FoundationIconsOffsetValues_Enum.FoundationIcons_Offset,fiiMan_SZ:59648+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiManAndCart_SZ:59649+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiManAndCashRegister_SZ:59650+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiCrate_SZ:59651+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiOpenDoor_SZ:59652+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiRalphieSolid_SZ:59653+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiCrateSolid_SZ:59654+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiManHead_SZ:59669+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiRalphie_SZ:59670+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiKong_SZ:59671+SZIconsOffsetValues_Enum.SZIcons_Offset,fiiInsertRow:65+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiSun:66+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiInclude:67+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiNonDrawn_MW:69+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiColorOptionReorder_MW:70+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiAreaReorder_MW:71+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiArea_MW:72+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiColorOption_MW:73+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiZoomPlus_MW:74+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiZoomMinus_MW:75+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiZoomReset_MW:76+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiPan_MW:77+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiText_MW:78+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiRelease_MW:79+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiReplace_MW:80+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiEditMultiple_MW:81+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiSearchCost_MW:82+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiSaw_MW:83+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiSplitChild_MW:84+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiSplitParent_MW:85+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiSplitWithoutParent_MW:86+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiSplitSlab_MW:87+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiFilterPhases_MW:88+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiPageBreak_MW:89+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset,fiiRoundingRuler_MW:90+MorawareIconsOffsetValues_Enum.MorawareIcons_Offset};function getRawFontId(a){if(a<=FontAwesomeBoundaries_Enum.FontAwesome_Last){return a}if(a>=IoniconBoundaries_Enum.Ionicon_First&&a<=IoniconBoundaries_Enum.Ionicon_Last){return a-IoniconOffsetValues_Enum.Ionicon_Offset}if(a>=FoundationIconsBoundaries_Enum.FoundationIcons_First&&a<=FoundationIconsBoundaries_Enum.FoundationIcons_Last){return a-FoundationIconsOffsetValues_Enum.FoundationIcons_Offset}if(a>=SZIconsBoundaries_Enum.SZIcons_First&&a<=SZIconsBoundaries_Enum.SZIcons_Last){return a-SZIconsOffsetValues_Enum.SZIcons_Offset}if(a>=MorawareIconsBoundaries_Enum.MorawareIcons_First&&a<=MorawareIconsBoundaries_Enum.MorawareIcons_Last){return a-MorawareIconsOffsetValues_Enum.MorawareIcons_Offset}return a}function getFontNamePrefix(a){if(a<=FontAwesomeBoundaries_Enum.FontAwesome_Last){return"FontAwesome"}if(a>=IoniconBoundaries_Enum.Ionicon_First&&a<=IoniconBoundaries_Enum.Ionicon_Last){return"Ionicon"}if(a>=FoundationIconsBoundaries_Enum.FoundationIcons_First&&a<=FoundationIconsBoundaries_Enum.FoundationIcons_Last){return"Foundation"}if(a>=SZIconsBoundaries_Enum.SZIcons_First&&a<=SZIconsBoundaries_Enum.SZIcons_Last){return"SZFont"}if(a>=MorawareIconsBoundaries_Enum.MorawareIcons_First&&a<=MorawareIconsBoundaries_Enum.MorawareIcons_Last){return"MorawareIcons"}return"FontAwesome"};var MWDateTime=function(){function m(s){var v=s.date,t=s.dateFormatString,u=t;if(!v){return""}if(!u){u="m/d/yyyy"}u=u.replace(/yyyy/,v.getFullYear());u=u.replace(/yy/,v.getFullYear().toString().substring(2,4));u=u.replace(/mm/,(v.getMonth()<9?"0":"")+(v.getMonth()+1));u=u.replace(/MM/,(v.getMonth()<9?"0":"")+(v.getMonth()+1));u=u.replace(/m/,v.getMonth()+1);u=u.replace(/M/,v.getMonth()+1);u=u.replace(/dd/,(v.getDate()<10?"0":"")+v.getDate());u=u.replace(/d/,v.getDate());return u}function a(s){return""+((s<10?"0":"")+s)}function i(s){if(s&&s.getTime()<=new Date(2079,5,6).getTime()&&s.getTime()>=new Date(1900,0,1).getTime()){return s}}function k(s){return s}function b(I){var x=I.dateString,A=I.dateFormatString,E=I.limitToShortDate;if(!x){return null}x=trim(x);if(""===x){return null}var t="^(\\d+)[- /.](\\d+)[- /.](\\d+)",H="^(\\d+)[- /.](\\d+)",u="[- /.]",s=new Date(),D=s.getMonth()+1,C=s.getDate(),B=s.getFullYear(),z=0,K,w=E?i:k;if(x.match(t)){K=x.search(u);D=parseInt(x.substring(z,K),10);z=K+1;K=z+x.substring(z).search(u);C=parseInt(x.substring(z,K),10);z=K+1;B=parseInt(x.substring(z),10)}else{if(x.match(H)){K=x.search(u);D=parseInt(x.substring(z,K),10);z=K+1;C=parseInt(x.substring(z),10)}else{return null}}if(D>=1000&&C<=12&&C>=1&&B<=31&&B>=1){return w(new Date(D,C-1,B))}if(B<=50){B=2000+B}else{if(B<=99){B=1900+B}}var J=(A.toLowerCase().indexOf("d")12&&D<=31&&C>=1&&C<=12){J=true}else{if(D>=1&&D<=12&&C>12&&C<=31){J=false}}var G,y,v;if(J){v=D;y=C;G=B}else{y=D;v=C;G=B}var F;if(E){if(v<32&&y<13&&G<2080&&G>1899){F=new Date(G,y-1,v)}}else{if(v<32&&y<13){F=new Date(G,y-1,v)}}return w(F)}function e(z){var y=z.date,u=z.omitLeadingZeros,s;if(y){var x=y.getFullYear(),A=y.getMonth()+1,w=y.getDate(),v=""+(u?A:a(A)),t=""+(u?w:a(w));s=x+"-"+v+"-"+t}else{s=""}return s}function f(t){var u=t.dateString,w=t.dateFormatString,s=t.limitToShortDate,v=t.omitLeadingZeros,x=MWDateTime.parseDateString({dateString:u,dateFormatString:w,limitToShortDate:s}),y=MWDateTime.getCanonicalDateString({date:x,omitLeadingZeros:v});return y}function p(s){s=s||new Date();return new Date(s.getFullYear(),s.getMonth()+1,1)}function g(s){s=s||new Date();return new Date(s.getFullYear(),s.getMonth(),s.getDate()-1)}function c(s){return g(p(s))}function r(s){s=s||new Date();return new Date(s.getFullYear(),s.getMonth(),1)}function n(u){var s=u.hour,v=u.minute,t=a(s||0),w=a(v||0);return t+":"+w}function q(s){return s>12?s-12:s}function o(s){return s>0?s:12}function d(w){var t=w.hour,x=w.minute,v=w.forceIncludeMinutes,u=w.padAMPM,y,s;if(t<12){y=o(t);s="am"}else{y=q(t);s="pm"}if(x||v){y+=":"+a(x)}y+=(u?" ":"")+s;return y}function l(J){var L=J.value,I=J.resultValueHolder,y=J.calMinSchedHour,C=J.calMaxSchedHour,t=L;I.message="";if(!t){return t}var v=0,G=0,N=new RegExp("^\\s*\\d+\\s*((a|p)m?)?\\s*$","i"),u=new RegExp("^\\s*\\d+\\:\\d+\\s*((a|p)m?)?\\s*$","i"),O=new RegExp("\\d+","g"),K=t.match(O),B=N.test(t),D=u.test(t),x=t.toLowerCase().indexOf("a")>-1,z=t.toLowerCase().indexOf("p")>-1;t=null;if(B||D){v=parseInt(K[0],10)}if(!(B||D)){I.message="Expected a value such as:\n\n\t8:30am\n\t3p\n\t13:42";return null}if(K.length>1){G=parseInt(K[1],10)}var s=d({hour:y,minute:0,forceIncludeMinutes:0,padAMPM:1}),w=d({hour:C,minute:59,forceIncludeMinutes:1,padAMPM:0}),A="Only times from "+s+" - "+w+" are supported";if(v<0||v>23){I.message=A;return null}if((x||z)&&(v<0||v>12)){I.message="When specifying am/pm, the hours range from 1 - 12";return null}if(G>59||G<0){I.message="Minutes range from 00 - 59";return null}if(x&&(v0||v===12&&02){I.message="Invalid minute specification. (Please only use two digits for the minutes)";return null}var M=K[0].substring(0,1)==="0";if(z||x||M){if(z&&v!==12){v+=12}if(x&&v===12){v=0}if(vC){I.message=A;return null}}else{var E=v===12?0:v;if(E>C){I.message=A;return null}if(EC){I.message=A;return null}}else{var H=v+(v<12?12:0);if(E>11){if(H>C){I.message=A;return null}}else{if(H<=C){I.message="Ambiguous time. Please specify am or pm";I.isAmPmAmbiguous=true;return null}}v=E}}t=d({hour:v,minute:G,forceIncludeMinutes:1,padAMPM:0});I.hours=v;I.minutes=G;return t}function j(u){var x=u.hours,s=u.minutes,v=u.suppressConvert30MinutesToHalfHour,t=!v,w;if(!x){w=s+" minute"+(s==1?"":"s")}else{if(t&&s===30){w=x+".5 hours"}else{w=x+" hour"+(x>1?"s":"");if(s){w+=" "+s+" minute"+(s>1?"s":"")}}}return w}function h(A){var z=A.value,D=A.resultValueHolder;D.message="";if(!z){return z}var v=0,x=0,t=new RegExp("^\\s*\\d+\\s*ho?u?r?s?\\s*(\\d+\\s*m?i?n?u?t?e?s?)?\\s*$","i"),C=new RegExp("^\\s*\\d+\\s*mi?n?u?t?e?s?$","i"),F=new RegExp("^\\s*\\d+\\:\\d+\\s*$"),E=new RegExp("^\\s*\\d+\\.5\\s*h?o?u?r?s?\\s*$"),y=new RegExp("\\d+","g"),u=z.match(y),B=t.test(z),w=F.test(z),s=E.test(z);if(s){v=parseInt(u[0],10);x=30}else{if(B||w){v=parseInt(u[0],10);if(u.length>1){x=parseInt(u[1],10)}x=60*v+x;v=(x-x%60)/60;x=x%60}else{if(C.test(z)){x=parseInt(u[0],10);if(x>18*60){D.message="Duration can be at most 18 hours.";z=null}else{v=(x-x%60)/60;x=x%60}}else{D.message="Expected a value such as:\n\n\t2h\n\t25m\n\t2h25\n\t2:25\n\t2 hours 25 minutes";z=null}}}if(z!==null){if((v>18)||(x>59)||(v==18&&x>0)){D.message="Duration can be at most 18 hours.";z=null}else{if(v===0&&x===0){D.message="Duration can not be zero.";z=null}}}if(z!==null){if(D){D.hours=v;D.minutes=x}z=j({hours:v,minutes:x})}return z}return{getLocalDateString:m,shortDatePassThroughFilter:i,parseDateString:b,getCanonicalDateString:e,convertDateStringToUrlParam:f,getFirstDayOfMonth:r,getLastDayOfMonth:c,getPreviousDay:g,getFirstDayOfNextMonth:p,get24HourTimeString:n,getAMPMTimeStringFrom24Hour:d,canonicalizeTimeStringOrNullIfInvalid:l,getDurationDisplayString:j,canonicalizeDurationOrNullIfInvalid:h}}();function getObj(b,a){var c;if(document.getElementById){c=document.getElementById(b)}else{if(document.all){c=document.all[b]}else{if(document.layers){c=document.layers[b]}}}if(a&&!c){alert('Object not found for id="'+b+'"')}return c}function mjtElemData(c,d,a){var b="objData-"+d;if(arguments.length>2){c[b]=a}else{return c[b]}}function isQuotaExceeded(b){var a=false;if(b){if(b.code){switch(b.code){case 22:a=true;break;case 1014:if(b.name==="NS_ERROR_DOM_QUOTA_REACHED"){a=true}break}}else{if(b.number===-2147024882){a=true}}}return a}function mjtLSData(b,a){if(arguments.length>1){try{localStorage.setItem(b,a)}catch(c){if(isQuotaExceeded(c)){localStorage.clear();localStorage.setItem(b,a)}else{throw c}}}else{return localStorage[b]}}function mjtLSRemove(a){localStorage.removeItem(a)}function mjtLSForEach(a){Object.keys(localStorage).forEach(a)}function getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a===-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}function getCookie(d){var b=d+"=",f=b.length,a=document.cookie.length,e=0;while(e2?a[2]:null,g=h>3?a[3]:null,d=h>4?a[4]:null,f=h>5?a[5]:false;document.cookie=c+"="+escape(e)+(b===null?"":"; expires="+b.toGMTString())+(g===null?"":"; path="+g)+(d===null?"":"; domain="+d)+(f?"; secure":"")}function delCookie(a){document.cookie=a+"="+escape(a)+"; expires=Fri, 31 Dec 1990 23:59:59 GMT;"}function cancelEvent(b,a){if(window.event){window.event.cancelBubble=true;if(a&&window.event.preventDefault){window.event.preventDefault()}}else{if(b){b.stopPropagation();if(a||b.altKey||b.ctrlKey||b.shiftKey){b.preventDefault()}}}return false}function mjtGetAncestorWithClass(a,c){var b=null,d=a;while(d){if(d.classList.contains&&d.classList.contains(c)){b=d;break}if(d.tagName==="BODY"){break}d=d.parentNode}return b}function mjtGetAncestorWithTag(a,d){var b=null,c=a;while(c){if(c.tagName===d){b=c;break}c=c.parentNode}return b}function mjtGetBodyPosIfPixels(){var c,a=document.body.style.top,b=document.body.style.left;if(a.length>2&&b.length>2&&a.substring(a.length-2)==="px"&&b.substring(b.length-2)==="px"){a=a.substring(0,a.length-2);c=[parseInt(b,10),parseInt(a,10)]}return c}function mjtGetBodyPosIfFixedElement(b){if(!window.getComputedStyle){return}var a=window.getComputedStyle(b,null),c;if("fixed"===a.position){if(b===document.body||window.getComputedStyle(document.body,null).position==="fixed"){c=mjtGetBodyPosIfPixels()}return c}}function mjtGetFixedBodyPosPixels(){return mjtGetBodyPosIfFixedElement(document.body)}function mjtPageOffset(){var c,b,a=mjtGetFixedBodyPosPixels();if(window.pageYOffset||window.pageXOffset){c=window.pageXOffset;b=window.pageYOffset}else{if(document.documentElement&&(document.documentElement.scrollTop||document.documentElement.scrollLeft)){c=document.documentElement.scrollLeft;b=document.documentElement.scrollTop}else{if(document.body){c=document.body.scrollLeft;b=document.body.scrollTop}}}if(a&&c!==undefined){c-=a[0];b-=a[1]}return[c,b]}function mjtPageYOffset(){return mjtPageOffset()[1]}function mjtPageXOffset(){return mjtPageOffset()[0]}function saveScrollPos(){var a=getObj("dialogCover"),d=a&&a.getAttribute("data-showing"),c,e,b;if(d){c=a.getAttribute("data-scrollLeft");e=a.getAttribute("data-scrollTop");if(c!==undefined){b=[c,e]}}if(!b){b=mjtPageOffset()}setCookie("tmpScrollTop",b[1]);setCookie("tmpScrollLeft",b[0])}function setFocus(b){try{if(b){b.focus();if(b.select){b.select()}}}catch(a){}};var pageLoaded=false,g_objPicker=null,g_objPickerRelativePos=null,g_objPickerRelativeCenter=false,g_showPickerTimer=null,g_positionPickerTimer=null,g_objCurrDialog,oPopup=null,g_isDoubleClickEvent=false,g_bSkipNavWarning=false,g_ignoreImmediateClick,g_timeoutResumeObservingClick;function isUIV2(){return typeof g_isUIV2!=="undefined"&&g_isUIV2}function isPhone(){return false}function hidePicker(){var a;if(g_objPicker!==null){if(g_objPicker.style.visibility!=="hidden"){a=1;g_objPicker.style.visibility="hidden";g_objPicker.style.zIndex=-1;g_objPicker.style.top=0;g_objPicker.style.left=0;g_objPicker=null;g_objPickerRelativePos=null;g_objPickerRelativeCenter=false}}if(typeof hideTypeAheadDiv==="function"){hideTypeAheadDiv()}return a}function removeNode(a){if(!a){return}if(a.removeNode){a.removeNode(true)}else{if(a.parentNode){a.parentNode.removeChild(a)}}}function doesElementHaveFixedNonBodyAncestor(b){var c=getIsFirefox();var a=b;while(a){if(a.offsetParent&&!(c&&a.offsetParent.nodeName==="BODY")){a=a.offsetParent}else{if(!(a.nodeName==="BODY"||a.nodeName==="HTML")){if(window.getComputedStyle(a,null).position==="fixed"){return true}}break}}return false}function posTop(c,g,d,b){if(!arguments.length){c=this}var f=c.offsetTop,a=c.offsetParent;while(a!==null){f+=a.offsetTop;var e=mjtGetBodyPosIfFixedElement(a);if(e){if(!d){f-=e[1]}break}a=a.offsetParent}if(g){a=c.parentNode;while(a){if(a.nodeName!=="BODY"&&a.nodeName!=="HTML"){f-=a.scrollTop?a.scrollTop:0}a=a.parentNode}}if(b&&doesElementHaveFixedNonBodyAncestor(c)){if(window.scrollY){f+=window.scrollY}else{if(getIsOldIE()&&window.pageYOffset){f+=window.pageYOffset}}}return f}function mjtIsElementPartOfDialog(a){return mjtGetAncestorWithClass(a,"uiv2dialogDiv")}var timedMsgId=null,timedMsgElement=null;function hideTimedMessage(){removeNode(timedMsgElement);timedMsgElement=null;if(typeof hideWorking==="function"){hideWorking()}}function displayTimedMessageP(b){var a=b.msgHTML,d=b.messageTimeoutMS||0,f=b.cssClassPrefix||"",c="uiv2";removeNode(timedMsgElement);var e=null;timedMsgElement=document.createElement("div");timedMsgElement.className=f+c+"timedMessage";e=timedMsgElement;document.body.appendChild(timedMsgElement);timedMsgElement.style.display="block";a='
Please Wait...
&#'+FontIconId_Enum.fiiSpinner+";"+a+"
";e.innerHTML=a;if(timedMsgId){clearTimeout(timedMsgId)}timedMsgId=null;if(d&&d>0){timedMsgId=setTimeout(hideTimedMessage,d)}}function displayTimedMessage(a,b){displayTimedMessageP({msgHTML:a,messageTimeoutMS:b})}function getEventElement(a){var b=null;if(window.event){b=window.event.srcElement}else{if(a){b=a.target}}while(b){if(b.nodeType===1){return b}else{b=b.parentNode}}}function checkAttribute(a,b){while(a){if(!a.getAttribute){return null}if(a.getAttribute(b)!==null){return a}a=a.parentNode}return null}var g_lastUserActivityTime=new Date();function doMouseover(b){g_lastUserActivityTime=new Date();var c=getEventElement(b),a=checkAttribute(c,"mjthover");if(a!==null){var d=a.getAttribute("mjthover");a.className=d}cancelEvent(b)}function doMouseout(b){g_lastUserActivityTime=new Date();var c=getEventElement(b),a=checkAttribute(c,"mjtclass");if(a!==null){var d=a.getAttribute("mjtclass");a.className=d}cancelEvent(b)}function doMouseup(b){g_lastUserActivityTime=new Date();var c=getEventElement(b),a;if(g_objPicker!==null){a=checkAttribute(c,"mjtpicker");if(a===null){hidePicker()}}hideMappingFOOnMouseupIfNecessary(c)}function eventIsDialogOrPopup(a){var c=0,b=a;while(b){if(b===g_objCurrDialog||b===oPopup){c=1;break}b=b.parentNode}return c}function setIgnoreImmediateClick(a){g_ignoreImmediateClick=1;if(g_timeoutResumeObservingClick){clearTimeout(g_timeoutResumeObservingClick)}g_timeoutResumeObservingClick=setTimeout(function(){g_ignoreImmediateClick=0},0)}function doClick(event){g_lastUserActivityTime=new Date();if(g_ignoreImmediateClick){return}var theElement=getEventElement(event);if(event){if(event.button===2){cancelEvent();return}}if(typeof hideTypeAheadDivIfNotTypeAheadDiv==="function"){hideTypeAheadDivIfNotTypeAheadDiv(theElement)}var eventElement=checkAttribute(theElement,"mjtclick");if(eventElement!==null){hideContextMenu();if(theElement!==eventElement&&"1"===eventElement.getAttribute("mjtdirectonly")){hideContextMenu();return}if(isDialogShowing()&&!eventIsDialogOrPopup(eventElement)){return}g_isDoubleClickEvent=false;eval(eventElement.getAttribute("mjtclick"));cancelEvent(event)}else{hideContextMenu()}}function stringIsDigitsOnly(a){return new RegExp("^\\d+$").test(a)}function stringStartsWith(c,b,d){var a=false;if(c&&b&&c.length>=b.length){if(d){c=c.toLowerCase();b=b.toLowerCase()}a=b===c.substring(0,b.length)}return a}function stringEndsWith(b,d,c){var a=false;if(b&&d&&b.length>=d.length){if(c){b=b.toLowerCase();d=d.toLowerCase()}a=d===b.substring(b.length-d.length)}return a}function buildUrlPrefixWithParamSeparator(a){return a+(stringEndsWith(a,"?")?"":"&")}function checkForAndHandleSessionTimeoutIfNecessary(a){if(stringStartsWith(a,"Session_Timeout:")){if(typeof handleSessionTimeout==="function"){var b=a.substring(16);return handleSessionTimeout(b)}}return 0}function checkResponseForError(c,b){hideTimedMessage();if(stringStartsWith(c,"Session_Timeout:")){var f=c.substring(16),a="";if(typeof handleSessionTimeout==="function"){if(handleSessionTimeout(f)){return false}}switch(f){case""+SessionKillReason_Enum.skrActivelyLoggedOut:a="You must log back in.";break;case""+SessionKillReason_Enum.skrNewLogin:a="You must log back in here.";break;case""+SessionKillReason_Enum.skrAdminKilled:a="Your session has been terminated and you must log back in.";break;default:a="You must log in.";break}alert(a);if(b!==false){if(typeof hideDialog==="function"){hideDialog()}if(typeof refreshPageShowingMessage==="function"){refreshPageShowingMessage()}else{window.location=window.location}}return false}if(c==="Insufficient_Priviledges"){alert("You do not have authority to perform this function."+String.fromCharCode(10)+"Please contact your administrator for more information");return false}var d=new RegExp("errtable","i");if(d.test(c)){var e=window.open("","Error_Win","height=400px, width=600px, dependent, center=yes, help=no, resizable=yes, status=no, scrollbars=yes");if(!e){alert(c)}else{e.document.write("");e.document.write("Remote Scripting Error");e.document.writeln("");e.document.writeln(c);e.document.writeln("");e.focus()}return false}return true}function refreshPageAndScrollPos(){saveScrollPos();displayTimedMessage("Refreshing page...");g_bSkipNavWarning=true;window.location=window.location}function rsCallbackRefreshPageAndScrollPos(c,b,a){if(checkResponseForError(c)){refreshPageAndScrollPos()}else{if(a&&a.onErrorFocusObject){setFocus(a.onErrorFocusObject)}}}function isCalendarPopup(a){return a.className.indexOf("calPopDialog")!==-1}function isShopPagePopup(b){var a=false;if(Object.prototype.hasOwnProperty.call(window,"g_isShopUserPage")){a=g_isShopUserPage}return a}function asyncShowPicker(){if(g_showPickerTimer){clearTimeout(g_showPickerTimer)}g_showPickerTimer=null;var a=getObj("pickerPopUp");if(a){a.style.visibility="visible";a.style.zIndex=!isDialogShowing()&&isCalendarPopup(a)&&!isShopPagePopup(a)?25:507;g_objPicker=a;if(a.objFocusItem){setFocus(a.objFocusItem);a.objFocusItem=null}}}function posLeft(c,b,d){if(!arguments.length){c=this}var f=c.offsetLeft;var a=c.offsetParent;while(a!==null){f+=a.offsetLeft;var e=mjtGetBodyPosIfFixedElement(a);if(e){if(!d){f-=e[0]}break}a=a.offsetParent}if(b){a=c.parentNode;while(a){if(a.nodeName!=="BODY"&&a.nodeName!=="HTML"){f-=a.scrollLeft?a.scrollLeft:0}a=a.parentNode}}return f}function getWidthOfText(b,d,c){var f=document.createElement("span");f.style.fontSize=c;f.style.fontFamily=d;f.style.whiteSpace="nowrap";f.innerHTML=b.nodeType&&b.nodeType===3?b.nodeValue:b;document.body.appendChild(f);var a=f.offsetWidth;document.body.removeChild(f);return a}function pageWidth(){if(document.documentElement&&document.documentElement.clientWidth){if(window.innerWidth&&window.innerWidthw){p=18;var C=parseFloat(k.style.borderWidth);if(isNaN(C)){C=0}x-=p+C+2;k.style.overflow="auto";k.style.height=w+"px"}k.style.width=q+p+"px";if(t+k.offsetWidth>rightOfVisibleScreen()){t=rightOfVisibleScreen()-k.offsetWidth}if(l0&&r<1){t+=r}k.style.top=l+"px";k.style.left=t+"px";scrollTypeaheadSelectionIntoViewIfNecessary();if(isDialogShowing()){if(g_isMobile){k.style.top=l-document.body.scrollTop+"px"}var m=isElementVisible(B),y=g_objCurrDialog&&g_objCurrDialog.querySelector?g_objCurrDialog.querySelector(".uiv2DialogHeaderRow"):null,v=g_objCurrDialog&&g_objCurrDialog.querySelector?g_objCurrDialog.querySelector("mainDialogButtonRow"):null;if(v){v=v.parentElement}if(!m||y&&B.getBoundingClientRect().bottomv.getBoundingClientRect().top){k.style.visibility="hidden"}}}function j(m,p,k){var l=posTop(p,true,false,true),o=l+p.offsetHeight+(k?-(m.offsetHeight+p.offsetHeight)/2:0),n=posLeft(p,true,false)+(k?(p.offsetWidth-m.offsetWidth)/2:0);if(n<5){n=5}if(o+m.offsetHeight>bottomOfVisibleScreen()){o=bottomOfVisibleScreen()-m.offsetHeight}if(n+m.offsetWidth>rightOfVisibleScreen()){n=rightOfVisibleScreen()-m.offsetWidth}if(obottomOfVisibleScreen()){n=k-l.offsetHeight}if(m+l.offsetWidth>rightOfVisibleScreen()){m=rightOfVisibleScreen()-l.offsetWidth}if(n/g,">").replace(/\"/g,""")}function htmlMultilineEncode(a){return a.replace(/\&/g,"&").replace(/\/g,">").replace(/\"/g,""").replace(/\n/g,"
")}function buildStyledCurrencyAmount(b){var a=b.formattedNumericValue,d=b.currencySymbol||"$",c;if(null===a||undefined===a){a=""}if(typeof a!=="string"){a=a.toString()}if(a){if(stringStartsWith(a,"-")){c='('+htmlEncode(d)+a.substring(1)+")"}else{c=d+a}}else{c=""}return c}function get24HourTime(b,a){return MWDateTime.get24HourTimeString({hour:b,minute:a})}function getAMPMTime(b,a){return MWDateTime.getAMPMTimeStringFrom24Hour({hour:b,minute:a,forceIncludeMinutes:1,padAMPM:0})}function getDurationDisplayString(b,a){return MWDateTime.getDurationDisplayString({hours:b,minutes:a})}function canonicalizeDurationOrNullIfInvalid(a,b){return MWDateTime.canonicalizeDurationOrNullIfInvalid({value:a,resultValueHolder:b})}function getTimeStringFrom24Hour(d,a,b,c){return MWDateTime.getAMPMTimeStringFrom24Hour({hour:d,minute:a,forceIncludeMinutes:b,padAMPM:c})}function canonicalizeTimeOrNullIfInvalid(a,b){return MWDateTime.canonicalizeTimeStringOrNullIfInvalid({value:a,resultValueHolder:b,calMinSchedHour:g_calMinSchedHour,calMaxSchedHour:g_calMaxSchedHour})}var SecuredObjectAccess=function(){function a(h,j,i){if(i&&h&&h>0&&h=48&&g<=57){k=g-48}else{if(g>64&&g<87){k=g-55}}return((k&j)!==0)}return false}function e(q){var h=q.isJTAdmin,s=q.isCGAdmin,l=q.isNVAdmin,k=q.jtSecuredObject,j=q.cgSecuredObject,o=q.nvSecuredObject,m=q.jtSecurityProfile,r=q.cgSecurityProfile,i=q.nvSecurityProfile,n=q.accessRight,g=n;if(null!==k){if(h){var p=k==JTSecuredObject_Enum.mjtCGQuote&&(((n&AccessRight_Enum.mjtARCreate)==AccessRight_Enum.mjtARCreate)||(n&AccessRight_Enum.mjtARDelete)==AccessRight_Enum.mjtARDelete);if(!p){return true}}}if(null!==j){if(s){return true}}if(null===j){switch(k){case JTSecuredObject_Enum.mjtViews:j=CGSecuredObject_Enum.cgsoViews;break;case JTSecuredObject_Enum.mjtCGEmailQuote:j=CGSecuredObject_Enum.cgsoCGEmailQuote;break;case JTSecuredObject_Enum.mjtCGQuote:j=CGSecuredObject_Enum.cgsoCGQuote;break;case JTSecuredObject_Enum.mjtCGQuoteFiles:j=CGSecuredObject_Enum.cgsoCGQuoteFiles;break;case JTSecuredObject_Enum.mjtAccount:case JTSecuredObject_Enum.mjtAccountAddress:j=CGSecuredObject_Enum.cgsoAccount;break;case JTSecuredObject_Enum.mjtAccountSettings:j=CGSecuredObject_Enum.cgsoAccountSettings;break;case JTSecuredObject_Enum.mjtSystemSettings:j=CGSecuredObject_Enum.cgsoSystemSettings;o=NVSecuredObject_Enum.nvsoSystemSettings;break;case JTSecuredObject_Enum.mjtAccountContacts:j=CGSecuredObject_Enum.cgsoAccount;break;case JTSecuredObject_Enum.mjtAccountFiles:j=CGSecuredObject_Enum.cgsoAccount;if(n!=AccessRight_Enum.mjtARRead){g=AccessRight_Enum.mjtARUpdate}break;case JTSecuredObject_Enum.mjtCGOrderAccounting:j=CGSecuredObject_Enum.cgsoOrderAccounting;break;case JTSecuredObject_Enum.mjtAccountIssues:j=CGSecuredObject_Enum.cgsoAccount;break;case JTSecuredObject_Enum.mjtSalespeople:j=CGSecuredObject_Enum.cgsoSalespeople;break}}if(null!==j){if(s){return true}}if(l&&null!==o){return true}if(a(k,n,m)){return true}if(a(j,g,r)){return true}if(a(o,n,i)){return true}return false}function b(i){var k=i.jtSecuredObject,j=i.cgSecuredObject,h=i.nvSecuredObject,g=i.accessRight;return e({isJTAdmin:jtPrivAdmin,isCGAdmin:cgPrivAdmin,isNVAdmin:nvPrivAdmin,jtSecuredObject:k===undefined?null:k,cgSecuredObject:j===undefined?null:j,nvSecuredObject:h===undefined?null:h,accessRight:g,jtSecurityProfile:g_JTAccessRights,cgSecurityProfile:g_CGAccessRights,nvSecurityProfile:g_NVAccessRights})}function d(g,h){return b({jtSecuredObject:g,accessRight:h})}function c(g,h){return b({cgSecuredObject:g,accessRight:h})}function f(g,h){return b({nvSecuredObject:g,accessRight:h})}return{jtHasAccess:d,cgHasAccess:c,nvHasAccess:f,checkSecurityProfileString:a}}();function jtHasAccess(a,b){return SecuredObjectAccess.jtHasAccess(a,b)}function cgHasAccess(a,b){return SecuredObjectAccess.cgHasAccess(a,b)}function nvHasAccess(a,b){return SecuredObjectAccess.nvHasAccess(a,b)}function checkSecurityProfileString(a,c,b){return SecuredObjectAccess.checkSecurityProfileString(a,c,b)}function hasJobFormsAccess(a){if(jtHasAccess(JTSecuredObject_Enum.mjtJobForms,a)){return !isBasicEdition}else{return false}}function iterateElementsByCSSSelector(d){var e=d.cssSelector,f=d.ancestor,b=d.fnProcessTargetedElement,a=b&&e?f?f.querySelectorAll(e):document.querySelectorAll(e):"",c,g;if(b&&e){for(c=0;!g&&cb;a--){if(c.charAt(a)!=" "&&c.charAt(a)!="\\t"){break}}return c.substring(b,a+1)}function removeClass(e,b){var d=e.indexOf(b);if(d>-1){var c=e.substring(0,d);var a=e.substring(d+b.length);e=trim(trim(c)+" "+trim(a))}return e}function setOrRemoveClass(e,g,d){var c=" "+e.className+" ",b=c.indexOf(" "+g+" "),f,a;if(b>-1&&d){f=trim(c.substring(0,b));a=trim(c.substring(b+g.length+2,c.length));c=trim(f+" "+a)}else{if(b<0&&!d){c=trim(c+g)}else{return}}e.className=c}function setFocusToCompoundSelectionValue(a,b){ClientDialogModule.setFocusToCompoundSelectionValue({nameField:a,selectField:b})}function getCompoundSelectionValue(b,a){return ClientDialogModule.getCompoundSelectionValue({idField:b,selectField:a})}function getCompoundSelectionDisplayValue(c,b,a){return ClientDialogModule.getCompoundSelectionDisplayValue({idField:c,selectField:b,nameField:a})}function setCurrentSchedTime(g,h){var a=getObj(g)[h];if(a&&!a.disabled){var b=new Date();var i=b.getHours();var d=b.getMinutes();var c=(i<10?"0":"")+i+":"+(d<10?"0":"")+d;var e=(i>12?i-12:i)+":"+(d<10?"0":"")+d+(i<12?"am":"pm");a.value=e;var f=a.form[a.form.id+"."+h+".id"];if(f){f.value=c}setFocus(a)}}function SetDropdownSelection(c,d,b){var a=getObj(c)[d];if(a&&!a.disabled){var e=0;for(e=0;e'+htmlMultilineEncode(c)+"",d,a.subdialog,b,a.subdialogDismisalFocusFieldId)}else{alert(c);if(e){setFocus(e)}}}function getLocalDateString(a){return MWDateTime.getLocalDateString({date:a,dateFormatString:dateFormatString})}function FormValidator(){var a=this;a.ModifiedFieldIds="";a.ModifiedFieldValues="";a.IgnoreFieldValue=null;a.BuildClientDlgParams=function(d,f,e){var c={subdialog:f?1:0,subdialogDismisalFocusFieldName:d?d:0,subdialogDismisalFocusFieldId:e};return c};a.ValidateTextField=function(r){var i=r.textFieldElem,n=r.fieldDisplayName,g=r.subdialogDismisalFocusFieldName,q=r.isRequiredField,e=r.maxTextLength,k=i?i.name:"",f=n||k||"Field",p=g||k,d=this.BuildClientDlgParams(p,1),m="",c=false;if(i){var h=i.value,l=h.length,j=trim(h);if(q&&!j){m="Please enter a "+f+" value."}else{if(e&&l>e){m="You've used "+l+", however "+f+" can be at most "+e+" letters."}else{c=true}}}else{var o=n?' "'+n+'"':"";m="Missing"+o+" field for text field validation!"}if(!c){showErrorMessageAndFocus(m,"Missing Field",i,d)}return c};a.ValidateTextAreaLineLengths=function(k){var i=k.textArea,e=k.maxLineLength,g=k.dismisalFocusFieldName||i.name,c=k.pluralObjectNameForErrorMessage||"lines",l=trim(i.value),f=l.split("\n"),d=f.filter(function(m){return m.length>e}),j=d.length>0,h="One or more "+c+" are longer than "+e+" characters";if(j){showErrorMessageAndFocus(h,"Too long",i,{subdialog:1,subdialogDismisalFocusFieldName:g});return false}return true};a.ValidateRequiredField=function(f,d,c){if(!f){showErrorMessageAndFocus("Missing field for required field validation!\n\n"+d,"Missing Field",f,c);return false}var e=trim(f.value);if(!e){showErrorMessageAndFocus(d,"Missing Value",f,c);return false}return true};a.CValidateRequiredField=function(f,e,c,d){return this.ValidateRequiredField(f,e,this.BuildClientDlgParams(c,d))};a.CSValidateRequiredField=function(e,d,c){return this.CValidateRequiredField(e,d,c,1)};a.CSValidateRequiredFieldP=function(c){return this.CSValidateRequiredField(c.field,c.rawMessage||"Missing Value",c.subdialogDismisalFocusFieldName||c.field.name)};a.ValidateDateField=function(g,f,d,c){if(!g){showErrorMessageAndFocus("Missing field for date validation! (Label = "+f+")","Missing Field",g,c);return false}var e=trim(g.value);if(shouldIgnoreValue(g.value,this.IgnoreFieldValue)){return true}if(!e){if(!d){showErrorMessageAndFocus("Please enter a date for '"+f+"'","Missing Date Value",g,c);return false}}else{if(!parseDateString(e)){showErrorMessageAndFocus("Please enter a valid date for '"+f+"'","Invalid Date Value",g,c);return false}}return true};a.CValidateDateField=function(g,f,d,c,e){return this.ValidateDateField(g,f,d,this.BuildClientDlgParams(c,e))};a.CSValidateDateField=function(f,e,d,c){return this.CValidateDateField(f,e,d,c,1)};a.CSValidateDateFieldP=function(i){var g=i.field,f=i.label,j=i.isNullable,e=i.resultValueHolder,d=i.subdialogDismisalFocusFieldName||g.name,c=trim(g.value),h=this.CSValidateDateField(g,f,j,d);if(e){if(h){e.success=true;e.rcDateObject=parseDateString(c);e.rcCanonicalDateString=getCanonicalDateString(e.rcDateObject)}else{e.success=false}}return h};var b=function(w){w=w||{};var k=w.field,p=w.label,l=w.useLabelInTitle,z=w.isNullable,u=w.returnEmptyAsNull,c=w.clientDlgParams,t=w.minValue,o=w.maxValue,i=w.maxDecimalPlaces,x=w.massageValue,e=w.suppressErrorMessage;if(!k){if(!e){showErrorMessageAndFocus("Missing field for number validation! (Label = "+p+")","Missing Field",k,c)}return false}var j=trim(k.value);if(shouldIgnoreValue(k.value,this.IgnoreFieldValue)){return j}if(x&&new RegExp("\\d+\\,\\d{3}(\\.\\d*)?").test(j)){var m=j.indexOf("."),q=j.indexOf(",");if(q>0&&(m<0||qo){if(!e){showErrorMessageAndFocus("'"+p+"' cannot be larger than "+o,(l?p:"Value")+" too large",k,c)}return false}if(x&&j===""){return""}if(i||i===0){var y=""+f,g=y.lastIndexOf("."),r=g>-1?y.length-g-1:0;if(r>i){if(!e){var d='"'+p+'"',s=i===1?"one decimal place":i+" decimal places",n=i?" can have at most "+s+".":" must be an integer",v=d+n,h=i?"Too Many Decimal Places":"Invalid "+(l?p:"Integer");showErrorMessageAndFocus(v,h,k,c)}return false}}return f};a.ValidateNumberField=function(i,g,d,c,h,e){var f=b({field:i,label:g,isNullable:d,clientDlgParams:c,minValue:h,maxValue:e});if(f===false){return false}return true};a.CValidateNumberField=function(i,g,d,c,e,h,f){return this.ValidateNumberField(i,g,d,this.BuildClientDlgParams(c,e),h,f)};a.CSValidateNumberField=function(h,f,d,c,g,e){return this.CValidateNumberField(h,f,d,c,1,g,e)};a.CSValidateNumberFieldP=function(f){var c=f.resultValueHolder,e=this.BuildClientDlgParams(f.subdialogDismisalFocusFieldName||f.field.name,1,f.subdialogDismisalFocusFieldId||f.field.id),d=b({field:f.field,label:f.label,useLabelInTitle:f.useLabelInTitle,isNullable:f.isNullable,returnEmptyAsNull:f.returnEmptyAsNull,clientDlgParams:e,minValue:f.minValue,maxValue:f.maxValue,maxDecimalPlaces:f.maxDecimalPlaces,suppressErrorMessage:f.suppressErrorMessage,massageValue:1});if(d===false){if(c){c.success=false}return false}if(c){c.rc=d;c.success=true}return true};a.BuildIntegerValidationMessage=function(f,d,c){var e="";if(arguments.length>=3&&null!==d&&null!==c){e=" from "+d+" to "+c+" "}else{if(arguments.length>=2&&null!==d){e=", no less than "+d+", "}else{if(arguments.length>=3&&null!==c){e=", no more than "+c+", "}}}return"Please enter a valid integer"+e+" for '"+f+"'"};a.IntegerValidationMessage=function(h,g,e,d,c,f){showErrorMessageAndFocus(this.BuildIntegerValidationMessage(g,e,d),f||"Invalid Integer",h,c)};a.ValidateIntegerField=function(d,f,i,m,l,g,h){if(!d){if(!h){showErrorMessageAndFocus("Missing field for integer validation! (Label = "+f+")","Missing Field",d,g)}return false}if(arguments.length>3&&null!==m&&0===trim(""+m).length){m=null}if(arguments.length>4&&null!==l&&0===trim(""+l).length){l=null}var c=trim(d.value);if(shouldIgnoreValue(d.value,this.IgnoreFieldValue)){return true}if(c===""){if(!i){if(!h){this.IntegerValidationMessage(d,f,m,l,g)}return false}}else{if(isNaN(c)){if(!h){this.IntegerValidationMessage(d,f,m,l,g)}return false}else{var k;try{k=parseInt(c,10)}catch(j){if(!h){this.IntegerValidationMessage(d,f,m,l,g)}return false}if(c.indexOf(".")>-1){if(!h){this.IntegerValidationMessage(d,f,m,l,g)}return false}else{if(arguments.length>3&&null!==m&&k4&&null!==l&&k>l){if(!h){this.IntegerValidationMessage(d,f,m,l,g)}return false}}}}}return true};a.CValidateIntegerField=function(j,i,e,g,c,d,f,h){return this.ValidateIntegerField(j,i,e,g,c,this.BuildClientDlgParams(d,f),h)};a.CSValidateIntegerField=function(i,h,e,f,c,d,g){return this.CValidateIntegerField(i,h,e,f,c,d,1,g)};a.CSValidateIntegerFieldP=function(c){return this.CValidateIntegerField(c.field,c.label,c.isNullable,c.minValue,c.maxValue,c.subdialogDismisalFocusFieldName||c.field.name,1,c.suppressErrorMessage)};a.ValidateAttributeFields=function(d,c){return this.ValidateAttributeFieldsForMultiple(d,null,null,c)};a.CValidateAttributeFields=function(c,d,e){return this.ValidateAttributeFields(c,this.BuildClientDlgParams(d,e))};a.CSValidateAttributeFields=function(c,d){return this.CValidateAttributeFields(c,d,1)};a.ValidateAttributeFieldsForMultiple=function(p,u,f,k){var e=u?true:false;if(e){this.ModifiedFieldIds=[];this.ModifiedFieldValues=[]}else{u=[];u[0]="0"}var d=p.attrTypes.value.split(","),s=p.attrNames.value.split("?"),r=p.attrDataTypes.value.split("?");for(var i=0;i0)?b[0]:null}function saveSettingsAndNavigateTo(a){saveScrollPos();window.location=a}function checkForScrollSetting(){var b=parseInt(getCookie("tmpScrollTop"),10);if(isNaN(b)){b=0}var a=parseInt(getCookie("tmpScrollLeft"),10);if(isNaN(a)){a=0}if(a>0||b>0){setTimeout(function(){window.scrollTo(a,b)},0)}delCookie("tmpScrollTop");delCookie("tmpScrollLeft")}function checkForSelectedRows(a,b){var c=false;if(!a){return false}if(a.chkRow){if(typeof(a.chkRow.checked)=="boolean"){c=a.chkRow.checked}else{for(var d=0;d0){d=d+","}d=d+c[a].split("?")[0]}}return d}function checkItemsWithId(i,b,c){if((""+b)===""){return}if(!i){return}if(!i.chkRow){return}var d=b.split(",");var e=true;var h=false;var a;var j;var g;if(typeof(i.chkRow.checked)=="boolean"){a=i.chkRow;j=a.value.split("?")[0];for(g=0;g1);c=D}}if(((E.extendSeries&&E.extendSeries.checked)||H)&&!c){if(!k.ValidateIntegerField(E.numDays,"Number of Days",H,1,99,q)){return}}var u=k.ModifiedFieldIds,F=k.ModifiedFieldValues,i=getCompoundSelectionValue(E.assigneeId,E.assigneeIdSelect),b=(E.phaseId||E.phaseIdSelect)?getCompoundSelectionValue(E.phaseId,E.phaseIdSelect):"",G=c&&n!="-1"&&n!=="",p=(E.seriesId.value!==""),C=E.prevStatus.value.split(","),g=unescapeArray(E.prevStartDate.value.split(",")),d=unescapeArray(E.prevSchedTime.value.split(",")),z=unescapeArray(E.prevDuration.value.split(",")),w=E.prevAssigneeId.value.split(","),f=unescapeArray(E.prevActivityDesc.value.split(",")),o=unescapeArray(E.prevPhaseId.value.split(",")),v=[],m,A=E.activityDesc.value;for(m=0;m0))){performUpdateJobActivityAndExtendSeries([j,h[0],getDateForUrlParam(E.startDate.value),escape(getTrueTimeValue(E.schedTime)),escape(getTrueDurationValue(E.schedDuration)),i,escape(A),u,F,v[0],b,E.seriesId.value,E.numDays.value])}else{performUpdateJobActivities([t.join(","),h.join(","),getDateForUrlParam(E.startDate.value),escape(getTrueTimeValue(E.schedTime)),escape(getTrueDurationValue(E.schedDuration)),i,escape(A),escape(u),escape(F),escape(v.join(",")),b])}}if(l){displayTimedMessage("Updating Job Activity...");disableDialogButtons()}}function confirmChangeStatusWithUnassignedMaterial(a,d,f,c){var b=c<2?"":(" ("+(f+1)+" of "+c+")"),e="This activity"+b+" has allocated material without assigned serial numbers.\n\nDo you want to mark this activity as "+a+"?";if(d){displaySimpleConfirmationDialog(d,htmlMultilineEncode(e),"Update Status",{},1,"ok","Proceed With Update");return}return window.confirm(e)}function confirmChangePhases(a){var b="Changing the phase for one activity will change the phase for the entire series.\n\nDo you want to update the phase?";if(a){displaySimpleConfirmationDialog(a,htmlMultilineEncode(b),"Update Phase",{},1,"ok","Proceed With Update");return}return window.confirm(b)}function iterateActivitiesToValidate(p){var i=getObj("editJobActivities"),l=i.ignoreFieldValue.value,d=p.statusToUse,n=p.splitPrevStatus,h=p.splitActivityIds,f=h.length;for(;p.index0)){return true}return false}function getIsIEOrEdge(){if(getIsOldIE()){return true}if(navigator&&navigator.userAgent&&(navigator.userAgent.indexOf("Edge")!==-1||navigator.userAgent.indexOf("Edg")!==-1)){return true}return false}function ScrollToIssues(){var a=getObj("IssuesBodyDiv")||getObj("issueSection");try{a.scrollIntoView(true);var b=getIsOldIE();if(b){window.scrollTo(0,rsPageYOffset())}}catch(c){if(getObj("PostIssues")){getObj("PostIssues").focus()}if(getObj("btnNewIssue")){getObj("btnNewIssue").focus()}else{if(getObj("PreIssues")){getObj("PreIssues").focus()}}}}function SubmitCreateIssue(){var b=getObj("createIssue");var a=new FormValidator();if(!a.ValidateRequiredField(b.issueName,"Please enter a Subject for the issue")){return}if(!a.ValidateRequiredField(b.statusId,"Please select a Status")){return}performSubmitCreateIssue([b.issueTypeId.value,b.objectId.value,escape(b.issueName.value),b.statusId.value,b.categoryId.value,b.assignedToId.value,escape(b.issueText.value)])}function SubmitUpdateIssue(){var b=getObj("updateIssue");var a=new FormValidator();if(!a.ValidateRequiredField(b.issueName,"Please enter a Subject for the issue")){return}if(!a.ValidateRequiredField(b.statusId,"Please select a Status")){return}performSubmitUpdateIssue([b.issueId.value,escape(b.issueName.value),b.statusId.value,b.categoryId.value,b.assignedToId.value,escape(b.issueText.value)])}function submitCreateJobActivityStep2WithParams(o){var j=getObj("createJobActivityStep2"),d=j.activitySeries?j.activitySeries.value.split("|"):[j.seriesId.value,""],c=d[0],k=1-1){var a=f+1+d.length+1,c=g.indexOf("&",a);if(c<0){return g.substring(a)}else{return g.substring(a,c)}}}}function addRemoveOrReplaceURLParameter(e,c,d){if(!c){return e}var g=""+e;var a="(\\&|\\?)"+c+"=";var f=g.search(new RegExp(a,"i"));if(f>-1){var b=g.indexOf("&",f+1+c.length+1);if(b<0){g=g.substring(0,f)}else{if("?"==g.substring(f,f+1)){g=g.substring(0,f+1)+g.substring(b+1)}else{g=g.substring(0,f)+g.substring(b)}}}if(g.length-1==g.indexOf("?")){g=g.substring(0,g.length-1)}if(d){if(g.indexOf("?")<0){g+="?"}else{g+="&"}g+=c+"="+d}return g}function setStopTime(C,a,u,b,j,l){var z=false;if(!b){}else{if(u){var I=getObj(a);var n=I[u];var B=I[b];var k=j?I[j]:null;if(!B){alert("setStopTime() - Couldn't get time field (name=\""+b+'")')}else{if(j&&!k){alert("setStopTime() - Couldn't get date field (name=\""+j+'")')}else{var x=B.value;var i=k?getDateForUrlParam(k.value):"";if(!x){alert("You must enter a scheduled time before you can end this "+(l?"appointment":"activity")+".");setFocus(B)}else{if(!validateTimeContents(B,"Sched Time",true)){return}x=getTrueTimeValue(B);var c=new Date();c=new Date(c.getFullYear(),c.getMonth(),c.getDate(),c.getHours(),c.getMinutes(),0,0);var p=c.getFullYear();var F=c.getMonth();var H=c.getDate();if(i){var f=i.split("-");p=parseInt(f[0],10);F=parseInt(f[1],10)-1;H=parseInt(f[2],10)}var t=x.split(":");var E=parseInt(t[0],10);var w=parseInt(t[1],10);var r=0;var v=0;var G=new Date(p,F,H,E,w,r,v);if(G>c){alert("The start time is in the future!")}else{var g=G.getTime();var q=c.getTime();var o=q-g;var J=((o-(o%60*1000))/(60*1000));var A=J%60;var D=(J-A)/60;if(D*60+A>60*18){alert("Can't have a duration > 18 hours!\n\n(Stopping now would result in a duration of "+D+" hours"+(A>0?" and "+A+" minute"+(A>1?"s":""):"")+".)")}else{if(D===0&&A===0){A=1}var e=canonicalizeDurationOrNullIfInvalid(D+":"+A,{});if(!e){e=D+" hours "+A+" minutes"}n.value=e;if(validateDurationContents(n,"Duration")){z=true;setFocus(n)}}}}}}}else{alert("setStopTime() - Missing duration field!")}}return z}function setDurationAsEndTime(d,c,e,b,a){setStopTime(null,d,c,e,b,a)}function setDialogConfirmer(a){var b=new DialogConfirmer(a);if(b.requiresConfirmation()){b.bind();a.DialogConfirmer=b}else{a.DialogConfirmer=null}}function reScanCurrentDialog(){if(g_objCurrDialog&&g_objCurrDialog.DialogConfirmer){g_objCurrDialog.DialogConfirmer.scanForNewNodes(true)}}function fileNameFromPath(c){var a=c.lastIndexOf("\\"),b=(a>-1&&a+1"+n}else{console.log(j+l.replace(/\n/g,"\n"+j))}}function b(j){i(JSON.stringify(j,null,2))}function g(j){i("+"+j);h[h.length]={nameDesc:j,start:new Date().getTime()}}function f(k){if(k){i(">>"+k)}var j="{no-more-blocks}";if(h.length){j=h[h.length-1].nameDesc+" ("+(new Date().getTime()-h[h.length-1].start)+"ms)";h.length=h.length-1}i("-"+j)}function c(j){return j===undefined?"-undefined-":j}function a(o){var k=o.toString(),j=k.indexOf("."),l=j>-1?k.substring(j+1):"",n=l?l.indexOf("4999999"):-1,m=n>-1;return m}function e(k,j){if(a(k)){i(j+" - number: "+k)}}return{logMessage:i,logBlockOpen:g,logBlockClose:f,logObject:b,logIfFloatingPointError:e,undefinedStringIfUndefined:c}}();var AppointmentFilterCategoryStatusSelection_Enum={oneOf:1,notOneOf:2},JobProcessFilterStatusSelection_Enum={oneOf:1,notOneOf:2},DialogButtonPosition_Enum={dbpBeforeOk:1,dbpAfterOk:2},MaterialFilter_Enum={mfNone:1,mfSelectedOnly:2,mfFilter:3},UserValidationConfirmationStages_Enum={uvsNone:1,uvsMissingEmail:2,uvsExternalUserMissingJobsAndAccounts:5,uvsAccountUserMissingAccounts:6,uvsAccountUserMissingCGQuoteForms:7,uvsMissingLoginLocations:8,uvsShopUserMissingPageViews:9,uvsShopUserMissingActivityTypes:10,uvsShopUserMissingAssignees:11};var StringificationUtils=function(){function c(l){var g=l.string,e=l.parameterName,d='"'+e+'":',m=d.length,k=g.indexOf(d);if(k>-1){var j=k+m,i=g.indexOf('"',j),f=g.indexOf('"',i+1),h=g.substring(i+1,f);g=g.substring(0,i)+h+g.substring(f+1)}return g}function b(f){var d=f.objectToStringify,g=f.arrTargetedPropertyNames,h=f.htmlEncodeResult,e=JSON.stringify(d);(g||[]).forEach(function(i){e=c({string:e,parameterName:i})});if(h){e=htmlEncode(e)}return e}function a(g){var j=g.functionName,h=j?j.split("."):[],f=h.length?window:undefined,e;for(e=0;e-1,ac="";if(Y.hasAttribute(D)){ac=Y.getAttribute(D)}var aa=ac.toUpperCase().indexOf(ad.toUpperCase())>-1;return X||aa}function V(Y){var X=document.createElement("span");X.classList.add(G().listItemElementContent_FirstSpan);X.classList.add("FontAwesomeIcon");if(Y.hasAttribute("selected")){X.innerHTML="&#"+FontIconId_Enum.fiiCheck+";"}else{X.innerHTML=" "}return X}function N(aa){var Z=document.createElement("li"),ab=V(aa);Z.appendChild(ab);var Y=document.createTextNode(aa.label),X=document.createElement("span");X.appendChild(Y);Z.appendChild(X);Z.classList.add(G().listItemElement_SubHeaderItem);return Z}function M(ae){function ad(ai){var ah=ai.optionElement,ak=ai.isUnderSubHeader,aj=document.createElement("li");aj.setAttribute("data-value",ah.getAttribute("value"));if(ak){aj.classList.add(G().listItemElement_UnderSubheader)}if(ah.hasAttribute("disabled")){aj.classList.add(G().listItemElement_NotSelectable)}else{aj.classList.add(G().listItemElement_Selectable);aj.addEventListener("click",C);aj.addEventListener("mouseenter",q);aj.addEventListener("mouseleave",l)}if(ah.hasAttribute("selected")){aj.classList.add(G().listItemElement_Selected);aj.classList.add(G().listItemElement_InFocus)}return aj}function ab(ak){var ai=document.createElement("span"),aj="(None)";if(ak.innerHTML){aj=ak.textContent}var ah=document.createTextNode(aj);ai.appendChild(ah);ai.classList.add("clsSearchableSelect-secondSpan");return ai}function ac(ak){var ai=document.createElement("span");ai.classList.add(G().listItemElementContent_DescriptiveText);var aj=ak.getAttribute(D),ah=document.createTextNode(aj);ai.appendChild(ah);return ai}var Y=ae.optionElement;var Z=ae.isUnderSubHeader;var X=ad({optionElement:Y,isUnderSubHeader:Z}),af=V(Y);X.appendChild(af);var aa=ab(Y);X.appendChild(aa);if(Y.hasAttribute(D)){var ag=ac(Y);X.appendChild(ag)}return X}function O(Y){var X=Y.selectElement,aa=Y.filterText,Z=Array.from(X.options);if(aa){Z=Z.filter(function(ab){return R({optionElement:ab,filterText:aa})})}return Z}function Q(af){var ae="",aa=false,X=[];for(var Y=0;Y0){var P=Q(T);K=document.createElement("ul");K.classList.add(G().listElement);P.forEach(function(X){K.appendChild(X)})}else{K=document.createElement("div");K.classList.add("clsSearchableSelect-NoMatches");var L=document.createTextNode("No matches found");K.appendChild(L)}return K}function n(M){var L=M.htmlCollection,K=M.className;for(var N=0;N=V&&ab<=X}else{return ab>=X&&ab<=V}});return Z}function U(Y){var aa=Y.arrElements,V=Y.firstElementIndex,W=Y.secondElementIndex,Z=N({arrElements:aa,firstElementIndex:V,secondElementIndex:W}),X=Z.reduce(function(ac,ab){return ac+ab.offsetHeight},0);return X}function Q(ad){var ab=ad.listItemHTMLCollection,W=ad.currentFocusIndex,ac=ad.pageHeight,aa=ad.up,Y=Array.from(ab),ae=Y.map(function(af,ag){return{listItemIndex:ag,heightToInFocusItem:U({arrElements:Y,firstElementIndex:ag,secondElementIndex:W}),isListItemSelectable:af.classList.contains(G().listItemElement_Selectable)}}),Z=ae.filter(function(af,ag){if(aa){return ag<=W&&af.heightToInFocusItem<=ac&&af.isListItemSelectable}else{return ag>=W&&af.heightToInFocusItem<=ac&&af.isListItemSelectable}}),V=Y[W];if(Z&&Z.length>0){var X=aa?0:Z.length-1;V=Z[X].listItemIndex}return V}var O=T.listElement,P=T.up,R=O.children;if(R.length>0){var S=O.clientHeight,L=n({htmlCollection:R,className:G().listItemElement_InFocus});if(L===null){L=0}var M=Q({listItemHTMLCollection:R,pageHeight:S,up:P,currentFocusIndex:L}),K=o({listItemHTMLCollection:R,currentFocusIndex:L,newFocusIndex:M});return K}else{return null}}function y(K,N){var M=d(K),L=m({selectElement:M,filterText:N});K.removeChild(K.children[1]);K.appendChild(L);return L}function b(K){var L=K.target;if(L.classList.contains(G().theBox)){return L}else{return L.parentElement}}function v(Q){var M=Q.target,L=M.parentElement.nextElementSibling,P;if(!Q.altKey&&!Q.ctrlKey){switch(Q.keyCode){case 38:P=e({listElement:L,up:true});if(P){scrollElementIntoViewWithinContainerElement(P,L)}break;case 40:P=e({listElement:L,up:false});if(P){scrollElementIntoViewWithinContainerElement(P,L)}break;case 33:P=k({listElement:L,up:true});if(P){scrollElementIntoViewWithinContainerElement(P,L)}break;case 34:P=k({listElement:L,up:false});if(P){scrollElementIntoViewWithinContainerElement(P,L)}break;default:var R=M.parentElement.classList.contains(G().searchTextBoxCollapsedDiv);if(!R){var K=M.parentElement.parentElement,S=M.value;var O=y(K,S),N=z(O);if(N){scrollElementIntoViewWithinContainerElement(N,O)}}break}}}function u(L){if(!L.altKey&&!L.ctrlKey){var O=L.target,K=O.parentElement.parentElement,P=getObj(K.searchableSelectElementId);if(L.keyCode===9){hidePicker();P.focus()}else{if(L.keyCode===13){var N=O.parentElement.nextElementSibling,M=h({htmlCollection:N.children,className:G().listItemElement_InFocus});if(M){H(M);x(M)}hidePicker();P.focus()}}}}function a(S){function M(V){var U=V.selectElement,X=V.minWidth;var W=document.createElement("div");W.classList.add(G().listContainer);W.setAttribute("mjtpicker","1");W.setAttribute("id",U.id+c);W.setAttribute("style","min-width: "+X+"px");return W}function R(X){var V=X.selectElement,Y=X.filterText;var U=document.createElement("input");U.setAttribute("id",V.id+"_searchTextBox");U.setAttribute("placeholder","Search..");U.classList.add(G().searchTextBox);U.addEventListener("keyup",v);U.addEventListener("keydown",u);if(Y){U.setAttribute("value",Y)}var W=document.createElement("span");var Z=document.createElement("div");Z.classList.add(G().searchTextBoxDiv);if(V.options&&V.options.length>20){W.classList.add("FontAwesomeIcon");W.innerHTML="&#"+getRawFontId(FontIconId_Enum.fiiMagnifyingGlass)+";"}else{Z.classList.add(G().searchTextBoxCollapsedDiv);U.classList.add(G().searchTextBoxCollapsedDiv)}Z.appendChild(W);Z.appendChild(U);return Z}var L=b(S),O=L.previousElementSibling,K=M({selectElement:O,minWidth:L.offsetWidth}),P=!S.ctrlKey&&!S.altKey&&!S.shiftKey&&event.key&&S.key.length===1&&S.key!==" ",T="";if(P){T=S.key}var Q=R({selectElement:O,filterText:T});K.appendChild(Q);var N=m({selectElement:O,filterText:T});K.appendChild(N);K.searchableSelectElementId=L.id;return K}function j(L){var P=b(L);var K=a(L),Q=K.children[0],O=Q.children[1];showContentInPickerWithParams({contentElement:K,objPickerRelativePos:P,focusItem:O,popupBorderStyle:"none"});var N=K.children[1];var M=z(N);if(M){scrollElementIntoViewWithinContainerElement(M,N)}}function t(K){if(g_objPicker){hidePicker()}else{j(K)}}function J(K){if(!K.altKey&&!K.ctrlKey){switch(event.keyCode){case 13:case 40:case 34:t(K);break;default:j(K);break}}}function i(M){var L=M.textContent,K="";if(A(M)){K=M.parentElement.label}return{optionText:L,optionGroupText:K}}function s(N){var M=document.createElement("div");M.id=N.id+p;M.classList.add(G().theBox);M.setAttribute("mjtpicker","1");if(N.tabIndex){M.setAttribute("tabIndex",N.tabIndex)}else{M.setAttribute("tabIndex","0")}M.addEventListener("click",t);M.addEventListener("keydown",J);var K=N.options[N.selectedIndex];if(K){var L=i(K);B({searchableSelectElement:M,optionTextAndOptionGroupText:L})}return M}function f(L){var M=L.element,K=L.elementToInsert;if(M&&M.parentNode){M.parentNode.insertBefore(K,M.nextElementSibling)}}var w=function(K){var L=s(K);K.classList.add(G().hideSelectElement);f({element:K,elementToInsert:L});L.focus()};var I=function(K){return stringEndsWith(K.id,p)};return{replaceWithSearchableSelect:w,isElementASearchableSelect:I,TestMethods:{cssClasses:G,searchableSelectElementIdSuffix:p}}})();var GroupedColumnTableLayoutManagement=function(){var h=[];function i(I){var L=I.bundle,J=I.tableId,B=I.columnGroupings,r=I.rowIndices,x=[],G="mjt_grpTR."+(J||"")+".",F,l=B.split(","),D=0;L.groupingInfo=x;for(F=0;F0){var A=l[F].split(";");if(A.length>1){var t=x.length;x[t]=[];x[t][0]=D;x[t][1]=A.length}D+=A.length}}if(x.length>0&&r.length>0){if(null===L.arrMaxRowHeightArrays){L.arrMaxRowHeightArrays=[];L.arrTRSetsArray=[];for(F=0;F1){if(0===z){w=[];L.arrMaxRowHeightArrays[L.arrMaxRowHeightArrays.length]=w;E=[];L.arrTRSetsArray[L.arrTRSetsArray.length]=E}E[z]=[];var y=0;for(y=0;ya){return 1}return 0}function stripeTable(c,f,a){var e=0;for(var b=0;b"+m+g+"";return a}function carefullyNotifyLoggedIn(d,g){try{var b="LoginAttemptTS",h="NewlyLoggedInUserId",c="NewlyLoggedInUserName",a=(new Date()).toString();mjtLSData(h,d?""+d:0);mjtLSData(c,g?g:"");mjtLSData(b,a)}catch(f){}}function addOnUnloadItem(a){g_oui[g_oui.length]=a}function addTrueOnUnloadItem(a){g_toui[g_toui.length]=a}function nodeIsChildOf(b,c){if(c){while(b){var a=b.parentNode;if(a==c){return 1}b=a}}return 0}function scrollSubDListItem(e,d,h){var f=getObj(e+"DialogContentDiv"),c=getObj(d).getElementsByTagName("tbody")[0].getElementsByTagName("tr"),b=0;if(c.length>h){var a=c[h];b=a.offsetTop;var g=a.offsetParent;while(g&&nodeIsChildOf(g,f)){b+=g.offsetTop;g=g.offsetParent}if(f.clientHeight){b=b-f.clientHeight/2+a.clientHeight}f.scrollTop=b}}function scrollToHighlightedSubDItem(b,d){var c=d.getElementsByTagName("tbody");if(c.length){var a=c[0].getElementsByTagName("tr");if(a.length){for(var e=0;e1&&b[1]==checkAttribute(b[1],"mjtclosedisabled")){return b[1]}var a=c.querySelector(".uiv2DialogCloseButton");if(a){return a}return null}function ensureDialogVisibleIfNecessary(){var b=g_objCurrDialog,e,c,h,d,g,a,f;if(!b){return}e=mjtPageYOffset();c=bottomOfVisibleScreen();a=pageHeight();h=posTop(b);d=h;f=b.offsetHeight;g=h+f;if(hc){if(h>e){if(f>a){d=e}else{d=c-f}}else{}}else{if(gc){d=(c-f)}}}}if(d!=h){b.style.top=d+"px"}}function clearMoveMenuTimer(){if(moveMenuTimer){clearTimeout(moveMenuTimer);moveMenuTimer=0}}function phoneMoveMenu(){clearMoveMenuTimer();var j=arrScrollingTableInfo.length;if(!j){return}for(var d=0;d100){var g=posTop(f),l=getObj(k+"PagingDiv");if(l){var m=g+f.offsetHeight,b=bottomOfVisibleScreen(),i=l.offsetHeight,a=getObj(k+"FixedPagingDiv"),h=a?posLeft(a):0,e=(b-i)+2;l.style.top=e+"px";l.style.width=f.parentNode.offsetWidth+"px";if(a){l.style.left=h+"px"}if((g+3*i-1,aj=(!S)&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1;clearMoveMenuTimer();var p=arrTopStuckHeaderInfo.length,ag=arrScrollingTableInfo.length;if(!g_objMenuBar){g_objMenuBar=getObj("menuBar")}if(!(g_objMenuBar||p||ag)){return}var K=mjtPageYOffset();if(K<0){K=0}if(K!=menuOldTop){if(g_objMenuBar){g_objMenuBar.style.top=K+"px"}}menuOldTop=K;var u=g_objMenuBar?g_objMenuBar.offsetHeight:0,ah=topOfVisibleScreen(),D=getObj("pageHeaderLogoDiv"),am=D?D.clientHeight:0,c=D?posTop(D)-ah:0,z=c+am-u,P=z>0?z:0,X=getObj("mainToolbar"),w=X?X.clientHeight:0,G=K+u+P+w;for(var ae=0;ae100){var v=posTop(Z),h=Z.getElementsByTagName("table"),m=h&&h.length>0?h[0]:null;if(Z.parentNode.firstChild.className==="pageNavWrapper"){v=posTop(Z.parentNode.firstChild);var Q=parseFloat(getComputedStyle(Z.parentNode.firstChild).marginTop);if(!isNaN(Q)){v-=Q}}else{if(m){v=posTop(m)}}if(W=W){if(q){if(!Object.prototype.hasOwnProperty.call(window,"g_stickyTableHeadersScrollVersion")||g_stickyTableHeadersScrollVersion===TableHeaderScrollImpl_Enum.thsiJavascriptAndFixedPositioning){q.style.top=W+"px"}else{if(g_stickyTableHeadersScrollVersion===TableHeaderScrollImpl_Enum.thsiFixedPosition){var an=getObj("mainToolbar");if(an){an.style.top="0px"}q.style.position="fixed";q.style.top=(W-ah+2)+"px";q.style.left=(Z.getBoundingClientRect().left)+"px";var al=10;var a=Z.getBoundingClientRect().left;var g=a;while(al-->0&&Math.abs(a-q.getBoundingClientRect().left)>1){g+=((a-q.getBoundingClientRect().left)/2);q.style.left=g+"px"}}else{var s=getObj("divV2Content");var H=getObj("pageToolStrip");var V=H?H.offsetHeight:0;var J=(s&&window.getComputedStyle)?parseFloat(window.getComputedStyle(s).paddingLeft):0;if(isNaN(J)){J=0}q.style.top=(W-V)+"px";q.style.left=(J+3)+"px";q.style.marginLeft=0;var k=getObj("v2LeftNavContainer");var ak=0;if(k){ak=k.offsetWidth;k.style.position="absolute";k.style.top=(ah-2)+"px";k.style.left="0px"}var r=getObj("mainToolbar");if(r){r.style.position="absolute";r.style.top=(ah-2-V)+"px";r.style.left=(0-ak)+"px";r.style.width=null}}}var ad=8;if(aj){var x=q.getBoundingClientRect().top;var ao=posTop(q);if(x!=ao){if(x=(W+ad+B))||((W+q.offsetHeight+50)>(v+Z.offsetHeight))){q.style.visibility="hidden";q.zIndex=-1}else{q.style.visibility="visible";q.zIndex=5}}}arrScrollTableOldTop[O]=W;var F=getObj(L+"PagingDiv");if(F){if(F.parentNode!=document.body){F.parentNode.removeChild(F);document.body.appendChild(F)}var o=v+Z.offsetHeight,n=bottomOfVisibleScreen(),l=F.offsetHeight,N=getObj(L+"FixedPagingDiv"),U=N.parentNode.nodeName=="TD",A=N?posLeft(N):0,d=(n-l)+2,ai=A,R=0;if(U){if(!aj){R=1}}else{R=2}ai-=R;if(Object.prototype.hasOwnProperty.call(window,"g_stickyTableHeadersScrollVersion")&&g_stickyTableHeadersScrollVersion===TableHeaderScrollImpl_Enum.thsiFixedPosition){F.style.bottom="0px";F.style.position="fixed";var e=window.pageXOffset||document.documentElement.scrollLeft;F.style.width="calc(100% + "+e+"px)";var M=getObj("v2LeftNavContainer");var t=Z.getBoundingClientRect().left;var E=rsPageXOffset()?Math.abs(N.getBoundingClientRect().left-t):0;F.style.left=(t+R-2-E)+"px";F.style.paddingLeft=E+"px";N.style.marginLeft="0px"}else{F.style.top=(d+4)+"px";F.style.width=Z.offsetWidth+"px";if(N){F.style.left=(ai-2)+"px"}}if((v+3*l=N.getBoundingClientRect().top){F.style.visibility="hidden";F.zIndex=-1}}var f=F.getAttribute("data-pages");if(f){var b=parseInt(f,10);if(!isNaN(b)&&b<=1){F.style.visibility="hidden"}}}}}}if((g_objPicker&&!isCalendarPopup(g_objPicker))||(getObj("typeAheadDiv")&&getObj("typeAheadDiv").formId)){g_positionPickerTimer=setTimeout(doPositionPicker,0)}}function onScrollBrowserWindow(){moveMenu();Layout.updateSectionHeaderButtons();positionToolbar();doPositionPicker()}function scaleScrollingTableHeader(q){var c=getObj("mainToolbar"),H=getObj("divV2Content"),t=getObj("v2LeftNavContainer");var z=t?parseFloat(getComputedStyle(t).width):0;if(isNaN(z)){z=0}GroupedColumnTableLayoutManagement.makeColumnGroupingAdjustments();if(scaleTableTimer){clearTimeout(scaleTableTimer)}scaleTableTimer=null;for(var I=0;I=0;m--){var o=l.rows[m].cells;var y=x.rows[m].cells;var e=0;var j=y.length;for(var C=0;C-1,B=ua.toLowerCase().indexOf("edge")>-1,E=ua.toLowerCase().indexOf("firefox")>-1,f=(ua.toLowerCase().indexOf("iPhone")||ua.toLowerCase().indexOf("iPad"));g=(u||f)?2:1;if(!r){l.style.width=(x.getBoundingClientRect().right-x.getBoundingClientRect().left)+"px"}else{if(!r){l.style.width=x.offsetWidth+"px"}}e=1+(2*A);if(B){e+=1}else{if(E){e+=1}}}}if(r){l.parentNode.style.width=(x.getBoundingClientRect().right-x.getBoundingClientRect().left)+"px"}}if(window.getComputedStyle){var D=getComputedStyle(y[C]);var G=parseFloat(D.paddingLeft);var a=parseFloat(D.paddingRight);var d=parseFloat(D.borderLeftWidth);var h=parseFloat(D.borderRightWidth);if(isNaN(G)){G=0}if(isNaN(a)){a=0}if(isNaN(d)){d=0}if(isNaN(h)){h=0}o[C].style.paddingLeft=D.paddingLeft;o[C].style.paddingRight=D.paddingRight;o[C].style.borderLeftWidth=D.borderLeftWidth;o[C].style.borderRightWidth=D.borderRightWidth;e=G+a+d+h}if(C=0?w:0)+"px"}}}arrScrollTableTop[I]=v.offsetTop;s.style.left=(posLeft(v)+g-z)+"px";arrScrollTableOldTop[I]=arrScrollTableTop[I]}}if(q===undefined||q===1){moveMenu()}if(isIE5Mac){scaleTableTimer=setTimeout(scaleScrollingTableHeader,1000)}}function selectFirstOptionSynch(a){a.options[0].selected=true}function selectFirstOption(a){setTimeout(function(){selectFirstOptionSynch(a)},0)}function isDialogShowingP(b){var a=b.ignoreStandardDialog,c=b.includeContextMenus;if(a&&!g_sds){return 0}if(g_sds||g_ds){return 1}if(c&&isContextMenuVisible()){return 1}if(typeof(g_objCurrDialog)=="undefined"){return 0}if(g_objCurrDialog===null){return 0}return !(g_currDialogIsViewsList||g_currDialogIsSubmenuDialog)}function isDialogShowing(a){return isDialogShowingP({ignoreStandardDialog:a,includeContextMenus:0})}function isDialogDisabled(){if(!isDialogShowing()){return false}var a=g_objCurrDialog.getAttribute("disabled");return(g_objCurrDialog&&a&&a==="true")?true:false}function isDialogOrBusyP(b){var a=b.ignoreStandardDialog?1:0,c=b.includeContextMenus?1:0;return g_wk||isDialogShowingP({ignoreStandardDialog:a,includeContextMenus:c})}function isDialogOrBusy(a){return isDialogOrBusyP({ignoreStandardDialog:a})}function showWorking(a,b){if(!b){g_wk=true}displayTimedMessage(a)}function refreshPageShowingMessage(){showWorking("Refreshing...",1);g_wk=false;window.location=window.location}function CheckDialogBeforeNavigation(){if(isDialogShowing()&&!g_bSkipNavWarning){return"If you leave this page now, any changes to the open dialog box will be lost."}var a,b,c;for(a=0;a=l)){if(-1==j.className.indexOf(" "+i)){j.className+=" "+i;if(getIsFirefox()){j.style.overflowY="scroll"}}}else{j.className=removeClass(j.className,i);if(getIsFirefox()){j.style.overflowY=""}}var k=pageWidth()-g;if(k0&&k.children[0].tagName.toLowerCase()==="form"){k=k.children[0]}}if(k&&k.elements){var c=getCloseButtonFromDialogForm(k);if(c){c.setAttribute("mjtclosedisabled","1");c.style.cursor="";c.setAttribute("disabled",true)}var g;for(g=0;g0&&h.children[0].tagName.toLowerCase()==="form"){h=h.children[0]}}if(h&&h.elements){var c=getCloseButtonFromDialogForm(h);if(c){c.setAttribute("mjtclosedisabled","0");c.style.cursor="pointer";c.setAttribute("disabled",false)}var f;for(f=0;f1){b=getObj("dynamicStackedDialog"+(h-2))}}}if(!b){b=getObj("dynamicSubdialog");if(b&&b.innerHTML){}if(!(b&&b.innerHTML)){b=getObj("dynamicDialog")}}var g=0;if(b&&b.innerHTML&&b.innerHTML!=g_strClearedDynamicDialogContent){b.style.display="";g=1}if(!g){hideDialogCover()}mwHideTooltip();if(f){f()}}function hideDialogP(a){hideDialog(a.hidingStackedSubdialog,a.hidingContextMenu,a.hidingStackedClientDialog_,a.callback)}function rsErrorCallbackShowErrorDialogAndRefresh(e,b,f){enableDialogButtons();f=f||{};var h=f.errorDialogTitle||"An error occurred.",i=f.showErrorInSubdialog,j=f.hideDialogBeforeShowError,k=f.errorSubdialogDismisalFocusFieldName,g=f.errorSubdialogDismisalFocusFieldId,a=f.fnPostErrorCallbackMessage,d=i||f.forceNoRefreshOnErrorExecuting,c=f.messageCssClassPrefix||"";if(j){hideDialog()}showDialogP('
'+htmlMultilineEncode(e)+"
","frmTmpMessage",{formTitle:h,contextDetailOrFnSubmit:{fnCancelOrClose:a?function(l){setTimeout(function(){a({form:l,responseString:e,contextId:b})},0);return 1}:d?undefined:function(){postErrorRefresh();return 0}},hideOkButton:1,isSubdialog:isDialogShowing(),subdialogDismisalFocusFieldName:k||0,subdialogDismisalFocusFieldId:g||0,cssClassPrefix:c})}function rsCallbackIntermediary(c,b,g){var f=g.originalOptions||{},d=f.fnOnCheckResponseError;if(!f.skipDisableDialogButtons){enableDialogButtons()}if(!checkResponseForError(c)){if(d){d(c,b,g)}return}var a=JSON.parse(c),e=g.fnJSONCallback;if(e){e(a,{originalPayload:g.originalPayload,originalOptions:g.originalOptions,doingWhat:g.doingWhat,contextId:b})}}function jsrsExecuteWithErrorP(a,h,c,g,i){if(!g){g={}}var b=i||{},f='Executing "'+a+'" Command...';if(c){f=c}var d=b.messageCssClassPrefix,e=jsrsExecute(rsCallbackIntermediary,a,[escape(JSON.stringify(g))],b.rsErrorCallback||rsErrorCallbackShowErrorDialogAndRefresh,{showErrorInSubdialog:isDialogShowing(),errorDialogTitle:"Error "+f,errorSubdialogDismisalFocusFieldId:b.errorSubdialogDismisalFocusFieldId,errorSubdialogDismisalFocusFieldName:b.errorSubdialogDismisalFocusFieldName,forceNoRefreshOnErrorExecuting:b.forceNoRefreshOnErrorExecuting,fnPostErrorCallbackMessage:b.fnPostErrorCallbackMessage,originalOptions:i,originalPayload:g,fnJSONCallback:h,doingWhat:c,messageCssClassPrefix:d},0,1,b.overriddenRemoteScriptingTarget);if(!b.skipInfoMessage){displayTimedMessageP({msgHTML:htmlEncode(f)+"...",cssClassPrefix:d})}if(!b.skipDisableDialogButtons){disableDialogButtons()}return e}function hideContextMenu(){var a;if(g_currDialogIsSubmenuDialog||g_currDialogIsViewsList){hideDialog(0,1);a=1}if(hideContextSubmenus()){a=1}if(typeof v2DisplayPan!="undefined"){if(v2DisplayPan(0)){a=1}}return a}function addViewportResizeEventSync(a){document.addEventListener("ViewportResized",a,false)}function dispatchViewportResizeEvent(){if(!document.createEvent){return}if(!g_resizeViewportEvent){g_resizeViewportEvent=document.createEvent("Event");g_resizeViewportEvent.initEvent("ViewportResized",true,true)}setTimeout(function(){document.dispatchEvent(g_resizeViewportEvent)},0)}function resizeCurrentDialog(){if(g_objCurrDialog&&g_objCurrDialog.firstChild){scrollDialogIfNecessary(g_objCurrDialog.firstChild.id)}}function doResize(){hideMappingFO();if(!g_currDialogIsViewsList){hideContextMenu()}recalculatePageLayout();scaleScrollingTableHeader();Layout.updateSectionHeaderButtons();resizeCurrentDialog();ChartAdapter.resizeChart();clearMoveMenuTimer();setTimeout(moveMenu,0);if(g_objPicker&&isCalendarPopup(g_objPicker)){doPositionPicker()}dispatchViewportResizeEvent()}function prepareForSubdialogDisplay(){if(!g_objCurrDialog){return}if(null!==ieVersion&&ieVersion<7){g_objCurrDialog.style.visibility="hidden"}disableDialogButtons()}function prepareForStackedSubdialogDisplay(){if(!g_objCurrDialog){return}if(null!==ieVersion&&ieVersion<7){g_objCurrDialog.style.visibility="hidden"}disableDialogButtons()}function prepareForStackedClientDialogDisplay(){prepareForStackedSubdialogDisplay()}function setFocusIfFocusable(a){var b=false;if(a&&(a.style.display!="none")&&!a.disabled){if(("INPUT"==a.nodeName&&a.type!="hidden")||("SELECT"==a.nodeName)||("BUTTON"==a.nodeName)||("TEXTAREA"==a.nodeName)){b=true;try{a.focus();if(a.select){a.select()}}catch(c){b=false}}else{if("A"==a.nodeName&&null===a.getAttribute("mjtfocusblocker")){b=true;try{a.focus()}catch(d){b=false}}}}return b}function findFirstFocusableItemWithOutParam(h,f,l,m,e,n){var a=null;if(null===h){return}l=l||h.className=="uiv2dialogHeader";var g,o=f?-1:1,d=h.childNodes,b=f?d.length-1:0,k;for(g=b;g>=0&&gbottomOfVisibleScreen()){d=bottomOfVisibleScreen()-b.offsetHeight}if(c+b.offsetWidth>rightOfVisibleScreen()){c=rightOfVisibleScreen()-b.offsetWidth}if(d0;g_showDialogIsStackedClientDialog=g_clientDialogStack.length>0;if(!g_objCurrDialog){return}g_objCurrDialog.style.visibility="visible";enableDialogButtons();setTimeout("asynchFocusOnDialogItem("+(this.dismisalFocusFieldName?'"'+this.dismisalFocusFieldName+'"':"null")+", "+(this.dismisalFocusFieldId?'"'+this.dismisalFocusFieldId+'"':"null")+");",0)}};ClientDialog.prototype.coreHide=function(){var b=this,c=g_clientDialogStack;if(b.objDialog){var a=function(){asynchFocusOnDialogItem((b.dismisalFocusFieldName?b.dismisalFocusFieldName:"null"),(b.dismisalFocusFieldId?b.dismisalFocusFieldId:"null"))};b.objDialog.innerHTML="";c.splice(c.length-1,1);if(!c.length){g_ds=0}removeNode(b.objDialog);b.objDialog=null;g_objCurrDialog=b.objBaseDialog;b.objBaseDialog=null;g_showDialogIsStackedSubdialog=g_subdialogStack.length>0;g_showDialogIsStackedClientDialog=c.length>0;if(b.parentDialog&&b.parentDialog.style&&b.parentDialogDisplay!==undefined){b.parentDialog.style.display=b.parentDialogDisplay}if((!g_objCurrDialog)&&(!c.length)){setTimeout(a,0);return}if(g_objCurrDialog){g_objCurrDialog.style.visibility="visible"}enableDialogButtons();setTimeout(a,0)}};ClientDialog.prototype.hide=function(){var a=this;if(a.objDialog){hideDialog(0,0,1)}a.coreHide()};function positionAndShowStackedSubdialog(f,d,a,b,e,c){g_objBaseDialog=g_objCurrDialog;g_showDialogIsStackedSubdialog=true;positionAndShowDialog(f,d,a,b,e,c)}function processSimpleDialogCallbackP(e,o){var k=null,l=(!o.doCheckResponseForError)||checkResponseForError(e),d=o.noOpIfEmptyResult&&!trim(e);if(d){enableDialogButtons()}else{if(l){if(o.isStackedSubdialog){var b=new StackedSubdialog(e,o.dismisalFocusFieldName||null,o.dismisalFocusFieldId||null)}else{if(!o.isSubdialog&&!o.skipHideDialog){if(true===o.skipDialogConfirmation){hideDialog()}else{hideDialogP({callback:function(){o.skipHideDialog=true;k=processSimpleDialogCallbackP(e,o)}});return k}}var g=getObj(o.isSubdialog?"dynamicSubdialog":"dynamicDialog");g.innerHTML=e}if(o.formId){k=getObj(o.formId)}var h;if((!k)&&o.arrAlternateFormIds&&o.arrAlternateFormIds.length){for(h=0;(!k)&&h"}n.addFlexibleRow({valueHTML:d});n.showClientDialog()}else{if(i.hideDialogOnSuccess){hideDialog()}if(i.refreshOnSuccess){refreshPageAndScrollPos()}if(h){h(k,b)}a=true}return a}function rsCallbackHandleStandardJSONResponseWithHideAndRefresh(a,c){var b=c.originalOptions||{};c.originalOptions=b;b.hideDialogOnSuccess=1;b.refreshOnSuccess=1;return rsCallbackHandleStandardJSONResponse(a,c)}function rsCallbackProcessV2Dialog(a,d){var b=null,c=(d||{}).originalOptions||{};if(rsCallbackHandleStandardJSONResponse(a,d)){if(!a.formId){alert('Missing "formId" in JSON response to dialog request.');consoleLog("Response:\r\n"+JSON.stringify(a,null,2))}else{if(!a.dialogContentAsString){alert('Missing "dialogContentAsString" in JSON response to dialog request.');consoleLog("Response:\r\n"+JSON.stringify(a,null,2))}else{b=processSimpleDialogCallbackP(a.dialogContentAsString,{formId:a.formId,isSubdialog:c.isSubdialog,skipHideDialog:c.skipHideDialog,isStackedSubdialog:c.isStackedSubdialog,dismisalFocusFieldName:c.dismisalFocusFieldName,dismisalFocusFieldId:c.dismisalFocusFieldId,focusItemId:a.forceFocusItemId||undefined,center:c.v1CenterDialog});if(c.fnProcessV2DialogOnSuccess){c.fnProcessV2DialogOnSuccess(a,d,b)}}}}return b}var DialogHeaderDeleteButton=function(){function c(){var i="frmConfirmObjectDeletion",j=getObj(i),e=mjtElemData(j,"formElemData"),d=e.deletePayload,h=e.displayNameOfObjectToDelete,f=e.remoteScriptingFunctionName,g=e.urlOnSuccess;hideDialog();jsrsExecuteWithErrorP(f,g?rsCallbackHandleStandardJSONResponse:rsCallbackHandleStandardJSONResponseWithHideAndRefresh,"Deleting "+h,d,{fnOnSuccess:g?function(){hideDialog();window.location=g}:undefined})}function a(i){var e=i.deletePayload,g=i.remoteScriptingFunctionName,d=i.displayNameOfObjectToDelete,f=i.rawConfirmationMessageText,j=i.urlOnSuccess,h="frmConfirmObjectDeletion",l=new ClientDialogBuilder({formId:h,formTitle:"Delete "+d,okButtonDisplayText:cdBuildMnemonicLabelHTML({rawLabel:"Delete",mnemonicChar:"d",mnemonicActionJS:"DialogHeaderDeleteButton.submitDeleteItem()"}),fnSubmit:c}),k={formElemData:{deletePayload:e,displayNameOfObjectToDelete:d,remoteScriptingFunctionName:g,urlOnSuccess:j}};hideDialogP({callback:function(){l.addFlexibleRow({rawValue:f});l.showClientDialog(k)}})}var b=function(o){var m=o.remoteScriptingFunctionName,h=o.deletePayload,g=o.displayNameOfObjectToDelete,l=o.rawButtonTitle,j=o.rawConfirmationMessageText,p=o.urlOnSuccess,d=o.additionalButtonClasses,n=htmlEncode(l||trim("Delete "+g)),f={deletePayload:h,remoteScriptingFunctionName:m,displayNameOfObjectToDelete:g,rawConfirmationMessageText:j,urlOnSuccess:p},k=JSON.stringify(f),e="DialogHeaderDeleteButton.confirmDelete("+htmlEncode(k)+")",i=cdBuildFAFontIconButton({fontId:FontIconId_Enum.fiiHollowTrash,additionalButtonClasses:d,doubleQuoteEncodedTitle:n,doubleQuoteEncodedOnClickJS:e});return i};return{buildDialogHeaderDeleteButton:b,confirmDelete:a,submitDeleteItem:c}}();function processSimpleDialogCallback(i,o,k,d,b,h,e,m,j,a,g,f,c,p,n,l){return processSimpleDialogCallbackP(i,{doCheckResponseForError:true,formId:o,focusItemId:k,center:d,isSubdialog:b,useSavedEventPagePosition:h,arrAlternateFormIds:e,isStackedSubdialog:m,dismisalFocusFieldName:j,dismisalFocusFieldId:a,forceLeftOfScreen:g,arrFormProperties:f,fnProcessFormOnSuccess:c,noOpIfEmptyResult:p,skipHideDialog:n,skipDialogConfirmation:l})}function rsCallbackProcessSimpleDialogP(a,b){return processSimpleDialogCallbackP(a.dialogContent,b.originalOptions)}function processSimpleStackedSubdialogCallback(f,i,h,b,g,a,e,c,d){return processSimpleDialogCallback(f,i,h,b,false,e,c,true,g?g:null,a?a:null,d?1:0)}function rsCallbackProcessSimpleDialogWithAlternateFormIds(c,a,b){processSimpleDialogCallback(c,b.formId,null,null,null,null,b.alternateFormIds)}function rsCallbackProcessSimpleDialog(b,a,c){processSimpleDialogCallback(b,c)}function rsCallbackProcessSimpleDialogWithParams(c,b,a){return processSimpleDialogCallback(c,a.formId,a.focusItemId?a.focusItemId:null,a.center?a.center:null,a.isSubdialog?a.isSubdialog:null,a.useSavedEventPagePosition?a.useSavedEventPagePosition:null,a.arrAlternateFormIds?a.arrAlternateFormIds:null,a.isStackedSubdialog?a.isStackedSubdialog:null,a.dismisalFocusFieldName?a.dismisalFocusFieldName:null,a.dismisalFocusFieldId?a.dismisalFocusFieldId:null,0,0,a.fnProcessFormOnSuccess?a.fnProcessFormOnSuccess:0,a.noOpIfEmptyResult?1:0)}function rsCallbackProcessSimpleSubdialogWithAlternateFormIds(c,a,b){processSimpleDialogCallback(c,b.formId,null,true,true,null,b.alternateFormIds)}function rsCallbackProcessSimpleSubdialog(b,a,c){processSimpleDialogCallback(b,c,null,true,true)}function rsCallbackProcessSimpleStackedSubdialog(b,a,c){processSimpleDialogCallback(b,c.formId,c.focusItemId?c.focusItemId:null,c.center,true,c.useSavedEventPagePosition?true:false,c.arrAlternateFormIds?c.arrAlternateFormIds:null,true,c.dismisalFocusFieldName?c.dismisalFocusFieldName:null,c.dismisalFocusFieldId?c.dismisalFocusFieldId:null,0,c.arrFormProperties?c.arrFormProperties:0)}function getJPNameForId(d){var c=null;for(var b=0;b=0&&a0){y.setAttribute("onclick","performCartSelectedOnly('"+x.id+"');return false;");y.classList.add("notselectedactionTab")}else{y.classList.add("cannotSelectactionTab")}}}return y.outerHTML};var s=function(x){return x.allowSearch||x.allowSelectedOnly||x.activeOnlyLabel};if(this.cartInfoElement){var u="",l="",e=this.form,w=e.forceJTStyle&&e.forceJTStyle.value=="1",i=e.forceCGStyle&&e.forceCGStyle.value=="1",o=w?"jt":(i?"cg":""),p="",t="",d="",j="",m=g(o,e,this),r=h(e,this),c=f(e,this);if(!this.singleSelect){switch(this.getRecordCount()){case 0:l="No items selected";break;case 1:l="1 item selected";break;default:l=this.getRecordCount()+" items selected";break}}if(s(this)){if(this.doShowSelectedOnly()){p=m}else{var q=this.allowSelectedOnly&&(this.getRecordCount()>0),n="";if(this.allowSearch){if(e.search){n=e.search.value}}if(n.length){if(!this.hideShowAllButton){p=m}}else{if(q){p='"}}if(this.allowSearch){t='";d+=cdBuildFAFontIconButton({buttonId:"btnSearchForCart",doubleQuoteEncodedOnClickJS:"performCartSearch('' + form.id + '');return false;",fontId:FontIconId_Enum.fiiMagnifyingGlass})}if(this.activeOnlyLabel){var a=this.getActiveOnlyCheckboxId(),v=this.isActiveOnlyChecked(),b="performCartToggledActiveOnly('"+e.id+"');";j=generateCheckboxDisplayedAsToggle({fieldId:a,fieldName:a,activeOnlyLabelText:this.activeOnlyLabel,isChecked:v,onclickScript:b,tabIndex:"0"})}}}u+='';if(!this.singleSelect&&s(this)){u+='"}else{if(l||p){u+='"}}u+='";if(j){u+='\n"}u+="
'+r+c+"
'+l+""+p+"
'+t+d+"
'+j+"
";this.cartInfoElement.innerHTML=u}};SimpleShoppingCart.prototype.getActiveOnlyCheckboxId=function(){return this.form.id+".chkActiveOnly"};SimpleShoppingCart.prototype.isActiveOnlyChecked=function(){var a=false;if(this.activeOnlyLabel&&!this.doShowSelectedOnly()){var b=this.getActiveOnlyCheckboxId();a=this.activeOnlyCheckboxDefaultValue;var c=getObj(b);if(c){a=c.checked}}return a};SimpleShoppingCart.prototype.updateFromCurrentCheckboxList=function(c,b){b=b?b:"";var a=this;callFunctionOnAllFieldsWithName(this.form,function(e,f){var d=c(f.value);e.updateItemCheckState(d,f.checked)},a,"chkRow"+b);this.cartField.value=this.getSerializedData();this.updateCartInfo()};SimpleShoppingCart.prototype.updateCheckBoxesAccordingToCart=function(b){if(!this.singleSelect){var a=this;callFunctionOnAllFieldsWithName(this.form,function(d,e){var f=b(e.value);var c=d.getDataIndexForId(f);e.checked=(null!==c)},a,"chkRow"+this.cbNameSuffix);if(this.form["chkRow"+this.cbNameSuffix]){highlightCheckedRows(this.form,this.cbNameSuffix)}}};SimpleShoppingCart.prototype.doShowSelectedOnly=function(){return this.showingSelectedOnly&&this.allowSelectedOnly};function SimpleShoppingCartContentDescriptor(a,b){this.idList=a;this.names=b}SimpleShoppingCartContentDescriptor.prototype.getIdList=function(){return this.idList};SimpleShoppingCartContentDescriptor.prototype.getNames=function(){return this.names};SimpleShoppingCart.prototype.recordComparator=function(d,e,c){var b=c(this.data[d]).toLowerCase();var a=c(this.data[e]).toLowerCase();if(b>a){return 1}if(bh){j+="...";break}var g=k(this.data[d[b]]);j+=escape(g);a+=g.length}}else{j=c}return new SimpleShoppingCartContentDescriptor(c,j)};function initializeSimpleShoppingCartFromFormFields(o,f,g,p,n,m,c,d,h,b,k,l,e){var j=getObj(o);if(!j){if(g){alert('Unable to find form, "'+o+'" for initializeSimpleShoppingCartFromFormFields()')}return null}var a=j[f];if(!a){if(g){alert('Unable to find cart field, "'+f+'" on form "'+f+'" for initializeSimpleShoppingCartFromFormFields()')}return null}var i=initializeSimpleShoppingCart(j,a,p?getObj(p):null,n?n:null,m?1:0,c?1:0,d?1:0,h?h:"",b?b:"",k?k:"",l,e);return i}function performCartSelectedOnly(a){var b=reconstructSimpleShoppingCart(a);if(b.form&&b.form.search){b.form.search.value=""}b.form.objCart.showingSelectedOnly=1;b.updateCartInfo();b.fnSearchOrSelectedOnly(b)}function performCartShowAll(a){var b=reconstructSimpleShoppingCart(a);b.form.objCart.showingSelectedOnly=0;if(b.form.search){b.form.search.value=""}b.updateCartInfo();b.fnSearchOrSelectedOnly(b)}function performCartToggledActiveOnly(a){var b=reconstructSimpleShoppingCart(a);b.fnSearchOrSelectedOnly(b)}function asynchPerformCartToggledActiveOnly(c){var d=reconstructSimpleShoppingCart(c);var b=getObj(d.getActiveOnlyCheckboxId());if(b){var a=b.checked;d.fnSearchOrSelectedOnly(d)}}function decodeQuestionMarkDelimitedCheckboxValueIntoArray(a){return unescapeArray(a.split("?"))}function decodeQuestionMarkDelimitedCheckboxValueForId(a){return""+decodeQuestionMarkDelimitedCheckboxValueIntoArray(a)[0]}function rsCallbackGetStandardSimpleShoppingCartTable2(e,a){var i=a.originalOptions,j=i.formId,f=getObj(j),c=i.tableId,h=getObj(c),g=reconstructSimpleShoppingCart(f.id,i.suppressMessageOnError?0:1);if(h){h.innerHTML=e.tableContentHTML;if(g){g.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}scrollDialogIfNecessary(j)}if(g){if(i.idOfFieldToHideOnSelectedOnly){var d=getObj(i.idOfFieldToHideOnSelectedOnly);if(d){d.style.display=g.doShowSelectedOnly()?"none":""}}g.refocusCartAfterUpdate()}if(g_objCurrDialog){var b=new FormInputNormalizer(g_objCurrDialog);b.normalize()}}function rsCallbackGetStandardSimpleShoppingCartTable(c,a,b){enableDialogButtons();if(checkResponseForError(c)){rsCallbackGetStandardSimpleShoppingCartTable2({tableContentHTML:c},{originalOptions:b})}}function updateSimpleShoppingCart(a){var b=reconstructSimpleShoppingCart(a,true);if(!b){return}b.updateFromCurrentCheckboxList(decodeQuestionMarkDelimitedCheckboxValueIntoArray,b.cbNameSuffix)}function decodeQuestionMarkDelimitedCheckboxValueIntoArrayWihtoutUnescapingId(a){var c=a.split("?");for(var b=1;b"}}}function updateImageLOVsForFieldsIfNecessary(a,g,b){if(a&&g){var f=g.split(",");for(var d=0;d100){a.style.width="1in"}}else{if(a.offsetHeight>100){a.style.height="1in"}}}}function LOVImageLoaded(a){doneLoadingPreviewImage(getObj("imgPreviewLOVImage"+a),getObj("imgPreviewLOVImageLoading"+a))}function rsCallbackShowNewFormFieldListValueSubdialog(a){processSimpleDialogCallback(a,"createFormFieldListValue",null,true,true)}function changeFormFieldListValue(b){var c=getObj("editJobForm");var a=c["formField"+b];if(a.value=="-1"){selectFirstOption(a);updateLOVImagePreview(b,a);jsrsExecute(rsCallbackShowNewFormFieldListValueSubdialog,"Dialog_GetNewFormFieldListValue",[b],enableDialogButtons);displayTimedMessage("Getting New Form Field List Value Dialog");disableDialogButtons()}else{updateLOVImagePreview(b,a)}}function rsCallbackUpdateIssueDialog(d,c){if(checkResponseForError(d)){hideDialog();getObj("dynamicDialog").innerHTML=d;var f=getObj("updateIssue");positionAndShowDialog(false,f.parentNode,true,f.issueText);var a=getObj("updateIssueHistoryEnd");if(a){var e=mjtPageYOffset();var b=mjtPageXOffset();a.scrollIntoView(true);window.scrollTo(b,e)}}}function showUpdateIssueDialog(b){var a="Getting Update Issue Dialog";jsrsExecute(rsCallbackUpdateIssueDialog,"Dialog_GetUpdateIssueDialog",b,rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error "+a},0,1);displayTimedMessage(a+"...")}function rsCallbackGetV2SearchFields(a,b){if(checkResponseForError(a)){showDialogP(''+a+"",b.originalOptions.formId,{hideOkButton:1,formTitle:"Search For...",focusFieldName:"searchTerm",focusFieldOnMobile:true,suppressDialogConfirmer:true,skipNavWarning:true})}}function showV2SearchDialog(){var a="",b="frmSearch";if(isDialogShowing()){return}jsrsExecuteWithErrorP("Dialog2_GetV2SearchFields",rsCallbackGetV2SearchFields,"Getting Search Dialog",{formId:b,searchTerm:escape(a),typeAheadAdditionalClasses:"typeahead-with-borders",isForToolbar:1,searchCategorySelectId:"searchCategoryDialogSelectId",hiddenResizeSelectId:"dialogHiddenResizeSelect",hiddenResizeOptionId:"dialogHiddenResizeOption",idSuffix:"dialog",hiddenInputId:"dialogSearchCategoryId",searchInputName:"dialogSearchTerm"},{formId:b,skipInfoMessage:true})}function getWebPage(){if(typeof g_currWebPageId!="undefined"){if(g_currWebPageId){return g_currWebPageId}}var e=window.location.search;e=e.substr(1,e.length);var f=e.split("&");var b;for(b=0;b0)||(g_subdialogStack&&g_subdialogStack.length>0)){if(g_clientDialogStack&&g_clientDialogStack.length){var a=g_clientDialogStack[g_clientDialogStack.length-1],f=a.formId;doCloseOrCancelClientDialog(f,a.isSubdialog)}else{hideSubdialog()}}else{if(g_objCurrDialog&&g_objCurrDialog.parentNode&&g_objCurrDialog.parentNode.id==="dynamicSubdialog"){hideSubdialog()}else{j=true;hideDialogP({callback:function(){carefullyClearGuider()}})}}if(!j){carefullyClearGuider()}}else{if(c){if(!czCheckForDialogMnemonics(c)){g=false}}else{g=false}}}else{if(!(getWebPage()==WebPages_Enum.CGEditQuote||getWebPage()==WebPages_Enum.CGEditPriceList)){switch(c){case 67:window.location=pageCalendar;break;case 73:if(isInventoryEdition||isEnterpriseEdition){window.location=pageInventorySummary}break;case 74:window.location=pageJobSummary_1;break;case 80:if(isInventoryEdition||isEnterpriseEdition){window.location=pagePOSummary}break;case 81:if(isEnterpriseEdition){window.location=pageQuoteSummary}break;case 83:showV2SearchDialog();break;default:g=false}}}if(g){cancelEvent(b);return false}}function doDoubleClick(event){var theElement=getEventElement(event),eventElement=checkAttribute(theElement,"mjtdblclick");if(eventElement!==null){if(isDialogShowing()&&!eventIsDialogOrPopup(eventElement)){return}setTimeout(hideContextMenu,0);g_isDoubleClickEvent=true;eval(eventElement.getAttribute("mjtclick"))}cancelEvent(event)}function screenOrientationChanged(a){scrollCurrentDialogIfNecessary()}function onloadInitialize(){pageLoaded=true;checkForScrollSetting();checkForCheckSetting();scaleScrollingTableHeader();document.onmouseover=doMouseover;document.onmouseout=doMouseout;document.onclick=doClick;document.ondblclick=doDoubleClick;if(isPhone()){document.ontouchstart=mwPhoneTouchStart;adjustPhoneDetailSectionAnchors()}var d=doKeyDown;if(typeof(fnAppOverrideDoKeyDown)=="function"){d=fnAppOverrideDoKeyDown}document.onkeydown=d;var b=getObj("divV2Content");if(document.onscroll){document.onscroll=onScrollBrowserWindow}else{window.onscroll=onScrollBrowserWindow}var a=function(h,g){var i=null;return function(){if(i){clearTimeout(i)}i=setTimeout(g,h)}};var f=a(500,function(){onScrollBrowserWindow()});if(document.addEventListener){document.addEventListener("scroll",f)}if(b){b.onscroll=onScrollBrowserWindow}if(typeof(document.onmouseup)!="function"){document.onmouseup=doMouseup}else{var e=document.onmouseup;document.onmouseup=function(){e();doMouseup()}}if(window.addEventListener){window.addEventListener("orientationchange",screenOrientationChanged,false)}if(document.fonts){var c=function(){if(isDialogShowing()&&g_objCurrDialog){var g=new FormInputNormalizer(g_objCurrDialog);g.normalize()}};if(document.fonts.ready&&document.fonts.ready.then){document.fonts.ready.then(function(){c()})}document.fonts.onloadingdone=function(){c()}}recalculatePageLayout();moveMenu();executeInitFunctions()}window.onresize=doResize;window.onbeforeunload=CheckDialogBeforeNavigation;window.onunload=processTrueUnloadFunctions;function setIdProperty(d,c,b){var a=document.getElementById(d);if(a!==null){a=a.style;a[c]=b}}function addEvent(e,d,b,a){if(e.addEventListener){e.addEventListener(d,b,a);return true}else{if(e.attachEvent){var c=e.attachEvent("on"+d,b);return c}else{alert("Event handler could not be attached");return false}}}function removeEvent(e,d,b,a){if(e.removeEventListener){e.removeEventListener(d,b,a);return true}else{if(e.detachEvent){var c=e.detachEvent("on"+d,b);return c}else{alert("Event handler could not be removed");return false}}}function hideSubdialog(){if(g_clientDialogStack.length){hideStackedClientDialog()}else{if(g_subdialogStack.length){hideStackedSubdialog()}else{hideDialog();g_objCurrDialog=g_objBaseDialog;g_objBaseDialog=null;g_showDialogIsSubdialog=false;if(!g_objCurrDialog){return}}}removeDialogScrollingClass();resizeCurrentDialog();if(g_objCurrDialog&&g_objCurrDialog.style){g_objCurrDialog.style.visibility="visible";enableDialogButtons()}}function closeDialogWindow(){if(window.opener){window.opener.window.focus()}window.close()}function markDialogAsMoved(){g_hasMovedItem=true;if(g_MoveTimer){clearTimeout(g_MoveTimer)}}function isPrimaryMouseButton(a){if(window.event){if(typeof(window.event.which)!="undefined"){return(1==window.event.which)}}if(window.event){return(window.event.button==1)}else{if(a){return(a.button===0)}}return false}function DialogPointerMove(c){if(!g_mouseCaptureElement){return}var a=g_mouseCaptureElement;if(!a){return}if(dialogTopPos===0){dialogTopPos=eventPageY(c)-a.offsetTop;dialogLeftPos=eventPageX(c)-a.offsetLeft;return}var b=eventPageY(c)-dialogTopPos;if(b<1){b=1}var d=eventPageX(c)-dialogLeftPos;if(eventPageX(c)<0){d=-dialogLeftPos}a.style.top=b+"px";a.style.left=d+"px"}function DialogPointerUp(a){if(!a.isPrimary){return}if(!g_mouseCaptureElement){return}window.removeEventListener("pointermove",DialogPointerMove);window.removeEventListener("pointerup",DialogPointerUp);getEventElement(a).style.cursor="";g_mouseCaptureElement=null;dialogTopPos=0;dialogLeftPos=0}function DialogPointerDown(b,e){if(!b.isPrimary){return}var a=getObj(e);if(!a){return}var c=getEventElement(b),d=checkAttribute(c,"data-MWUndraggable");if(d){return}hideContextMenu();hideNonDialog();g_mouseCaptureElement=a;window.addEventListener("pointermove",DialogPointerMove);window.addEventListener("pointerup",DialogPointerUp);getEventElement(b).style.cursor="move";dialogTopPos=eventPageY(b)-a.offsetTop;dialogLeftPos=eventPageX(b)-a.offsetLeft}function parameterClearingHideDialog(){hideDialog()}function rsErrorCallbackShowErrorDialog(c,a,b){enableDialogButtons();showInfoDialogWithConsequenceP({formTitle:(b?b.errorDialogTitle:"")||"An error occurred.",fnConsequence:function(){},valueHTML:'
'+htmlMultilineEncode(c)+"
"})}function ShowSubmenuDialog(e,b,a,h){if(isDialogShowing()){return}if((""+b)!==""&&g_objCurrDialogId==b){hideDialog();return}hideDialog();var g=getObj("submenuDlg");var d="";for(var c=0;c
'}else{d+=''+a[c]+""}}g.innerHTML=d;var f=getEventElement(e);if(f.nodeName.toUpperCase()=="IMG"){f=f.offsetParent}g.style.top=f.offsetHeight+"px";g.style.left=f.offsetLeft+"px";g.style.visibility="visible";g.style.zIndex=200;cancelEvent(e);g_objCurrDialog=g;g_objCurrDialogId=b;g_currDialogIsSubmenuDialog=true;return false}function rsCallbackChangePasswordDialog(b,a){var c=processSimpleDialogCallback(b,"changePassword","oldPwd",false,false,true);if(c){c.oldPwd.value="";c.newPwd.value="";c.confPwd.value=""}}function ShowChangePasswordDialog(){jsrsExecute(rsCallbackChangePasswordDialog,"Dialog_GetChangePasswordDialog",[],hideTimedMessage);displayTimedMessage("Getting password dialog...")}function rsCallbackSwitchedToUXV2(a){if(checkResponseForError(a)){displayTimedMessage("Refreshing page...");window.location=pageMySettings}}function isEmptyResponse(a){if(a==" "){return true}return(a==="")}function rsCallbackDisplayResponse(c,a,b){if(checkResponseForError(c)){b=b||{};if(!isEmptyResponse(c)){var e=b.clientDialogTitle||"";if(e){var d=htmlMultilineEncode(c);hideDialog();if(b.fnOk){showInfoDialogWithConsequenceP({valueHTML:d,formTitle:e,fnConsequence:function(f){b.fnOk(f,b.fnOkParams)}})}else{showInfoDialog(d,e)}return}else{alert(c)}}hideDialog()}}function postChangePassword(){var b=getObj("changePassword"),a="1"==b.forceChangePassword.value;if(a){refreshPageAndScrollPos()}else{hideDialog()}}function rsChangeSelfPassword(a){if(checkResponseForError(a)){if(!isEmptyResponse(a)){showInfoDialogWithConsequenceP({formTitle:" . . . ",rawValue:a,fnConsequence:postChangePassword});return}postChangePassword()}}function SubmitChangePassword(){var f=getObj("changePassword"),b=f.oldPwd.value,c=f.newPwd.value,a=f.confPwd.value,e="1"==f.forceChangePassword.value;if(c!=a){showInfoDialog("Passwords do not match!","Mismatched Passwords",1,"confPwd");return}if(!validateClientSidePasswordVals(f.userName,f.newPwd,function(h,g){showInfoDialog(h,"Error Validating New Password",1,"validatePwd")})){return}var d="Updating password...";jsrsExecute(rsChangeSelfPassword,"Admin_ChangeSelfPassword",[escape(b),escape(c)],rsErrorCallbackShowErrorDialogAndRefresh,{showErrorInSubdialog:1,errorDialogTitle:"Error "+d},0,1);displayTimedMessage(d+"...");disableDialogButtons()}function CancelChangePassword(){var b=getObj("changePassword"),a="1"==b.forceChangePassword.value;if(a){alert("You must change your password.");setFocus(b.oldPwd)}else{hideDialog()}}function scrollParentDialogIfNecessary(b,a,c){if(typeof(a)=="undefined"){a=1}c=1;while(null!==b){if(null!==getObj(b.id+"DialogContentDiv")){scrollDialogIfNecessary(b.id,a,c);break}b=b.parentNode}}function rescrollParentDialogIfNecessary(a){while(null!==a){if(null!==getObj(a.id+"DialogContentDiv")){reScrollDialogIfNecessary(a.id);break}a=a.parentNode}}function showAndPositionButtonPopup(o,k,q,l,a,n){hideDialog();var s=getObj("contextMenuPopUp");s.innerHTML=q;var i=getObj(k),c=posTop(i)+i.offsetHeight,j=posLeft(i),d=mjtPageXOffset(),b=mjtPageYOffset(),f=pageWidth(),m=pageHeight(),g=s.offsetWidth,p=s.offsetHeight;if(a&&(c+p>b+m)){var r=b+m-p-30;c=Math.max(b,r)}if(n&&(j+g>d+f)){var h=d+f-g-30;j=Math.max(d,h)}s.style.top=c+"px";s.style.left=j+"px";var e=null;if(l){e=getObj(l)}g_objShowDialogObject=s;g_currDialogIsSubmenuDialog=false;g_showDialogIsSubmenu=false;g_showDialogIsViewsList=true;g_objSetFocusObject=e;g_showDialogTimer=setTimeout(asyncShowDialogWithoutHideDialog,0);cancelEvent(o)}var g_submenuCallbackContextId=null;var g_callbackContextMenuElement=null;var g_strSeparatorContent='
';function ContextMenu(b){if(typeof b==="string"){b={menuClasses:b}}else{b=b||{}}var a=this,c=b.menuClasses;this.styleInactiveItems=b.styleInactiveItems;this.MenuItemCount=0;this.Rows=[];this.ListItems=[];if(c){this.MenuClasses=c}this.AddScriptItem=function(g,h,f,e,d){a.AddHTMLTitledScriptItem(htmlEncode(g),h,f,e,d)};this.AddHTMLTitledScriptItem=function(e,h,g,f,d){if(f){f=' onmouseover="'+f+'"'}else{f=""}if(d){d=' onmouseout="'+d+'"'}else{d=""}this.Rows[this.MenuItemCount]='"+e+"";this.MenuItemCount++};this.AddMenuItemP=function(j){var s=j.rawText||"",x=j.itemHTML,g=x||htmlEncode(s),i=(j.inactive?"":j.doubleQuoteReadyScript)||"",t=!i,z=j.isSubmenu,q=j.altSubmenu,h=j.checked,w=j.doubleQuoteReadyItemTitle||"",o=w?('data-mwtooltip="'+w+'" '):"",u="",r=j.menuItemId,e=r?(' id="'+r+'"'):"",y=j.hide,p=j.isHelpTextItem,m=y?' style="display:none"':"",d="",v=j.leadItemIconId,A="",B=trim(t&&this.styleInactiveItems?" clsInactiveMenuRow":""),n=B?' class="'+B+'"':"",f="contextMenuRow"+(j.isHeader?" contextMenuHeader":"")+(p?" clsMenuHelpText":"")+(j.isFullWidthHeader?" contextMenuFullRowHeader":""),l=' class="'+f+'"',C=j.additionalIconClasses||"";if(v){A='&#'+getRawFontId(v)+";"}if(h){u='&#'+getRawFontId(FontIconId_Enum.fiiCheck)+";"}if(z){d='&#'+getRawFontId(FontIconId_Enum.fiiRightChevron)+";"}if(q){d='&#'+getRawFontId(q.fontId||FontIconId_Enum.fiiRightChevron)+";"}var k="
"+(A?'':"")+A+g+(A?"":"")+"
";this.Rows[this.MenuItemCount]=""+k+u+d+"";this.MenuItemCount++};this.AddSubmenuScriptItem=function(d,e){this.Rows[this.MenuItemCount]=''+htmlEncode(d)+'  ';this.MenuItemCount++};this.AddHTMLTitledSubmenuScriptItem=function(d,e){this.Rows[this.MenuItemCount]=''+d+'  ';this.MenuItemCount++};this.AddHTMLTitledLinkItem=function(d,f,g,e){this.Rows[this.MenuItemCount]='";this.MenuItemCount++};this.AddLinkItem=function(e,f,g,d){this.AddHTMLTitledLinkItem(htmlEncode(e),f,g,d)};this.AddInactiveHTMLTitledItem=function(d,e){this.Rows[this.MenuItemCount]='';if(e){this.Rows[this.MenuItemCount]+='&#'+FontIconId_Enum.fiiCheck+";"}this.Rows[this.MenuItemCount]+=d+"";this.MenuItemCount++};this.AddInactiveItem=function(d,e){a.AddInactiveHTMLTitledItem(htmlEncode(d),e)};this.AddSeparator=function(){this.Rows[this.MenuItemCount]=g_strSeparatorContent;this.MenuItemCount++};this.AddSeparatorIfNecessary=function(){if(this.MenuItemCount&&(this.Rows[this.MenuItemCount-1]!=g_strSeparatorContent)){this.AddSeparator()}};this.GetHTML=function(e){var d=e?"":this.MenuClasses,f=d?' class="'+d+'"':"";return'"+this.Rows.join("")+"
"};this.Show=function(e,i,h,l){if(isDialogShowing()){var k=false;var d=getEventElement(e);while(d){if(d==g_objCurrDialog||d==oPopup){k=true;break}d=d.parentNode}if(!k){return}}else{hideNonDialog()}if(this.MenuItemCount===0){return}var f=getObj("contextMenuPopUp");if(typeof l==="function"){f.fnOnHide=l}else{f.fnOnHide=null}f.style.top="0px";f.style.left="0px";f.innerHTML=this.GetHTML();if(this.MenuClasses){f.className="dialogDiv"+(this.MenuClasses?(" "+this.MenuClasses):"")}else{f.className="dialogDiv"}var j=eventPageY(e)+2,g=eventPageX(e)+2;if(!(isNaN(i)||isNaN(h))){g=i;j=h}if(j+f.offsetHeight>bottomOfVisibleScreen()){j=j-f.offsetHeight-4}if(g+f.offsetWidth>rightOfVisibleScreen()){g=g-f.offsetWidth-4}if(jbottomOfVisibleScreen()){k=bottomOfVisibleScreen()-d.offsetHeight}if(h+d.offsetWidth>rightOfVisibleScreen()){h=posLeft(j)-d.offsetWidth}if(kPage Number:';showDialog(e,"GotoPageNum","Go To Page Number","pageNumber",{fnSubmit:SubmitGotoPageNum},0,0,0,0,d?1:0)}function SubmitGotoSelectionListPageNum(){submitGotoPageNumUsingFunction()}function csShowFunctionGotoPageNum(f,d,a,c){var e=isDialogShowing();var b="";b+="";b+="";b+="";b+="";b+="";b+="Page Number:";b+="";b+="";showDialogP(b,"GotoPageNum",{formTitle:"Go To Page Number",skipCentering:1,useStackedDialog:1,contextDetailOrFnSubmit:{fnSubmit:SubmitGotoPageNum,fnCancelOrClose:CancelGotoPageNum,callbackData:{}},isSubdialog:e})}function ShowFunctionGotoPageNum(d,c,a,b){var e=isDialogShowing();jsrsExecute(rsCallbackProcessSimpleDialogWithParams,"Dialog_GetGotoPageNumByFunctionDialog",[c,b,a,e?1:0],hideTimedMessage,{useSavedEventPagePosition:true,formId:"GotoPageNum",isStackedSubdialog:e?1:0});displayTimedMessage("Getting Goto Page Dialog...")}function SortPageWorkhorse(a){if(isDialogShowing()){return}saveScrollPos();displayTimedMessage("Re-sorting...");window.location=a}function buildSortPageWorkhorse(e,d,c,a,b){var g=(d?true:false);var f="";if(g){f="SortPageWorkhorse(unescape('"+escape(d+e)+"'))"}else{f=c+"('"+e+"', "+a+", unescape('"+escape(b)+"'))"}return f}function promptToSortPage(event,addPreSortColumnMenuItemsFunction_,addColumnMenuItemsFunction_,columnParams_,sortBy_,omitAscendingOption_,omitDescendingOption_,url_,sortFunction_,pageNum_,searchTerm_,tableId_){var ascendingSortBy;var descendingSortBy;var enableDefault_=false;if(sortBy_.indexOf("a")===0){ascendingSortBy=sortBy_;descendingSortBy="d"+sortBy_.substring(1)}else{ascendingSortBy="a"+sortBy_.substring(1);descendingSortBy=sortBy_}if(enableDefault_&&g_isDoubleClickEvent){if(!addPreSortColumnMenuItemsFunction_){if(!omitAscendingOption_){eval(buildSortPageWorkhorse(ascendingSortBy,url_,sortFunction_,pageNum_,searchTerm_));return}if(!omitDescendingOption_){eval(buildSortPageWorkhorse(descendingSortBy,url_,sortFunction_,pageNum_,searchTerm_));return}}}var theMenu=new ContextMenu();if(addPreSortColumnMenuItemsFunction_){if(addPreSortColumnMenuItemsFunction_(theMenu,columnParams_,true)){return}}if(!omitAscendingOption_){theMenu.AddHTMLTitledScriptItem("↑ Sort ascending",buildSortPageWorkhorse(ascendingSortBy,url_,sortFunction_,pageNum_,searchTerm_),enableDefault_&&(!addPreSortColumnMenuItemsFunction_))}if(!omitDescendingOption_){theMenu.AddHTMLTitledScriptItem("↓ Sort descending",buildSortPageWorkhorse(descendingSortBy,url_,sortFunction_,pageNum_,searchTerm_),enableDefault_&&(!addPreSortColumnMenuItemsFunction_)&&omitAscendingOption_)}if(addColumnMenuItemsFunction_){if(addColumnMenuItemsFunction_(theMenu,columnParams_,true)){return}}if(theMenu.MenuItemCount>0){if(!enableDefault_&&(!(omitAscendingOption_&&omitDescendingOption_))&&theMenu.MenuItemCount==1){eval(buildSortPageWorkhorse(sortBy_,url_,sortFunction_,pageNum_,searchTerm_))}else{theMenu.Show(event)}}}function promptToSortPageWithUrl(b,c,h,i,f,g,e,d,a){promptToSortPage(b,c,h,i,f,e,d,g,null,null,null,a)}function promptToSortPageWithFunction(b,d,j,k,i,h,f,e,c,g,a){promptToSortPage(b,d,j,k,i,h,f,null,e,c,g,a)}function rsCallbackHideDialogRefreshPageAndScrollPos(a){if(checkResponseForError(a)){hideDialog();refreshPageAndScrollPos();return true}else{enableDialogButtons();return false}}function hideDlgRefreshPageScrollAndCheck(a,b){storeCheckState(b);if(rsCallbackHideDialogRefreshPageAndScrollPos(a)){return true}else{delCookie("tmpCheckedRows");delCookie("tmpCheckboxedForm");return false}}function properCase(c){var b=c.split(" ");var a;for(a=0;a300){f=f.substring(0,300)+"..."}var c="Are you sure you want to "+m.toLowerCase()+" ",b=properCase(m)+" "+properCase(e>1?k:n);if(e>1){c=c+"these "+e+" "+k}else{c=c+"this "+n}c=c+"? \n"+f;displaySimpleConfirmationDialog(doPerformAction,htmlMultilineEncode(c),b,{paramArray:l,paramIndexForIds:i,remoteFunctionName:h,rsCallback:a,strIds:j,fnProcessRSContextId:g,strDoWhat:b,paCSErrorDialogTitle:d?d:0},1,"ok")}function submitPerformActionOnNamedItems(m,r,j,s,b,f,q,g,h,a){var p=getObj(m);g=g?g:rsCallbackRefreshPageAndScrollPos;if(!p.chkRow){return false}var k="",o="",n=[],c=0,l=[];if(typeof(p.chkRow.checked)=="boolean"){if(p.chkRow.checked){n=p.chkRow.value.split("?");k=n[0];l[0]=k;o=unescape(n[1]);c=1}}else{var i=0;for(var e=0;e300){o=o.substring(0,300)+"..."}var d=0;if(h){d=function(t){h(l,t)}}submitPerformAction(c,k,o,r,j,s,b,f,q,g,d,a)}function clickedDialogLink(a){hideDialogP({callback:function(){window.location=a}})}function updateDropdownImageGivenObjects(c,f,d){if(c&&f){var b=null;var a=false;if(d){var g=d.value.split(",");if(g.length>0){b=g[1];a="1"==g[2]}}var e=(a&&b)?"":"none";c.style.display=e;f.style.display=e;if(a&&b){c.src=pageDownloadAttachedFile+"&fileId="+b}reScrollDialogIfNecessary(d.form.id)}}function isQPLByPriceGroupSelected(b){var a=b.cboPriceQPLBy;if(a){return parseInt(a.value,10)==PriceQuoteProductLineBy_Enum.pqplbPriceGroup}return false}var g_noImageMessageCheckTimerId=null;function asynchCheckNecessityOfNoImageMessage(){clearTimeout(g_noImageMessageCheckTimerId);g_noImageMessageCheckTimerId=null;var e=getObj("msgCurrentlyNoImages"),l=getObj("rowProductLineItemDisplayImages");if(e||l){var h=getObj("editQuoteLineItem");if(!h){h=getObj("createQuoteLineProduct")}var m=false;var d=getObj("optionShowProductVariants");var k=null;if(h&&h.productId&&h.productId.value){k=h.productId.value.split("?");if(k.length>=26){var i=","+k[21]+","+k[22]+","+k[23]+","+k[24]+","+k[25]+",";m=i.indexOf(",1,")>-1}}if(e){var c=false,n,b,o,g,j;for(n=1;(!c)&&(n<=5);++n){b=getObj("Attr"+n+"Value");if(b){o=getObj("attrImage"+n);g=getObj("attrImageRow"+n);if(o&&g){j=b.value.split(",");if(j.length>0){var a=j[1];if(a){c=a?true:false}}}}}e.style.display=c?"none":""}if(k){if(k.length>=21){var f=(parseInt(k[20],10)>0);if(f){if(isQPLByPriceGroupSelected(h)){m=false}}}}if(l){l.style.display=m?"":"none"}}}function forceHideDisplayImagesRow(){var a=getObj("rowProductLineItemDisplayImages");if(a){a.style.display="none"}}function checkNecessityOfNoImageMessage(){if(g_noImageMessageCheckTimerId){clearTimeout(g_noImageMessageCheckTimerId)}g_noImageMessageCheckTimerId=setTimeout(asynchCheckNecessityOfNoImageMessage,200)}function updateProductAttributeValueImage(d){var c=getObj("attrImage"+d);var b=getObj("attrImageRow"+d);if(c&&b){var a;if(parseInt(d,10)>0&&parseInt(d,10)<=5){a=getObj("Attr"+d+"Value")}else{a=getObj("attributeValueId")}updateDropdownImageGivenObjects(c,b,a)}checkNecessityOfNoImageMessage()}function clearCachedAttrValsForAttrNum(a){populateAttrContextId[a]="";populateAttrName[a]="";populateAttrInitValue[a]="";updateProductAttributeValueImage(a)}function rsCallbackPopulateAttr(c,b){for(var a=1;a<=5;a++){if(populateAttrContextId[a]==b){if(checkResponseForError(c)){var d=getObj("productId").value.split("?")[0];getObj(populateAttrName[a]).innerHTML='
";if(populateAttrInitValue[a]!==""){getObj("Attr"+a+"Value").value=populateAttrInitValue[a]}}clearCachedAttrValsForAttrNum(a);return}}}function clearProductAttributeSelectionRSCalls(){for(var a=1;a<=5;a++){if(populateAttrContextId[a]){mjtrsAbort(populateAttrContextId[a])}populateAttrContextId[a]=""}}function getProductAttributesSelections(m,t,b,c,r,a,s,f,d,e,k){if(k){var g=k.getAttribute("data-mjtSkipUnchangedProductLastVal");if(g==t){return}k.setAttribute("data-mjtSkipUnchangedProductLastVal",t)}var n=t.split("?");if(typeof(d)=="undefined"){d=1}else{d=d?1:0}var i=null;if(c){i=c.split("?")}if(d===null){d=1}clearProductAttributeSelectionRSCalls();if(r&&a){return getQuoteLineProductAttrSelV2(n,i,m,b,r,a)}for(var p=1;p<=5;p++){var o=false,j=getObj(m+p+"Type"),u=getObj(m+p+"Value");if((b+(2*p)-1)0){var l=unescape(n[b+(2*p)-1]);j.innerHTML=htmlEncode(l)+":";j.setAttribute("data-mjtAttrTypeName",l);j.setAttribute("attrTypeId",n[b+(2*p)-2]);populateAttrName[p]=m+p+"Value";getObj(populateAttrName[p]).innerHTML="Loading...";if(i&&p<=i.length){populateAttrInitValue[p]=i[p-1]}else{populateAttrInitValue[p]=""}if(r&&a){populateAttrContextId[p]=jsrsExecute(rsCallbackPopulateAttr,"Admin_GetActiveSellAttributeValueOptionElements",[r,a,p])}else{if(r&&s){populateAttrContextId[p]=jsrsExecute(rsCallbackPopulateAttr,"Admin_GetActivePurchaseAttributeValueOptionElements",[r,s,f,p,d])}else{populateAttrContextId[p]=jsrsExecute(rsCallbackPopulateAttr,"CustomField_GetAttributeValueOptionElements",[n[b+(2*p)-2],d,e?0:1])}}}else{j.innerHTML="";u.innerHTML="";o=true}}else{j.innerHTML="";u.innerHTML="";o=true}var q=getObj(m+p+"RowId"),h=getObj("attrImageRow"+p);if(q){q.style.display=o?"none":"";q.setAttribute("data-mjtHiddenAttribute",o?1:0)}if(h){h.style.display=o?"none":""}}checkNecessityOfNoImageMessage();if(typeof clearSelectedInventoryData==="function"){clearSelectedInventoryData()}return 1}function IsNumber(g){g=trim(g);if(g.length===0){return false}var e=" .+-0123456789";var d=" .0123456789";var f;var a=false;var c=false;var h=false;f=e.indexOf(g.charAt(0));if(f==1){a=true}else{if(f<0){return false}else{if(f>3){h=true}}}for(var b=1;b0){c.jobTemplateId.value=b}else{selectFirstTemplateForNewJob(c)}}}function ChangedAccountForNewJob(a){var b=getObj("createJob");if(b&&b.customerId){if(b.customerId.value.length){jsrsExecute(rsCallbackLookupDefaultTemplate,"Job_GetAccountJobTemplate",[b.customerId.value,b.jobProcessId.value],enableDialogButtons);if(a){displayTimedMessage("Looking up default Job Template for account...")}}else{selectFirstTemplateForNewJob(b)}}}function viewJobDetails(a,c){g_bSkipNavWarning=true;var b=c?c:g_builtinJobProcessId;hidePicker();disableDialogButtons();displayTimedMessage("Loading "+htmlEncode(carefullyGetJobProcessName(b))+"...");window.location=arrPageJobDetail[b]+a}function rsCallbackViewNewJob(c,a,b){if(checkResponseForError(c)){viewJobDetails(c,b?b.jobProcessId:0)}}function rsCallbackSuccessfullyCreatedNewJob(responseString_,contextId_,params_){var theForm=getObj("createJob"),successfulCreateCallbackFnName=theForm.successfulCreateCallbackFnName.value,tmpJPId=params_.jobProcessId;tmpJPId=tmpJPId?tmpJPId:0;if(successfulCreateCallbackFnName){eval(successfulCreateCallbackFnName+"({jobProcessId:"+tmpJPId+", jobId:"+responseString_+', jobName:unescape("'+escape(theForm.jobName.value)+'")})')}else{rsCallbackViewNewJob(responseString_,contextId_,{jobProcessId:tmpJPId})}}function confirmCreateDuplicateJobIfNecessary(d,b,f){var e=false;if(checkResponseForError(d)){if(isEmptyResponse(d)){f()}else{var h=d.split("?")[1],g=carefullyGetJobProcessName(h),a=g==b,c=a?"another":"a";displaySimpleConfirmationDialog(f,"There is already a "+htmlEncode(g)+" with that name.
Are you sure you want to create "+c+" "+htmlEncode(b)+" with the same name?","Duplicate "+b,{},1)}}return e}function rsCallbackValidateNewJobName(b){var g=getObj("createJob"),d=g.jobProcessName.value,f=trim(g.jobName.value),e=g.customerId.value,a=g.jobTemplateId.value,c=function(){var h="Creating New "+d;jsrsExecute(rsCallbackSuccessfullyCreatedNewJob,"Job_CreateJob",[escape(f),e,a,g.jobProcessId.value,g.defaultSalespersonId?g.defaultSalespersonId.value:"",g.defaultSalespersonId?0:1],rsErrorCallbackShowErrorDialog,{jobProcessId:g.jobProcessId.value,showErrorInSubdialog:1,errorDialogTitle:"Error "+h},0,1);displayTimedMessage(htmlEncode(h)+"...");disableDialogButtons()};enableDialogButtons();setFocus(g.jobName);confirmCreateDuplicateJobIfNecessary(b,d,c)}function SubmitCreateNewJob(){var c=getObj("createJob"),b=c.jobProcessName.value,a=new FormValidator();if(!a.CSValidateRequiredField(c.jobName,"Please enter a "+b+" Name")){return}if(!a.CSValidateRequiredField(c.customerId,"Please select an Account","customerName")){setFocus(c.customerName);return}jsrsExecute(rsCallbackValidateNewJobName,"Job_GetJobByName",[escape(c.jobName.value),c.customerId.value],enableDialogButtons);displayTimedMessage("Validating "+htmlEncode(b)+" Name...");disableDialogButtons()}function rsCallbackTemplateOptions(b,a){if(g_templateContextId==a){if(checkResponseForError(b)){getObj("createQuoteTemplates").innerHTML=""}}}function getDummyTemplateCBOPlaceholder(){return''}var g_lastQuotePriceType=null;function changeQuotePriceType(a){if(a){setTimeout("changeQuotePriceType( false);",0);return}var c=getObj("createQuote"),b="";if(c.createQuotePriceTypeId){b=c.createQuotePriceTypeId.value}else{b=getObj("createQuotePriceTypeId").value}if(null===g_lastQuotePriceType||(g_lastQuotePriceType!=b)){g_lastQuotePriceType=b;if(b){g_templateContextId="";getObj("createQuoteTemplates").innerHTML="Loading..."+getDummyTemplateCBOPlaceholder();g_templateContextId=jsrsExecute(rsCallbackTemplateOptions,"Quote_GetPriceTypeTemplateOptionElements",b,hideTimedMessage);displayTimedMessage("Getting Quote Templates...")}else{getObj("createQuoteTemplates").innerHTML='No Price list Selected'+getDummyTemplateCBOPlaceholder()}}}function rsCallbackPriceTypeOptions(b,a){if(g_priceTypeContextId==a){if(checkResponseForError(b)){getObj("createQuotePriceTypes").innerHTML="";g_lastQuotePriceType=null;changeQuotePriceType(true)}}}function changeQuoteCustomer(){var d=getObj("createQuote"),a=QuoteType_Enum.mjtAccountQuote;for(var b=0;bQuotes can't be added to inactive accounts.","Account Is Inactive")}function rsCallbackViewNewCGQuote2(a,d){var c=(d||{}).originalOptions||{},b=c.expectedIdFieldName||"id";hideDialog();window.location=pageCGEditQuote+a[b]}function submitCreateNewCGQuote(){var g=getObj("createQuote");var d=new FormValidator();if(!d.CSValidateRequiredField(g.quoteName,"Please enter a Quote Name")){return}var f=false;var a="1";for(var c=0;c'+htmlEncode(f.name)+""}g+="";showSubdialog(g,"frmAssignPLToAcount","Assign Price List To Account","cboPLForAccount",{fnSubmit:submitAssignCGToAccount,callbackData:{accountId:h,arrPLs:e}},0,0,0,0,"cboPriceList",0,0,g_isCounterGo?"":"cg")}}function assignPLToAccountFromCreateCGQuote(a){jsrsExecute(rsCallbackGetCGPLsToAssignToAccount,"CG_GetCGPLsToAssignToAccount",[a],enableDialogButtons,{accountId:a});displayTimedMessage("Getting Price Lists available to be added to the account");disableDialogButtons()}function changedPLOption(){var d=getObj("createQuote"),c=d.cboPriceList,a=c.options[c.selectedIndex],b=a.getAttribute("data-mjtassignpl");if(b){c.selectedIndex=0;assignPLToAccountFromCreateCGQuote(d.accountId.value)}}function rsCallbackCGPriceListOptions(e,d){if(g_priceTypeContextId==d){if(checkResponseForError(e)){var f,g,a,c,b=getObj("createCGQuotePriceLists");b.innerHTML="";g_lastQuotePriceType=null;f=getObj("cboPriceList");c=f.options;g=c.length;if(g<2){f.style.display="none";a=document.createElement("div");b.appendChild(a);if(g){a.innerHTML=htmlEncode(c[0].innerHTML)}else{a.innerHTML=g?htmlEncode():"No Price List Found For Selected Account";a.className="helpText"}}}}}function changeCGQuoteAccount(){var f=getObj("createQuote"),e=(f.accountId?f.accountId.value:"")||(f.accountSelect?f.accountSelect.value:""),d=false,b="1",c,a;for(c=0;cNo Account Selected'+getPriceTypesCBOPlaceholder()}else{g_priceTypeContextId="";getObj("createCGQuotePriceLists").innerHTML="Loading..."+getPriceTypesCBOPlaceholder();g_priceTypeContextId=jsrsExecute(rsCallbackCGPriceListOptions,"CG_GetAccountCGPriceListOptionElements",[a?e:""],hideTimedMessage);displayTimedMessage("Getting Price List options")}}function changeCGQuoteType(){var d=getObj("createQuote"),b=QuoteType_Enum.mjtAccountQuote,a;for(var c=0;cCG Quotes can't be added to inactive accounts.","Account Is Inactive")}function getJTQuoteUrl(a){return pageQuoteDetail+a}function getJTQuoteRevisionUrl(a){return pageQuoteDetail+"?revId="+a}function rsCallbackViewNewQuote(a){if(checkResponseForError(a)){hideDialog();window.location=getJTQuoteUrl(a)}else{enableDialogButtons()}}function SubmitCreateNewQuote(){var f=getObj("createQuote");var d=new FormValidator();if(!d.CSValidateRequiredField(f.quoteName,"Please enter a Quote Name")){return}var a="1";for(var c=0;c0){getObj("createPurchaseOrderCostTypes").innerHTML=""}else{getObj("createPurchaseOrderCostTypes").innerHTML="(No active cost lists for this supplier)"}}}}function rsCallbackShowNewSupplierSubdialog(a){processSimpleDialogCallback(a,"createSupplier","name",true,true)}function showNewSupplierSubdialog(a){var b=getObj(a);if(b.supplierId.value=="-1"){selectFirstOption(b.supplierId);jsrsExecute(rsCallbackShowNewSupplierSubdialog,"Dialog_GetNewSupplierSubdialog",[],enableDialogButtons);displayTimedMessage("Getting New Supplier Subdialog");disableDialogButtons()}}function changePOSupplier(){var a=getObj("createPurchaseOrder");if(a.supplierId.value=="-1"){showNewSupplierSubdialog(a.id);return}if(a.supplierId.value!==""){g_costTypeContextId="";getObj("createPurchaseOrderCostTypes").innerHTML="Loading...";g_costTypeContextId=jsrsExecute(rsCallbackCostTypeOptions,"PO_GetSupplierCostTypeOptionElements",a.supplierId.value)}else{getObj("createPurchaseOrderCostTypes").innerHTML=""}}function rsCallbackNewPODialog(b,a){if(checkResponseForError(b)){hideDialog();getObj("dynamicDialog").innerHTML=b;changeGeneratePONumber();changePOSupplier();var c=getObj("createPurchaseOrder");positionAndShowDialog(false,c.parentNode,false,c.supplierId,true)}}function ShowNewPODialog(c,a,d){var b="Getting New Purchase Order Dialog";jsrsExecute(rsCallbackNewPODialog,"Dialog_GetNewPODialog",[a,d],rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error "+b},0,1);displayTimedMessage(b+"...")}function buildPageURLForPO(a){return pagePODetail+a+"?"}function rsCallbackViewNewPO(a){if(checkResponseForError(a)){g_bSkipNavWarning=true;window.location=buildPageURLForPO(a)}}function SubmitCreateNewPO(){var d=getObj("createPurchaseOrder");var b=new FormValidator();if(!b.CSValidateRequiredField(d.supplierId,"Please select a Supplier")){return}var a="";if(!d.generatePONumber.checked){if(!b.CSValidateRequiredField(d.poNumber,"Please enter a PO Number")){return}a=d.poNumber.value}if(d.costTypeId.value=="-1"){alert("No active cost lists for this supplier.");setFocus(d.supplierId);return}if(!b.ValidateRequiredField(d.shipToLocationId,"Please select a Ship-To Location")){return}var c="";if(d.costTypeId){c=d.costTypeId.value}else{c=getObj("costTypeId").value}jsrsExecute(rsCallbackViewNewPO,"PO_CreatePurchaseOrder",[d.supplierId.value,d.jobId.value,c,d.shipToLocationId.value,escape(a)],enableDialogButtons);displayTimedMessage("Creating Purchase Order...");disableDialogButtons()}function submitDuplicatePO(){var h=getObj("createPurchaseOrder")||getObj("duplicatePO"),e=new FormValidator(),a="",b;if(!h.generatePONumber.checked){if(!e.CSValidateRequiredField(h.poNumber,"Please enter a PO Number")){return}a=h.poNumber.value}if(!e.ValidateRequiredField(h.shipToLocationId,"Please select a Ship-To Location")){return}if(!e.CSValidateDateField(h.orderDate,"Order Date",true)){return}if(!e.CSValidateDateField(h.expectedReceiptDate,"Expected Delivery Date",true)){return}if(!e.CSValidateNumberField(h.taxPct,"Tax Rate %",true)){return}if(!e.CSValidateAttributeFields(h)){return}var c=e.ModifiedFieldIds,d=e.ModifiedFieldValues,g=getListOfCheckedRowValues(h,0),f="Creating Duplicate Purchase Order";jsrsExecute(rsCallbackViewNewPO,"PO_DuplicatePO",[h.poId.value,escape(a),h.supplierId.value,h.costListId.value,h.shipToLocationId.value,getDateForUrlParam(h.orderDate.value),getDateForUrlParam(h.expectedReceiptDate.value),trim(h.taxPct.value),escape(h.description.value),escape(c),escape(d),escape(g)],rsErrorCallbackShowErrorDialog,{showErrorInSubdialog:1,errorDialogTitle:"Error "+f},0,1);displayTimedMessage(f+"...");disableDialogButtons()}function rsCallbackNewApptDialog(b,a){processSimpleDialogCallback(b,"createAppt","apptName",true)}function showNewApptDialog(c,b,d,a){jsrsExecute(rsCallbackNewApptDialog,"Dialog_GetNewApptDialog",[getDateForUrlParam(b),d,a],rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error Getting New Appointment Dialog"},0,1);displayTimedMessage("Getting Appointment Dialog...")}function SubmitCreateNewAppt(){var h=getObj("createAppt"),c=new FormValidator(),g=h.recurringId.value;if(!c.CSValidateRequiredField(h.apptName,"Please enter a Name")){return}if(!c.CSValidateDateField(h.startDate,"Start Date",false)){return}if(!validateDurationContents(h.schedDuration,"Duration")){return}if(!validateTimeContents(h.schedTime,"Time")){return}if(g){var b=g.split("?");if(b.length&&b.length>2){var f=b[1];if(f){f=parseDateString(f);var a=parseDateString(h.startDate.value);if(a>f){showInfoDialog(htmlMultilineEncode("The appointment start date cannot be after the recurrence end date."),"Invalid Start/End Date",1,h.startDate.name);return}}}}var e=getCompoundSelectionValue(h.assigneeId,h.assigneeIdSelect),d="Creating Appointment";g_NewApptDate=h.startDate.value;jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Job_CreateAppointment",[escape(trim(h.apptName.value)),getDateForUrlParam(h.startDate.value),escape(getTrueTimeValue(h.schedTime)),escape(getTrueDurationValue(h.schedDuration)),e,escape(trim(h.apptDesc.value)),h.recurringId.value,h.status.value,h.categoryId.value],rsErrorCallbackShowErrorDialogAndRefresh,{showErrorInSubdialog:1,errorDialogTitle:"Error "+d},0,1);displayTimedMessage(d+"...");disableDialogButtons()}function rsCallbackViewNewAppt(a){if(checkResponseForError(a)){g_bSkipNavWarning=true;window.location=pageCalendar+"&dayCount=1&effdate="+getDateForUrlParam(g_NewApptDate)}}function ShowNewCustomerDialog(){var a="Getting New Account Dialog";jsrsExecute(rsCallbackProcessSimpleDialogWithParams,"Dialog_GetNewCustomerDialog",[],rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error "+a,formId:"createCustomer"},0,1);displayTimedMessage(a+"...")}function viewQuoteDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading Quote...");window.location=getJTQuoteUrl(a)}function viewCGQuoteDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading CG Quote...");window.location=pageCGViewQuote+a}function viewOrderDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading Order...");window.location=pageCGOrderView+a}function viewAccountDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading Account...");window.location=pageCustomerDetail+a}function viewPurchaseOrderDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading Purchase Order...");window.location=pagePODetail+a}function viewSerialNumberDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading Serial Number...");window.location=pageSerialNumberDetail+a}function viewProductVariantDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading Product Variant...");window.location=pageInventoryDetail+"variantId="+a}function viewSupplierDetails(a){g_bSkipNavWarning=true;hidePicker();disableDialogButtons();displayTimedMessage("Loading Suppliers...");window.location=pageSupplierDetail+a}function rsCallbackViewNewCustomer(a){if(checkResponseForError(a)){viewAccountDetails(a)}else{enableDialogButtons()}}function rsV2JsonCallbackViewNewAccount(a){hideDialog();viewAccountDetails(a.accountId)}function rsCallbackValidateNewCustomerName(d){var g=getObj("createCustomer"),b=trim(g.customerName.value),e="",c="";if(g.priceType){e=g.priceType.value}if(g.cgPriceList){c=g.cgPriceList.value}var a="An Account with this name already exists. Are you sure you want to create another Account with this name?";var f=function(){jsrsExecute(rsCallbackViewNewCustomer,"Customer_CreateCustomer",[escape(b),e,c],enableDialogButtons);displayTimedMessage("Creating Account...");disableDialogButtons()};if(checkResponseForError(d)){if(!isEmptyResponse(d)){displaySimpleConfirmationDialogP(f,a,{formTitle:"Create Account",isSubdialog:true,subdialogDismisalFocusFieldName:"dialogFieldName"});return}}f()}function SubmitCreateCustomer(){var b=getObj("createCustomer");var a=new FormValidator();if(!a.CSValidateRequiredField(b.customerName,"Please enter an Account Name")){return}if(b.priceType){if(!a.CSValidateRequiredField(b.priceType,"Please select a Price List")){return}}if(b.cgPriceList){if(!a.CSValidateRequiredField(b.cgPriceList,"Please select a CG-Price List")){return}}jsrsExecute(rsCallbackValidateNewCustomerName,"Customer_GetCustomerByName",escape(b.customerName.value),hideTimedMessage);displayTimedMessage("Validating Account Name...")}function addSelectOptions(f,c,e){var d=c.split(","),a=e.split(",");for(var b=0;b0){a=checkAttribute(b.options[b.options.length-1],"mjtLastOption")}if(a){b.insertBefore(c,a)}else{b.appendChild(c)}return c}function rsCallbackCreatedInSubdialog(l,e,p){enableDialogButtons();if(checkResponseForError(l)){var n=p.responseIdNameSeparator?p.responseIdNameSeparator:"?",r=l.split("?"),h=(p.idPrefix?p.idPrefix:"")+r[0],o;if((typeof p.valueToUse=="undefined")&&(null!==p.valueToUse)){o=p.valueToUse}else{o=r[1]}var b=p.multiValueSeparator?p.multiValueSeparator:",",d=h.split(b),g;if(d.length>1){g=o.split(b)}else{g=[o]}var k=null;var j=getObj(p.formId);if(p.formId!=p.selectControlParentFormId&&j){k=reconstructSimpleShoppingCart(j.id);var f;for(f=0;f-1){d+="&sort="+h.sortDirection.value+f}if(a!==""){d+="&cols="+a}if(trim(h.pageSize.value)!==""){d+="&pageSize="+trim(h.pageSize.value)}if(e!==""){d+="&filters="+e}if(h.currentViewId&&h.currentViewId.value&&trim(h.currentViewId.value)!==""){d+="&mrv="+trim(h.currentViewId.value)}g_bSkipNavWarning=true;disableDialogButtons();displayTimedMessage("Updating Purchase Order Options...");window.location=d}function postConfirmationDeleteCGQuote(b){var a=b.url;jsrsExecute(a?rsCallbackSaveSettingsAndNavigateTo:rsCallbackRefreshPageAndScrollPos,"CG_DeleteQuote",[b.quoteId,b.promptingToIgnoreEmails?1:0],hideTimedMessage,{url:a?a:0});displayTimedMessage("Deleting Quote...")}function rsCallbackConfirmDeleteCGQuote(f,d,e){if(checkResponseForError(f)){var h=e.quoteId,c=e.quoteName,a=JSON.parse(f),g=a.activeEmailCount,b;if(g){b='
'+htmlMultilineEncode('The quote, "'+c+'",\nhas already been emailed'+(g==1?"":(" "+g+" times"))+'.\n\nAre you sure you want to delete it?"')+"
";e.promptingToIgnoreEmails=1}else{b='Are you sure you want to delete the quote, "'+htmlEncode(c)+'"?'}displaySimpleConfirmationDialogP(postConfirmationDeleteCGQuote,b,{formTitle:"Delete Quote",okButtonDisplayText:"Delete",contextDetail:e})}}function confirmDeleteCGQuote(d,a,b){hideDialog();var c="Checking Quote Dependencies";jsrsExecute(rsCallbackConfirmDeleteCGQuote,"CG_CheckCGQuoteDependencies",d,rsErrorCallbackShowErrorDialogAndRefresh,{quoteId:d,quoteName:a,url:b?b:0,errorDialogTitle:"Error "+c},0,1);displayTimedMessage(c+"...")}function submitCGQuoteSummaryOptions(){var h=getObj("viewOptions");var e=getURLEncodedFiltersFromForm(h);var b=new FormValidator();if(!b.CSValidateNumberField(h.pageSize,"Rows per page",true)){return}var d=pageCGQuotes+"&view=0";if(trim(h.priceListId.value)!==""){d+="&priceList="+trim(h.priceListId.value)}if(trim(h.salespersonId.value)!==""){d+="&salesperson="+trim(h.salespersonId.value)}if(h.accountId&&h.accountId.value){d+="&accountId="+h.accountId.value}var c=h.sortColumnName.value;var g=getObj("optionsFieldCart");var a=ToolMan.dragsort().encodeNestedListStructure(g,jobProcessCartStripper);var f=ToolMan.dragsort().flatIndexOfItem(a,c);if(f>-1){d+="&sort="+h.sortDirection.value+f}if(a!==""){d+="&cols="+a}if(trim(h.pageSize.value)!==""){d+="&pageSize="+trim(h.pageSize.value)}if(e!==""){d+="&filters="+e}if(h.currentViewId&&h.currentViewId.value&&trim(h.currentViewId.value)!==""){d+="&mrv="+trim(h.currentViewId.value)}g_bSkipNavWarning=true;disableDialogButtons();displayTimedMessage("Updating Quote Options...");window.location=d}function showCGQuoteSummaryOptions(a,g,i,j,f,c,d,b,h,e){if(!e){e=""}showOptionsDialog("Dialog_GetCGQuotesOptionsDialog",[escape(g),escape(i),escape(j),escape(f),escape(c),d?1:0,escape(b),h,e])}function changePrintQuoteType(){var h=getObj("printableQuote");if(h.printTypeObject){var d=h.printTypeObject[0].checked;for(var c=0;c'+k+""}else{c=f+k}if(!c){showInfoDialog("There are no active Forms available for printing a quote.","No Active Forms");return}c='";a.addFlexibleRow({valueHTML:c});if(d){a.addFlexibleFieldRow({rawLabel:"Print As",valueHTML:''})}else{a.addFlexibleFieldRow({rawLabel:"Print As",valueHTML:cdBuildRBP("docType","printTypePDF","PDF",{checked:true,fieldValue:"pdf"}),hideRow:!i});if(i){a.addFlexibleFieldRow({valueHTML:cdBuildRBP("docType","printTypeHTML","HTML",{fieldValue:"htm"})});a.addFlexibleFieldRow({valueHTML:cdBuildRBP("docType","printTypeDOC","Word Document",{fieldValue:"doc"}),rowId:"printTypeDOCSelection"})}if(i&&g.canUpdateQuote){a.addFlexibleRow({valueHTML:"
"});a.addFlexibleRow({valueHTML:cdBuildCheckboxAndLabel("chkMakeDefault","printableQuote_chkMakeDefault","Make this the default format for this quote")})}else{a.addTextFieldRow("chkMakeDefault",{fieldValue:"1",hideRow:1})}}var h=a.showClientDialog();if(h){mjtElemData(h,"quoteId",e.quoteId);mjtElemData(h,"quoteRevisionId",e.quoteRevisionId);changePrintQuoteType()}}function showPrintableQuoteRevisionV2(b,a){hideDialog();jsrsExecuteWithErrorP("Dialog2_GetPrintableQuoteRevisionInfoV2",rsCallbackHandleStandardJSONResponse,"Getting Printable Quote Revision Info",{quoteId:b,quoteRevisionId:a},{fnOnSuccess:rsCallbackProcessPrintableQuoteRevisionInfoV2})}function getPrintableQuoteSelections(){var d=getObj("printableQuote"),b=mjtElemData(d,"quoteId"),c,a={quoteId:b,makeDefault:d.chkMakeDefault&&d.chkMakeDefault.checked,isPacket:false,packetId:"",formId:""};c=d.cboFormOrPacket.value.split(":");a.isPacket=c[0]=="P";if(c.length>1){if(a.isPacket){a.packetId=c[1]}else{a.formId=c[1]}}return a}function submitPrintableQuoteStep2(){var m=getPrintableQuoteSelections(),g=getObj("printableQuote"),d,b="",l,k="pdf",n=mjtElemData(g,"quoteRevisionId");for(d=0;d-1){d+="&sort="+g.sortDirection.value+e}if(a!==""){d+="&cols="+a}if(trim(g.pageSize.value)!==""){d+="&pageSize="+trim(g.pageSize.value)}if(g.currentViewId&&g.currentViewId.value&&trim(g.currentViewId.value)!==""){d+="&mrv="+trim(g.currentViewId.value)}g_bSkipNavWarning=true;disableDialogButtons();displayTimedMessage("Updating Supplier Options...");window.location=d}function rsCallbackEditSupplierHeaderDialog(b,a){var c=processSimpleDialogCallback(b,"editSupplier");updateAttributeLOVsIfNecessary(c)}function ShowEditSupplier(b){var a="Getting Edit Supplier Header Dialog";jsrsExecute(rsCallbackEditSupplierHeaderDialog,"Dialog_GetEditSupplierHeaderDialog",b,rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error "+a},0,1);displayTimedMessage(a+"...")}function SubmitEditSupplier(){var d=getObj("editSupplier"),c=new FormValidator();if(!c.CSValidateRequiredField(d.supplierName,"Please enter a Supplier Name")){return}if(!c.CSValidateNumberField(d.taxPct,"Tax Rate %",true)){return}if(!c.CSValidateAttributeFields(d)){return}var a=c.ModifiedFieldIds,b=c.ModifiedFieldValues;jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Admin_UpdateSupplier",[d.supplierId.value,escape(d.supplierName.value),escape(d.supplierDesc.value),d.taxPct.value,escape(a),escape(b),d.chkIsInactive.checked?1:0],enableDialogButtons);displayTimedMessage("Updating Supplier...");disableDialogButtons()}function showReorderUnitsOfMeasureDialog(b,a){jsrsExecute(rsCallbackReorderDialog,"Dialog_GetReorderUnitsOfMeasureDialog",[a],hideTimedMessage);displayTimedMessage("Getting Re-Order Units Of Measure Dialog...")}function submitReorderUnitsOfMeasure(){var c=getObj("frmReorder"),b=getObj("optionsFieldCart"),a=ToolMan.dragsort().encodeNestedListStructure(b,cartStripper,0);jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Admin_ReorderUnitsOfMeasure",[a],enableDialogButtons);displayTimedMessage("Re-Ordering Units Of Measure...");disableDialogButtons()}function showReorderCGPriceLists(a,b){jsrsExecute(rsCallbackReorderDialog,"Dialog_GetReorderCGPriceListsDialog",[b],hideTimedMessage);displayTimedMessage("Getting Re-Order CG-Price Lists Dialog...")}function editCGPriceList(a){displayTimedMessage("Editing Price List...");window.location=pageCGEditPriceList+a}function rsCallbackDuplicateCGPriceList(c,b){if(checkResponseForError(c)){hideDialog();var a=JSON.parse(c);editCGPriceList(a.priceListId)}}function duplicateCGPriceList(b,d,a){var c="Creating a new Price List";jsrsExecute(rsCallbackDuplicateCGPriceList,"CG_DuplicateCGPriceList",[a.priceListId,null===a.revisionId?"":a.revisionId,escape(d)],rsErrorCallbackShowErrorDialog,{showErrorInSubdialog:1,errorDialogTitle:"Error "+c},0,1);displayTimedMessage(c+"...");disableDialogButtons()}function showDuplicateCGPriceListDialog(a,e,c,d){var b={fnSetName:duplicateCGPriceList,callbackData:{priceListId:e,revisionId:typeof(d)=="undefined"?null:d}};displaySimpleEditNameDialog(b,"New Price List Name","Duplicate Price List",c+" - New")}function rsCallbackDeleteCGPriceList(c,a,b){if(checkResponseForError(c)){window.location=pageCGPriceLists}}function postConfirmationDeleteCGPriceList(a){jsrsExecute(rsCallbackDeleteCGPriceList,"CG_DeleteCGPriceList",[a.priceListId,a.promptingToIgnoreAccountPriceLists?1:0],hideTimedMessage);displayTimedMessage("Deleting Price List...")}function rsCallbackConfirmDeleteCGPriceList(f,a,j){if(checkResponseForError(f)){var d=j.priceListId,b=j.priceListName,m=JSON.parse(f),l=m.priceListName,k=m.dependentQuotes,g=m.quoteCount,e=m.accountCount,h;if(k&&k.length){h='";for(var c=0;c"}if(k.length"}h+="";showComplexInfoDialog(h,"Cannot delete price list",null,null,null,true);return}if(e){h='
'+htmlMultilineEncode('The Price List, "'+b+'",\nis associated with '+e+" Account"+(e==1?"":"s")+'.\n\nAre you sure you want to delete it?"')+"
";j.promptingToIgnoreAccountPriceLists=1}else{h='Are you sure you want to delete the Price List, "'+htmlEncode(b)+'"?'}displaySimpleConfirmationDialogP(postConfirmationDeleteCGPriceList,h,{formTitle:"Delete Price List",okButtonDisplayText:"Delete",contextDetail:j})}}function confirmDeleteCGPriceList(b,a){hideDialog();jsrsExecute(rsCallbackConfirmDeleteCGPriceList,"CG_CheckCGPriceListDependencies",b,hideTimedMessage,{priceListId:b,priceListName:unescape(a)});displayTimedMessage("Checking Price List Dependencies...")}function sortCGPriceLists(d,c,g){var f=getObj("frmSelectPriceLists");var e=reconstructSimpleShoppingCart(f.id);var b=e.doShowSelectedOnly()?1:0;var a=e.getContentDescriptor().getIdList();jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"CG_GetSelectCGPriceListsTable",[f.id,f.parentFormId.value,escape(a),d,c,b],enableDialogButtons,{formId:f.id,tableId:f.id+"_priceListTable"});displayTimedMessage("Getting "+getPrefixedCGPLString()+" Table...");disableDialogButtons()}function searchOrSelectedCGPriceLists(a){sortCGPriceLists("",0,"")}function rsCallbackGetSelectCGPriceListsDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectPriceLists",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj(e.id+"_priceListTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields(e.id,"cart",true,"cartInfoSpan",searchOrSelectedCGPriceLists,false,true,false,null,null);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showSelectCGPriceListsDialog(d,e,b){var a=getObj(e),c=getCompoundSelectionValue(a.priceListId,a.priceListIdSelect);jsrsExecute(rsCallbackGetSelectCGPriceListsDialog,"CG_GetSelectCGPriceListsDialog",[e,escape(c)],enableDialogButtons,{parentFormId:e,dismisalFocusFieldName:b.name});displayTimedMessage("Getting Select "+getPrefixedCGPLString()+" Dialog...");disableDialogButtons()}function submitSelectCGPriceLists(a){submitSelectCustomCompoundSelect(a,"priceList")}function MoveUpItemsInList(c){for(var a=1;a=0;a--){if((c.options[a].selected)&&(!c.options[a+1].selected)){var b=c.options[a+1];c.removeChild(b);c.insertBefore(b,c.options[a])}}}function MoveItemsBetweenLists(a,b){for(var c=0;c0;displayTimedMessage("Refreshing page...");g_bSkipNavWarning=true;if(c){g=g.substring(0,e)}window.location=addRemoveOrReplaceURLParameter(g,"view",h)}else{if(a&&a.onErrorFocusObject){setFocus(a.onErrorFocusObject)}}}function getSelectedSaveViewVisibilityTypeText(c){var f="";if(isSaveViewDialogCreateNewRadioButtonChecked()){var b=c.cboSaveViewType;if(b){f=b.options[b.selectedIndex].innerText}}else{var a=c.updateExisting_viewNameSelect;if(a){var e=a.options[a.selectedIndex];var d=e.parentElement;var g=d.getAttribute("label");if(stringEndsWith(g,"s")){f=g.substring(0,g.length-1)}else{f=g}}}return f}var g_renameViewIfDifferentName=false;function rsCallbackValidateNewViewNameFullOrMobile(e,l,p){enableDialogButtons();var j=getObj("saveView");if(!j){j=getObj("viewOptions")}var h=e?PageViewVisibilityType_Enum.pvvtPublic:getSaveViewVisibilityTypeId(j),f=e?j.viewName.value:getSaveViewName(j),d=j.pageId.value,m=d==WebPages_Enum.Report,b=(m?"Report":"View"),g=e?j.view.value:getSelectedViewIdForCreateNewView(j),c=j.externalRoleId?getCompoundSelectionValue(j.externalRoleId,j.externalRoleIdSelect):"",k=[d,escape(f),escape(j.params.value),(j.isDefault?(j.isDefault.checked?"1":"0"):""),"","",null===g?"":g,escape(c),escape(""+h),g_renameViewIfDifferentName?1:0],q={fnCallback:p?rsCallbackPostViewCreation:rsCallbackRefreshPageAndScrollPos,arrRSParams:k,callbackParams:p?p:null,viewType:b};if(checkResponseForError(l)){if(!isEmptyResponse(l)){if((null!==g)&&((""+g)==l)){}else{if((!jtHasAccess(JTSecuredObject_Enum.mjtCalendarSettings,AccessRight_Enum.mjtARDelete))&&(null!==g)&&(0!==g.length)){showInfoDialog("A "+b+" with this name already exists and you do not have permission to delete it.","Can't Delete Existing View",1,"viewName");return}q.viewWasOverwritten=1;var o=htmlMultilineEncode("A "+b+" with this name already exists.\n\nDo you want to overwrite the existing "+b+"?"),i="Overwrite Existing "+b,a="Save";if(!m){if(h===PageViewVisibilityType_Enum.pvvtPublic||h===PageViewVisibilityType_Enum.pvvtExternal){var n=getSelectedSaveViewVisibilityTypeText(j);o=htmlMultilineEncode("The "+n+' "'+f+'" will be updated for all users.');i="Updating for All Users";a="Update "+n}}displaySimpleConfirmationDialog(doSaveView,o,i,q,1,"viewName",a);return}}}doSaveView(q)}function rsCallbackValidateNewViewNameFull(c,a,b){rsCallbackValidateNewViewNameFullOrMobile(false,c,b?b:null)}function rsCallbackValidateNewViewNameMobile(c,a,b){rsCallbackValidateNewViewNameFullOrMobile(true,c,b?b:null)}function postCreateV2Report(c,a,b){if(checkResponseForError(c)){var e=c.split("?"),f=e[0],d=unescape(e[1]);enableDialogButtons();hideDialog();window.location=pageReport+"view="+f}}function showEnterViewNameInfoDialog(e,d){var c=e.pageId.value,b=c===WebPages_Enum.Report,a=b?"report":"view",f=getSelectedOrDefaultVisibilityPrefixForCreateNewView(e),g=d?"viewName":getViewNameFieldNameForCreateNewView(f);showInfoDialog("Please enter a name for the "+htmlEncode(a),"Missing Name",1,g)}function showSelectViewNameInfoDialog(){var a="updateExisting_viewNameSelect";showInfoDialog("Please select a view to update","Missing Name",1,a)}function showMissingViewNameInfoDialog(a,b){if(isSaveViewDialogCreateNewRadioButtonChecked()){showEnterViewNameInfoDialog(a,b)}else{showSelectViewNameInfoDialog()}}function submitSaveView(e,g,b){g_renameViewIfDifferentName=g;var f=getObj("saveView");if(!f){f=getObj("viewOptions")}var a=e?PageViewVisibilityType_Enum.pvvtPublic:getSaveViewVisibilityTypeId(f),d=trim(e?f.viewName.value:getSaveViewName(f)),c=f.pageId.value;if(!d){showMissingViewNameInfoDialog(f,e);return}jsrsExecute(e?rsCallbackValidateNewViewNameMobile:rsCallbackValidateNewViewNameFull,"Admin_GetViewByName",[c,escape(d),escape(""+a)],hideTimedMessage,b?b:null);displayTimedMessage("Validating View Name...");disableDialogButtons()}function scrollButtonMenuIfNecessary(a){var c=getObj(a);if(c){c.style.height="";var e=mjtPageYOffset(),b=posTop(c),f=pageHeight(),d=f-(b-e)-30;if(d<100){d=100}if(c.offsetHeight>d){c.style.height=d+"px";c.className="contextMenuContentScrolling"}}}function scrollChangeViewMenuIfNecessary(){scrollButtonMenuIfNecessary("ChangeViewMenuDiv")}function showAndPositionViewPopup(b,a,c){showAndPositionButtonPopup(b,"btnShowViews",a,c);scrollChangeViewMenuIfNecessary()}function ShowChangeViewDialog(d,e,c,f,a){if(isDialogShowing()){return}if(!a){a=""}var b="Getting Select View Dialog";jsrsExecute(rsCallbackProcessSimpleDialogWithParams,"Dialog_GetUIV2ChangeViewDialog2",[e,c,escape(f),a],rsErrorCallbackShowErrorDialogAndRefresh,{formId:"frmSelectView",errorDialogTitle:"Error "+b},0,1);displayTimedMessage(b+"...")}var g_viewSearchChangeTimer;function changedSelectViewSearchFieldTimer(){var j=getObj("frmSelectView"),f=j?j.pageViewSearchText:0,k=f?f.value.toLowerCase():0,c=f?f.getAttribute("data-lastVal"):0,q,o=1,h,l,p,i,e=[];if(c==k){return}h=1;do{l=getObj("pageViewSelectionSectionHeader"+h);if(!l){break}e[h]=0;++h}while(1);f.setAttribute("data-lastVal",k);var m=0;o=1;do{p=getObj("selViewRow"+o);if(!p){break}i=getObj("selViewContent"+o);q=i.getAttribute("data-name").toLowerCase();var b=(q.toLowerCase().indexOf(k)>=0);p.style.display=b?"":"none";if(b){h=i.getAttribute("data-sectionIdx");e[h]=1;m++}++o}while(1);var g=getObj("viewsDialogNoViewsMatchText");if(m===0){if(!g){g=document.createElement("div");g.id="viewsDialogNoViewsMatchText";g.className="helpText";g.innerHTML="There are no views that match the search criteria.";var n=j.querySelector(".view-search");if(n){n.appendChild(g)}}}else{if(g){g.remove()}}for(h=1;h"+htmlEncode(g)+""}else{if(f){f+=""}g=j.innerText;f+=''}}}if(!f){showInfoDialog("Either there are no views defined, or you've filtered them all out.","No Views Avaialable",1);return}f+="";a=cdBuildReadOnlyFieldRowP({rawLabel:"Default View",valueHTML:'"});showDialogP(a,m,{formTitle:"Select Default View",focusFieldName:h,focusFieldOnMobile:1,okButtonDisplayText:"Save",contextDetailOrFnSubmit:{fnSubmit:submitSelectDefaultView,callbackData:{}},isSubdialog:1})}function JobProductMenu(g,a,f,b,e,d){var c=new ContextMenu();if(d==1&&jtHasAccess(JTSecuredObject_Enum.mjtInventory,AccessRight_Enum.mjtARRead)){c.AddLinkItem("View Current Inventory",pageInventoryDetail+"&variantId="+f);c.AddLinkItem("View Inventory Transactions",pageInventoryTxns+"&variantId="+f)}c.Show(g)}function getSerialNumberUrl(a){return pageSerialNumberDetail+a}function rsCallbackEditSerialNumberDialog(b,a){var c=processSimpleDialogCallback(b,"editSerialNumber",null,true);updateAttributeLOVsIfNecessary(c)}function showEditSerialNumber(b,c){var a="Getting Edit Serial Number Dialog";jsrsExecute(rsCallbackEditSerialNumberDialog,"Inventory_GetEditSerialNumberDialog",c,rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:a},0,1);displayTimedMessage(a+"...")}function SubmitEditSerialNumber(){var d=getObj("editSerialNumber"),c=new FormValidator();if(!c.CSValidateRequiredField(d.serialNumber,"Please enter a serial number")){return}if(!c.CSValidateAttributeFields(d)){return}var a=c.ModifiedFieldIds,b=c.ModifiedFieldValues;jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Inventory_UpdateSerialNumber",[escape(d.serialNumberId.value),escape(d.serialNumber.value),escape(d.batchNumber.value),escape(d.description.value),d.inventoryLocationId.value,escape(a),escape(b)],enableDialogButtons);displayTimedMessage("Updating Serial Number...");disableDialogButtons()}function RunReport(){var a=getObj("flexForm");setTimeout('window.location = "'+pageReport+"&view="+a.param1.value+'";',0)}function rsCallbackEditAttachedFileDialog(b,a){var c=processSimpleDialogCallback(b,"editFileAttributes","description",true);updateAttributeLOVsIfNecessary(c)}function ShowEditFileAttributes(d,a,c){var b="Getting Edit File Attributes Dialog";if(!c){c=0}jsrsExecute(rsCallbackEditAttachedFileDialog,"Dialog_GetEditAttachedFileDialog",[a,c],rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error "+b},0,1);displayTimedMessage(b+"...")}function submitEditFileAttributes(){var f=getObj("editFileAttributes"),c=new FormValidator();if(!c.CSValidateAttributeFields(f)){return}var a=c.ModifiedFieldIds,b=c.ModifiedFieldValues,e="",d="Updating Attached File";if(f.phaseId){e=getCompoundSelectionValue(f.phaseId,f.phaseIdSelect)}jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Job_UpdateAttachedFileAttributes",[f.fileId.value,escape(f.description.value),escape(a),escape(b),e],rsErrorCallbackShowErrorDialog,{showErrorInSubdialog:1,errorDialogTitle:"Error "+d},0,1);displayTimedMessage(d+"...");disableDialogButtons()}function initShoppingCart(b){if(!b){b=""}var a=getObj("optionsFieldCart"+b);if(a){ToolMan.dragsort().makeListSortable(a,verticalDragSortOnly)}}function ShowJobSummaryOptions(a,c,p,o,h,b,n,e,m,j,g,f,d,k,l,i){if(!i){i=""}showOptionsDialog("Dialog_GetJobsOptionsDialog",[c,escape(p),escape(o),escape(h),b,n,e,escape(m),escape(j),escape(g),f?1:0,escape(d),k,l?1:0,i])}function SubmitJobSummaryOptions(k){var f=getObj("viewOptions");var b=getURLEncodedFiltersFromForm(f);var a=new FormValidator();if(!a.CSValidateNumberField(f.pageSize,"Rows per page",true)){return}if(getAutoRefreshRate().length>0&&!a.CSValidateIntegerField(f.refreshRate,"Auto Refresh Rate",true,1,9999)){return}var e=k+"&view=0",j=f.JobStatus.value;if(!("0"!==j)){e+="&status="+j}if(f.customerId.value!==""){e+="&customerId="+f.customerId.value}if(f.nextActivityId.value!==""){e+="&nextActivity="+f.nextActivityId.value}var h=f.sortColumnName.value;var g=getObj("optionsFieldCart");var d=ToolMan.dragsort().encodeNestedListStructure(g,jobProcessCartStripper);var c=ToolMan.dragsort().flatIndexOfItem(d,h);if(c>-1){e+="&sort="+f.sortDirection.value+c}if(d!==""){e+="&cols="+d}if(trim(f.pageSize.value)!==""){e+="&pageSize="+trim(f.pageSize.value)}if(getAutoRefreshRate()!==""){var i=parseInt(getAutoRefreshRate(),10);if(i>0&&i<5){i=5}e+="&refreshRate="+i}if(b!==""){e+="&filters="+b}if(f.currentViewId&&f.currentViewId.value&&trim(f.currentViewId.value)!==""){e+="&mrv="+trim(f.currentViewId.value)}g_bSkipNavWarning=true;disableDialogButtons();displayTimedMessage("Updating Job Options...");window.location=e}function SubmitAccountSummaryOptions(){var h=getObj("viewOptions");var e=getURLEncodedFiltersFromForm(h);var b=new FormValidator();if(!b.CSValidateNumberField(h.pageSize,"Rows per page",true)){return}var d=pageCustomerSummary+"&view=0";if(trim(h.priceTypeId.value)!==""){d+="&priceType="+trim(h.priceTypeId.value)}var c=h.sortColumnName.value;var g=getObj("optionsFieldCart");var a=ToolMan.dragsort().encodeNestedListStructure(g,cartStripper);var f=ToolMan.dragsort().flatIndexOfItem(a,c);if(f>-1){d+="&sort="+h.sortDirection.value+f}if(a!==""){d+="&cols="+a}if(trim(h.pageSize.value)!==""){d+="&pageSize="+trim(h.pageSize.value)}if(e!==""){d+="&filters="+e}if(h.currentViewId&&h.currentViewId.value&&trim(h.currentViewId.value)!==""){d+="&mrv="+trim(h.currentViewId.value)}g_bSkipNavWarning=true;disableDialogButtons();displayTimedMessage("Updating Account Options...");window.location=d}function ShowAccountSummaryOptions(a,g,i,f,c,d,b,h,e){if(!e){e=""}showOptionsDialog("Dialog_GetAccountsOptionsDialog",[escape(g),escape(i),escape(f),escape(c),d?1:0,escape(b),h,e])}function getV2EventLogDateFilterOption(){var b=getObj("btnEventLogDateOptions"),a=b?parseInt(b.getAttribute("data-dateOptions"),10):0;return a}function dateTypeChanged(){var g=getV2EventLogDateFilterOption(),e=getObj("cellDateFilterFrom"),a=getObj("cellDateFilterFromLabel"),f=getObj("cellDateFilterTo"),c=getObj("cellDateFilterToLabel"),i=getObj("cellDateFilterLastNDays"),b,d,h;switch(g){case EventLogDateFilterOptions_Enum.eldfoBefore:d=1;c.innerHTML="Before";break;case EventLogDateFilterOptions_Enum.eldfoAfter:b=1;a.innerHTML="After";break;case EventLogDateFilterOptions_Enum.eldfoBetween:d=1;b=1;a.innerHTML="Between ";c.innerHTML="and";break;case EventLogDateFilterOptions_Enum.eldfoDaysAgo:h=1;break;default:h=1;break}e.style.display=b?"":"none";a.style.display=b?"":"none";f.style.display=d?"":"none";c.style.display=d?"":"none";i.style.display=h?"":"none"}function showEventLogOptions(d,j,f,b,k,e,i,h,a,c){hideDialog();var g="Getting Event Log Options Dialog";jsrsExecute(rsCallbackProcessSimpleDialogWithParams,"Dialog_GetEventLogOptionsDialog",[d?1:0,j?1:0,f,b?b:"",k?k:"",e?e:"",i?i:"",h?h:"",a?a:"",c?c:""],rsErrorCallbackShowErrorDialogAndRefresh,{formId:"viewOptions",errorDialogTitle:"Error "+g,fnProcessFormOnSuccess:function(){dateTypeChanged()}},0,1);displayTimedMessage(g+"...")}function showUserEventLogOptions(a,i,f,c,j,e,h,g,b,d){showEventLogOptions(0,i,f,c,j,e,h,g,b,d)}function showActivityTypeEventLogOptions(f,e,b,h,a,g,d,c){showEventLogOptions(1,e,b,h,a,g,d,c,0,0)}function validateDateRangeOptions(b){var e=getV2EventLogDateFilterOption(),c={rc:false},g=e===EventLogDateFilterOptions_Enum.eldfoDaysAgo,d=(e===EventLogDateFilterOptions_Enum.eldfoBetween),h=d||(e===EventLogDateFilterOptions_Enum.eldfoBefore),a=d||(e===EventLogDateFilterOptions_Enum.eldfoAfter),f=new FormValidator();if(g){if(!f.CSValidateIntegerField(b.lastDays,"Number of Days",false,1,9999)){return c}}else{if(a){if(!f.CSValidateDateField(b.fromDate,h?"From":"After",false)){return c}}if(h){if(!f.CSValidateDateField(b.toDate,a?"To":"Before",false)){return c}}}c.urlAddendum="";if(g){if(trim(b.lastDays.value)!==""){c.urlAddendum+="&lastDays="+trim(b.lastDays.value)}}else{if(trim(b.fromDate.value)&&a){c.urlAddendum+="&from="+trim(getDateForUrlParam(b.fromDate.value))}if(trim(b.toDate.value)&&h){c.urlAddendum+="&to="+trim(getDateForUrlParam(b.toDate.value))}}c.rc=true;return c}function submitEventLogOptions(j){var i=getObj("viewOptions"),d=getURLEncodedFiltersFromForm(i),f=(i.actionsId&&i.actionsIdSelect)?getCompoundSelectionValue(i.actionsId,i.actionsIdSelect):null,g=(i.objectsId&&i.objectsIdSelect)?getCompoundSelectionValue(i.objectsId,i.objectsIdSelect):null,c=new FormValidator(),e;if(!c.CSValidateNumberField(i.pageSize,"Rows per page",true)){return}e=validateDateRangeOptions(i);if(!e.rc){return}var h=(j?pageUserEventLog:pageActivityTypeEventLog)+"&view=0",a=j?getCompoundSelectionValue(i.userId,i.userIdSelect):"",b=j?"":getCompoundSelectionValue(i.activityTypeId,i.activityTypeIdSelect);if(j&&!a){showInfoDialog("Please select one or more Users.","Missing Option",1,"btnSelectUser");return}if((!j)&&!b){showInfoDialog("Please select one or more Activity Types.","Missing Option",1,"activityTypeIdSelect");return}if(trim(a)){h+="&user="+trim(a)}if(trim(b)){h+="&activityTypeId="+trim(b)}if(trim(i.pageSize.value)!==""){h+="&pageSize="+trim(i.pageSize.value)}h+=e.urlAddendum;if(f){h+="&actions="+trim(f)}if(g){h+="&objects="+trim(g)}if(d!==""){h+="&filters="+d}g_bSkipNavWarning=true;disableDialogButtons();displayTimedMessage("Updating Change Log Options...");window.location=h}function submitUserEventLogOptions(){submitEventLogOptions(1)}function submitActivityTypeEventLogOptions(){submitEventLogOptions(0)}function ShowQuoteSummaryOptions(a,g,i,j,f,c,d,b,h,e){if(!e){e=""}showOptionsDialog("Dialog_GetJTQuotesOptionsDialog",[escape(g),escape(i),escape(j),escape(f),escape(c),d?1:0,escape(b),h,e])}function SubmitQuoteSummaryOptions(){var h=getObj("viewOptions");var e=getURLEncodedFiltersFromForm(h);var b=new FormValidator();if(!b.CSValidateNumberField(h.pageSize,"Rows per page",true)){return}var d=pageQuoteSummary+"&view=0";if(trim(h.priceTypeId.value)!==""){d+="&type="+trim(h.priceTypeId.value)}if(trim(h.salespersonId.value)!==""){d+="&salesperson="+trim(h.salespersonId.value)}if(h.customerId.value!==""){d+="&customerId="+h.customerId.value}var c=h.sortColumnName.value;var g=getObj("optionsFieldCart");var a=ToolMan.dragsort().encodeNestedListStructure(g,jobProcessCartStripper);var f=ToolMan.dragsort().flatIndexOfItem(a,c);if(f>-1){d+="&sort="+h.sortDirection.value+f}if(a!==""){d+="&cols="+a}if(trim(h.pageSize.value)!==""){d+="&pageSize="+trim(h.pageSize.value)}if(e!==""){d+="&filters="+e}if(h.currentViewId&&h.currentViewId.value&&trim(h.currentViewId.value)!==""){d+="&mrv="+trim(h.currentViewId.value)}g_bSkipNavWarning=true;disableDialogButtons();displayTimedMessage("Updating Quote Options...");window.location=d}function SelectDropdownItem(b){var a="";var c="";a=b.value;c=b.options[b.selectedIndex].text;selectItem(a+"?"+c)}function getCheckedItemInfo(b,c){var a="";var f="";if(!b){return}if(typeof(b.chkRow)=="undefined"){if(c){closeDialogWindow()}return}var d;if(typeof(b.chkRow.checked)=="boolean"){if(b.chkRow.checked){d=b.chkRow.value.split("?");a=d[0];f=d[1]}}else{for(var e=0;e"+f+"";g="mjt_GetFirstChildWithNodeName(this,'SPAN').style.color='white'";j="mjt_GetFirstChildWithNodeName(this,'SPAN').style.color='"+e+"'"}if(a==d[0]){k.AddInactiveHTMLTitledItem(f,true)}else{if(parseInt(d[4],10)===0){k.AddHTMLTitledScriptItem(f,"updateJobActivityStatus('"+c+"', '"+d[0]+"', '"+a+"', '"+b+"')",false,g,j)}}}k.ShowCallbackSubmenu("updateJobActivityStatusSubmenu",1)}function checkMustUpdateCachedActivityStatus(){var c=new Date(),b=c.getTime(),d=g_arrStatusesTS.getTime(),a=30*1000;return b-d>=a}function updateCachedActivityStatuses(c){var a=JSON.parse(c),b=a.arrStatuses;g_arrStatuses=b;g_arrStatusesTS=new Date()}function rsCallbackGetActivityStatusesForUpdateSubMenu(c,a,b){if(checkResponseForError(c)){if(contextMenu_isCallbackSubmenuContext(a)){updateCachedActivityStatuses(c);doShowUpdateJobActivityStatusSubmenu(b.objShowSubmenuParams)}}}function ShowUpdateJobActivityStatusSubmenu(b,e,a,c){if(!jtHasAccess(JTSecuredObject_Enum.mjtJobActivity,AccessRight_Enum.mjtARUpdate)){return}var h={statusId:a,activityId:e,serializedAllocationWarning:c},d=0,g=new ContextMenu(),i="Getting Activity Statuses",f=checkMustUpdateCachedActivityStatus();if(g.dismissCallbackSubmenuIfShowing("updateJobActivityStatusSubmenu",1,b)){return}if(f){d=jsrsExecute(rsCallbackGetActivityStatusesForUpdateSubMenu,"Job_GetJobActivityStatuses",[],rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:i,objShowSubmenuParams:h},0,1);contextMenu_initForCallbackSubmenu(b,d);displayTimedMessage(i+"...")}else{contextMenu_initForCallbackSubmenu(b,0);doShowUpdateJobActivityStatusSubmenu(h);return}}function updateJobActivityStatus(a,g,d,c){var b=getActivityStatusInfo(g);var f=getActivityStatusInfo(d);if(b.activityStatusTypeId=="3"&&f.activityStatusTypeId!="3"&&c=="1"&&isInventoryEdition){var e="This activity has allocated material without assigned serial numbers.\n\nDo you want to mark this activity as Complete?";if(!window.confirm(e)){return false}}jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Job_UpdateJobActivityStatus",[a,g],rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error Updating Job Activity Status"},0,1);displayTimedMessage("Updating Job Activity Status...");disableDialogButtons()}function changeRecurrenceFrequency(){var c=getObj("appointmentRecurrence");var a=AppointmentRecurrenceFrequency_Enum.arfDaily;for(var b=0;b0&&FilterTextMode_Enum.ftmIsEmpty==a){setFilterTextMode(b,getObj("filterExactMatchOnly").checked?FilterTextMode_Enum.ftmIsExactMatch:FilterTextMode_Enum.ftmSearch)}else{if(b.txtTextFilterValue.value.length===0){}}}function changedV2TextFilterMode(){var b=getObj("editJobFilter"),a=textFilterModeIdFromForm(b);b.txtTextFilterValue.style.visibility=a===FilterTextMode_Enum.ftmIsEmpty?"hidden":"visible"}function friendlyTextRestriction(a,c){var b=textFilterModeIdFromForm(a);switch(b){case FilterTextMode_Enum.ftmIsExactMatch:return"exactly matches '"+a.txtTextFilterValue.value+"'";case FilterTextMode_Enum.ftmSearch:return"contains '"+a.txtTextFilterValue.value+"'";case FilterTextMode_Enum.ftmIsEmpty:return"is empty";default:return"Unknown Text Filter Mode="+b}}function friendlyUIV2DateRestrictionFromFields(h,e,b,j){var a=j.bwdBeginDate.value,f=j.fwdBeginDate.value,c=j.absBeginDate.value,g=j.bwdEndDate.value,d=j.fwdEndDate.value,i=j.absEndDate.value;return friendlyUIV2DateRestriction(e,b,a,f,c,g,d,i)}function friendlyDateRestriction(a,e){var d=jasBeginDateRestrictionTypeFromForm(a),b=jasEndDateRestrictionTypeFromForm(a),c=getDateFilterFieldsToUse(a);return friendlyUIV2DateRestrictionFromFields(a,d,b,c)}function jasFilterStatDisplayListFromForm(a){if(getActivityStatusSelection(a)==ActivityStatusSelection_Enum.any){return""}else{return getCompoundSelectionDisplayValue(a.filtJobActStatusId,a.filtJobActStatusIdSelect,a.filtJobActStatusName)+" "}}function friendlyJASDescription(b){var g,f;if(getActivityStatusSelection(b)==ActivityStatusSelection_Enum.oneOf){f=" is "}else{if(getActivityStatusSelection(b)==ActivityStatusSelection_Enum.notOneOf){f=" is not "}else{f=""}}if(b.FilterType.value=="0"){g="Each "}else{if(b.FilterType.value=="1"){g="At least one "}else{if(b.FilterType.value=="2"){g="No "}}}var a,d=friendlyDateRestriction(b,"has no start date"),c=(getCompoundSelectionDisplayValue(b.filtJobActTypeId,b.filtJobActTypeIdSelect,b.filtJobActTypeName)+" "),e=jasFilterStatDisplayListFromForm(b);if(e){f=" and"+f}a=g+c+"activity "+d+f+(d===""&&(getActivityStatusSelection(b)==ActivityStatusSelection_Enum.any)?"exists":"")+e;return a}function countChecks(a){var c=0;if(!a){return 0}if(a.length){for(var b=0;bc[2]||typeof(c[2])=="undefined"){return 1}return 0}function ShoppingCart(q){function e(x){removeCartItem(this.data,x)}function s(){return serializeCart(this.data)}function f(x){if(this.NewQtyLimit!="none"){this.NewQtyLimit=parseFloat(this.NewQtyLimit)-x[3]}addCartItem(this.data,x)}function n(x){var A=x.split("|");var z=[];var y;z[0]="";for(y=1;y0);highlightCheckedRows(G);if(C>0){F=getObj("spanAlloc"+B);if(F){F.style.display="";D=getObj("allocQty"+B);D.value=this.ItemQuantity(C);x=getObj("useAll"+B);A=getObj("useNeeded"+B);x.style.display=this.ItemQuantity(C)==this.AvailableQuantity(C)?"none":"";A.style.display=G.unserializedQty&&((G.unserializedQty.value<0&&this.ItemQuantity(C)!==0)||(G.unserializedQty.value>0&&this.ItemQuantity(C)!=this.AvailableQuantity(C)))?"":"none"}if(E){E(this,C,G.chkRow)}}else{F=getObj("spanAlloc"+B);if(F){F.style.display="none"}}}else{var z=true;for(y=0;y0);if(C<=0){z=false}}highlightCheckedRows(G);for(y=0;y0){F=getObj("spanAlloc"+B);if(F){F.style.display="";D=getObj("allocQty"+B);D.value=this.ItemQuantity(C);x=getObj("useAll"+B);A=getObj("useNeeded"+B);x.style.display=this.ItemQuantity(C)==this.AvailableQuantity(C)?"none":"";A.style.display=G.unserializedQty&&((G.unserializedQty.value<0&&this.ItemQuantity(C)!==0)||(G.unserializedQty.value>0&&this.ItemQuantity(C)!=this.AvailableQuantity(C)))?"":"none"}if(E){E(this,C,G.chkRow[y])}}else{F=getObj("spanAlloc"+B);if(F){F.style.display="none"}}}}}}function t(x){var z=0;if(x.chkRow){if(x.chkRow.length){var y;for(y=0;y=a){c.style.height=a+"px";c.style.overflow="auto"}else{c.style.height=c.scrollHeight+"px";c.style.overflow=""}}function updateDivWidth(a,c){var b=getObj(a);if(!b){return}b.style.width="";if(b.scrollWidth>=c){b.style.width=c+"px";b.style.overflow="auto"}else{b.style.width=b.scrollWidth+"px";b.style.overflow=""}}function changeDateRequirement(r){if(r){r="."+r}else{r=""}var o=getObj("editJobFilter");var f=o["btnMainDateFilterSpecPicker"+r],g=f.getAttribute("data-dateRequiredType"),k=f.getAttribute("data-relativeDateSpecType"),n=k==DateRestrictionType_Enum.Absolute,l=k==DateRestrictionType_Enum.RelativeForward,j=k==DateRestrictionType_Enum.RelativeBackward,d=j||l,h=g==DateRequiredType_Enum.mjtDateNull,s=g==DateRequiredType_Enum.mjtDateNullable,p=g==DateRequiredType_Enum.mjtDateOnOrBefore,q=g==DateRequiredType_Enum.mjtDateOnOrAfter,a=g==DateRequiredType_Enum.mjtDateRange,m=p||q,b=getObj("cellDateFilterSimpleRelDaysValue"+r),i=getObj("cellDateFilterSimpleRelDateValue"+r),c=getObj("cellDateFilterSimplePrefix"+r),e=getObj("cellDateFilterSimpleSuffix"+r);c.style.display=((m||h||s)&&!r)?"":"none";e.style.display=d?"":"none";if(p){c.innerHTML="On or before "}else{if(q){c.innerHTML="On or after "}else{if(h){c.innerHTML="Empty"}else{if(s){c.innerHTML="Any"}else{if(a){c.innerHTML="Range"}}}}}if(l){e.innerHTML=" days from today"}else{if(j){e.innerHTML=" days ago"}}i.style.display=n?"":"none";b.style.display=d?"":"none";if(!r){getObj("blockDateBounds").style.display=a?"":"none";if(a){changeDateRequirement("rangeBefore");changeDateRequirement("rangeAfter")}}}function selectedDateFilterSpecType(f,g,h,e,b,d,a){var c=getObj(h);c.setAttribute("data-dateRequiredType",e);c.setAttribute("data-relativeDateSpecType",b?b:"");changeDateRequirement(a);if(d){asynchFocusOnDialogItem(d)}}function addDateFilterSpecItem(f,g,e,d,b,c,h,a){if(b&&!h){g="
"+g+"
"}f.AddHTMLTitledScriptItem(g,"selectedDateFilterSpecType(event,'"+e.form.id+"','"+e.id+"',"+d+","+(b?b:"undefined")+(c?(",'"+c+"'"):"")+",'"+a+"')")}function showSelectDateFilterSpecTypeMenu(f,d,b,g,a){var c=new ContextMenu("clsDateFilterMenu"),e=a?("."+a):"";if(!g){if(!b){addDateFilterSpecItem(c,"Any",d,DateRequiredType_Enum.mjtDateNullable,"",g,a)}addDateFilterSpecItem(c,"Empty",d,DateRequiredType_Enum.mjtDateNull,"",g,a);c.AddInactiveHTMLTitledItem('
On or Before
')}if((!g)||(g==DateRequiredType_Enum.mjtDateOnOrBefore)){addDateFilterSpecItem(c,"# of days ago",d,DateRequiredType_Enum.mjtDateOnOrBefore,DateRestrictionType_Enum.RelativeBackward,"txtDateFilterSimpleRelDateDays"+e,g,a);addDateFilterSpecItem(c,"# of days from today",d,DateRequiredType_Enum.mjtDateOnOrBefore,DateRestrictionType_Enum.RelativeForward,"txtDateFilterSimpleRelDateDays"+e,g,a);addDateFilterSpecItem(c,"Date",d,DateRequiredType_Enum.mjtDateOnOrBefore,DateRestrictionType_Enum.Absolute,"txtDateFilterSimpleRelDateDate"+e,g,a)}if(!g){c.AddInactiveHTMLTitledItem('
On or After
')}if((!g)||(g==DateRequiredType_Enum.mjtDateOnOrAfter)){addDateFilterSpecItem(c,"# of days ago",d,DateRequiredType_Enum.mjtDateOnOrAfter,DateRestrictionType_Enum.RelativeBackward,"txtDateFilterSimpleRelDateDays"+e,g,a);addDateFilterSpecItem(c,"# of days from today",d,DateRequiredType_Enum.mjtDateOnOrAfter,DateRestrictionType_Enum.RelativeForward,"txtDateFilterSimpleRelDateDays"+e,g,a);addDateFilterSpecItem(c,"Date",d,DateRequiredType_Enum.mjtDateOnOrAfter,DateRestrictionType_Enum.Absolute,"txtDateFilterSimpleRelDateDate"+e,g,a)}if(!g){c.AddSeparator();addDateFilterSpecItem(c,"Range of Dates",d,DateRequiredType_Enum.mjtDateRange,"",g,a)}c.Show(f)}var g_loadingAttrFilterDetailsId=null;function rsCallbackEditAttrFilterDetails(b,a){if(a==g_loadingAttrFilterDetailsId){g_loadingAttrFilterDetailsId=null;if(checkResponseForError(b)){var c=getMajorFilterType(getObj("editJobFilter"));var d=getObj("attrFilterDetails");if(c==DynSQLComponentTypes_Enum.mjtSingleJobAttributeValue||c==DynSQLComponentTypes_Enum.mjtJobReportAttributeValue){d=getObj("jobAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtSingleCustAttributeValue){d=getObj("custAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtSingleQuoteAttributeValue){d=getObj("quoteAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtSingleCGQuoteAttributeValue||c==DynSQLComponentTypes_Enum.mjtSingleCGOrderAttributeValue){d=getObj("cgquoteAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtSingleSerialNumberAttributeValue){d=getObj("serialNumberAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtActivityAttributeValue){d=getObj("activityAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtPOAttributeValue){d=getObj("poAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtSupplierAttributeValue){d=getObj("supplierAttrFilterDetails")}else{if(c==DynSQLComponentTypes_Enum.mjtJobFormAttributeValue){d=getObj("jobFormFieldFilterDetails")}}}}}}}}}d.innerHTML=b;if(getObj("editJobFilter").cart&&getObj("editJobFilter").initValue){initializeShoppingCartSelectionList("editJobFilter",getObj("editJobFilter").initValue.value,"LongListFilter")}if(getObj("dateAttrFilter")){changeDateRequirement()}else{if(getObj("numberAttrFilter")){changeV2NumberFilterRelation()}else{if(getObj("initializeCheckboxId")){highlightCheckedRows(getObj("editJobFilter"));synchronizeAllRowsCheckbox(getObj("editJobFilter"))}else{if(getObj("textAttrFilter")){changedV2TextFilterMode()}}}}scrollCurrentDialogIfNecessary()}}}function changeSelectedAttr(c){var f=getObj("editJobFilter"),b=getMajorFilterType(f),a="",e;if(b==DynSQLComponentTypes_Enum.mjtSingleJobAttributeValue||b==DynSQLComponentTypes_Enum.mjtJobReportAttributeValue){if(getObj("jobAttrs")){a=getObj("jobAttrs").value}e=getObj("jobAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtSingleCustAttributeValue){if(getObj("custAttrs")){a=getObj("custAttrs").value}e=getObj("custAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtSingleQuoteAttributeValue){if(getObj("quoteAttrs")){a=getObj("quoteAttrs").value}e=getObj("quoteAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtSingleCGQuoteAttributeValue||b==DynSQLComponentTypes_Enum.mjtSingleCGOrderAttributeValue){if(getObj("cgquoteAttrs")){a=getObj("cgquoteAttrs").value}e=getObj("cgquoteAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtSingleSerialNumberAttributeValue){if(getObj("serialNumberAttrs")){a=getObj("serialNumberAttrs").value}e=getObj("serialNumberAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtActivityAttributeValue){if(getObj("activityAttrs")){a=getObj("activityAttrs").value}e=getObj("activityAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtPOAttributeValue){if(getObj("poAttrs")){a=getObj("poAttrs").value}e=getObj("poAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtSupplierAttributeValue){if(getObj("supplierAttrs")){a=getObj("supplierAttrs").value}e=getObj("supplierAttrFilterDetails")}else{if(b==DynSQLComponentTypes_Enum.mjtJobFormAttributeValue){if(getObj("jobFormFields")){a=getObj("jobFormFields").value}e=getObj("jobFormFieldFilterDetails")}}}}}}}}}var d="";if(getObj("initstr")!==null){d=getObj("initstr").value}if(a!==""){if(g_loadingAttrFilterDetailsId!==null){mjtrsAbort(g_loadingAttrFilterDetailsId)}g_loadingAttrFilterDetailsId=jsrsExecute(rsCallbackEditAttrFilterDetails,"Job_GetAttrFilterDetails",[escape(d),escape(a),b,getWebPage(),c,"1"==f.isNewFilter.value?1:0]);e.innerHTML='
'}}function getFilterIdListInfoFromForm(p,c){var b={},m=getObj("attr"+c);if(!m){m=getObj("attrVals")}if(!m){return b}var e=m.getAttribute("data-isJobStatus")=="1",k=m.getAttribute("data-isFormFieldCB")=="1",a=m.getAttribute("data-isDropdownPhraseFilter")=="1",d=[],o=[],l;b.arrIds=d;b.arrNames=o;if(k){if(getObj("rbFFCBChecked").checked){d.push("1");o.push("Checked")}else{if(getObj("rbFFCBUnChecked").checked){d.push("0");o.push("Not Checked")}}}else{if(e){l=getObj("rbTwoStateFilterState1");if(!l.checked){l=getObj("rbTwoStateFilterState2");if(!l.checked){l=null}}if(l){d.push(l.value);o.push(l.getAttribute("data-displayVal"))}}else{if(a){var f=0,n,g,q=0;b.arrRawPreamble=[];while(true){g="data-mjtrawpreamble"+q;if(!m.hasAttribute(g)){break}b.arrRawPreamble[q]=m.getAttribute(g);++q}b.isDropdownPhraseFilter=1;while(true){n=p["cboPhraseFilter"+f];if(!n){break}d[d.length]=n.value;o.push(n.options[n.selectedIndex].getAttribute("data-mjtDisplayValue"));++f}}else{var j=m.getElementsByTagName("input"),h;for(h=0;h=3){g=l.split(":")[2]}var d,k,j=false;if(m.invertList&&m.invertList.length==2){j=m.invertList[1].checked}switch(a){case SQLFilterType_Enum.ListMember:b=AttributeDataTypes_Enum.SelectFromList;d=getFilterIdListfromForm(m,c);k=g+":"+b+":"+c+":"+a+":"+d+";"+(j?"1":"0");break;case SQLFilterType_Enum.DateFilter:b=AttributeDataTypes_Enum.EnterDate;k=g+":"+b+":"+c+":"+a+":"+jasBeginDateRestrictionTypeFromForm(m)+","+jasEndDateRestrictionTypeFromForm(m)+","+jasDateRequiredIdToUseForFilterIdStrFromForm(m)+","+beginDateId(m)+","+endDateId(m);break;case SQLFilterType_Enum.Numeric:case SQLFilterType_Enum.Currency:b=(a==SQLFilterType_Enum.Currency?AttributeDataTypes_Enum.EnterCurrency:AttributeDataTypes_Enum.EnterNumber);k=g+":"+b+":"+c+":"+a+":"+jasBeginNumberRestrictionTypeFromForm(m)+","+jasEndNumberRestrictionTypeFromForm(m)+","+jasNumberRequiredIdFromForm(m)+","+beginNumberId(m)+","+endNumberId(m);break;case SQLFilterType_Enum.Salesperson:b=0;d=getFilterIdListfromForm(m,c);k=g+":"+b+":"+c+":"+a+":"+d;break;case SQLFilterType_Enum.QuoteDate:case SQLFilterType_Enum.BuiltInDate:b=0;k=g+":"+b+":"+c+":"+a+":"+c+";"+jasBeginDateRestrictionTypeFromForm(m)+","+jasEndDateRestrictionTypeFromForm(m)+","+jasDateRequiredIdToUseForFilterIdStrFromForm(m)+","+beginDateId(m)+","+endDateId(m);break;case SQLFilterType_Enum.BuiltInNumeric:case SQLFilterType_Enum.BuiltInCurrency:b=0;k=g+":"+b+":"+c+":"+a+":"+c+";"+jasBeginNumberRestrictionTypeFromForm(m)+","+jasEndNumberRestrictionTypeFromForm(m)+","+jasNumberRequiredIdFromForm(m)+","+beginNumberId(m)+","+endNumberId(m);break;case SQLFilterType_Enum.TextFilter:case SQLFilterType_Enum.LinkFilter:case SQLFilterType_Enum.AutoNumberFilter:case SQLFilterType_Enum.MultilineFilter:switch(a){case SQLFilterType_Enum.TextFilter:b=AttributeDataTypes_Enum.EnterText;break;case SQLFilterType_Enum.LinkFilter:b=AttributeDataTypes_Enum.Link;break;case SQLFilterType_Enum.AutoNumberFilter:b=AttributeDataTypes_Enum.AutoNumber;break;case SQLFilterType_Enum.MultilineFilter:b=AttributeDataTypes_Enum.MultilineText;break}n=textFilterModeIdFromForm(m);f=n==FilterTextMode_Enum.ftmIsExactMatch;e=n==FilterTextMode_Enum.ftmSearch;k=g+":"+b+":"+c+":"+a+":"+escape(n+","+((f||e)?escape(m.txtTextFilterValue.value):""));break;case SQLFilterType_Enum.BuiltInText:b=AttributeDataTypes_Enum.EnterText;n=textFilterModeIdFromForm(m);f=n==FilterTextMode_Enum.ftmIsExactMatch;e=n==FilterTextMode_Enum.ftmSearch;k=g+":"+b+":"+c+":"+a+":"+c+";"+escape(n+","+(f||e?escape(m.txtTextFilterValue.value):""));break;case SQLFilterType_Enum.QuoteType:case SQLFilterType_Enum.CGQuoteType:d=getFilterIdListfromForm(m,c);k=g+":0:"+c+":"+a+":"+d;break;case SQLFilterType_Enum.QuoteHasJob:k=g+":0:"+c+":"+a+":"+(getQuoteHasJobFilterFieldValue(m)?"1":"0");break;case SQLFilterType_Enum.CGQuoteHasJob:k=g+":0:"+c+":"+a+":"+(getQuoteHasJobFilterFieldValue(m)?"1":"0");break;case SQLFilterType_Enum.IsRemnantSerialNumber:k=g+":0:"+c+":"+a+":"+(m.isRemnant[0].checked?"1":"0");break;case SQLFilterType_Enum.FieldFilter:k=g+":0:"+c+":"+a+":"+m.fieldFilterId.value;break;case SQLFilterType_Enum.BuiltInList:b=0;d=getFilterIdListfromForm(m,c);k=g+":"+b+":"+c+":"+a+":"+c+";"+d+";"+(j?"1":"0");break;case SQLFilterType_Enum.BuiltInLongList:b=0;d=m.initValue.value;k=g+":"+b+":"+c+":"+a+":"+c+";"+d+";"+(j?"1":"0");break;default:alert("SelectAttrFilter:Unknown filterType = "+a);break}if(validateAttrFilter(m,a)){b=0;selectFilter(escape(i+"|"+k)+"?"+escape(htmlMultilineEncode(friendlyAttrDescription(m,l))))}}function getIssueFilterCategoryStatusSelection(a){if(!a){a=getObj("editJobFilter")}var b=IssueFilterCategoryStatusSelection_Enum.any;if(a.cboIssueCategoryRestriction){b=parseInt(a.cboIssueCategoryRestriction.options[a.cboIssueCategoryRestriction.selectedIndex].value,10)}return b}function changeFilterIssueCategory(){var b=getObj("editJobFilter");if(b.cboIssueCategoryRestriction){var a=getIssueFilterCategoryStatusSelection(b)==IssueFilterCategoryStatusSelection_Enum.any;getObj("cellCategoryPicker").style.display=a?"none":""}}function getAppointmentFilterCategoryStatusSelection(a){if(!a){a=getObj("editJobFilter")}var c=AppointmentFilterCategoryStatusSelection_Enum.oneOf;for(var b=0;bLoading Filter Details...'}else{getObj("editFilterDetails").innerHTML='
No Filter Type Selected'}}function initJobFilterEdit(a){changeMajorFilterType(a?a:"")}function updateFilterListSize(){var b=getObj("activeFilterTable"),c;if(b.rows){c=b.rows.length?1:0}else{var a=mjt_GetChildrenWithNodeName(b,"LI");c=a.length?1:0}getObj("filterList").style.display=c?"":"none";scrollParentDialogIfNecessary(b)}function reStripeFilters(){var b=document.querySelectorAll("#activeFilterTable li table tr:first-child");if(b){for(var a=0;a";l=getObj("activeFilterTable")}var d=document.createElement("li");l.appendChild(d);d.id="filterLI"+e;l=document.createElement("table");l.style.width="100%";d.appendChild(l);o=l.insertRow(l.rows.length);o.setAttribute("data-filterId",e);o.id="filterRow"+e;var c=document.createElement("input");c.type="hidden";c.id="filter"+e;c.name="filter"+e;c.value=k;var j=o.insertCell(o.cells.length);var g=o.insertCell(o.cells.length),m=o.insertCell(o.cells.length);m.className="buttonCell";j.name="filterName"+e;j.id="filterName"+e;j.innerHTML=f;var h="showSelectFilterDialog(event,null,'"+a+"','filter"+e+"','filterName"+e+"','"+(i?i:"")+"')";j.className="clickable underlined";j.setAttribute("onclick",h);g.style.display="none";g.appendChild(c);m.innerHTML=cdBuildFAFontIconButton({doubleQuoteEncodedOnClickJS:"DeleteFilter('filterRow"+e+"')",fontId:FontIconId_Enum.fiiCircledMinusRemove_Ionicon,additionalFontClasses:"bold",additionalButtonClasses:"compactButton"});reStripeFilters();updateFilterListSize()}function DeleteFilter(b){var e=getObj(b),d=e.getAttribute("data-filterId"),c=getObj("filterLI"+d),a=e.nextSibling;e.style.display="none";while(a!==null){if(a.className=="evenRow"){a.className="oddRow"}else{if(a.className=="oddRow"){a.className="evenRow"}}a=a.nextSibling}if(c){c.style.display="none";removeNode(c)}removeNode(e);reStripeFilters();updateFilterListSize()}function validateInvSummaryColumnSelection(a){var c=true;var e=false;var d=false;var f=a.toUpperCase();if(f.length>2){var b=f.substring(0,2);if(("SU"==b)||(f.indexOf(",SU")>-1)){e=true}if(("SN"==b)||(f.indexOf(",SN")>-1)){d=true}if(("SA"==b)||(f.indexOf(",SA")>-1)){d=true}}if(d&&e){alert("Cannot display both (S)ummary and (D)etail columns in the same view.");c=false}return c}function issueFilterStatusId(b){var e,a="1:",g=0;for(e=0;e2){b[3]="1"}i+=1;g="First ";d="Job"}else{if(f.whichActivity[1].checked){if(b.length>2){b[3]="2"}g="Last ";d="Job"}else{if(f.whichActivity[2].checked){b[0]="P"+b[0];if(b.length>2){b[3]="1"}g="First ";d="Phase"}else{if(f.whichActivity[3].checked){b[0]="P"+b[0];if(b.length>2){b[3]="2"}g="Last ";d="Phase"}}}}i=b.join("_");e=f.measureField.value+":"+i;h=f.measureField.options[f.measureField.selectedIndex].text+" by "+g+f.measureTimeField.options[f.measureTimeField.options.selectedIndex].text+" in "+d}else{e=f.measureField.value+":"+f.measureTimeField.value;h=f.measureField.options[f.measureField.selectedIndex].text+" by "+f.measureTimeField.options[f.measureTimeField.options.selectedIndex].text}setCompoundSelectionValue(a.measureId,a.measureName,a.measureIdSelect,e,h);changeReportMeasures();hideSubdialog()}function ShowMapMenu(g,d,f,e,b,c,h){var a=escape((d!==""?d+", ":"")+(f!==""?f+", ":"")+(e!==""?e+", ":"")+(b!==""?b+" ":"")+(c!==""?c+" ":"")+(h!==""?h:""));if(isPhone()){window.location="https://maps.google.com/maps?q="+a+"&zoom=2"}else{window.open("https://maps.google.com/maps?q="+a+"&zoom=2","_blank")}}function changeMeasureTimeField(){var f=getObj("editReportMeasure");var c=f.measureTimeField.value;var e=getObj("firstInJobSelector");var d=getObj("lastInJobSelector");var b=getObj("firstInPhaseSelector");var a=getObj("lastInPhaseSelector");if(isActivityField(c)){e.style.display="";d.style.display="";if(b){b.style.display="";a.style.display=""}}else{e.style.display="none";d.style.display="none";if(b){b.style.display="none";a.style.display="none"}}}function rsCallbackMeasureSelectionForSubjectArea(b,a){if(checkResponseForError(b)){getObj("editMeasureDetails").innerHTML=b;changeMeasureTimeField()}}function changeMeasureSubjectArea(){var e=getObj("editReportMeasure"),c=e.measureSubjectArea,b="",a;if(c.selectedIndex>-1){b=c.options[c.selectedIndex].value}if(!b){c.selectedIndex=1;b=c.options[1].value}a=b=="Job_Form";getObj("formSelector").style.display=a?"":"none";if(a){b=e.jobForm.value}if(g_prevSAName==b){return}g_prevSAName=b;var d=e.initValue.value;jsrsExecute(rsCallbackMeasureSelectionForSubjectArea,"Report_GetMeasureSelectionForSubjectArea",[d,b])}function ChangeSelectedJobForm(){var c=getObj("editReportMeasure"),b=c.measureSubjectArea,a;for(a=0;a-1}else{d=1}f.setAttribute("data-foFilterPermits",d?1:0);f.style.display=d?"":"none"}p=n.querySelectorAll("div[data-fosectioncontainer]");for(o=0;o';var c=document.createElement("UL");d.appendChild(c);c.setAttribute("mjtgroupingid",b);c.setAttribute("class","innerList");c.setAttribute("className","innerList");c.appendChild(a)}function fo_CollapseAll(b){if(null!==b){var c=b.getElementsByTagName("div");var a;for(a=0;a(current selection)");if(a>-1){fo_ClearCurrentSelectionFromField(e,a,f)}}}}}function fo_ExpandToNode(b,a){fo_ClearCurrentSelectionFromFields(b);if(arguments.length>1&&null!==a&&0!==a.length){fo_CollapseAll(b)}if(""!==(""+a)){var c=getObj(a);if(null!==c&&c.getAttribute("data-fieldtreetype")=="fieldTreeLeaf"){c.setAttribute("data-fieldtreetype","fieldTreeSingleSelectedLeaf");c.className="fieldTreeSingleSelectedLeaf";c.innerHTML+=" (current selection)";fo_ExpandParentNodes(b,c.parentNode)}}}function addFieldToCart(n,f,j,e,w,p,u){var s=true;if(!u){u=null}if(!w){w=""}if(!p){p="fieldCart"}var v=getObj(p+w);if(!v){alert("addFieldToCart() - Can't find the cart with id="+p+w)}var o=v.getElementsByTagName("li").length;if(1==e&&o>0){var h=null;while((h=mjt_GetFirstChildWithNodeName(v,"LI"))){var c=h.id;if(c.indexOf("cartrow_"+w)===0){c=c.substring(8+w.length);removeFieldFromCart(c,w)}else{break}}o=v.getElementsByTagName("li").length}var q="";if(null!==j){q=' mjtparentgroupid="'+j+'" '}var a="";if(null!==u){a=' mjtcartcommonid="'+u+'"'}var m=cdBuildFAFontIconButton({fontId:FontIconId_Enum.fiiCircledMinusRemove_Ionicon,doubleQuoteEncodedOnClickJS:"removeFieldFromCart('"+n+"','"+w+"')",additionalButtonClasses:"compactButton",additionalFontClasses:"bold"}),d='\n
  • The price list \''+l+"' cannot be deleted because it depends on "+g+" quote"+(g===1?"":"s")+":

     '+htmlEncode(k[c].quoteName)+"

    (showing quotes 1-'+k.length+" of "+g+")
    Loading...
    ";if(m){d+=""}d+="
    &#"+getRawFontId(FontIconId_Enum.fiiUpDownArrow)+";"+f+"\n"+m+"
    ";var x=false,g=false;if(null!==j){var k=mjt_GetChildrenWithNodeName(v,"LI"),t;for(t=0;t0){var r=k[k.length-1];if(r.getAttribute("mjtgroupingid")&&j==r.getAttribute("mjtgroupingid")){var b=mjt_GetFirstChildWithNodeName(r,"UL");if(b){b.innerHTML+=d;x=true}}}}if(!x){if(g&&null!==j){d="\n
  • \n
      \n"+d+"
  • "}v.innerHTML+=d}if(o===0&&v.getElementsByTagName("li").length>0&&getObj("noFieldsDiv")!==null&&getObj(p+"Div")!==null){getObj("noFieldsDiv").style.display="none";getObj(p+"Div").style.display=""}ToolMan.dragsort().makeListSortable(v,verticalDragSortOnly);return s}function markLeavesDisabled(b){for(var a=0;a(in use)"}}}function AddReportField(b,j,e,f){if(!f){f=""}if(!j){j=0}var h=getObj("selectReportFields"),a=getObj(b),g,i;if(a.getAttribute("data-fieldtreetype")=="fieldTreeLeaf"){g=getObj(b);i=g.innerHTML;var d=a.getAttribute("mjtcartcommonid");var c=null;if(d){c=g_commonFieldSet[d]}if(!c){c=[b]}markLeavesDisabled(c);addFieldToCart(b,i,a.getAttribute("mjtparentgroupid"),j,f,null,d);rescrollParentDialogIfNecessary(g)}}var g_filterFSTreeTimer;function filterFSTree(){var b=getObj("fieldTreeFilterField"),c=b.value,d="data-lastFilterValue",a=b.getAttribute(d);if(a!=c){filterFOTreeForNewFilterTerm(c);b.setAttribute(d,c)}}function delayedFilterFSTree(){clearTimeout(g_filterFSTreeTimer);g_filterFSTreeTimer=setTimeout(filterFSTree,250)}function verticalDragSortOnly(a){a.toolManDragGroup.verticalOnly()}function ClearAllReportFields(b){if(!b){b=""}var a=getObj("optionsFieldCart"+b);a.innerHTML=""}function submitPrintBarcodeLabelsForm(){var g=getObj("printBarcodeLabelForm"),a=new FormValidator();if(!a.CSValidateRequiredField(g.formTemplateId,"Please select a Label")){return}var h=g.formTemplateId.value.split("?"),c=h[0],l=parseInt(h[1],10),m=parseInt(h[2],10);var b=buildUrlPrefixWithParamSeparator(pageLegacyLabelForms)+"inline=1&formTemplateId="+c;if(g.poId){b+="&poId="+g.poId.value}if(g.poReceiptId){b+="&poReceiptId="+g.poReceiptId.value}if(g.snIdList){b+="&snIdList="+g.snIdList.value}if(l>1||m>1){if(!a.CSValidateIntegerField(g.startLabel,"Start Label",0,1,l*m)){return}b+="&start="+g.startLabel.value}try{var k=new Date();var j="barcodeWin"+k.getTime()+""+Math.floor(1000*Math.random());disableDialogButtons();var f=window.open(b,j,"height=500px,width=550px,help=no,resizable=yes,scrollbars=yes,status=no");if(f){f.focus()}}catch(i){enableDialogButtons()}hideDialog()}function submitPrintBarcodeLabelsFormForBarcodes(){var j=getObj("printBarcodeLabelForm"),c=new FormValidator();if(!c.CSValidateRequiredField(j.formTemplateId,"Please select a Label")){return}var o=new Date();var n="barcodeWin"+o.getTime()+""+Math.floor(1000*Math.random());var k;var l=j.formTemplateId.value.split("?"),g=l[0],p=parseInt(l[1],10),r=parseInt(l[2],10);var b=buildUrlPrefixWithParamSeparator(pageLegacyLabelForms)+"inline=1&formTemplateId="+g;var a={field:j.startLabel,label:"Start Label",minValue:1,maxValue:p*r};if(p>1||r>1){if(!c.CSValidateNumberFieldP(a)){return}b+="&start="+j.startLabel.value}var f=document.createElement("form");f.setAttribute("method","POST");f.setAttribute("action",b);f.setAttribute("target",n);if(j.snIdList){k=j.snIdList.value}var q=document.createElement("input");q.setAttribute("type","hidden");q.setAttribute("name","snIdList");q.setAttribute("value",k);f.appendChild(q);document.body.appendChild(f);var h="scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no, width=550px,height=550px";try{disableDialogButtons();var i=window.open("",n,h);f.submit();document.body.removeChild(f);if(i){i.focus()}}catch(m){}hideDialog()}function rsCallbackNewJobPhaseDialog(b,a){processSimpleDialogCallback(b,"createJobPhase",null,true)}function showCreateJobPhase(a,b){jsrsExecute(rsCallbackNewJobPhaseDialog,"Dialog_GetNewJobPhaseDialog",[a],hideTimedMessage);displayTimedMessage("Getting New "+htmlEncode(b)+" Phase Dialog...")}function rsCallbackValidateNewJobPhaseName(b,a,d){var c=getObj("createJobPhase")?getObj("createJobPhase"):getObj("editJobPhase");enableDialogButtons();if(checkResponseForError(b)){if(!isEmptyResponse(b)){if(!(c.jobPhaseId&&c.jobPhaseId.value==b)){alert("A phase with this name already exists.");c.phaseName.select();c.phaseName.focus();return}}}updateOrCreateJobPhase(d,1)}function submitCreateJobPhase(c){var b=getObj("createJobPhase")?getObj("createJobPhase"):getObj("editJobPhase");var a=new FormValidator();if(!a.CSValidateRequiredField(b.phaseName,"Please enter a Name")){return}jsrsExecute(rsCallbackValidateNewJobPhaseName,"Job_GetJobPhaseByName",[b.jobId.value,escape(b.phaseName.value)],enableDialogButtons,c);displayTimedMessage("Validating "+htmlEncode(c)+" Phase Name...");disableDialogButtons()}function performUpdateOrCreateJobPhase(b,a,e){var d=htmlEncode(e),c=b?"Updating "+d+" Phase...":"Creating "+d+" Phase";jsrsExecute(rsCallbackRefreshPageAndScrollPos,b?"Job_UpdateJobPhase":"Job_CreateJobPhase",a,rsErrorCallbackShowErrorDialogAndRefresh,{showErrorInSubdialog:1,errorDialogTitle:"Error "+c},0,1);displayTimedMessage(c+"...");disableDialogButtons()}function UpdateSelectionCart(d){var e=getObj(d);var b=new ShoppingCart(e.cart.value);b.SyncFromForm(e);b.SyncToForm(e);b.SortByName();e.cart.value=b.Serialize();e.initValue.value="";for(var c=1;c<=b.NumItems();++c){e.initValue.value+=((c>1)?",":"")+b.ItemId(c)}var a=getObj("shoppingCartInfo");if(a){a.innerHTML=(b.NumItems()==1?"1 item":(b.NumItems()>0?(b.NumItems()+" items"):"No items"))+" selected";if(getObj("btnShowAll").style.display=="none"){getObj("btnShowSelected").style.display=b.NumItems()>0?"":"none"}}}function ViewSelectionCart(formName_,displayFn_,escapedSearchTerm_){if(typeof(escapedSearchTerm_)=="undefined"){escapedSearchTerm_=""}getObj("btnShowSelected").style.display="none";getObj("btnShowAll").style.display="";var theForm=getObj(formName_);theForm.showItems.value="selected";eval(displayFn_+"('',1,unescape('"+escapedSearchTerm_+"'));")}function ShowAllItems(formName_,displayFn_,escapedSearchTerm_){if(typeof(escapedSearchTerm_)=="undefined"){escapedSearchTerm_=""}getObj("btnShowSelected").style.display="";getObj("btnShowAll").style.display="none";var theForm=getObj(formName_);theForm.showItems.value="filtered";eval(displayFn_+"('',1,unescape('"+escapedSearchTerm_+"'));")}function rsCallbackLongListFilterItems(b,a){if(checkResponseForError(b)){var d=getMajorFilterType(getObj("editJobFilter"));var e=getObj("attrFilterDetails");if(d==DynSQLComponentTypes_Enum.mjtSingleJobAttributeValue||d==DynSQLComponentTypes_Enum.mjtJobReportAttributeValue){e=getObj("jobAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtSingleCustAttributeValue){e=getObj("custAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtSingleQuoteAttributeValue){e=getObj("quoteAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtSingleCGQuoteAttributeValue||d==DynSQLComponentTypes_Enum.mjtSingleCGOrderAttributeValue){e=getObj("cgquoteAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtSingleSerialNumberAttributeValue){e=getObj("serialNumberAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtActivityAttributeValue){e=getObj("activityAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtPOAttributeValue){e=getObj("poAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtSupplierAttributeValue){e=getObj("supplierAttrFilterDetails")}else{if(d==DynSQLComponentTypes_Enum.mjtJobFormAttributeValue){e=getObj("jobFormFieldFilterDetails")}}}}}}}}}var c=pageHeight()-120;e.innerHTML=b;initializeShoppingCartSelectionList("editJobFilter",getObj("editJobFilter").initValue.value,"LongListFilter")}}function ShowLongListFilterItems(i,j,f,b){if(!b){b=""}var r=getObj("editJobFilter");var o=r.initValue.value;var k="";var t=getMajorFilterType(r);var e=getTypeInfo(t);var c=e.split(":")[0];var q=false;if(r.invertList&&r.invertList.length==2){q=r.invertList[1].checked}var s=(q?"1":"0");if(getObj("initstr")!==null){k=getObj("initstr").value;if(k!==""){var p=k.split("|");var l=p[1].split(":");var a;if(p[0]!=t){k=""}if(l[3]!=11){k=""}if(k.length&&l.length>3){var m=l[4].split(";");if(m.length>1&&m[2]!=s){m[2]=s;l[4]=m.join(";");p[1]=l.join(":");k=p.join("|")}}if(l.length<5||l[4].split(";")[0]!=c){k=""}}}if(k===""){var n=getVBUsage(t);var d=e.split(":")[1];if(e.split(":").length>=3){n=e.split(":")[2]}var g=0;var h=r.initValue.value;k=t+"|"+n+":"+g+":"+c+":"+d+":"+c+";"+h+";"+s}r.showItems.value=(r.showItems.value!="selected"?"filtered":"selected");jsrsExecute(rsCallbackLongListFilterItems,"Job_GetLongListFilterItems",[i,j,f,t,c,getWebPage(),k,o,r.showItems.value,b]);getObj("longListTable").innerHTML="Loading..."}function searchOnEnter(e_,searchFn_){var keycode;if(window.event){keycode=window.event.keyCode}else{if(e_){keycode=e_.which}else{return true}}if(keycode==13){eval(searchFn_+"('','',getObj('searchTerm').value)");return false}else{return true}}function SubmitPrintJobActivity(){var h=getObj("printJobActivity"),l=h.isAppointment.value=="1",g=pagePrintCalendar+(l?"&appointmentId=":"&activityId=")+h.jobActivityId.value,b=false,f;if(h.printType){if(h.printType[0].checked){g+="&packetId="+h.activityPacketId.value;b=true}}if(!b){if(!h.calendarForm.value){showInfoDialog('
    There are no active Activity Forms defined.

    You can define or activate Activity Forms on the Job Settings page.',"No Activity Forms Defined",1,"ok");return}g+="&formatId="+h.calendarForm.value;var n="";if(h.printActFormId&&h.printActFormIdSelect){n=getCompoundSelectionValue(h.printActFormId,h.printActFormIdSelect)}if(n){g+="&forms="+n}}if(h.pagebreak){if(h.pagebreak.checked){g+="&pb=3"}}var m="pdf";for(f=0;f-1?f.options[g]:0,a=c?c.getAttribute("data-adminOption"):"",e=c?"1"===a:0,d=e||getAnyOrSelectedIsAny(b,"UserPermissions");return d}function confirmAndProceedWithValidation(a){if(a.validationStage>=a.targetValidationStage){return true}showDialogP(""+a.htmlMessage+"","frmConfirmSkipAndValidateUser",{formTitle:a.formTitle,isSubdialog:1,subdialogDismisalFocusFieldName:a.focusFieldName,okButtonDisplayText:"Continue",contextDetailOrFnSubmit:{fnSubmit:function(){hideSubdialog();a.fnValidateNewStage(a.targetValidationStage)}}})}function confirmAnyOrSelection(a,c,e,f,d,b){if(a.userLoginTypeId.value==UserLoginType_Enum.ultxShop){if(!getAnyOrSelectedIsAny(a,c)){if(!getCompoundSelectionValue(a["allowed"+c+"Id"],a["allowed"+c+"IdSelect"])){if(!confirmAndProceedWithValidation({fnValidateNewStage:b,formTitle:"No "+e+" Selected",htmlMessage:"You have not selected any "+htmlEncode(e)+".
    This Shop User will not be able to see anything.

    Are you sure you want to keep these settings?",focusFieldName:"allowed"+c+"IdSelect",validationStage:f,targetValidationStage:d})){return}}}}return true}function confirmInternalRoleOrAdminSelection(a){if(!(getCompoundSelectionValue(a.roleId,a.roleIdSelect)||isAdminInUserDialog(a))){var b=new ClientDialogBuilder({formTitle:"No Role Selected",subdialogDismisalFocusFieldName:"roleIdSelect"});b.addFlexibleRow({rawValue:"You have not selected a Role\n\nWithout a Role, this user would not be authorized for any actions."});b.showClientDialog();return}return 1}function confirmExternalRoleSelection(a){if(getCompoundSelectionValue(a.externalRoleId,a.externalRoleIdSelect)){return 1}var b=new ClientDialogBuilder({formTitle:"No Role Selected",subdialogDismisalFocusFieldName:"externalRoleIdSelect"});b.addFlexibleRow({rawValue:"You have not selected a Role\n\nWithout a Role, this user would not be authorized for any views."});b.showClientDialog()}function validateUserForCreateOrEdit(j,b,e,d){var a=new FormValidator(),c=j.userLoginTypeId.value,h=j.userCGLoginTypeId.value,i=j.userNVLoginTypeId.value,f=c==UserLoginType_Enum.ultxRestAPI||h==UserCGLoginType_Enum.ucgltxRestAPI||i==UserNVLoginType_Enum.unvltRestAPI,g=function(l){validateUserForCreateOrEdit(getObj(j.id),l,e,d)};b=b||UserValidationConfirmationStages_Enum.uvsNone;if(!d){if(!a.CSValidateRequiredField(j.userName,"Please enter a name.")){return}if(!f&&j.newPwd&&j.confPwd&&(j.newPwd.value!=j.confPwd.value)){showInfoDialog("The passwords you have entered do not match.","Mismatched Passwords",1,"newPwd");return}if(!f&&j.newPwd&&!validateClientSidePasswordVals(j.userName,j.newPwd,function(m,l){showInfoDialog(m,"Error Validating Password",1,"newPwd")})){return}if(j.disableAsOfDate&&!a.CSValidateDateField(j.disableAsOfDate,"Auto-disable date",true)){return}if(!j.userId){if(!f&&!trim(j.email.value).length){if(!confirmAndProceedWithValidation({fnValidateNewStage:g,formTitle:"Missing Email Address",htmlMessage:"You have not specified an email address for this user.
    An email address is required in order to perform a password reset.

    Are you sure you want to omit an email address?",focusFieldName:"email",validationStage:b,targetValidationStage:UserValidationConfirmationStages_Enum.uvsMissingEmail})){return}}}if(j.disableAsOfDate&&j.disableAsOfDate.value&&!(j.isDisabled&&j.isDisabled.checked)){if(parseDateString(j.disableAsOfDate.value)<=new Date()){showInfoDialog("Set the Auto-disable date to a future date so that the user will not be immediately disabled.","Invalid Auto-Disable Date",1,"disableAsOfDate");return}}}if(j.roleIdSelect&&(((!(g_isCounterGo||g_isNVInventory))&&j.userLoginTypeId.value==UserLoginType_Enum.ultxInternal)||(g_isCounterGo&&j.userCGLoginTypeId.value==UserCGLoginType_Enum.ucgltxInternal)||g_isNVInventory&&j.userNVLoginTypeId.value==UserNVLoginType_Enum.unvltInternal)){if(!confirmInternalRoleOrAdminSelection(j)){return}}else{if(j.userLoginTypeId.value==UserLoginType_Enum.ultxExternal){if((!j.allowSelectRoles)||"1"==j.allowSelectRoles.value){if(!confirmExternalRoleSelection(j)){return}}if(j.accountId&&j.accountName&&(j.accountName.type!="hidden")){if(!(j.accountId.value||combineJobProcessBasedJobIdSelections(j))){if(!confirmAndProceedWithValidation({fnValidateNewStage:g,formTitle:"No Jobs or Accounts Selected",htmlMessage:"You have not selected any Jobs or Accounts.
    This user will not be authorized to view any data.

    Are you sure you want to keep these settings?",focusFieldName:"",validationStage:b,targetValidationStage:UserValidationConfirmationStages_Enum.uvsExternalUserMissingJobsAndAccounts})){return}}}}else{if(j.userCGLoginTypeId.value==UserCGLoginType_Enum.ucgltxAccount){if(j.accountId&&j.accountName&&(j.accountName.type!="hidden")){if(!j.accountId.value){if(!confirmAndProceedWithValidation({fnValidateNewStage:g,formTitle:"No Accounts Selected",htmlMessage:"You have not selected any Accounts.
    This user will not be authorized to view any data.

    Are you sure you want to keep these settings?",focusFieldName:"accountName",validationStage:b,targetValidationStage:UserValidationConfirmationStages_Enum.uvsAccountUserMissingAccounts})){return}}if(!j.quoteFormId.value){if(!confirmAndProceedWithValidation({fnValidateNewStage:g,formTitle:"No Forms Selected",htmlMessage:"You have not selected any CG Quote Forms.
    This user will not be authorized to print any quotes.

    Are you sure you want to keep these settings?",focusFieldName:"quoteFormName",validationStage:b,targetValidationStage:UserValidationConfirmationStages_Enum.uvsAccountUserMissingCGQuoteForms})){return}}}}}}if(j.loginFromAnywhere&&!j.loginFromAnywhere.checked){var k=getCompoundSelectionValue(j.loginLocationId,j.loginLocationIdSelect);if(!k){if(!confirmAndProceedWithValidation({fnValidateNewStage:g,formTitle:"No Login Locations Selected",htmlMessage:"You have not selected any Login Locations.
    This user will not be able to login at all.

    Are you sure you want to keep these settings?",focusFieldName:"loginLocationIdSelect",validationStage:b,targetValidationStage:UserValidationConfirmationStages_Enum.uvsMissingLoginLocations})){return}}}if(j.userLoginTypeId.value==UserLoginType_Enum.ultxShop){if(!confirmAnyOrSelection(j,"PageView","Views",b,UserValidationConfirmationStages_Enum.uvsShopUserMissingPageViews,g)){return}if(!confirmAnyOrSelection(j,"ActivityType","Activities",b,UserValidationConfirmationStages_Enum.uvsShopUserMissingActivityTypes,g)){return}if(!confirmAnyOrSelection(j,"Assignee","Assignees",b,UserValidationConfirmationStages_Enum.uvsShopUserMissingAssignees,g)){return}}e()}function rsCallbackShowNewInvLocationSubdialog(a){processSimpleDialogCallback(a,"createInventoryLocation",null,true,true)}function ChangeInventoryLocation(b,c){var d=getObj(b);var a=d["inventoryLocationId"+c];if(a.value=="-1"){selectFirstOption(a);jsrsExecute(rsCallbackShowNewInvLocationSubdialog,"Dialog_GetNewInvLocationSubdialog",[escape(b),escape(c)],enableDialogButtons);displayTimedMessage("Getting New Inventory Location Subdialog");disableDialogButtons()}}function rsCallbackSubmitCreateInventoryLocationSubdialog(h,c,l){if(checkResponseForError(h)){var g=getObj(l.originalFormId);var f=l.idSuffix;var k="inventoryLocationId"+f;var d=g[k];var m=h.split("?");addOption(d,m[0],m[1],true);if(g.id=="assignSerialNumbers"){var b=parseInt(g.lineCount.value,10);var a=parseInt(f,10);for(var e=0;e
    Are you sure you wish to proceed?","Create Field and Auto-Generate Values",d,1,"btnOk","Create Field and "+f+" Values")}else{doCreateAttributeType(d)}}}function SubmitCreateAttributeType(d,b){var g=getObj("createAttributeType"),c=new FormValidator(),f=g.attributeDataTypeId.value;if(!c.CSValidateRequiredField(g.name,"Please enter a Name")){return}if(!g.attributeUsage.value){return}if(!f){showInfoDialog("Please select a Data Type.","No Data Type Selected",1,"attributeDataTypeId");return}if(g.attributeUsage.value==""+AttributeUsage_Enum.ParentAttribute&&g.childAttrTypeId.value===""){return}if(f==AttributeDataTypes_Enum.AutoNumber){if(!c.CSValidateIntegerField(g.nextNumber,"Starting Number",1,null,null)){return}if(!c.CSValidateIntegerField(g.padZeros,"Display At Least (...) Digits",0,1,20)){return}}if(f==AttributeDataTypes_Enum.SelectFromList){if(!c.CSValidateRequiredField(g.listOfValues,"Please enter at least one value")){return}}if(!d){d="rsCallbackRefreshPageAndScrollPos"}var a=getCompoundSelectionValue(g.jobProcessId,g.jobProcessIdSelect),e={attrCreationCallbackName:d,strJobProcessIds:a,isSubdialog:b};if(f==AttributeDataTypes_Enum.AutoNumber&&g.populateExisting.checked){jsrsExecute(rsCallbackGetAutoGenObjectCountForCustomFieldOnCreate,"Admin_GetAutoGenObjectCountForCustomField",["",g.attributeUsage.value,a],enableDialogButtons,e);disableDialogButtons();displayTimedMessage("Checking auto-generation count.")}else{doCreateAttributeType(e)}}function changeAttributeDataType(c){var h=getObj(c);var f=h.attributeDataTypeId.value;var e=(f==FormFieldDataTypes_Enum.SelectFromList);var d=getObj("createAttrHasColorRow");if(d){d.style.display=(e?"":"none")}var g=getObj("rowPreviewImageOnEdit");if(g){g.style.display=(e?((h.hasImage&&h.hasImage.checked)?"":"none"):"none")}var a=getObj("createAttrHasImageRow");if(a){a.style.display=(f==FormFieldDataTypes_Enum.SelectFromList?"":"none")}var b=getObj("createAttrIsSearchableRow");if(b){b.style.display=(f==FormFieldDataTypes_Enum.SelectFromList?"":"none")}getObj("createAttrSortAlphaRow").style.display=(f==FormFieldDataTypes_Enum.SelectFromList?"":"none");getObj("createAttrNextNumberRow").style.display=(f==FormFieldDataTypes_Enum.AutoNumber?"":"none");getObj("createAttrPadZerosRow").style.display=(f==FormFieldDataTypes_Enum.AutoNumber?"":"none");getObj("createAttrAutoNumberPrefixRow").style.display=(f==FormFieldDataTypes_Enum.AutoNumber?"":"none");getObj("createAttrAutoNumberSuffixRow").style.display=(f==FormFieldDataTypes_Enum.AutoNumber?"":"none");getObj("createAttrAutoNumberPopulateExistingRow").style.display=(f==FormFieldDataTypes_Enum.AutoNumber?"":"none");if(h.listOfValues){getObj("createAttrListOfValuesRow").style.display=(f==FormFieldDataTypes_Enum.SelectFromList?"":"none");h.listOfValues.style.display=(f==FormFieldDataTypes_Enum.SelectFromList?"":"none")}}function sharedExecuteGetCreateAttributeTypeSubdialog(a,c,b,d,e){jsrsExecute(rsCallbackProcessSimpleDialogWithParams,"Dialog_GetCreateAttributeTypeSubdialog",[a,c,b,d?1:0,e?e:""],enableDialogButtons,{formId:"createAttributeType",center:true,isSubdialog:true,isStackedSubdialog:true,fnProcessFormOnSuccess:function(){try{changeAttributeUsage()}catch(f){}changeAttributeDataType("createAttributeType")}})}function ChangeProductAttribute(h,e){var d,m,k,c,j,b=getObj("createJobActivityProduct");var g=getObj("createJobActivityProductAttr"+e+"Type");if(!g){g=getObj("createQuoteProductAttr"+e+"Type")}if(!g){g=getObj("createPOLineAttr"+e+"Type")}if(g){k=g.getAttribute("data-mjtattrtypename");if(!k){k=g.innerHTML.replace(/\:$/,"")}c=g.getAttribute("attrtypeid")}if(!c||!k){var f=getObj("attributeTypeId");if(f&&f.value&&f.options){if(!c){c=f.value}if(!k){k=f.options[f.selectedIndex].text}}}if(parseInt(e,10)>0&&parseInt(e,10)<=5){d=getObj("Attr"+e+"Value")}else{d=getObj("attributeValueId")}var i=d.value.split(",");if(i[0]=="-1"){selectFirstOption(d);var l="New Product Attribute Value",a=new ClientDialogBuilder({formId:"createProductAttrVal",formTitle:l,focusFieldName:"name",focusFieldOnMobile:1,subdialogDismisalFocusFieldId:d.id,fnSubmit:SubmitCreateProductAttrValSubdialog,okButtonDisplayText:'Save'});if(k){a.addFlexibleFieldRow({rawLabel:"Attribute Name",rawValue:k})}a.addFlexibleFieldRow({rawLabel:"New Value",valueHTML:""});a.showClientDialog();setTimeout(function(){updateProductAttributeValueImage(e)},0)}else{updateProductAttributeValueImage(e)}checkNecessityOfNoImageMessage();if(typeof clearSelectedInventoryData==="function"){clearSelectedInventoryData()}if(b&&typeof buildAddMaterialToActivitySNPicker=="function"){b.main_cart.value="";buildAddMaterialToActivitySNPicker()}}function rsCallbackSubmitProductAttrValSubdialog(e){if(checkResponseForError(e)){var a,d,b=e.split("?");if(parseInt(g_EditProductAttrNum,10)>0&&parseInt(g_EditProductAttrNum,10)<=5){d=g_EditProductAttrNum;a=getObj("Attr"+g_EditProductAttrNum+"Value")}else{a=getObj("attributeValueId")}g_EditProductAttrNum="";var f=checkAttribute(a.options[0],"mjtNoItemsOption");if(f){removeNode(f)}addOption(a,b[0],b[2],true);for(var c=0;c2){var d=mjt_GetChildrenWithNodeName(b[0],"TD");if(d&&d.length>1&&"JobTracker"==d[1].innerHTML){var g=d[1].innerHTML;d=mjt_GetChildrenWithNodeName(b[1],"TD");if(d&&d.length>1){var a=d[1].innerHTML;d=mjt_GetChildrenWithNodeName(b[2],"TD");if(d&&d.length>1){var f=mjt_GetFirstChildWithNodeName(d[1],"PRE");if(f){alert(h+"Source="+g+"\nError Number="+a+"\nDescription:\n\n"+f.innerHTML);c=true}}}}}if(!c){showInfoDialog(frames.upload_iframe.document.body.innerHTML,"Upload Error",isDialogShowing()?1:0,null)}}function getContrastingColor(i){var f="black",c="white";i=i.toLowerCase();if("black"==i){f=c}else{if("#"==i.substring(0,1)){var e=parseInt(i.substring(1,3),16),d=parseInt(i.substring(3,5),16),a=parseInt(i.substring(5,7),16);var h=(3*e+4*d+a)/(3+4+1);if(h<255/2){f=c}}}return f}var TIMED_MESSAGE_TIMEOUT=2000;function TimedMessageForResponse(d,c,a,e){var b=this;this.message=c;this.timeout=((arguments.length<3||null===a)?TIMED_MESSAGE_TIMEOUT:a);this.errorCheckerFunction_=d;this.postMessageCallback=(arguments.length<4)?null:e;this.ResponseMessageDisplayer=function(f,g){if(!b.errorCheckerFunction_||b.errorCheckerFunction_(f,g)){displayTimedMessage(b.message,b.timeout);if(b.postMessageCallback){b.postMessageCallback(f,g)}}}}function buildTimedMessageCallback(c,b,a,d){return(new TimedMessageForResponse(c,b,a,d)).ResponseMessageDisplayer}function StandardTimedMessageErrorChecker(a,b){return checkResponseForError(a,b)}function BuildStdTimedMessageCallback(b,a,c){return(new TimedMessageForResponse(StandardTimedMessageErrorChecker,b,a)).ResponseMessageDisplayer}function performCreateAddress(b,a){jsrsExecute(a.fnSubmitAddressCallback?a.fnSubmitAddressCallback:rsCallbackRefreshPageAndScrollPos,"Admin_CreateAddress",b,enableDialogButtons,a.fnSubmitAddressCallbackParams?a.fnSubmitAddressCallbackParams:null);displayTimedMessage("Creating Address...");disableDialogButtons()}function performUpdateAddress(a){jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Admin_UpdateAddress",a,enableDialogButtons);displayTimedMessage("Updating Address...");disableDialogButtons()}function rsCallbackTrackProgressShowing(c,a){if(checkResponseForError(c)){hideDialog();getObj("dynamicDialog").innerHTML=c;var d=getObj("asynchTaskMonitorDialog");var b=d.taskId.value;scrollDialogIfNecessary("asynchTaskMonitorDialog");positionAndShowDialog(false,d.parentNode,false,null);g_taskMonitorTimer=setTimeout("updateProgressBar("+b+");",0)}}var g_preparedToTrackProgress=false;function showTrackProgress(c,a,b,d){if(!d){d=""}if(!b){b=null}jsrsExecute(rsCallbackTrackProgressShowing,"Dialog_GetAsynchTaskMonitorDialog",[c,a,b,d])}function updateProgress(b,e){var a=getObj("progress");var g=getObj("progressBar");a.innerHTML=b;var c=getObj("progressBarSlide");var f=getObj("progressSeparator");var d=getObj("progressBarWait");if(-1==e){d.style.display="";g.style.display="none";a.style.display="none";f.style.display="none"}else{d.style.display="none";g.style.display="";a.style.display="";f.style.display="";if(e<0){b="0%"}c.style.width=b}}function rsCallbackUpdateProgressBarFromResponse(responseString_,id_){if(checkResponseForError(responseString_)){var theForm=getObj("asynchTaskMonitorDialog");if(null!==theForm){var taskId=theForm.taskId.value;var splitVals=responseString_.split(":");var tmpStatus=splitVals[0];var tmpProgress=parseInt(splitVals[1],10);var tmpTotal=splitVals[2];if(tmpTotal<=0){tmpTotal=1}var percentage=Math.round(1*(100*tmpProgress/tmpTotal))/1+"%";var tmpPhaseDescription=unescape(splitVals[3]);var tmpErrorCode=splitVals[4];var tmpEscapedErrorDescription=splitVals[5];var tmpEscapedCompletionHint=splitVals[6];if(""+tmpStatus=="0"){updateProgress(percentage,tmpProgress);document.getElementById("phaseDescription").innerHTML=tmpPhaseDescription;g_taskMonitorTimer=setTimeout("updateProgressBar("+taskId+");",3*1000)}else{var progWaitElem=getObj("progressBarWait");progWaitElem.style.display="none";var completionCallback=theForm.completionCallback.value;theForm.status.value=tmpStatus;eval(completionCallback+"("+taskId+","+tmpStatus+","+tmpErrorCode+",unescape('"+tmpEscapedErrorDescription+"'),unescape('"+tmpEscapedCompletionHint+"'),unescape('"+escape(tmpPhaseDescription)+"'))");var progDescTableElem=getObj("progressDescTable");if(progDescTableElem){progDescTableElem.border="1";progDescTableElem.border="0"}}}}else{hideDialog()}}function updateProgressBar(a){jsrsExecute(rsCallbackUpdateProgressBarFromResponse,"Admin_GetAsynchTaskStatus",a)}function AsynchTaskMonitorClosed(){if(g_taskMonitorTimer){clearTimeout(g_taskMonitorTimer)}g_taskMonitorTimer=null;var theForm=getObj("asynchTaskMonitorDialog");var proceedWithClose=true;if(theForm&&theForm.cancelCallback&&theForm.cancelCallback.value.length){proceedWithClose=eval(theForm.cancelCallback.value+"()")}if(proceedWithClose){hideDialog()}}function hideProgressBar(){document.getElementById("progressBar").style.display="none";document.getElementById("progress").style.display="none";document.getElementById("progressSeparator").style.display="none";document.getElementById("closeWarning").style.display="none";document.getElementById("closeWarningSeparator").style.display="none"}var g_autoRefreshTimer=null;var g_lastRefreshTime=null;var g_refreshRate=0;var countdownElement=null;function hmsFromSeconds(c){var d="";var b=Math.floor(c/60/60);c=c-60*60*b;var a=Math.floor(c/60);c=Math.round(c);if(b>0){d=b+":"}if(a>0){d=d+a+":"}return d+c}function refreshDisplayedCountdown(d){if(d>10||isDialogShowing()){removeNode(countdownElement);countdownElement=null}else{var f=getObj("countdownInterior");if(!countdownElement){countdownElement=document.createElement("table");countdownElement.className="countdown";var b=document.createElement("tbody");countdownElement.appendChild(b);var c=document.createElement("tr");b.appendChild(c);f=document.createElement("td");c.appendChild(f);f.className="countdownInterior";f.id="countdownInterior";document.body.appendChild(countdownElement);countdownElement.id="countdownDiv";countdownElement.border="0";countdownElement.cellPadding="0";countdownElement.cellSpacing="0"}var e=getObj("menuBar");if(e){countdownElement.style.top=(posTop(e)+e.offsetHeight)+"px"}countdownElement.style.display="block";var a="Refresh in "+Math.round(d)+"s.";a=''+a;f.innerHTML=a}}function resetRefreshTimer(b,a){if(!a){a=1}refreshDisplayedCountdown(b);g_autoRefreshTimer=setTimeout(autoRefreshIfNecessary,a*1000)}function initAutoRefresh(a){g_lastRefreshTime=new Date();g_lastUserActivityTime=g_lastRefreshTime;g_refreshRate=60*a;resetRefreshTimer(g_refreshRate)}function rsCallbackGetCanAutoRefresh(c,a,b){var e=b.fnDenied,d=b.params;hideTimedMessage();if(checkResponseForError(c)){if(!c||!c.length||"1"!=c.substring(0,1)){e(d)}else{b.fnPermitted(d)}}else{e(d)}}function rsCallbackErrorGetCanAutoRefresh(c,a,b){hideTimedMessage();b.fnDenied(b.params)}function testIfCanAutoRefresh(d,a,c,b){jsrsExecute(rsCallbackGetCanAutoRefresh,"Admin_GetCanAutoRefresh",[],rsCallbackErrorGetCanAutoRefresh,{fnPermitted:a,fnDenied:c,params:b},0,1);if(d){displayTimedMessage(d)}}function autoRefreshIfNecessary(b){clearTimeout(g_autoRefreshTimer);var a=new Date();var c=g_refreshRate-(a.getTime()-g_lastUserActivityTime.getTime())/1000;if(c<1){c=1}if(isDialogShowing()){resetRefreshTimer(c)}else{if(((a.getTime()-g_lastUserActivityTime.getTime())/1000)>=g_refreshRate){if(b){saveSettingsAndNavigateTo(window.location);displayTimedMessage("Refreshing Page...")}else{testIfCanAutoRefresh("Checking server state before auto-refreshing...",function(){autoRefreshIfNecessary(true)},function(d){initAutoRefresh(g_refreshRate/60)},0)}}else{resetRefreshTimer(c)}}}function displayAutoRefreshSection(){var a=getObj("autoRefreshOptions");a.style.display=""}function autoRefreshOptionChanged(){var b=getObj("autoRefreshOptions");var c=getObj("chkAutoRefresh");var a=c.checked;if(a){setTimeout(displayAutoRefreshSection,50)}else{b.style.display="none"}}function getAutoRefreshRate(){var a=getObj("chkAutoRefresh");if(a.checked){return trim(a.form.refreshRate.value)}else{return""}}function rsCallbackEditJobHeaderDialog(b,a){var c=processSimpleDialogCallback(b,"editJobHeader");updateAttributeLOVsIfNecessary(c)}function ShowEditJobHeader(a){var b="Getting Edit Job Header Dialog";jsrsExecute(rsCallbackEditJobHeaderDialog,"Dialog_GetEditJobHeaderDialog",a,rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error "+b},0,1);displayTimedMessage(b+"...")}function duplicateJob(c,a,d,e){var b="Getting Duplicate "+htmlEncode(e)+" Dialog";jsrsExecute(rsCallbackCheckAllRowsAndUpdateLOVAttrsOfDialog,"Dialog_GetDuplicateJobDialog",a,rsErrorCallbackShowErrorDialogAndRefresh,{formName:"duplicateJob",errorDialogTitle:"Error "+b},0,1);displayTimedMessage(b+"...")}function performSubmitEditJobHeader(a){var b="Saving Data";jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Job_UpdateJobFields",a,rsErrorCallbackShowErrorDialogAndRefresh,{showErrorInSubdialog:1,errorDialogTitle:"Error "+b},0,1);displayTimedMessage(b+"...");disableDialogButtons()}function rsCallbackDuplicateJob(c,b,a){if(checkResponseForError(c)){hideDialog();displayTimedMessage("Displaying new "+htmlEncode(a.jobProcessName)+"...");window.location=arrPageJobDetail[a.jobProcessId]+c}}function performSubmitDuplicateJob(a,b,c){jsrsExecute(rsCallbackDuplicateJob,"Job_DuplicateJob",a,enableDialogButtons,{jobProcessId:b,jobProcessName:c});displayTimedMessage("Duplicating "+htmlEncode(c)+"...");disableDialogButtons()}function rsCallbackValidateNewJobNameForEdOrDup(d,b,a){enableDialogButtons();var e=getObj(a.formId),c=function(){submitEditOrDuplicateJob(a.duplicate,true,1)};setFocus(e.jobName);confirmCreateDuplicateJobIfNecessary(d,a.jobProcessName,c)}function verifyJobNameOnEditOrDuplicateJobHeader(b){var c=getObj(b?"duplicateJob":"editJobHeader"),a=new FormValidator();if(!a.ValidateRequiredField(c.accountId,"Please select an Account")){return}if(!a.CSValidateRequiredField(c.jobName,"Please enter a "+c.jobProcessName.value+" Name")){return}jsrsExecute(rsCallbackValidateNewJobNameForEdOrDup,"Job_GetJobByName",[escape(c.jobName.value),c.accountId.value,(b?"":c.jobId.value)],enableDialogButtons,{duplicate:b?true:false,jobProcessId:c.jobProcessId.value,jobProcessName:c.jobProcessName.value,formId:c.id});disableDialogButtons();displayTimedMessage("Validating "+htmlEncode(c.jobProcessName.value)+" Name...")}function performPrepareSubmitEditJob(){var a=getObj("editJobHeader");if(a.jobName.value!=a.origJobName.value){verifyJobNameOnEditOrDuplicateJobHeader(false)}else{submitEditOrDuplicateJob(false,false,1)}}function performPrepareSubmitDuplicateJob(){verifyJobNameOnEditOrDuplicateJobHeader(true)}function addDisplayFieldForQuote(a,d){var c=getObj("optionsFieldCart"),b='\n
  • &#"+getRawFontId(FontIconId_Enum.fiiUpDownArrow)+";"+d+"
  • ";c.innerHTML+=b;ToolMan.dragsort().makeListSortable(c,verticalDragSortOnly)}function submitAddQuoteTextDisplayField(){var e=getObj("editQuoteRevision");if(!e){e=getObj("editQuoteSettings")}var a="";var d="";var c=e.fieldCount.value;e=getObj("createQuoteTextDisplayFieldDialog");var b=trim(e.txtValue.value);a=c+"_T"+escape(b);d="Text: "+htmlEncode(b);hideSubdialog();enableDialogButtons();addDisplayFieldForQuote(a,d)}function rsGetCreateQuoteTextDisplayFieldDialog(b,a){processSimpleDialogCallback(b,"createQuoteTextDisplayFieldDialog",null,false,true)}function promptForQuoteTextDisplayField(){jsrsExecute(rsGetCreateQuoteTextDisplayFieldDialog,"Quote_GetCreateQuoteTextDisplayFieldDialog",[],enableDialogButtons);disableDialogButtons();displayTimedMessage("Getting Text Display Field Dialog")}function rsCallbackPrintIssueDialog(c,b){if(checkResponseForError(c)){hideDialog();getObj("dynamicDialog").innerHTML=c;var d=getObj("printIssue");if(d.chkRow){if(typeof(d.chkRow.checked)=="boolean"){d.chkRow.checked=true;highlightOneCheckedRow(d.chkRow);synchronizeAllRowsCheckbox(d)}}var a=getObj("issuesDiv");if(a){a.style.height=(a.scrollHeight>300?"300px":"")}positionAndShowDialog(false,d.parentNode,false,d.formId,true)}}function showPrintIssue(c,b,a,d){if(!d){d=""}jsrsExecute(rsCallbackPrintIssueDialog,"Dialog_GetPrintIssueDialog",[b,a,d],hideTimedMessage);displayTimedMessage("Getting Print Issue Dialog...")}function submitPrintIssue(){var g=getObj("printIssue");var f=getListOfCheckedRowValues(g,1,null,"Please select one or more issues to print",null,undefined,undefined,{subdialogDismisalFocusFieldName:"",subdialog:1});if(!f){return}if(!g.formTemplate.value){showInfoDialog("Please select a format to print.","No Issue Format Selected",1,"formTemplate");return}var k="pdf";for(var d=0;d=1024000){return Math.round(a/1048576*100)/100+"MB"}else{if(a>1000){return Math.round(a/1024*100)/100+"KB"}}return a+"B"}function advanceToNextFileIfNecessary(a){--g_outstandingFileUploads;if(g_outstandingFileUploads<=0){g_disableFileDragDrop=false;if(g_hasFileDragDropError){enableDialogButtons()}else{hideTimedMessage();hideDialog();refreshPageAndScrollPos();g_arrFileDragDropFileInfos=[];g_nextDragDropFileId=1;g_outstandingFileUploads=0;g_hasFileDragDropError=false;g_disableFileDragDrop=false}}else{if(typeof a==="function"){a()}}}function buildRemoveFileLink(a){return cdBuildFAFontIconButton({doubleQuoteEncodedTitle:"Remove Slab Image File",fontId:FontIconId_Enum.fiiHollowTrash,doubleQuoteEncodedOnClickJS:"fileDragRemove('"+a+"')"})}function uploadFile(C,a,B,q,w){if(C.alreadyHandled){advanceToNextFileIfNecessary(a);return}var z=B,e=4,j=new XMLHttpRequest(),r=new FormData(),o=getObj("dragDropFileSection"+C.id),A=C.file,x,k,p=z.attrDataTypes?z.attrDataTypes.value:"",n=p.split("?"),m=z.attrTypes?z.attrTypes.value:"",b=m.split(","),d={},g,f,h,v,t;for(g=0;gUploading...'}j.onreadystatechange=function(){if(j.readyState===e){var F="";if(j.status===200){var E=j.responseText;try{var i=JSON.parse(E);if(i.error){F='An error occurred uploading the file, "'+A.name+'":\n';if(i.error.message){F+=i.error.message}if(i.error.stackTrace){F+="\n"+i.error.stackTrace}}else{if(!i.success){F="Upload failed:\n"+E}}}catch(D){F="Upload failed:\n"+E}if(!F){if(q){q(A,j)}else{if(o){o.innerHTML=A.name+" ("+formatFileSize(A.size)+') Upload complete';C.alreadyUploaded=1}}}}else{F="Upload failed, please retry."}if(F){if(w){w(A,j,F)}else{g_hasFileDragDropError=true;if(o){o.innerHTML=A.name+" ("+formatFileSize(A.size)+") "+buildRemoveFileLink(C.id)+'
    '+htmlMultilineEncode(F)+"
    "}}}if(!w&&!q){advanceToNextFileIfNecessary(a)}}};j.send(r)}function doUploadFiles(c){disableDialogButtons(!g_arrFileDragDropFileInfos.length);if(g_arrFileDragDropFileInfos.length>0){g_hasFileDragDropError=false;g_outstandingFileUploads=g_arrFileDragDropFileInfos.length;var a=0,b=function(){if(a>=g_arrFileDragDropFileInfos.length){return}uploadFile(g_arrFileDragDropFileInfos[a++],b,c)};b()}else{c.submit()}saveScrollPos();displayTimedMessage("Uploading file...")}function cancelFileUploadSubmission(b,a){g_disableFileDragDrop=false;return 1}function rsCallbackCheckFileName(a){g_disableFileDragDrop=false;enableDialogButtons();if(checkResponseForError(a)){var c=true;var d=getObj("createFile");if(!isEmptyResponse(a)){var b=a.indexOf("\n")>-1?"s":"";g_disableFileDragDrop=true;displaySimpleConfirmationDialog(function(){doUploadFiles(d)},htmlMultilineEncode("Do you want to overwrite the following, existing file"+b+"?\n\n"+unescape(a)),"Overwrite File"+b,{},1,"fileName",0,cancelFileUploadSubmission)}else{doUploadFiles(d)}}}function submitCreateFile(){var g=getObj("createFile");if(g.phaseId){if(g.phaseIdSelect){g.phaseId.value=getCompoundSelectionValue(g.phaseId,g.phaseIdSelect)}}var e="",c,f,a=0;if(g_arrFileDragDropFileInfos.length>0){for(c=0;c0){e.style.display=(f&&c.children.length==1)?"":"block";if(c.children.length===1){e.innerText="File To Attach:"}else{e.innerText="Files To Attach:"}}else{e.style.display="none"}}if(b>0&&c&&c.children.length>=b){g.style.display="none"}else{g.style.display="block"}resizeCurrentDialog()}function processUploadFileAsImageForThumbnail(a,b){var c=new FileReader();c.onload=function(e){var d=e.target,f=new Image();f.onload=function(g){a.objLoadedImage=f;if(b){b()}};f.onerror=function(g){fileDragRemove(a.id);showInfoDialog('Failed to load "'+htmlEncode(a.file.name)+'" as an image.',"Invalid Image",1)};f.src=d.result;getObj("imgThumb"+a.id).src=d.result};c.readAsDataURL(a.file)}function draggedFileHasValidType(d){var h=d.file||0,g=(h.name||""),a=ClientFunctions.getFileComponentsFromFilePath(g),f=a.extension,c=d.uploadSettings||0,b=c.acceptedFileTypes||[],e=true;if(f&&b.length){e=b.some(function(i){return i===f})}return e}function fileDragDrop(o){fileDragOver(o);if(g_disableFileDragDrop){return}var p=o.target;while(p.tagName.toLowerCase()!=="form"&&p){p=p.parentNode}if(p){var b,n=p,c=findFirstDescendantWithAClass(n,["uploadedFiles"]),l,a,q,j,g=getFileUploadLimit(n),m=getUploadFilesSettings(n),h=m.requiresRenderThumbnail;if(o.target.files&&o.target.files.length){b=o.target.files}else{b=o.dataTransfer.files}if(g>-1){if(g_arrFileDragDropFileInfos.length+b.length>g){showInfoDialog("You have selected too many files.

    You may only select "+g+" "+(g>1?"files":"file")+".
    "+(g_arrFileDragDropFileInfos.length?("
    If you wish to replace a file, remove it and add a new one."):""),"Too Many Files Selected",1);return}}for(l=0;lThe following file is not a supported type:

    '+htmlEncode(q.name)+'

    '+m.invalidFileTypeHelpMessage+"","Invalid File",1)}else{g_arrFileDragDropFileInfos.push(j);var d=document.createElement("div"),r=buildRemoveFileLink(a),k="imgThumb"+a,f=q.name+" ("+formatFileSize(q.size)+")";if(h){f='Loading... '+f+" "+r}else{f+=r}d.id="dragDropFileSection"+a;d.innerHTML=f;c.appendChild(d);if(h){processUploadFileAsImageForThumbnail(j)}}}if(n.fileName&&!n.fileName.length){n.fileName.value=""}toggleFilesToUploadList(n)}}function enableFileDragDrop(b){g_arrFileDragDropFileInfos=[];var c=new XMLHttpRequest();if(typeof window.File!=="undefined"&&typeof window.FileList!=="undefined"&&typeof window.FileReader!=="undefined"&&typeof c.upload!=="undefined"){var a=findFirstDescendantWithAClass(b,["fileDropMessageContainer"]);if(a){a.style.display="block"}b.fileName.addEventListener("change",fileDragDrop);b.addEventListener("dragover",fileDragOver);b.addEventListener("dragleave",fileDragOver);b.addEventListener("drop",fileDragDrop)}}function rsCallbackGetCreateAttachedFileDialog(b,a){g_arrFileDragDropFileInfos=[];var c=processSimpleDialogCallback(b,"createFile",null,true);if(c){enableFileDragDrop(c)}}function showCreateFile(c,a,e,d){var b="Getting Create Attached File Dialog";jsrsExecute(rsCallbackGetCreateAttachedFileDialog,"Dialog_GetCreateAttachedFileDialog",[a,e,d||""],rsErrorCallbackShowErrorDialogAndRefresh,{errorDialogTitle:"Error "+b},0,1);displayTimedMessage(b+"...")}function SelectSearchFilter(){var c=getObj("editJobFilter");var b=new FormValidator();if(!b.CSValidateRequiredField(c.searchTerm,"Please enter a search term")){return}var a=trim(c.searchTerm.value);selectFilter(escape(c.componentType.value+"|"+c.searchFilter.value+":"+escape(escape(a)))+"?"+escape(htmlEncode("Search for '"+a+"'")))}function rsCallbackValidateUpdateViewName(d){var e=getObj("editPageView"),b=e.pageViewId.value,c=e.pageId.value==WebPages_Enum.Report,a=c?"report":"view";if(checkResponseForError(d)){if(!isEmptyResponse(d)){if(b==d){}else{if(!jtHasAccess(JTSecuredObject_Enum.mjtViews,AccessRight_Enum.mjtARDelete)){alert("A "+a+" with this name already exists and you do not have permission to delete it.");setFocus(e.viewName);return}else{if(!confirm("A "+a+" with this name already exists. Do you want to overwrite the existing "+a+"?")){setFocus(e.viewName);return}}}}}jsrsExecute(rsCallbackRefreshPageAndScrollPos,"Admin_UpdatePageView",[escape(e.pageId.value),escape(e.viewName.value),(e.defaultView?(e.defaultView.checked?"1":"0"):""),e.pageViewGroupId.value,escape(e.pageViewId.value)],enableDialogButtons);displayTimedMessage("Saving "+a+"...");disableDialogButtons()}function submitEditPageView(){var d=getObj("editPageView"),a=d.pageId.value==WebPages_Enum.Report,c=a?"Report":"View",b=new FormValidator();if(!b.CSValidateRequiredField(d.viewName,"Please enter a name.")){return}jsrsExecute(rsCallbackValidateUpdateViewName,"Admin_GetViewByName",[escape(d.pageId.value),escape(d.viewName.value),escape(d.visibilityTypeId.value)],hideTimedMessage);displayTimedMessage("Validating "+c+" Name...")}function showEditPageView(d,b,a,c){jsrsExecuteWithErrorP("Dialog2_GetEditPageViewDialog",rsCallbackProcessSimpleDialogP,a?"Getting Rename Report Dialog":"Getting Rename View Dialog",{pageId:d,pageViewId:b,isCurrentView:c?1:0},{formId:"editPageView",isSubdialog:!a})}function SetActivityAssignee(e,f,b,d,c){var g=getObj(e);if(g){setCompoundSelectionValue(g[f],g[b],g[d],c,"");var a=g[d];if(a.focus){a.focus()}}}function sortAssignees(c,d,j){var m="",i=0,g=getObj("frmSelectAssignees"),h=reconstructSimpleShoppingCart(g.id),l=h.isActiveOnlyChecked(),f=(("1"==g.includeInactive.value)&&(!l))?1:0,e=("1"==g.includeUnassignedOption.value)?1:0,b=("1"==g.includeMyselfOption.value)?1:0;if(h.doShowSelectedOnly()){i=1}m=h.getContentDescriptor().getIdList();var k=j.split(",");var a=unescape(k[0]);jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectAssigneesTable",["",escape(m),c,d,a,i,f,e,b],enableDialogButtons,{formId:g.id,tableId:g.id+"_assigneeTable"});displayTimedMessage("Getting Assignees Table...");disableDialogButtons()}function searchOrSelectedAssignees(b){var e=b.getForm();var c=true;var a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortAssignees("",0,d)}function rsCallbackGetSelectAssigneesDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectAssignees",null,true,a.dismisalFocusFieldName);if(e){getObj("frmSelectAssignees_assigneeTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectAssignees","cart",true,"cartInfoSpan",searchOrSelectedAssignees,true,true,null,null,a.includeActiveOnlyOption?"Active Assignees Only":null);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId);g_objSetFocusObject=e.search?e.search:g_objSetFocusObject}}function selectAssigneeForCompoundSelection(b,h,k,e,j,g,f,i,a){if(!i){i="assignee"}var c=getObj(k);var d=getCompoundSelectionValue(c[i+"Id"],c[i+"IdSelect"]);jsrsExecute(rsCallbackGetSelectAssigneesDialog,"Dialog_GetSelectAssigneesDialog",[k,d,e?1:0,j?1:0,g?1:0,f?1:0,escape(i),a?1:0],enableDialogButtons,{parentFormId:k,dismisalFocusFieldName:h.name,includeActiveOnlyOption:f?1:0});displayTimedMessage("Getting Select Assignees Dialog...");disableDialogButtons()}function rsCallbackGetNewAssigneeForSelectionSubdialog(a){var b=processSimpleStackedSubdialogCallback(a,"createAssignee",null,true,"search")}function newAssigneeForSelectionDialog(a){jsrsExecute(rsCallbackGetNewAssigneeForSelectionSubdialog,"Dialog_GetNewAssigneeForSelectionSubdialog",[1],enableDialogButtons)}function SubmitCreateAssigneesForSelection(){submitCreateAssigneeSubdialogWithCallback(rsCallbackCreatedInSubdialog,buildCreatedInSubdialogParamsForSelList("frmSelectAssignees",searchOrSelectedAssignees,getObj("frmSelectAssignees").parentFormId.value,"assigneeIdSelect"))}function submitSelectForCompoundSelectionField(a,b){var c=getObj(a);if(c.formFieldsPrefix){b=c.formFieldsPrefix.value}submitSelectCustomCompoundSelect(a,b)}function submitSelectAssignees(a){submitSelectForCompoundSelectionField(a,"assignee")}function sortPhases(b,a,d){var e=getObj("frmSelectPhases"),c=e.jobId.value;jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectPhasesTable",[e.id,"","",b,a,c],enableDialogButtons,{formId:e.id,tableId:e.id+"_phaseTable"});displayTimedMessage("Getting Phases Table...");disableDialogButtons()}function searchOrSelectedPhases(b){var e=b.getForm();var c=true;var a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortPhases("",0,d)}function rsCallbackGetSelectPhasesDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectPhases",null,true,a.dismisalFocusFieldName);if(e){getObj("frmSelectPhases_phaseTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectPhases","cart",true,"cartInfoSpan",searchOrSelectedPhases,false,false);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function selectPhaseForCompoundSelection(e,c,f,b,g,h){var a=getObj(f);var d=getCompoundSelectionValue(a.phaseId,a.phaseIdSelect);jsrsExecute(rsCallbackGetSelectPhasesDialog,"Dialog_GetSelectPhasesDialog",[f,d,b],enableDialogButtons,{parentFormId:f,dismisalFocusFieldName:c.name});displayTimedMessage("Getting Select Phases Dialog...");disableDialogButtons()}function sortAccounts(b,c,g){var j="";var f=0;var d=getObj("frmSelectAccounts"),h="1"==d.singleSelect.value,e=reconstructSimpleShoppingCart(d.id),i=g.split(","),a=unescape(i[0]);if(!h){if(e.doShowSelectedOnly()){f=1}j=e.getContentDescriptor().getIdList()}jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectAccountsTable",[d.id,"",escape(j),b,c,a,f,escape(d.accountIdToExclude.value),("1"==d.showInactive.value?1:0),(h?1:0),d.forceJTStyle.value,d.forceCGStyle.value],enableDialogButtons,{formId:d.id,tableId:d.id+"_accountTable"});displayTimedMessage("Getting Accounts Table...");disableDialogButtons()}function searchOrSelectedAccounts(b){var e=b.getForm();var c=true;var a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortAccounts("",0,d)}function rsCallbackGetSelectAccountsDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectAccounts",null,true,a.dismisalFocusFieldName);if(e){getObj("frmSelectAccounts_accountTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectAccounts","cart",true,"selectAccountsCartInfoSpan",searchOrSelectedAccounts,true,a.singleSelect?false:true,a.singleSelect,null,null,null,a.hideShowAllButton);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId);e.onSelectFn=a.onSelectFn?a.onSelectFn:null}}function selectAccountForCompoundSelection(b,m,j,e,k,c,l,a,i,g,h){var d=getObj(m),f=getCompoundSelectionValue(d[l+"Id"],d[l+"IdSelect"]);jsrsExecute(rsCallbackGetSelectAccountsDialog,"Dialog_GetSelectAccountsDialog",[m,e?e:"",k?1:0,c?1:0,l,escape(f),a?1:0,g?1:0,h?1:0],enableDialogButtons,{parentFormId:m,dismisalFocusFieldName:j.name,singleSelect:c?1:0,onSelectFn:i?i:null,hideShowAllButton:true});displayTimedMessage("Getting Select Accounts Dialog...");disableDialogButtons()}function submitSelectSpecificAccounts(d,a,e){var g=getObj(d),c=getObj(g.parentFormId.value);if(!c){alert("submitSelectSpecificAccounts() - Failed to find the parent form with id="+g.parentFormId.value);return}var b=g.formFieldsPrefix.value+"Id",f=g.formFieldsPrefix.value+"Name";setCompoundSelectionValue(c[b],c[f],c[b+"Select"],a,unescape(e));if(g.onSelectFn){g.onSelectFn()}}function submitSelectAccount(b,a){submitSelectCustomCompoundSelect(b,a)}function rsCallbackCreatedNewAccountForSubdialog(b,a){enableDialogButtons();if(checkResponseForError(b)){var c=getObj("createAccount");submitSelectSpecificAccounts(c.id,b,c.accountName.value);hideSubdialog()}}function rsCallbackValidateNewAccountName(c){var e=getObj("createAccount"),b=trim(e.accountName.value),d="",a="";if(e.priceType){d=e.priceType.value}if(e.cgPriceList){a=e.cgPriceList.value}if(checkResponseForError(c)){if(!isEmptyResponse(c)){if(!confirm("An Account with this name already exists. Are you sure you want to create another Account with this name?")){setFocus(e.accountName);return}}}jsrsExecute(rsCallbackCreatedNewAccountForSubdialog,"Customer_CreateCustomer",[escape(b),d,a],enableDialogButtons);displayTimedMessage("Creating Account...");disableDialogButtons()}function submitNewAccountSubdialog(){var b=getObj("createAccount");var a=new FormValidator();if(!a.CSValidateRequiredField(b.accountName,"Please enter an Account Name")){return}if(b.priceType){if(!a.CSValidateRequiredField(b.priceType,"Please select a "+getPrefixedEEPLString())){return}}if(b.cgPriceList){if(!a.CSValidateRequiredField(b.cgPriceList,"Please select a "+getPrefixedCGPLString())){return}}jsrsExecute(rsCallbackValidateNewAccountName,"Customer_GetCustomerByName",escape(b.accountName.value),hideTimedMessage);displayTimedMessage("Validating Account Name...")}function dismissCurrentSubdialogAndShowNewAccountSubdialog(h,g,f,b){var e=g.form.onSelectFn,c=getObj(f),a=c.forceJTStyle&&c.forceJTStyle.value=="1",d=c.forceCGStyle&&c.forceCGStyle.value=="1";hideSubdialog();jsrsExecute(rsCallbackProcessSimpleStackedSubdialog,"Dialog_GetNewAccountSubdialog",[f,b,a?1:0,d?1:0],enableDialogButtons,{formId:"createAccount",useSavedEventPagePosition:true,dismisalFocusFieldId:g.id,arrFormProperties:[{name:"onSelectFn",value:e}]});displayTimedMessage("Getting New Account Subdialog...");disableDialogButtons()}function sortActivityTypes(b,c,g){var i="";var f=0;var d=getObj("frmSelectActivityTypes");var e=reconstructSimpleShoppingCart(d.id);var h=g.split(",");var a=unescape(h[0]);if(e.doShowSelectedOnly()){f=1}i=e.getContentDescriptor().getIdList();jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectActivityTypesTable",[d.id,d.parentFormId.value,escape(i),b,c,f,d.jobProcessId.value,d.allowSelectJobProcess.value,d.includeInactive.value],enableDialogButtons,{formId:d.id,tableId:d.id+"_activityTypeTable",idOfFieldToHideOnSelectedOnly:"newButtonSection"+e.cbNameSuffix});displayTimedMessage("Getting Activity Types Table...");disableDialogButtons()}function searchOrSelectedActivityTypes(b){var e=b.getForm();var c=true;var a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortActivityTypes("",0,d)}function rsCallbackGetSelectActivityTypesDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectActivityTypes",null,true,a.dismisalFocusFieldName);if(e){getObj("frmSelectActivityTypes_activityTypeTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectActivityTypes","cart",true,"actTypeCartInfoSpan",searchOrSelectedActivityTypes,false,true,false,e.tableId.value);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showActivityTypeSelectionSubdialog(a,j,g,d,e,f,c,i){var b=getObj(j),h=getCompoundSelectionValue(b[i+"Id"],b[i+"IdSelect"]);jsrsExecute(rsCallbackGetSelectActivityTypesDialog,"Dialog_GetSelectActivityTypesDialog",[j,d,h,e?1:0,f?1:0,c?1:0,escape(i)],enableDialogButtons,{parentFormId:j,dismisalFocusFieldName:g.name,jobProcessId:d});displayTimedMessage("Getting Select Activity Types Dialog...");disableDialogButtons()}function submitSelectActivityTypes(a){var b=getObj(a);submitSelectCustomCompoundSelect(a,b.formFieldsPrefix.value,0)}function sortJobProcesses(d,c,g){var a="";var b=0;var f=getObj("frmSelectJobProcesses");var e=reconstructSimpleShoppingCart(f.id);a=e.getContentDescriptor().getIdList();jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectJobProcessesTable",[f.id,f.parentFormId.value,escape(a),d,c],enableDialogButtons,{formId:f.id,tableId:f.id+"_jobProcessTable"});displayTimedMessage("Getting Job Processes Table...");disableDialogButtons()}function searchOrSelectedJobProcesses(b){var e=b.getForm();var c=true;var a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortJobProcesses("",0,d)}function rsCallbackGetSelectJobProcessesDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectJobProcesses",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj("frmSelectJobProcesses_jobProcessTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectJobProcesses","cart",true,"cartInfoSpan",searchOrSelectedJobProcesses,false,false);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId);d.onSelectCode=a.onSelectCode?a.onSelectCode:null}}function showJobProcessSelectionSubdialog(e,f,d,c){var b=getObj(f);var a=getCompoundSelectionValue(b.jobProcessId,b.jobProcessIdSelect);jsrsExecute(rsCallbackGetSelectJobProcessesDialog,"Dialog_GetSelectJobProcessesDialog",[f,a],enableDialogButtons,{parentFormId:f,dismisalFocusFieldName:d.name,onSelectCode:c?c:null});displayTimedMessage("Getting Select Job Processes Dialog...");disableDialogButtons()}function submitSelectJobProcesses(formId_){var cart=reconstructSimpleShoppingCart(formId_);var onSelectCode=null;if(cart&&cart.onSelectCode){onSelectCode=cart.onSelectCode}submitSelectCustomCompoundSelect(formId_,"jobProcess");if(onSelectCode){eval(onSelectCode)}}function sortJobs(d,e,i){var g=getObj("frmSelectJobs");var k=g.accountId?g.accountId.value:"";var b=g.processId.value;var j="1"==g.singleSelect.value;var h=reconstructSimpleShoppingCart(g.id);var f=h.doShowSelectedOnly()?1:0;var n=h.getContentDescriptor().getIdList();var l=i.split(",");var c=unescape(l[0]);var m=h.isActiveOnlyChecked()?1:0;jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectJobsTable",[g.id,g.parentFormId.value,escape(n),d,e,b,escape(c),f,m,k,j?1:0],enableDialogButtons,{formId:g.id,tableId:g.id+"_jobTable"});var a=carefullyGetJobProcessName(b,true);displayTimedMessage("Getting "+htmlEncode(a)+" Table...");disableDialogButtons()}function searchOrSelectedJobs(b){var d=b.getForm();var a="";if(d.search&&d.search.style.display===""){a=d.search.value}var c=escape(a);sortJobs("",0,c)}function rsCallbackGetSelectJobsDialog(c,b,a){var g=processSimpleStackedSubdialogCallback(c,"frmSelectJobs",null,false,a.dismisalFocusFieldName,null,true);if(g){getObj(g.id+"_jobTable").onclick=doClick;var e=carefullyGetJobProcessName(g.processId.value,true);var d="";d="Or Unscheduled ";var f=initializeSimpleShoppingCartFromFormFields(g.id,"cart",true,"cartInfoSpan",searchOrSelectedJobs,true,!a.singleSelect,a.singleSelect,null,"Active "+d+e);f.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showSelectJobsSubdialog(a,i,h,c,d,f){var e=getObj(i);var g=getCompoundSelectionValue(e["job"+c+"Id"],e["job"+c+"IdSelect"]);jsrsExecute(rsCallbackGetSelectJobsDialog,"Dialog_GetSelectJobsDialog",[i,escape(g),c,d?d:"",f?1:0],enableDialogButtons,{parentFormId:i,dismisalFocusFieldName:h.name,singleSelect:f?1:0});var b=carefullyGetJobProcessName(c,true);displayTimedMessage("Getting Select "+htmlEncode(b)+" Dialog...");disableDialogButtons()}function submitSelectSingleJob(f,d,b,c,e){var a=getObj(d);var g=reconstructSimpleShoppingCart(f);setCompoundSelectionValue(a["job"+b+"Id"],a["job"+b+"Name"],a["job"+b+"IdSelect"],c,unescape(e));hideSubdialog()}function submitSelectJobs(b,a){submitSelectCustomCompoundSelect(b,"job"+a)}function getTypeAheadJobForAccount(b,e,a,d){var c={isInactiveColumnIndex:2,inactiveMeansCompleteColumnIndex:2};c.expectedContextId=jsrsExecute(rsCallbackGetTypeAheadSearchText,"Dialog_GetTopJobInfosForAccountGivenPrefix",[escape(e),d.accountId,d.processId],hideTimedMessage,c)}function sortExternalPageViews(b,c,g){var d=getObj("frmSelectExternalPageViews");var a=d.processId.value;var h=d.pageId.value;var e=reconstructSimpleShoppingCart(d.id);var f=e.doShowSelectedOnly()?1:0;var i=e.getContentDescriptor().getIdList();jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectExternalPageViewsTable",[d.id,d.parentFormId.value,escape(i),b,c,h,a,f],enableDialogButtons,{formId:d.id,tableId:d.id+"_externalPageViewTable"});displayTimedMessage("Getting External Page Views Table...");disableDialogButtons()}function searchOrSelectedExternalPageViews(a){sortExternalPageViews("",0,"")}function rsCallbackGetSelectExternalPageViewsDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectExternalPageViews",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj(e.id+"_externalPageViewTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields(e.id,"cart",true,"cartInfoSpan",searchOrSelectedExternalPageViews,false,true,false,null,null);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showSelectExternalPageViewsSubdialog(e,g,c,f,b){var a=getObj(g);var d=getCompoundSelectionValue(a["pageView"+f+"Id"],a["pageView"+f+"IdSelect"]);jsrsExecute(rsCallbackGetSelectExternalPageViewsDialog,"Dialog_GetSelectExternalPageViewsDialog",[g,escape(d),f,b],enableDialogButtons,{parentFormId:g,dismisalFocusFieldName:c.name});displayTimedMessage("Getting Select External Page Views Subdialog...");disableDialogButtons()}function submitSelectExternalPageViews(a){var b=getObj(a);submitSelectCustomCompoundSelect(a,"pageView"+b.pageId.value)}function sortSavedViews(b,c,g){var f=getObj("frmSelectSavedViews");var h=f.pageVisibilityId.value;var j=f.pageId.value;var k=g.split(",");var a=unescape(k[0]);var e=reconstructSimpleShoppingCart(f.id);var d=e.doShowSelectedOnly()?1:0;var l=e.getContentDescriptor().getIdList();var i="1"==f.singleSelect.value?1:0;jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectSavedViewsTable",[f.id,b,c,escape(a),j,h,i,escape(l),d],enableDialogButtons,{formId:f.id,tableId:f.id+"_savedViewTable"});displayTimedMessage("Getting Saved Views Table...");disableDialogButtons()}function searchOrSelectedSavedViews(b){var d=b.getForm();var a="";if(d.search&&d.search.style.display===""){a=d.search.value}var c=escape(a);sortSavedViews("",0,c)}function rsCallbackGetSelectSavedViewsDialog(c,b,a){var f;if(a.subdialog){f=processSimpleStackedSubdialogCallback(c,"frmSelectSavedViews",null,false,a.dismisalFocusFieldName,null,true)}else{f=processSimpleDialogCallback(c,"frmSelectSavedViews")}if(f){getObj(f.id+"_savedViewTable").onclick=doClick;var d=a.singleSelect?true:false;var e=initializeSimpleShoppingCartFromFormFields(f.id,"cart",true,"cartInfoSpan",searchOrSelectedSavedViews,true,!d,d,null,null);e.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showSelectSavedViewsDialog(b,j,h,c,g,i,f,d){var a="";if(j){var e=getObj(j,1);a=getCompoundSelectionValue(e[i+"Id"],e[i+"IdSelect"])}jsrsExecute(rsCallbackGetSelectSavedViewsDialog,"Dialog_GetSelectSavedViewsDialog",[j,c,g?g:"",i?i:"",f?1:0,d?1:0,a,false],enableDialogButtons,{parentFormId:j,dismisalFocusFieldName:h?h.name:null,subdialog:f,singleSelect:d?1:0});displayTimedMessage("Getting Select Saved Views Dialog...");disableDialogButtons()}function submitSelectSavedView(f,e,d){var g=getObj(f);if("1"==g.isSubdialog.value){var a=getObj(g.parentFormId.value),c=g.formFieldsPrefix.value+"Id",b=g.formFieldsPrefix.value+"Name";setCompoundSelectionValue(a[c],a[b],a[c+"Select"],e,d);hideSubdialog()}else{setTimeout('window.location = "'+pageReport+"&view="+e+'";',0);g_bSkipNavWarning=true;displayTimedMessage("Generating report...")}}function submitSelectSavedViews(a){var b=getObj(a);submitSelectCustomCompoundSelect(a,b.formFieldsPrefix.value)}function ShowReportsDialog(a){showSelectSavedViewsDialog(a,"",null,WebPages_Enum.Report,null,null,0,1)}function rsCallbackGetCalendarActivityTypesTable(b,a){if(checkResponseForError(b)){var f="frmSelectCalendarActivityTypes",g=getObj(f),c=f+"_calendarActivityTypeTable",d=getObj(c),e=reconstructSimpleShoppingCart(g.id,true);if(d){d.innerHTML=b;if(e){e.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}scrollDialogIfNecessary(f)}if(e){e.refocusCartAfterUpdate()}}}function sortCalendarActivityTypes(a,b,g){var d=getObj("frmSelectCalendarActivityTypes"),e=reconstructSimpleShoppingCart(d.id),f=e.doShowSelectedOnly()?1:0,i=e.getContentDescriptor().getIdList(),h=("1"==d.includeAppointments.value)?1:0,c=("1"==d.includeInactive.value)?1:0;jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectCalendarActivityTypesTable",[d.id,d.parentFormId.value,escape(i),a,b,f,h,c],enableDialogButtons,{formId:d.id,tableId:d.id+"_calendarActivityTypeTable"});displayTimedMessage("Getting Calendar Activity Types Table...");disableDialogButtons()}function searchOrSelectedCalendarActivityTypes(a){sortCalendarActivityTypes("",0,"")}function rsCallbackGetSelectCalendarActivityTypesDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectCalendarActivityTypes",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj(e.id+"_calendarActivityTypeTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields(e.id,"cart",true,"cartInfoSpan",searchOrSelectedCalendarActivityTypes,false,true,false,null,null);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showSelectCalendarActivityTypes(f,g,c,h,e,b){var a=getObj(g),d=getCompoundSelectionValue(a[b+"Id"],a[b+"IdSelect"]);jsrsExecute(rsCallbackGetSelectCalendarActivityTypesDialog,"Dialog_GetSelectCalendarActivityTypesDialog",[g,escape(d),h?1:0,e?1:0,b],enableDialogButtons,{parentFormId:g,dismisalFocusFieldName:c.name});displayTimedMessage("Getting Select Calendar Activity Types Dialog...");disableDialogButtons()}function submitSelectCalendarActivityTypes(b,a){submitSelectCustomCompoundSelect(b,a)}function sortSalespersons(e,d,h){var g=getObj("frmSelectSalespersons"),f=reconstructSimpleShoppingCart(g.id),c=f.doShowSelectedOnly()?1:0,b=f.getContentDescriptor().getIdList(),a=("1"==g.includeMyselfAndNoneOptions.value)?1:0;jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectSalespersonsTable",[g.id,g.parentFormId.value,escape(b),e,d,c,a?1:0],enableDialogButtons,{formId:g.id,tableId:g.id+"_salespersonTable"});displayTimedMessage("Getting Salesperson Table...");disableDialogButtons()}function searchOrSelectedSalespersons(a){sortSalespersons("",0,"")}function rsCallbackGetSelectSalespersonsDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectSalespersons",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj(e.id+"_salespersonTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields(e.id,"cart",true,"cartInfoSpan",searchOrSelectedSalespersons,false,true,false,null,null);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showSelectSalespersonsDialog(d,f,b,e){var a=getObj(f);var c=getCompoundSelectionValue(a.salespersonId,a.salespersonIdSelect);jsrsExecute(rsCallbackGetSelectSalespersonsDialog,"Dialog_GetSelectSalespersonsDialog",[f,escape(c),e?1:0],enableDialogButtons,{parentFormId:f,dismisalFocusFieldName:b.name});displayTimedMessage("Getting Select Salesperson Dialog...");disableDialogButtons()}function submitSelectSalespersons(a){submitSelectCustomCompoundSelect(a,"salesperson")}function sortPriceLists(d,c,g){var f=getObj("frmSelectPriceLists"),e=reconstructSimpleShoppingCart(f.id),b=e.doShowSelectedOnly()?1:0,a=e.getContentDescriptor().getIdList();jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectPriceListsTable",[f.id,f.parentFormId.value,escape(a),d,c,b],enableDialogButtons,{formId:f.id,tableId:f.id+"_priceListTable"});displayTimedMessage("Getting "+getPrefixedEEPLString()+" Table...");disableDialogButtons()}function searchOrSelectedPriceLists(a){sortPriceLists("",0,"")}function rsCallbackGetSelectPriceListsDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectPriceLists",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj(e.id+"_priceListTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields(e.id,"cart",true,"cartInfoSpan",searchOrSelectedPriceLists,false,true,false,null,null);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function showSelectPriceListsDialog(d,e,b){var a=getObj(e),c=getCompoundSelectionValue(a.priceTypeId,a.priceTypeIdSelect);jsrsExecute(rsCallbackGetSelectPriceListsDialog,"Dialog_GetSelectPriceListsDialog",[e,escape(c)],enableDialogButtons,{parentFormId:e,dismisalFocusFieldName:b.name});displayTimedMessage("Getting Select Price List Dialog...");disableDialogButtons()}function submitSelectPriceLists(a){submitSelectCustomCompoundSelect(a,"priceType")}function sortAccountForPriceList(e,d,g){var f=getObj("frmSelectAccountForPriceList"),c=f.priceListId.value,a=g.split(","),b=unescape(a[0]);jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectAccountForPriceListTable",[f.id,"",b,e,d,c],enableDialogButtons,{formId:f.id,tableId:f.id+"_accountForPriceListTable"});displayTimedMessage("Getting Account For Price Lists Table...");disableDialogButtons()}function searchOrSelectedAccountForPriceList(b){var e=b.getForm(),c=true,a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortAccountForPriceList("",0,d)}function rsCallbackGetSelectAccountForPriceListSubdialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectAccountForPriceList",null,true,a.dismisalFocusFieldName);if(e){getObj("frmSelectAccountForPriceList_accountForPriceListTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectAccountForPriceList","cart",true,"selectAccountForPriceListCartInfoSpan",searchOrSelectedAccountForPriceList,true,false,true);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId);e.onSelectFn=a.onSelectFn?a.onSelectFn:null}}function selectAccountForPriceListForCompoundSelection(f,g,e,d,h,b){if(!h){showInfoDialog("Please select an active Price List.","Select A Price List",1,"priceTypeId");return}var a=getObj(g),c=getCompoundSelectionValue(a[d+"Id"],a[d+"IdSelect"]);jsrsExecute(rsCallbackGetSelectAccountForPriceListSubdialog,"Dialog_GetSelectAccountForPriceListSubdialog",[g,d,h],enableDialogButtons,{parentFormId:g,dismisalFocusFieldName:e.name,onSelectFn:b?b:null});displayTimedMessage("Getting Select Account For Price List Dialog...");disableDialogButtons()}function getTypeAheadAccountForPriceList(a,d){var c=a.priceTypeId.value,b={extraHTMLColumnIndex:2};if(c){b.expectedContextId=jsrsExecute(rsCallbackGetTypeAheadSearchText,"Dialog_GetTopAccountInfosForPriceListGivenPrefix",[escape(d),c],hideTimedMessage,b)}}function sortPriceListsWithOrWithoutProduct(a,b,g){var c=getObj("frmSelectPriceLists"),f=c.productId.value,h="1"==c.withProduct.value,d=reconstructSimpleShoppingCart(c.id),e=0;if(d.doShowSelectedOnly()){e=1}var i=d.getContentDescriptor().getIdList();jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectPriceListsWithOrWithoutProductTable",[c.id,c.parentFormId.value,escape(i),e,a,b,f,h?1:0],enableDialogButtons,{formId:c.id,tableId:c.id+"_priceListTable"});displayTimedMessage("Getting Price Lists Table...");disableDialogButtons()}function searchOrSelectedPriceListsWithOrWithoutProduct(b){var e=b.getForm(),c=true,a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortPriceListsWithOrWithoutProduct("",0,d)}function rsCallbackGetSelectPriceListsWithOrWithoutProductDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectPriceLists",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj("frmSelectPriceLists_priceListTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectPriceLists","cart",true,"cartInfoSpan",searchOrSelectedPriceListsWithOrWithoutProduct,false,true);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function getSelectPriceListWithOrWithoutProductDialog(a,i,f,e,c,h,b){var d=getObj(i),g=getCompoundSelectionValue(d[h+"Id"],d[h+"IdSelect"]);jsrsExecute(rsCallbackGetSelectPriceListsWithOrWithoutProductDialog,"Dialog_GetSelectPriceListsWithOrWithoutProductDialog",[i,g,e,c?1:0,escape(h),escape(b?b:"")],enableDialogButtons,{parentFormId:i,dismisalFocusFieldName:f.name});displayTimedMessage("Getting Select Price Lists Dialog...");disableDialogButtons()}function sortCostListsWithProduct(e,d,h){var g=getObj("frmSelectCostLists"),b=g.productId.value,f=reconstructSimpleShoppingCart(g.id),c=0;if(f.doShowSelectedOnly()){c=1}var a=f.getContentDescriptor().getIdList();jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectCostListsWithProductTable",[g.id,g.parentFormId.value,escape(a),c,e,d,b],enableDialogButtons,{formId:g.id,tableId:g.id+"_costListTable"});displayTimedMessage("Getting Cost Lists Table...");disableDialogButtons()}function searchOrSelectedCostListsWithProduct(b){var e=b.getForm(),c=true,a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortCostListsWithProduct("",0,d)}function rsCallbackGetSelectCostListsWithProductDialog(c,b,a){var e=processSimpleStackedSubdialogCallback(c,"frmSelectCostLists",null,false,a.dismisalFocusFieldName,null,true);if(e){getObj("frmSelectCostLists_costListTable").onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields("frmSelectCostLists","cart",true,"cartInfoSpan",searchOrSelectedCostListsWithProduct,false,true);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId)}}function getSelectCostListsWithProductDialog(f,g,e,h,d,b){var a=getObj(g),c=getCompoundSelectionValue(a[d+"Id"],a[d+"IdSelect"]);jsrsExecute(rsCallbackGetSelectCostListsWithProductDialog,"Dialog_GetSelectCostListsWithProductDialog",[g,c,h,escape(d),escape(b?b:"")],enableDialogButtons,{parentFormId:g,dismisalFocusFieldName:e.name});displayTimedMessage("Getting Select Cost Lists Dialog...");disableDialogButtons()}function sortProductsForVariantDefinition(b,c,i){var g=getObj("frmSelectProductForVariantDefinition"),k=i.split(","),a=unescape(k[0]),h=g.supplierId.value,e="1"==g.includeInactive.value,j="1"==g.includeProductInfo.value,f="1"==g.includeMeasureInfo.value,d=g.costTypeId.value;jsrsExecute(rsCallbackGetStandardSimpleShoppingCartTable,"Dialog_GetSelectProductForVariantDefinitionTable",[g.id,g.parentFormId.value,escape(a),b,"",h,e?1:0,j?1:0,f?1:0,escape(g.selectedProductId.value),d],hideTimedMessage,{formId:g.id,tableId:g.id+"_productForVariantDefinitionTable"});displayTimedMessage("Getting Select Product For Variant Definition Table...")}function searchOrSelectedProductForVariantDefinition(b){var e=b.getForm(),c=true,a="";if(e.search&&e.search.style.display===""){a=e.search.value}var d=escape(a);sortProductsForVariantDefinition("",0,d)}function rsCallbackGetSelectProductForVariantDefinitionTableForDialog(f,c,j){if(checkResponseForError(f)){var h="frmSelectProductForVariantDefinition",g="Select Product",a='
    X Items Selected
    '+f+"
    ",e;showDialogP(a,h,{formTitle:g,isSubdialog:1,subdialogDismisalFocusFieldName:j.dismisalFocusFieldName,focusFieldName:"btnAddMaterials",contextDetailOrFnSubmit:{fnCancelOrClose:function(){hideSubdialog()}},hideOkButton:1});e=getObj(h);if(e){var i=getObj(e.id+"_productForVariantDefinitionTable");i.onclick=doClick;var d=initializeSimpleShoppingCartFromFormFields(e.id,"cart",true,"prodForVariantCartInfoSpan",searchOrSelectedProductForVariantDefinition,true,false,true);d.updateCheckBoxesAccordingToCart(decodeQuestionMarkDelimitedCheckboxValueForId);var b=new FormInputNormalizer(g_objCurrDialog);b.normalize();if(j.scrollToHighlighted){scrollToHighlightedSubDItem(e,i)}}}}function showSelectProductForVariantDefinitionDialog(a,g,i,h,c,d,f,k,b){var e=getObj(g).productId.value,j="Getting Select Product For Variant Definition Info";jsrsExecute(rsCallbackGetSelectProductForVariantDefinitionTableForDialog,"Dialog_GetSelectProductForVariantDefinitionTable",["frmSelectProductForVariantDefinition",g,"","","",h?h:"",d?1:0,k?1:0,b?1:0,escape(e),c],enableDialogButtons,{dismisalFocusFieldName:i.name,scrollToHighlighted:e.length?1:0,parentFormId:g,supplierId:h,includeInactive:d,escapedOnSelectCode:f,includeProductInfo:k,includeMeasureInfo:b,costTypeId:c});displayTimedMessage(j+"...");disableDialogButtons()}function showHideAvailableProductHierarchyDescriptionAsNecessary(i,h,e,a){var g=getObj("productHierarchyDescription");if(g){if(i){var f=i.split("?"),b=unescape(f[h]),c=unescape(f[e]),d=unescape(f[a]);g.innerHTML="  "+htmlEncode(c+" - "+d+" ("+b+")")}else{g.innerHTML=""}if(getObj("productHierarchyDescriptionRow")){getObj("productHierarchyDescriptionRow").style.display=i?"":"none"}}}function setProductForVariantDefinitionSelectionFieldValue(formId_,parentFormId_,id_,value_){var theForm=getObj(formId_),theParentForm=getObj(parentFormId_);setCompoundSelectionValue(theParentForm.productId,theParentForm.productName,null,id_,value_);var strOnSelect=theForm.onSelectCode.value;hideSubdialog();if(strOnSelect){eval(strOnSelect)}}function getProductInfoForTypeAhead(b,h,e){var g=false,d=true,c=false;if(b.includeInactive){g="1"==b.includeInactive.value}if(b.includeProductInfo){d="1"==b.includeProductInfo.value}if(b.includeMeasureInfo){c="1"==b.includeMeasureInfo.value}var f={expectedContextId:null,extraHTMLColumnIndex:2};var a=(e&&e.handlingFocus)?1:0;if(b.cachedProductTypeAhead&&(a||!h)){f.forceIgnoreCurrentTextForBold=a?1:0;rsCallbackGetTypeAheadSearchText(b.cachedProductTypeAhead.value,1,f)}else{f.expectedContextId=jsrsExecute(rsCallbackGetTypeAheadSearchText,"Dialog_GetTopProductsForVariantDefinitionGivenPrefix",[escape(h),b.supplierId?b.supplierId.value:"",g?1:0,d?1:0,c?1:0,b.costTypeId?b.costTypeId.value:""],hideTimedMessage,f)}}function getProductInfoForTypeAheadForcingEmpty(a,c,b){return getProductInfoForTypeAhead(a,"",b,{textToAddOrMatch:c?c:""})}function asynchShowSelectSellProductDropdown(c,b){var a=getObj("typeAheadDiv");a.ignoreFocus=false;handleTypeAheadTextBoxFocus(null,c,{formId:c,textFieldName:b,idFieldName:"productId",fnGetTypeAheadData:getProductInfoForTypeAheadForcingEmpty,forceTypeAheadOnFocus:true,showTypeAheadWhenUnmatched:true,ignoreCurrentTextForBold:true,forceImmediatePopup:true})}function showSelectProductInfoForTypeAhead(c,b){var a=getObj("typeAheadDiv");a.ignoreFocus=true;setFocus(getObj(c)[b]);setTimeout('asynchShowSelectSellProductDropdown("'+c+'","'+b+'")',0)}function submitSelectFields(formId_){var theForm=getObj(formId_),strCartNameSuffix=theForm.cartNameSuffix.value,strOriginalCartNameSuffix=theForm.originalCartNameSuffix.value,strValidationFunctionName=theForm.validationFunctionName.value,cart=getObj("fieldCart"+strCartNameSuffix),columns=ToolMan.dragsort().encodeNestedListStructure(cart,cartStripper,strCartNameSuffix),validationResult=true;if(strValidationFunctionName){eval("validationResult="+strValidationFunctionName+"(columns);")}if(validationResult){var strInnerHtml=cart.innerHTML.replace(new RegExp("cartrow_"+strCartNameSuffix,"g"),"cartrow_"+strOriginalCartNameSuffix);strInnerHtml=strInnerHtml.replace(new RegExp("'"+strCartNameSuffix+"'","g"),"'"+strOriginalCartNameSuffix+"'");var list=getObj("optionsFieldCart"+strOriginalCartNameSuffix);list.innerHTML=unescape(strInnerHtml);ToolMan.dragsort().makeListSortable(list,verticalDragSortOnly);hideSubdialog();scrollParentDialogIfNecessary(list)}}function rsCallbackGetSelectFieldsDialog(d,c,a){var h=processSimpleStackedSubdialogCallback(d,"frmSelectFields",null,false,a.dismisalFocusFieldName,null,true);if(h){var f=h.cartNameSuffix?h.cartNameSuffix.value:"",e=ToolMan.dragsort(),g="fieldCart"+f,b=getObj(g);if(!b){alert("rsCallbackGetSelectFieldsDialog() - Couldn't get the cart using strCartId="+g)}e.makeListSortable(b,verticalDragSortOnly);initFieldOrganizerForCartCommonFields(f)}}function rsCallbackGetSelectFieldsInfo(j,d){var o="frmSelectFields",l,f=d.originalPayload,h=d.originalOptions,k=h.parentFormId,c=f.cartNameSuffix,p=f.fieldListType,i=h.validationFunctionName,g=h.originalCartNameSuffix,b=new ClientDialogBuilder({formId:o,formTitle:j.formTitle,okButtonDisplayText:"Apply",fnSubmit:function(){submitSelectFields(o)}});b.addFlexibleRow({valueHTML:j.selectorDivHtml});b.addFlexibleRow({valueHTML:'',hideRow:1});l=b.showClientDialog();if(l){var n=l.cartNameSuffix?l.cartNameSuffix.value:"",e=ToolMan.dragsort(),m="fieldCart"+n,a=getObj(m);if(!a){consoleLog("rsCallbackGetSelectFieldsDialog() - Couldn't get the cart using strCartId="+JSON.stringify(m));alert("rsCallbackGetSelectFieldsDialog() - Couldn't get the cart using strCartId="+m)}e.makeListSortable(a,verticalDragSortOnly);initFieldOrganizerForCartCommonFields(n)}}function showAddListFieldsUsingSubdialogP(p){var o=p.formId,f=p.button,c=p.fieldListType,g=p.primarySeparator,h=p.validationFunctionName,d=p.originalCartNameSuffix,m=p.customRemoteScriptingFunctionName,a=p.arrAdditionalParamsForSelect,l=p.isClientSideR2;var j="subD_"+g_subdialogStack.length+"cartSfx";if(!d){d=""}if(!h){h=""}var k=getObj("optionsFieldCart"+d),b=ToolMan.dragsort().encodeNestedListStructure(k).replace(new RegExp("cartrow_"+d,"g"),"");if(g&&g!=","){b=b.replace(/\,/g,g)}if(l){jsrsExecuteWithErrorP("Dialog2_GetSelectFieldsInfo",rsCallbackHandleStandardJSONResponse,"Getting Field Selection Info",{cartNameSuffix:j,cartContents:b,fieldListType:c},{parentFormId:o,validationFunctionName:h,originalCartNameSuffix:d,fnOnSuccess:rsCallbackGetSelectFieldsInfo})}else{var q=[o,escape(j),escape(b),escape(c),escape(h),escape(d)],n="Getting Select Fields Dialog";if(a){for(var e=0;ed*60+h)&&(fg*60&&f.hours*60+f.minutesg*60+30&&f.hours*60+f.minutes'+c+'
    '}if(i){e="txtPassword";g="Change Password";a+='User Name:"+htmlEncode(i)+'Old Password:New Password:Confirm New Password:"}else{a+='User Name:Password:"}disableDialogButtons();showDialogP(a,h,{formTitle:g,focusFieldName:e,contextDetailOrFnSubmit:submitReviveSession,isSessionReviver:1,okButtonDisplayText:(!i)?"Sign In":"Ok"});return 1}function submitEditOrAddTaxRate(m,f){var d=f.id,a=f.arrTaxCodeList,j,l,c=new FormValidator(),g,e=m.txtName,k,h,b="";if(!c.CSValidateRequiredField(e,"Please enter a Name")){return}for(g=0;g&#'+FontIconId_Enum.fiiFilledCircle+";"+(f.itemHTML?f.itemHTML:htmlEncode(f.name))+"
    \n"}else{j=f.script;m+='\n"}m+=""}}h.innerHTML=m}if(e){e.innerHTML="&#"+getRawFontId(FontIconId_Enum.fiiDownChevron)+";"}h.style.display="";h.setAttribute(k,"1")}}}}function showHelpMenu(){showHelpMenuP()}var ChartAdapter=function(){function c(d){var g=[],e=d.split(" "),i="",f,h=64;e.forEach(function(j){f=i.length+j.length;if(f>h){g.push(i);i=j}else{if(i.length){i+=" "}i+=j}});if(i){g.push(i)}return g}function a(){if(!g_chart||!g_chartId){return}var i=g_chart;var m=getObj(g_chartId);if(!i||!m){return}var f=pageHeight();var k=getObj("mainToolbar");var e=getObj("divV2Content");var n=k?(parseInt(getComputedStyle(k).height,10)):0;var o=posTop(m,true);var g=f-o-3;if(g>0){m.style.height=g+"px";m.parentNode.style.maxHeight=g+"px"}var j=Math.max(document.documentElement.clientWidth,window.innerWidth||0);var d=posLeft(m,true);var l=j-d-25;if(l>0){m.style.width=l+"px";m.parentNode.style.maxWidth=l+"px"}if(i){i.resize()}}function b(s){var v=s.chartId,d=s.legendId,l=s.data,q=s.yAxisLabel,k=s.xAxisLabel,i=s.showPointLabels,m=s.chartType,p=s.rotateLabels,x=s.height,u=s.width,e=s.maxY,y=s.responsive,r=s.autoSkip,j=s.categoryPercentage,t=!!s.beginYAxisAtZero,f=s.yAxisSuggestedMin,h=s.yAxisSuggestedMax,n=null,o=getObj(v);if(!o){setTimeout(function(){b({chartId:v,legendId:d,data:l,yAxisLabel:q,xAxisLabel:k,showPointLabels:i,chartType:m,rotateLabels:p,height:x,width:u,maxY:e,responsive:y,autoSkip:r,categoryPercentage:j})},100);return}l.showPointLabels=i;var w=function(){var z=32;var B=16;var D=700;var A=z;var C=parseInt(o.style.height,10);if(C<=D){A-=((D-C)/10);A=Math.max(A,B)}return A};var g={scaleShowGridLines:true,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:true,scaleShowVerticalLines:true,bezierCurve:true,bezierCurveTension:0.4,pointDot:true,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:true,datasetStrokeWidth:2,datasetFill:true,legend:{display:d!==null,labels:{fontSize:12,fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif'}},tooltips:{callbacks:{title:function(C,B){var z=C.length>0?B.datasets[C[0].datasetIndex].label:"";var A=c(B.labels[C[0].index]+" "+z);A.push((B.datasets[C[0].datasetIndex].data[C[0].index]).toLocaleString());return A},afterTitle:function(z,A){return""},label:function(z,A){return""}}},responsive:y,maintainAspectRatio:false,scales:{yAxes:[{scaleLabel:{display:(q&&q.length>0)?true:false,labelString:q},ticks:{padding:2,beginAtZero:t,suggestedMin:f,suggestedMax:h,steps:10,stepValue:10,fontSize:12,fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',max:e?e:undefined}}],xAxes:[{categoryPercentage:j,scaleLabel:{display:(k&&k.length>0)?true:false,labelString:k},gridLines:{display:false},ticks:{fontSize:12,fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',autoSkip:r,maxTicksLimit:l.length,callback:function(z){return((z.length>w())?z.substr(0,w()-5)+" ...":z)+" "}},afterCalculateTickRotation:!p?null:function(B){B.labelRotation=90;var z=B.height;if(z===undefined){z=-1}for(var A=0;A"+g+""}c.AddHTMLTitledScriptItem(g,"/*selectedDateFilterSpecType*/selectedEventLogDateFilterSpecType(event,'"+b.id+"',"+e+(a?(",'"+a+"'"):"")+")")}}function showSelectUserChangeLogDateOptionsMenu(c,b){var a=new ContextMenu("clsDateFilterMenu");addEventLogDateFilterSpecItem(a,"Last N Days",b,EventLogDateFilterOptions_Enum.eldfoDaysAgo,"lastDays");a.AddInactiveHTMLTitledItem('
    Date
    ');addEventLogDateFilterSpecItem(a,"After",b,EventLogDateFilterOptions_Enum.eldfoAfter,"fromDate",1);addEventLogDateFilterSpecItem(a,"Before",b,EventLogDateFilterOptions_Enum.eldfoBefore,"toDate",1);addEventLogDateFilterSpecItem(a,"Between",b,EventLogDateFilterOptions_Enum.eldfoBetween,"fromDate",1);a.Show(c)}function exportToSpreadsheet(a,c){var e="frmConfirmExport",d="rbExportType",f=d+"_Current",b=new ClientDialogBuilder({formId:e,formTitle:"Export",focusFieldName:f,focusFieldOnMobile:1,okButtonDisplayText:"Export",fnSubmit:function(){var g=getObj(e).querySelector('input[name="'+d+'"]:checked').value;hideDialog();var h=addRemoveOrReplaceURLParameter(window.location.href,"spreadsheet","1");h=addRemoveOrReplaceURLParameter(h,"exportType",g);h=addRemoveOrReplaceURLParameter(h,"table",a);if(c){h=addRemoveOrReplaceURLParameter(h,"outputFileName",c)}window.open(h,"_blank")}});b.addFlexibleRow({rawValue:"What would you like to export?"});b.addDialogInteriorRows(cdBuildRBRowP(d,f,"Current Page",{checked:1,autofocus:1,fieldValue:"CurrentPage"})+cdBuildRBRowP(d,d+"_All","All Pages",{fieldValue:"AllPages"}));b.showClientDialog()}function positionToolbar(){var i=getObj("mainToolbar"),g=getObj("pageToolStrip"),b=getObj("btnToolstripHamburgerMenu"),a=getObj("v2LeftNavContainer");if(!b||!i||!g||!a){return}var l=(Object.prototype.hasOwnProperty.call(window,"g_stickyTableHeadersScrollVersion")&&g_stickyTableHeadersScrollVersion===TableHeaderScrollImpl_Enum.thsiFixedPosition);var c=pageWidth();var d=5;var k=parseFloat(getComputedStyle(a).width);if(isNaN(k)){k=0}var h=getComputedStyle(b.parentNode).display!=="none";var j=window.pageXOffset||document.documentElement.scrollLeft;var m=0;if(l){i.style.position="fixed";var f=0;if((i.offsetWidth+m)>c){var e=(i.offsetWidth+m)-c;f=(Math.min(e,j))}i.style.minWidth="calc(100% + "+Math.abs(f-m)+"px)";i.style.left=(-f+m)+"px"}}function showDialogButtons(c){var d=document.getElementsByClassName("uiv2DialogButtonMenu"),a=document.getElementsByClassName("uiv2DialogButtons");if(d&&d.length===1&&a&&a.length===1){var l=d[0].getBoundingClientRect(),e=posLeft(d[0]),o=posTop(d[0]),k=new ContextMenu("uiv2DialogButtonContextMenu"),m=a[0].querySelectorAll("button, a.buttonLink"),g;for(g=0;g"+htmlEncode(h.getAttribute("data-mwtooltip"))+"",f=h.getAttribute("onclick");if(h.tagName.toLowerCase()==="a"){var b=h.getAttribute("href");if(b){f="hideDialog();window.location='"+b+"';"}}else{f=f.replace(new RegExp('"',"g"),""")}k.AddHTMLTitledScriptItem(h.innerHTML+n,f)}k.Show(c,e+((l.right-l.left)/2),o-((l.top-l.bottom)/2))}}function clearInputFile(e){if(e.value){try{e.value=""}catch(d){}if(e.value){var c=document.createElement("form"),a=e.parentNode,b=e.nextSibling;c.appendChild(e);c.reset();a.insertBefore(e,b)}}}function onFileInputChange(f){var e=f;while(e!==null&&(e.tagName.toLowerCase()!=="form"&&e.tagName.toLowerCase()!=="td")){e=e.parentNode}if(!e){return}var b=findFirstDescendantWithAClass(e,["uploadedFilesHeader"]);var a=findFirstDescendantWithAClass(e,["uploadedFiles"]);while(a.children.length>0){a.removeChild(a.firstChild)}var d=(f.name?f.name:-1);var c=document.createElement("div");c.id="dragDropFileSection"+d;c.innerHTML=fileNameFromPath(f.value)+" ("+formatFileSize(f.size)+") "+buildRemoveFileLink(d);c.onclick=function(){clearInputFile(f)};a.appendChild(c);toggleFilesToUploadList(e)}function getQuoteDepHolderFormId(){if(g_isCounterGo){return"editQuote"}return"editQuoteRevision"}function addQuoteDeposit(j){var f=getObj(getQuoteDepHolderFormId()),g=f.depositUnitDesc.value,h,l=parseInt(f.maxDepositCount.value,10),i=l+1,d=i,b="deleteQuoteDeposit("+d+")",e="Deposit"+d,c="DepositDescription"+d,a=getObj("postDepositRow");f.maxDepositCount.value=i;h=cdBuildTextFieldRowP(e,"Deposit",{maxLength:15,fieldSize:5,additionalFieldCellClasses:"dlgControlSet",strPostFieldHTML:g+cdBuildFAFontIconButton({doubleQuoteEncodedTitle:"Delete Deposit",fontId:FontIconId_Enum.fiiHollowTrash,doubleQuoteEncodedOnClickJS:b})})+cdBuildTextFieldRowP(c,"Description",{maxLength:80,fieldSize:40,additionalFieldCellClasses:"dlgControlSet",strPostFieldHTML:'(Optional)'});var k=document.createElement("tbody");k.setAttribute("id","editQuoteDepositDiv"+d);k.innerHTML=h;k.className="dialogFieldGrouper";a.parentNode.insertBefore(k,a);if(j){setTimeout("SetDepositFocus("+d+");",5)}}function deleteQuoteDeposit(a){var c=getObj(getQuoteDepHolderFormId()),b=parseInt(c.maxDepositCount.value,10);removeNode(getObj("editQuoteDepositDiv"+a))}function SetDepositFocus(a){var b=getObj(getQuoteDepHolderFormId());setFocus(b["Deposit"+a])}var g_filterReportsTimeout,g_lastFilterReportsValue="";function doFilterReports(){var a=getObj("reportSearchTerm"),m=a.value.toLowerCase(),h,d,o=["s","m"],c,n,j,g,e,f,l,p,k,b;if(m!=g_lastFilterReportsValue){g_lastFilterReportsValue=m;for(d=0;d-1);l.style.display=p?"":"none";if(p){++b;l.className=(b%2)?"oddRow":"evenRow"}}if(j){j.style.display=b?"":"none"}if(n){n.style.display=b?"":"none"}if(e){e.style.display=b?"":"none"}g=getObj("SectionHeader_"+o[d]);if(g){g.style.display=b?"":"none"}}}}}function filterReports(){if(g_filterReportsTimeout){clearTimeout(g_filterReportsTimeout)}g_filterReportsTimeout=setTimeout(doFilterReports,150)}function getProcessIdForCreateJobFromQuote(a){var d=a.jobProcessId,b=a.cboProcess,c=d?d.value:b.options[b.selectedIndex].value;return parseInt(c||0,10)}function rsCallbackGetJobTemplateOptionElements(c,f){f=f||{};var d=getObj("rowJobTemplate"),b=f.originalPayload,a=b?b.jobProcessId:0,e=getObj(f.originalOptions.formId);mjtElemData(d,"data-lastSelectedProcessId",a);if(c){e.jobTemplateId.innerHTML=c.optionElements;d.style.display=""}else{e.jobTemplateId.innerHTML="";d.style.display="none"}setFocus(e.cboProcess)}function updateTemplatesForProcess(f,b){var g=getObj(f),e=getProcessIdForCreateJobFromQuote(g),d=getObj("rowJobTemplate"),c=mjtElemData(d,"data-lastSelectedProcessId")||0,a={formId:f};if(c!=e){if(e){jsrsExecuteWithErrorP("Dialog2_GetJobTemplateOptionElements",rsCallbackGetJobTemplateOptionElements,"Getting Templates for Process",{jobProcessId:e,accountId:b},a)}else{rsCallbackGetJobTemplateOptionElements(null,{originalOptions:a})}}}function rsCallbackGetExpiringDialogInfo(c){var b=c.expired,a=c.refresh,d=new ClientDialogBuilder({formTitle:b?"Expired License":"Expiring License",fnCancelOrClose:(a?function(){refreshPageAndScrollPos()}:null)});d.addFlexibleRow({valueHTML:c.messageHTML});d.showClientDialog()}function showExpiringDialog(){jsrsExecuteWithErrorP("Dialog2_GetExpiringDialogInfo",rsCallbackGetExpiringDialogInfo,"Getting Expiring License Dialog")}function promptReplaceAddressWithAccountOrJobAddress(b){hideDialog();var a=b.jobProcessName,c=new ClientDialogBuilder({formId:"frmReplaceQuoteAddress",formTitle:b.isOrder?"Delete Order Address":"Delete Quote Address",focusFieldName:"rbUseAccountOrJobAddress_Job",focusFieldOnMobile:1,fnSubmit:b.fnSubmit,callbackData:{id:b.id,jobProcessName:b.jobProcessName,isOrder:b.isOrder}});c.addFlexibleRow({rawValue:"Replace Quote Address with:"});c.addFlexibleRow({valueHTML:cdBuildRBP("rbUseAccountOrJobAddress","rbUseAccountOrJobAddress_Job","Use "+htmlEncode(a)+" Address",{checked:1})});c.addFlexibleRow({valueHTML:cdBuildRBP("rbUseAccountOrJobAddress","rbUseAccountOrJobAddress_Account","Use Account Address")});c.showClientDialog()}function executeSimpleActionButtonDialogItemV2(a){var d=getObj("frmSimpleActionButtonDialog"),c=mjtElemData(d,"arrLinkInfo"),b=c[a];hideDialog();b.fnActionV2()}function addSimpleActionButtonIfNecessaryV2(c,f,b){var e,a,d=f?f[b]:0;if(d){if(d.fnActionV2){a='";c.addFlexibleRow({valueHTML:a});e=true}else{if(d==="-"||d.isSeparator){c.addFlexibleRow({valueHTML:"
    "});e=true}}}return e}function showSimpleActionButtonDialogV2(j){var d=j.arrLinkInfo,c=j.fnAddPreambleDialogRows,e,f,h,b=new ClientDialogBuilder({formId:"frmSimpleActionButtonDialog",formTitle:j.rawFormTitle||"",fnCancelOrClose:j.fnCancelOrClose,focusFieldName:"btnAddLine0",focusFieldOnMobile:1}),i,g,a;if(c){c(b)}for(e=0;e-1&&n+1-1?p.substring(m+1).toLowerCase():"";return{filePath:l,fileName:p,extension:o}}}function j(m){var o=m.filePath||"",l=m.fileComponents||g(o),n=b(l.extension);return n}function h(n){var l=n||[],m=l.map(function(p){var o=g(p);return o.fileName});return m}function d(n){var o=n.arrFilePaths,m=n.arrFileNames||h(o),l=n.subdialogDismissalFocusFieldName,p=m.join("
    ");showInfoDialog('The following file'+(m.length>1?"s are":" is")+" not a supported image type:

    "+htmlMultilineEncode(p)+'

    '+e()+"","Invalid Image Files",1,l)}return{addStringifiedElementAsChildOfParentAfterElementsWithClass:a,getAcceptPropertyForImageUpload:k,getCommaDelimitedListOfImageFileTypes:i,getFileComponentsFromFilePath:g,isValidImageFile:j,showInvalidImageSubdialog:d,getValidImageFileTypesMessage:e}}();var Layout=function(){function C(I){return((I||{}).tagName||"").toLowerCase()}function t(O){var I=O.candidateElement,Q=O.currentExtremeElement,K=O.compareRightEdge,N=Q||I;if(I&&Q){var M=I.getBoundingClientRect(),L=Q.getBoundingClientRect(),J=K?M.right:M.left,P=K?L.right:L.left;if(K){if(J>P){N=I}else{N=Q}}else{if(J0}function F(I){return z(I)||C(I)==="span"}function f(I){var K=I,N=undefined,M=0;while(F(K)){if(D(K)){if(N===undefined){N=K.getBoundingClientRect().left}if(K.length){M+=getWidthOfText(K,null,null)}else{var J=c(K);M+=getWidthOfText(K.innerText,J?J.fontFamily:null,J?J.fontSize:null);var O=parseFloat(J.paddingLeft);if(!isNaN(O)){M+=O}var L=parseFloat(J.paddingRight);if(!isNaN(L)){M+=L}}}K=K.nextSibling}M+=N;return M}function w(L){var I=L.firstChild,O=I?I.firstChild:null,N=0;if(C(I)==="span"){N=f(I)}else{if(C(O)==="table"){var K,M=O.rows;for(K=0;K0){P=Math.min(0,P+V)}}return P}function s(R){var L=R.leftmostButton,N=R.computedStyleOfRightmostButton,M=R.rightEdgeOfViewport,J=R.unadjustedRight,K=R.styleLeftOfRightmostButton,S=R.isDivBasedSectionHeader,I=R.sectionHeaderWidthOffset,O=parseInt(N.paddingRight,10),P=parseInt(N.marginRight,10),Q;if(isNaN(O)){O=0}if(isNaN(P)){P=0}Q=Math.min(M-I-J-O-P-A,0);Q=k({isDivBasedSectionHeader:S,proposedRelativeLeft:Q,leftmostButton:L,styleLeftOfRightmostButton:K});return Q}function m(W){var Y=W.isDivBasedSectionHeader,X=W.arrButtons,O=W.boundingButtons,J=W.sectionHeaderWidthOffset,M=O.rightmostElement,R=window.pageXOffset,I=pageWidth(),P=R+I,L=parseInt(M.style.left,10)||0,Q=getComputedStyle(M),N=parseInt(Q.width,10),U=posLeft(M)+N,K=U-L,T=P-J,V=T1){a.setAttribute(d,c?"1":"")}else{var b="1"==a.getAttribute(d);return b}}function testForUncheckedCheckBoxes(e,a){var d=0,c,b;for(b=0;b1}function checkAllCheckboxIfNecessary(c,g,a){g=g||"";if(c){var f=c.form,e=f["chkRow"+g],b=e?(e.length?e:[e]):[],d=testForUncheckedCheckBoxes(b,a);checkAllRowsCheckbox(f,!d,g)}}function highlightOneCheckedRow(c){var d=mjtGetAncestorWithTag(c.parentNode,"TR"),a=d?mjtGetAncestorWithClass(d,"clsHighlightRowsWithClass"):null,b=c.checked;if(d){if(a){if(b){d.classList.add("highlightRow")}else{d.classList.remove("highlightRow")}}else{d.style.backgroundColor=b?"#ffffcc":""}}}function checkSingleRow(n,c,m,l,e,k){if(!m){m=""}var r=c.form;var t=c.checked;if(!l){highlightOneCheckedRow(c)}var b=r["chkRow"+m];var o;if(b.length){var d=c.id;var j=g_multiCheckPrevRowId;if(g_multiCheckPrevFormName==r.name){var f=false;if(window.event){if(!window.event.altKey&&!window.event.ctrlKey&&window.event.shiftKey){f=true}}else{if(n){if(!n.altKey&&!n.ctrlKey&&n.shiftKey){f=true}}}if(f){g_multiCheckOperationInProgress=true;var s=c.checked;var q=-1;var a=-1;for(o=0;o-1&&a>-1&&q!=a){var p;var g;if(q"+c+""}return c}function buildDialogSubmitButtonRow(w){var f=w.formId,x=w.formTitle,p=w.renderMainButtonRowInSections,l=w.hideOkButton,o=w.includeBackButton,k=w.arrAdditionalSubmitLevelButtons,z=w.okButtonDisplayText,u=w.doubleQuoteEncodedOkButtonTitle||"",d=w.cssClassPrefix,g=u?' data-mwtooltip="'+u+'"':"",q=' colspan="3"',c="doSubmitClientDialog('"+f+"');return false;",b="",h=[],r,j,t="",y="",m="",e="",a,n,s="";if(k){for(r=0;r<< Back'}if(!l){var v=z||"";if(!v){v="Save";if(x){if(stringStartsWith(x,"Delete")){v="Delete"}else{if(stringStartsWith(x,"Remove")){v="Remove"}else{if(stringStartsWith(x,"Generate")){v="Generate"}else{if(stringStartsWith(x,"Import")){v="Import"}else{if(stringStartsWith(x,"Synch")){v="Synch"}}}}}}}y+=' "}for(r=0;r';if(t){a+=''+t+""}if(y){a+=''+y+""}if(m){a+=''+m+""}if(e){a+=''+e+""}a+=""}else{a=t+y+m+e}s='"+a+""}return s}function showDialogP(p,a,k){if(!k){k={}}var l=k.dialogBoxAdditionalClasses,v=k.additionalDialogHeaderRowClasses||"",t=null,h=k.arrExtraHeaderButtons;if(h){h=h.filter(function(B){return B&&trim(B)?true:false})}var n=headerButtonsApply(h),c=k.formAction||"",y=c?'action="'+c+'" ':'action="#" ',x=k.skipHeaderButtonCollapse||n&&h.length===1,w=k.isSessionReviver||k.isSubdialog?1:0;if(isDialogOrBusy(w)){return t}if(!k.isSubdialog&&typeof hideDrawingPopups==="function"){hideDrawingPopups()}if(!k.isSubdialog&&typeof hideContextMenu==="function"){hideContextMenu()}var j=k.contextDetailOrFnSubmit;if(typeof j==="function"){j={fnSubmit:j}}else{if(!k.hideOkButton&&!(j&&j.fnSubmit)){alert("Missing fnSubmit in context detail!");consoleLog("Missing fnSubmit. tmpContextDetailOrFnSubmit="+JSON.stringify(j));return t}}if(k.isSessionReviver){g_sds=1}else{g_ds=1}var z=k.cssClassPrefix||"";var f="doSubmitClientDialog('"+a+"');return false;",o=f,r=k.isSessionReviver?"divReLoginDialog":"divClientSideDialog"+(g_clientDialogStack.length+1),A="doCloseOrCancelClientDialog('"+a+"',"+(k.isSubdialog?1:0)+");return false;",g=k.dialogRowsTableClasses||"",e,b,s=a+"DlgDiv",u=' colspan="3"',i=z+"uiv2dialogBox"+(l?" "+l:""),q='
    '+p+"
    '+htmlEncode(k.formTitle?k.formTitle:"-Untitled-")+''+buildHeaderButtonSectionIfNecessary(h,x)+'';if(n&&!x){q+="
    &#"+getRawFontId(FontIconId_Enum.fiiVerticalEllipsis)+";
    "}q+='';if(k.isSubdialog||k.forceUseBackButtonForClose){q+='&#'+getRawFontId(FontIconId_Enum.fiiCircledLeftArrow)+";"}else{q+='&#'+getRawFontId(FontIconId_Enum.fiiX)+";"}q+="
    ";q+=buildDialogSubmitButtonRow({formId:a,formTitle:k.formTitle,renderMainButtonRowInSections:k.renderMainButtonRowInSections,hideOkButton:k.hideOkButton,includeBackButton:k.includeBackButton,arrAdditionalSubmitLevelButtons:k.arrAdditionalSubmitLevelButtons,okButtonDisplayText:k.okButtonDisplayText,doubleQuoteEncodedOkButtonTitle:k.doubleQuoteEncodedOkButtonTitle,cssClassPrefix:z});q+='
    ";if(k.isSubdialog){disableDialogButtons()}q='
    '+q+"
    ";e=new ClientDialog(q,k.subdialogDismisalFocusFieldName,k.subdialogDismisalFocusFieldId,r,a,k.isSubdialog);b=e.getObjDialog();if(k.isSessionReviver){b.zIndex=999}g_showDialogIsStackedClientDialog=1;t=getObj(a);t.contextDetail=j;g_bSkipNavWarning=k.skipNavWarning===true;setTimeout(function(){if(k.focusFieldName&&(!Object.prototype.hasOwnProperty.call(window,"g_isMobile")||!g_isMobile||k.focusFieldOnMobile)){var B=getObj(a);if(B){var D=B[k.focusFieldName];setFocus(D);if(k.focusFieldOnMobile&&D){setTimeout(function(){if(getObj(a)){var E=document.body.scrollTop;if(E){document.body.scrollTop=0}}},0)}}}else{var C=getObj(a+".dialogCloseButton");setFocus(C)}},0);var m=getObj(a+"DlgDiv");m.style.visibility="visible";m.style.zIndex="201";showDialogCover();scrollDialogIfNecessary(a);if(!k.suppressDialogConfirmer){setDialogConfirmer(m)}if(!k.suppressNormalizeInputFields){var d=new FormInputNormalizer(m);d.normalize()}return t}function showDialog(b,n,c,g,m,l,f,h,k,a,j,i,d,e,o){showDialogP(b,n,{formTitle:c,focusFieldName:g,contextDetailOrFnSubmit:m,includeBackButton:l,okButtonDisplayText:f,hideOkButton:h,isSubdialog:a,subdialogDismisalFocusFieldName:j,subdialogDismisalFocusFieldId:i,hideCancelButton:d,skipNavWarning:e,skipCentering:o})}function showCGOrJTDialog(e,d,a,b,c){if(e&&!d){c.cssClassPrefix="cg"}else{if(d&&!e){c.cssClassPrefix="jt"}}showDialogP(a,b,c)}function showSubdialog(a,n,b,g,m,l,f,h,k,j,i,d,c,e,o){showDialogP(a,n,{formTitle:b,focusFieldName:g,contextDetailOrFnSubmit:m,includeBackButton:l,okButtonDisplayText:f,hideOkButton:h,isSubdialog:1,subdialogDismisalFocusFieldName:j,subdialogDismisalFocusFieldId:i,hideCancelButton:d,cssClassPrefix:c,skipNavWarning:e,skipCentering:o})}function showComplexInfoDialog(b,f,d,a,c,e){showDialog(b,"frmTmpMessage",f,"",0,0,0,1,"",d,a,c,0,e)}function showInfoDialog(d,e,c,a,b){showComplexInfoDialog(''+d+"",e,c,a,b)}function submitInfoWithConseq(a,b){if(b.autoDismissInfoDialog){if(b.subdialog){hideSubdialog()}else{hideDialog()}}b.fnOk(a,b.params)}function showComplexInfoDialogWithConsequence(b,h,g,e,d,a,c,f){if(!g){throw'Missing "fnOk_" parameter to showComplexInfoDialogWithConsequence()'}showDialog(b,"frmTmpMessage",h,"btnOk",{fnSubmit:submitInfoWithConseq,callbackData:{fnOk:g,params:e?e:0,autoDismissInfoDialog:!f,subdialog:d?1:0}},0,0,0,0,d,a,c,1)}function showInfoDialogWithConsequence(e,h,g,d,c,a,b,f){showComplexInfoDialogWithConsequence(""+e+"",h,g,d,c,a,b,f)}function getCallbackDataOfDialog(c){var b=c.contextDetail,a=b.callbackData;return a}function getCallbackDataOfDialogWithId(a){var b=getObj(a);return getCallbackDataOfDialog(b)}function commonSubmitFormFunction(d,b){var e=getObj(d),c=e.contextDetail,a=c.callbackData;c.fnSubmit(e,a?a:0,b?1:0)}function doSubmitClientDialog(a){if(!g_wk){commonSubmitFormFunction(a)}}function doCloseOrCancelClientDialog(f,c){if(!g_wk){var g=getObj(f),e=g.contextDetail,b=e?e.callbackData:0,d=e?e.fnCancelOrClose:0,a=1;if(d){a=d(g,b?b:0)}if(a){if(c){hideSubdialog()}else{hideDialogP({callback:function(){}})}}}}function submitClientDialogOnEnter(c,b){var a;if(window.event){a=window.event.keyCode}else{if(b){a=b.which}else{return true}}if(""+a==="13"){doSubmitClientDialog(c);return false}return true}function handlePostConfirmation(a,b){if(!b.dontHideDialogOnSubmit){if(b.subdialog){hideSubdialog()}else{hideDialog()}}b.fn(b.detail)}function displaySimpleConfirmationDialogP(a,b,d){if(!d){d={}}var e=d.formId||"frmConfirmation";if(!isDialogOrBusy(d.isSubdialog)){var c=''+b+"";showDialogP(c,e,{formTitle:d.formTitle,focusFieldName:"btnOk",contextDetailOrFnSubmit:{fnSubmit:handlePostConfirmation,fnCancelOrClose:d.fnCancelOrClose?d.fnCancelOrClose:0,callbackData:{fn:a,detail:d.contextDetail?d.contextDetail:0,subdialog:d.isSubdialog?1:0,dontHideDialogOnSubmit:d.dontHideDialogOnSubmit}},okButtonDisplayText:d.okButtonDisplayText,hideOkButton:0,isSubdialog:d.isSubdialog,subdialogDismisalFocusFieldName:d.subdialogDismisalFocusFieldName,cssClassPrefix:d.cssClassPrefix})}}function displaySimpleConfirmationDialog(b,c,a,i,e,g,d,j,f,h){displaySimpleConfirmationDialogP(b,c,{formTitle:a,contextDetail:i,isSubdialog:e,subdialogDismisalFocusFieldName:g,okButtonDisplayText:d,fnCancelOrClose:j,dontHideDialogOnSubmit:f})}function buildSubmitOnEnterCode(a){return" onkeypress=\"return submitClientDialogOnEnter('"+a+"',event);\""}function cdBuildMnemonicLabelHTML(g){var j=g.mnemonicChar,a=g.mnemonicFocusFieldName,b=g.expandingFieldNameBase,e=g.mnemonicActionJS,f=g.rawLabel||"",i=g.includeRequiredFieldAsterisk,h;if(j&&(e||a||b)&&f){if(!e){if(a){e="setDlgFieldFocus('"+a+"')"}else{e="ClientDialogModule.PROTECTED.setFocusExpandingTextField('"+b+"')"}}var c=f.toLowerCase().indexOf(j.toLowerCase());if(c>-1){if(c){var d=c;do{if(" "===f.charAt(d-1)){break}d=f.toLowerCase().indexOf(j.toLowerCase(),d+1)}while(d>0);if(d>-1){c=d}}h=htmlEncode(f.substring(0,c))+''+f.substring(c,c+1)+""+htmlEncode(f.substring(c+1))}}h=h||htmlEncode(f);if(i){h=ClientDialogModule.PROTECTED.getRequiredFieldAsteriskHtml()+h}return h}function cdBuildOpenDialogLabelCell(b,c){var e=b?' id="'+b+'"':"",a=trim("dialogFieldName "+(c||"")),d=a?' class="'+a+'"':"";return""}function cdBuildFontIconElem(i){var a=i.fontId,c=i.fontIconElemId,d=i.terseFontIcon?"Terse":"",e=c?' id="'+c+'"':"",g=i.additionalFontIconClasses||"",b=getFontNamePrefix(a)+d+"Icon"+(g?" "+g:""),f=i.hideIcon?' style="display:none"':"",h=i.rawTooltip;return"&#'+getRawFontId(a)+";"}function cdBuildTypeaheadSideButton(b){var d=b.sideButtonClasses,e=b.rawSideButtonTitle,a=b.rawActivationJS,c="button-inputLeft"+(d?" "+d:"");return'"}function cdBuildTextAreaFieldP(m,l){if(!l){l={}}var d=l.rowCount||g_notesRowCount,g=l.colCount||40,e=l.onChangeDoubleQuotedContent,a=l.unencodedText,b=l.fieldId,c=b?' id="'+b+'"':"",k=l.textAreaClasses,j=k?' class="'+k+'"':"",n="",i="",h=l.maxLength,f=h?'maxLength="'+h+'" ':"";if(e){n=' onchange="'+e+'" onkeyup="'+e+'"'}if(l.emWidth){i=' style="width:'+l.emWidth+"em;min-width:"+l.emWidth+'em"'}return""+(a?htmlEncode(a):"")+""}function cdBuildTextAreaField(c,b,d,a){cdBuildTextAreaFieldP(c,{unencodedText:b,rowCount:d,onChangeDoubleQuotedContent:a})}function cdBuildTextAreaFieldRowP(l,m,k){if(!k){k={}}var e=k.labelAbove,i=k.textAreaRowClasses,n=k.additionalClassesForAllTextAreaRows,g=trim((i||"")+" "+(n||"")),j=g?' class="'+g+'"':"",h=n?' class="'+n+'"':"",d=trim(k.additionalLabelCellClasses||""),f=d?" "+d:"",b=k.postTextAreaFieldHtml||"",a=k.rowId,c=a?' id="'+a+'"':"",o=k.hideRow?' style="display:none"':"";m=m?m+(k.suppressLabelColon?"":":"):"";if(e){return"'+m+"'+cdBuildTextAreaFieldP(l,k)+b+""}else{return""+cdBuildOpenDialogLabelCell(k.fieldLabelId,d)+m+''+cdBuildTextAreaFieldP(l,k)+b+""}}function cdBuildTextAreaFieldRow(d,f,c,e,a,b){return cdBuildTextAreaFieldRowP(d,f,{labelAbove:a,unencodedText:c,rowCount:e,onChangeDoubleQuotedContent:b})}function cdBuildTextFieldP(G,w){w=w||{};var Q=w.maxLength||0,f=w.forceSuppressAutofill,z=w.omitMaxLength,D=Q&&!z?'maxlength="'+Q+'" ':"",a=w.onChangeCode||"",S=w.onClickCode||"",L=S?'onclick="'+S+'" ':"",q=w.visibilityHidden,F=w.hideField,R=w.fieldSize,g=R?'size="'+R+'" ':"",y=a?'onkeyup="'+a+'" onchange="'+a+'" ':"",p=w.omitStyleWidth,l=p?"":w.strStyleWidth||"",P=l?"width:"+l:"",k=F?"display:none;":"",j=q?"visibility:hidden;":"",t=l||F||q?'style="'+k+j+P+'"':"",M=w.fieldId||"",n=M?'id="'+M+'" ':"",e=w.onPasteJS,u=e?'onpaste="'+e+'"':"",B=w.additionalRawFieldAttributes?w.additionalRawFieldAttributes+" ":"",I=f?"data-1p-ignore ":"",d=w.typeaheadInfo,v=d?d.forcedFullDropdownInfo:0,T=v?v.omitSideButton:0,b=v?v.rawActivationJS:"",c=b?'mjttypeaheadactivation="'+htmlEncode(b)+'" ':"",O=b&&!T,m=w.placeholder||"",C=w.fieldValue||"",o=w.strOnKeyPress||"",N="text",x=w.step,H=w.minValue,J=w.maxValue,i="",E="",s=trim((O?"input-buttonRight ":"")+(w.fieldClasses||"")),h=s?'class="'+s+'" ':"",A=w.disabled?'disabled="disabled" ':"",r="";if(typeof H!=="undefined"){i='min="'+H+'" '}if(typeof J!=="undefined"){E='max="'+J+'" '}if(w.isSearch){N="search"}else{if(w.isPasswordField){N="password"}else{if(w.isNumber){N="number";if(typeof x==="undefined"){x="any"}}else{if(w.isEmail){N="email"}else{if(w.isURL){N="url"}else{if(w.isTelephone){N="tel"}else{if(w.isDate){N="date"}else{if(w.isMonth){N="month"}else{if(w.isHiddenField){N="hidden"}}}}}}}}}if(x){r='step="'+x+'" '}var K='";if(d){K+='"}return K}function cdBuildTextField(g,j,f,h,b,e,c,d,a,i){return cdBuildTextFieldP(g,{fieldValue:j,strOnKeyPress:f,maxLength:h,strStyleWidth:b,isPasswordField:e,typeaheadInfo:c,onChangeCode:d,fieldId:a,suppressAutocomplete:i})}function cdBuildTextFieldRowP(l,m,p){if(!p){p={}}var d=p.labelAbove,q=p.rowId?' id="'+p.rowId+'"':"",r=p.hideRow?' style="display:none"':"",k=p.additionalFieldRowClasses,j=k?' class="'+k+'" ':"",a=p.additionalFieldCellClasses,f=trim("dialogFieldValue"+(a?" "+a:"")),c=p.strPostFieldHTML||"",s=p.typeaheadInfo,o=s?s.forcedFullDropdownInfo:0,i=o?o.omitSideButton:0,g=o?o.rawActivationJS:"",b=o?o.rawSideButtonTitle:"",h=o?o.sideButtonClasses:"",e=f?' class="'+f+'"':"";if(g&&!i){c=cdBuildTypeaheadSideButton({rawActivationJS:g,sideButtonClasses:h,rawSideButtonTitle:b})+c}var n;if(d){n=""}else{n=""}n+=cdBuildOpenDialogLabelCell(p.fieldLabelId,p.additionalLabelCellClasses)+(m?m+(p.suppressLabelColon?"":":"):"")+""+(d?"":"")+("")+(p.strPreFieldHTML||"")+cdBuildTextFieldP(l,p)+c+"\n";if(d){n+=""}return n}function cdBuildTextFieldRow(g,i,k,f,h,b,e,c,j,d,a){return cdBuildTextFieldRowP(g,i,{fieldValue:k,strOnKeyPress:f,maxLength:h,strStyleWidth:b,isPasswordField:e,typeaheadInfo:c,strPostFieldHTML:j,onChangeCode:d,rowId:a})}function cdBuildReadOnlyFieldRowP(p){p=p||{};var h="",k="",i=p.labelAbove,l=p.suppressLabelColon,f=p.hideRow?' style="display:none"':"",c=p.rowId,n=c?' id="'+c+'" ':"",b=p.additionalRowClasses,m=b?' class="'+b+'" ':"",e=p.valueCellId,j=e?' id="'+e+'" ':"",g=p.additionalValueCellClasses||"",o=p.serializableRowData,d=ClientDialogModule.PROTECTED.buildDialogRowDataAttribute({serializableRowData:o}),a;if(g){g=" "+g}if(p.labelHTML){h=p.labelHTML}else{if(p.rawLabel){h=htmlEncode(p.rawLabel)}}if(p.valueHTML){k=p.valueHTML}else{if(p.rawValue){k=htmlEncode(p.rawValue)}}if(i){a=""}else{a=""}a+=cdBuildOpenDialogLabelCell(p.fieldLabelId,p.additionalCellClasses)+(h?h+(l?"":":"):"")+""+(i?"":"")+'"+k+"\n"+(i?"\n":"");return a}function cdBuildRBP(h,a,i,k){k=k||{};var c=k.onClickCode,e=k.onChangeCode,d=k.fieldValue,g=typeof d==="undefined",f=k.forceLabelOnTheLeft,b='",j='";if(f){return j+b}return b+j}function cdBuildRB(d,b,e,f,c,a){return cdBuildRBP(d,b,e,{checked:f,fieldValue:""+c,onClickCode:a})}function cdBuildRBRowP(j,b,k,m){m=m||{};var g=m.rowLabelHTML||htmlEncode(m.rawRowLabel||""),i=m.additionalCellClasses,f=trim("dialogFieldName "+(i||"")),e=m.additionalValueCellClasses,h=trim("dialogFieldValue "+(e||"")),a=m.additionalRowClasses||"",d=m.hideRow?' style="display:none"':"",c=m.postRBFieldHtml||"",l=a?' class="'+a+'"':"";return"'+g+''+cdBuildRBP(j,b,k,m)+c+"\n"}function cdBuildRBRow(d,b,e,f,c,a){return cdBuildRBRowP(d,b,e,{checked:f,fieldValue:""+c,onClickCode:a})}function cdBuildCheckboxAndLabelP(l){var m=l.fieldName,b=l.fieldId,h=l.fieldLabelHTML||cdBuildMnemonicLabelHTML(l)||"",n=b?' for="'+b+'"':"",g=b?'id="'+b+'" ':"",c=n?' style="cursor:pointer"':"",k=h?" "+h+"":"",a=l.checked,o=l.fieldValue,f=l.doubleQuoteEncodedOnClickJS,e=f?' onclick="'+f+'" ':"",j=l.disabled,i=l.additionalCBClasses;var d=i?' class="'+i+'"':"";return'"+k}function cdBuildCheckboxAndLabel(d,b,g,h,c,a,f,e){return cdBuildCheckboxAndLabelP({fieldName:d,fieldId:b,fieldLabelHTML:g,checked:h,fieldValue:c,doubleQuoteEncodedOnClickJS:a,disabled:f,additionalCBClasses:e})}function generateHTMLLabelAsString(b){var a="";return a}function generateHTMLCheckboxAsString(b){var a='";return a}function generateCheckboxDisplayedAsToggle(d){var c=generateHTMLLabelAsString({forAttributeContent:d.fieldId,content:htmlEncode(d.activeOnlyLabelText)}),e=generateHTMLCheckboxAsString({idAttributeContent:d.fieldId,nameAttributeContent:d.fieldName,isChecked:d.isChecked,onclickAttributeContent:d.onclickScript,tabIndex:d.tabIndex}),b=e+generateHTMLSpanAsString({classAttributeContent:"slider round",content:""}),a=c+generateHTMLLabelAsString({classAttributeContent:"switch",content:b});return a}function cdBuildCheckboxRowP(h,p,s){var j=!s||undefined===s.forceLabelOnTheLeft;s=s||{};var f=s.fieldValue||"",r=s.additionalValueCellClasses||"",i=s.additionalLabelCellClasses||"",g=j?false:s&&s.forceLabelOnTheLeft,m=!g&&s&&s.omitEmptyCell,c=s.checked,u=s.disabled,t=s.fieldName||h,l=s.onClickCode||"",k=u?' style="color: #999999;"':"",n=s.rowId,o=n?' id="'+n+'"':"",e=s.additionalRowClasses,d=e?' class="'+e+'" ':"",b=s.hideRow?' style="display:none"':"",a=trim("dialogFieldValue "+r),q="";if(!m){q+=cdBuildOpenDialogLabelCell(undefined,i)+(g?'":"")+""}q+=''+cdBuildCheckboxAndLabel(t,h,g?"":p,c,f,l,u,s.additionalCBClasses)+"\n";return q}function cdBuildCheckboxRow(e,b,f,g,d,a,c){return cdBuildCheckboxRowP(b,f,{labelOnTheLeft:c?1:0,checked:g,fieldValue:d,onClickCode:a,fieldName:e})}function cdCarefullyLocalizeDateValue(a){if(a&&typeof a==="string"){try{var b=parseDateString(a),c=getLocalDateString(b);a=c}catch(d){}}else{if(!a){a=""}}return a}function cdBuildDatePickerStrTarget(b,a){return"document.getElementById('"+b+"')."+a}function cdShowCalendarForDateField(a){if(a){var b=a.form;show_calendar(cdBuildDatePickerStrTarget(b.id,a.name),a.value,"")}}function cdBuildDatePickerFieldP(j,i,k){k=k||{};var e=k.strOnKeyPress||"",h=k.additionalTextFieldClasses,g=k.fieldId,b=g?'id="'+g+'" ':"",d=k.strOnChangeDoubleQuotedContent||"",c=d?'onchange="'+d+'" ':"",f=h?' class="'+trim(h)+'"':"",a;a="&#'+getRawFontId(FontIconId_Enum.fiiCalendar)+";";return a}function cdBuildDatePickerField(f,e,b,d,c,a){return cdBuildDatePickerFieldP(f,e,{strValue:b,strOnKeyPress:d,strOnChangeDoubleQuotedContent:c,fieldId:a})}function cdBuildDatePickerRowP(i,h,l){l=l||{};var a=l.rowId||"",j=a?' id="'+a+'"':"",b=l.additionalFieldRowClasses,f=b?' class="'+b+'" ':"",g=l.additionalCellClasses,d=trim("dialogFieldName "+(g||"")),c=l.additionalValueCellClasses,e=trim("dialogFieldValue "+(c||"")),k=l.fieldLabelHTML?l.fieldLabelHTML+":":"";return"'+k+""+(l.labelAbove?"":"")+''+cdBuildDatePickerFieldP(i,h,l)+(l.strPostPickerHTML||"")+""}function cdBuildDatePickerRow(k,i,j,e,f,d,g,h,a,b,c){return cdBuildDatePickerRowP(k,i,{fieldLabelHTML:j,strPostPickerHTML:g,rightAlignField:h,labelAbove:b,rowId:c,strValue:e,strOnKeyPress:f,strOnChangeDoubleQuotedContent:d,fieldId:a})}function cdBuildFAFontIconButton(f){var b=f.fontId,e=f.disabled,d=e?' disabled="disabled"':"",c="",a="";if(f.additionalFontClasses){c=" "+f.additionalFontClasses}if(f.additionalButtonClasses){a=" "+f.additionalButtonClasses}return"