1var radWindowNumber = 1; 2 3// Base64 object usefull for encoding / decoding 4var Base64 = { _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function (e) { var t = ""; var n, r, i, s, o, u, a; var f = 0; e = Base64._utf8_encode(e); while (f < e.length) { n = e.charCodeAt(f++); r = e.charCodeAt(f++); i = e.charCodeAt(f++); s = n >> 2; o = (n & 3) << 4 | r >> 4; u = (r & 15) << 2 | i >> 6; a = i & 63; if (isNaN(r)) { u = a = 64 } else if (isNaN(i)) { a = 64 } t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a) } return t }, decode: function (e) { var t = ""; var n, r, i; var s, o, u, a; var f = 0; e = e.replace(/[^A-Za-z0-9+/=]/g, ""); while (f < e.length) { s = this._keyStr.indexOf(e.charAt(f++)); o = this._keyStr.indexOf(e.charAt(f++)); u = this._keyStr.indexOf(e.charAt(f++)); a = this._keyStr.indexOf(e.charAt(f++)); n = s << 2 | o >> 4; r = (o & 15) << 4 | u >> 2; i = (u & 3) << 6 | a; t = t + String.fromCharCode(n); if (u != 64) { t = t + String.fromCharCode(r) } if (a != 64) { t = t + String.fromCharCode(i) } } t = Base64._utf8_decode(t); return t }, _utf8_encode: function (e) { e = e.replace(/rn/g, "n"); var t = ""; for (var n = 0; n < e.length; n++) { var r = e.charCodeAt(n); if (r < 128) { t += String.fromCharCode(r) } else if (r > 127 && r < 2048) { t += String.fromCharCode(r >> 6 | 192); t += String.fromCharCode(r & 63 | 128) } else { t += String.fromCharCode(r >> 12 | 224); t += String.fromCharCode(r >> 6 & 63 | 128); t += String.fromCharCode(r & 63 | 128) } } return t }, _utf8_decode: function (e) { var t = ""; var n = 0; var r = c1 = c2 = 0; while (n < e.length) { r = e.charCodeAt(n); if (r < 128) { t += String.fromCharCode(r); n++ } else if (r > 191 && r < 224) { c2 = e.charCodeAt(n + 1); t += String.fromCharCode((r & 31) << 6 | c2 & 63); n += 2 } else { c2 = e.charCodeAt(n + 1); c3 = e.charCodeAt(n + 2); t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63); n += 3 } } return t } } 5 6if (!Array.prototype.indexOf) { 7 Array.prototype.indexOf = function (elt /*, from*/) { 8 var len = this.length >>> 0; 9 10 var from = Number(arguments[1]) || 0; 11 from = (from < 0) ? Math.ceil(from) : Math.floor(from); 12 if (from < 0) 13 from += len; 14 15 for (; from < len; from++) { 16 if (from in this && this[from] === elt) 17 return from; 18 } 19 return -1; 20 }; 21} 22 23String.prototype.format = function () { 24 var content = this; 25 for (var i = 0; i < arguments.length; i++) { 26 var replacement = '{' + i + '}'; 27 content = content.replace(replacement, arguments[i]); 28 } 29 return content; 30}; 31 32var dateFormat = function () { 33 var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, 34 timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, 35 timezoneClip = /[^-+\dA-Z]/g, 36 pad = function (val, len) { 37 val = String(val); 38 len = len || 2; 39 while (val.length < len) val = "0" + val; 40 return val; 41 }; 42 43 // Regexes and supporting functions are cached through closure 44 return function (date, mask, utc) { 45 var dF = dateFormat; 46 47 // You can't provide utc if you skip other args (use the "UTC:" mask prefix) 48 if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { 49 mask = date; 50 date = undefined; 51 } 52 53 // Passing date through Date applies Date.parse, if necessary 54 date = date ? new Date(date) : new Date; 55 if (isNaN(date)) throw SyntaxError("invalid date"); 56 57 mask = String(dF.masks[mask] || mask || dF.masks["default"]); 58 59 // Allow setting the utc argument via the mask 60 if (mask.slice(0, 4) == "UTC:") { 61 mask = mask.slice(4); 62 utc = true; 63 } 64 65 var _ = utc ? "getUTC" : "get", 66 d = date[_ + "Date"](), 67 D = date[_ + "Day"](), 68 m = date[_ + "Month"](), 69 y = date[_ + "FullYear"](), 70 H = date[_ + "Hours"](), 71 M = date[_ + "Minutes"](), 72 s = date[_ + "Seconds"](), 73 L = date[_ + "Milliseconds"](), 74 o = utc ? 0 : date.getTimezoneOffset(), 75 flags = { 76 d: d, 77 dd: pad(d), 78 ddd: dF.i18n.dayNames[D], 79 dddd: dF.i18n.dayNames[D + 7], 80 m: m + 1, 81 mm: pad(m + 1), 82 mmm: dF.i18n.monthNames[m], 83 mmmm: dF.i18n.monthNames[m + 12], 84 yy: String(y).slice(2), 85 yyyy: y, 86 h: H % 12 || 12, 87 hh: pad(H % 12 || 12), 88 H: H, 89 HH: pad(H), 90 M: M, 91 MM: pad(M), 92 s: s, 93 ss: pad(s), 94 l: pad(L, 3), 95 L: pad(L > 99 ? Math.round(L / 10) : L), 96 t: H < 12 ? "a" : "p", 97 tt: H < 12 ? "am" : "pm", 98 T: H < 12 ? "A" : "P", 99 TT: H < 12 ? "AM" : "PM", 100 Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), 101 o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), 102 S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] 103 }; 104 105 return mask.replace(token, function ($0) { 106 return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); 107 }); 108 }; 109}(); 110
111// Some common format strings 112dateFormat.masks = { 113 "default": "ddd mmm dd yyyy HH:MM:ss", 114 shortDate: "m/d/yy", 115 mediumDate: "mmm d, yyyy", 116 longDate: "mmmm d, yyyy", 117 fullDate: "dddd, mmmm d, yyyy", 118 shortTime: "h:MM TT", 119 mediumTime: "h:MM:ss TT", 120 longTime: "h:MM:ss TT Z", 121 isoDate: "yyyy-mm-dd", 122 isoTime: "HH:MM:ss", 123 isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", 124 isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" 125}; 126 127// Internationalization strings 128dateFormat.i18n = { 129 dayNames: [ 130 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 131 "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" 132 ], 133 monthNames: [ 134 "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", 135 "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" 136 ] 137}; 138 139// For convenience... 140Date.prototype.format = function (mask, utc) { 141 return dateFormat(this, mask, utc); 142}; 143 144function GetQueryString(key, default_) { 145 if (default_ == null) default_ = ""; 146 key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 147 var regex = new RegExp("[\\?&]" + key + "=([^&#]*)"); 148 var qs = regex.exec(mxRawURL); 149 if (qs == null) 150 return default_; 151 else 152 return qs[1]; 153} 154 155function ReplaceUrlParam(url, name, value) { 156 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 157 var regexS = "[\\?&]" + name + "=([^&#]*)"; 158 var regex = new RegExp(regexS); 159 var results = regex.exec(url); 160 if (results == null) 161 return url; 162 else { 163 return url.replace(results[0], results[0].replace(/=(.*)/, '=' + value)); 164 } 165} 166 167function RemoveUrlParam(key, sourceURL) { 168 var rtn = sourceURL.split("?")[0], 169 param, 170 params_arr = [], 171 queryString = (sourceURL.indexOf("?") !== -1) ? sourceURL.split("?")[1] : ""; 172 if (queryString !== "") { 173 params_arr = queryString.split("&"); 174 for (var i = params_arr.length - 1; i >= 0; i -= 1) { 175 param = params_arr[i].split("=")[0]; 176 if (param === key) { 177 params_arr.splice(i, 1); 178 } 179 } 180 rtn = rtn + "?" + params_arr.join("&"); 181 } 182 return rtn; 183} 184 185function GetRadWindowName() { 186 radWindowNumber++; 187 188 return "RadWindow" + radWindowNumber; 189} 190 191function OpenEditWindow(managerId, pagesPath, windowTitle, editControlVirtualPath, containerPageTypeName, parentModuleName, parentControlTypeName, settingsControlId, editMode, itemId, customerType, view, publicAccess, doPostBack, additionalAssemblyPath, additionalParams) { 192 if (typeof doPostBack === "undefined") doPostBack = false; 193 if (typeof additionalAssemblyPath == "undefined") additionalAssemblyPath = ""; 194 if (typeof additionalParams == "undefined") additionalParams = ""; 195 196 // Add the Parent Window's URL Parameters to the Edit URL so they become accessible from the Pop-up ONLY if the parent is not 197 // already an IFRAME 198 var parentWindowUrlParams = ""; 199 if (self == top) { 200 parentWindowUrlParams = mxRawURLQueryString; 201 if (parentWindowUrlParams.length > 0) { 202 parentWindowUrlParams = RemoveUrlParam("CustomerType", parentWindowUrlParams); 203 parentWindowUrlParams = RemoveUrlParam("TabId", parentWindowUrlParams); /* To avoid problems with DNN */ 204 parentWindowUrlParams = parentWindowUrlParams.replace("?", "&"); 205 } 206 } 207 208 var manager = $find(managerId);
209 var wnd = manager.Open(pagesPath + "/Edit.aspx?WindowTitle=" + windowTitle + "&EditControlVirtualPath=" + editControlVirtualPath + "&ContainerPageTypeName=" + containerPageTypeName + "&ParentModuleName=" + parentModuleName + "&ParentControlTypeName=" + parentControlTypeName + "&SettingsControlId=" + settingsControlId + "&EditMode=" + editMode + "&ItemId=" + itemId + "&CustomerType=" + customerType + "&View=" + view + "&PublicAccess=" + publicAccess + "&DoPostback=" + doPostBack + "&AdditionalAssemblyPath=" + additionalAssemblyPath + "&AdditionalParams=" + additionalParams + parentWindowUrlParams, GetRadWindowName()); 210} 211 212function GetRadWindow() { 213 var oWindow = null; 214 if (window.radWindow) oWindow = window.radWindow; 215 else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 216 return oWindow; 217} 218 219function CloseRadWindow() { 220 var oWindow = GetRadWindow(); 221 oWindow.argument = null; 222 oWindow.close(); 223} 224 225function EditWindowClosing(wnd, args) { 226 if (args.get_argument() != null) { 227 if (args.get_argument().action == 'save') { 228 // Check if we should close the parent (only if it's a pop-up) 229 if (args.get_argument().closeParent != null && args.get_argument().closeParent.length > 0 && args.get_argument().closeParent == 'Yes') { 230 ShowLoadingMessage(); 231 CloseWindow(args.get_argument().action, args.get_argument().view); 232 } 233 else { 234 if (args.get_argument().doPostback != null && args.get_argument().doPostback == true) { 235 // Make a postback and send "Refresh" to tell components to repopulate themselves 236 ShowLoadingMessage(); 237 __doPostBack('Refresh', args.get_argument().postbackArgument); 238 } else { 239 // Check if the Edit Page is returning a View we should return to 240 if (args.get_argument().view != null && args.get_argument().view.length > 0) { 241 // Check if the View parameter was already part of the URL 242 if (GetQueryString('View', null).length > 0) { 243 // If so, replace it with the new value 244 ShowLoadingMessage(); 245 window.location.href = ReplaceUrlParam(mxRawURL, 'View', args.get_argument().view); 246 } else { 247 // If not, add it to the URL 248 if (mxRawURL.indexOf('?') != -1) { 249 // Not the first parameter 250 ShowLoadingMessage(); 251 window.location.href = mxRawURL + "&View=" + args.get_argument().view; 252 } 253 else { 254 // The first parameter 255 ShowLoadingMessage(); 256 window.location.href = mxRawURL + "?View=" + args.get_argument().view; 257 } 258 } 259 } else { 260 // Renavigate to same page 261 ShowLoadingMessage(); 262 window.location.href = window.location.href; 263 } 264 } 265 } 266 } 267 } 268} 269 270function OpenConfigurationWindow(pagesPath, title, displayTitleEnabled, showDisplayTitle, pageTypeName, controlVirtualPath, controlId, editModeEnabled, securityByModeEnabled, allowAnonymousSecurity, basicViewChildControlsVirtualPaths, advancedViewControlVirtualPath, basicEditChildControlsVirtualPaths, advancedEditControlVirtualPath, module, component) { 271 var url = pagesPath + "/Configuration.aspx?DisplayTitleEnabled=" + displayTitleEnabled + "&ShowDisplayTitle=" + showDisplayTitle + "&PageTypeName=" + pageTypeName + "&ControlVirtualPath=" + controlVirtualPath + "&ControlId=" + controlId + "&EditModeEnabled=" + editModeEnabled + "&SecurityByModeEnabled=" + securityByModeEnabled + "&AllowAnonymousSecurity=" + allowAnonymousSecurity + "&BasicViewChildControlsVirtualPaths=" + basicViewChildControlsVirtualPaths + "&AdvancedViewControlVirtualPath=" + advancedViewControlVirtualPath + "&BasicEditChildControlsVirtualPaths=" + basicEditChildControlsVirtualPaths + "&AdvancedEditControlVirtualPath=" + advancedEditControlVirtualPath + "&Module=" + module + "&Component=" + component; 272 273 $('#mxConfigurationModal #save').addClass('disabled'); 274 $('#mxConfigurationModal #title').text(title); 275 $('#mxConfigurationModal iframe').attr('src', url); 276 $('#mxConfigurationModal').draggable(); 277 //$('#mxConfigurationModal').modal(); 278 $('#mxConfigurationModal').modal('show'); 279} 280 281function ConfigurationWindowClosing() { 282 if ($('#mxConfigurationModal #configToolbarAction').val() == 'save') { 283 ShowLoadingMessage(); 284 window.location.href = window.location.href; 285 } 286 287 $('#mxConfigurationModal #configToolbarAction').val(''); 288} 289 290function OpenAdminWindow(pagesPath, title, isUserAdmin) { 291 var url = pagesPath + "/Admin.aspx?isUserAdmin=" + isUserAdmin; 292 293 $('#mxAdminModal #save').addClass('disabled'); 294 $('#mxAdminModal #title').text(title); 295 $('#mxAdminModal iframe').attr('src', url); 296 $('#mxAdminModal').draggable(); 297 //$('#mxAdminModal').modal(); 298 $('#mxAdminModal').modal('show'); 299} 300 301function AdminWindowClosing() { 302 if ($('#mxAdminModal #adminToolbarAction').val() == 'save') { 303 ShowLoadingMessage(); 304 window.location.href = window.location.href; 305 } 306 307 $('#mxAdminModal #adminToolbarAction').val(''); 308} 309 310function OpenErrorReportWindow(managerId, pagesPath, correlationId) { 311 var manager = $find(managerId); 312 var wnd = manager.Open(pagesPath + "/ErrorReport.aspx?correlationId=" + correlationId); 313} 314 315function GetWindow() { 316 var wnd = null; 317 if (window.radWindow) wnd = window.radWindow; 318 else if (window.frameElement.radWindow) wnd = window.frameElement.radWindow; 319 return wnd; 320} 321 322function MailTo(email, subject) { 323 location.href = "mailto:" + email + "?subject=" + subject; 324} 325 326function ShowConfirmDialog(managerId, callBackFunctionName, dialogText, dialogTitle) { 327 var callBackFunction = window[callBackFunctionName]; 328 var manager = $find(managerId); 329 var oWnd = manager.radconfirm(dialogText, callBackFunction, 350, null, null, dialogTitle); 330 var popupElement = oWnd.get_popupElement(); 331 popupElement.className = popupElement.className + " mx-windowmanager mx-dialog-popup"; 332} 333 334function ShowAlertDialog(managerId, callBackFunctionName, dialogText, dialogTitle) { 335 var callBackFunction = window[callBackFunctionName]; 336 var manager = $find(managerId); 337 var oWnd = manager.radalert(dialogText, 350, null, dialogTitle, callBackFunction); 338 var popupElement = oWnd.get_popupElement(); 339 popupElement.className = popupElement.className + " mx-windowmanager mx-dialog-popup"; 340} 341 342/* 343This function is useful to make radio buttons work inside repeaters 344See http://www.codeguru.com/csharp/csharp/cs_controls/custom/article.php/c12371/ASPNET-Tip-Using-RadioButton-Controls-in-a-Repeater.htm 345*/ 346function SetUniqueRadioButton(nameregex, current) { 347 re = new RegExp(nameregex); 348 349 for (i = 0; i < document.forms[0].elements.length; i++) { 350 elm = document.forms[0].elements[i] 351 if (elm.type == 'radio') { 352 if (re.test(elm.name)) { 353 elm.checked = false; 354 } 355 } 356 } 357 358 current.checked = true; 359} 360 361/* Accounts */ 362 363function OnClientNodeClicking(sender, args) { 364 var node = args.get_node();
365 var nodeUrl = node.get_navigateUrl(); 366 if (nodeUrl != null) { 367 location.replace(nodeUrl); 368 } 369} 370 371/* End Accounts */ 372 373/* Select Sessions */ 374 375function RowSelected(gridId, checkBox, waitListOff, availableSeats, rowIndex) { 376 var grid = $find(gridId); 377 var masterTable = grid.get_masterTableView(); 378 var row = masterTable.get_dataItems()[rowIndex]; 379 try { 380 var cell = masterTable.getCellByColumnUniqueName(row, "Message"); 381 382 if (!checkBox.checked) 383 cell.innerHTML = ""; 384 else { 385 if (!waitListOff && availableSeats <= 0) 386 cell.innerHTML = "Waitlist"; 387 } 388 } 389 catch (err) { } 390} 391 392function selectSession(check, textbox) { 393 if (check.disabled) 394 return; 395 396 textbox = (typeof textbox == 'string') ? document.getElementById(textbox) : textbox; 397 398 SetRowState(check, textbox); 399 400 if (check.checked) { 401 if (textbox.value == "" || textbox.value == "0") 402 textbox.value = "1"; 403 } else { 404 textbox.value = "0"; 405 } 406} 407 408function SetRowState(check, textbox) { 409 textbox.disabled = !check.checked; 410 411 //this is for overriding a default class added by the framework 412 if (textbox.disabled) { 413 textbox.className += " aspNetDisabled"; 414 } else { 415 textbox.classList.remove("aspNetDisabled"); 416 } 417} 418 419/* End Select Sessions */ 420 421/* Status Bar */ 422 423function ProcessWarningAnswer(arg) { 424 if (arg) { 425 ShowLoadingMessage(); 426 __doPostBack("FilterAndContinueToShippingCart", ""); 427 } 428} 429 430/* End Status Bar */ 431 432/* Navigation */ 433 434function OpenNavigationPanelConfigWindow(managerId, pagesPath, name, selectedEventTypes, someoneElseRegistration) { 435 var manager = $find(managerId); 436 var wnd = manager.Open(pagesPath + "/NavigationConfig.aspx?Name=" + name + "&EventTypes=" + selectedEventTypes + "&WindowTitle=Config. Navigation&DisplayTitle=Edit Navigation&SomeoneElseRegistration=" + someoneElseRegistration, GetRadWindowName()); 437} 438 439/* End Navigation */ 440 441/* Membership Navigation */ 442 443function OpenMembershipNavigationPanelConfigWindow(managerId, pagesPath, name, displayType, customerType, selectedBenefits) { 444 var manager = $find(managerId); 445 446 var wnd = manager.Open(pagesPath + "/MembershipApplicationNavigationConfig.aspx" + "?Name=" + name + "&displayType=" + displayType + "&customerType=" + customerType + "&Benefits=" + selectedBenefits + "&WindowTitle=Config. Membership Application Navigation&DisplayTitle=Edit Navigation", GetRadWindowName()); 447} 448 449function OpenMembershipNavigationMappingsPanelConfigWindow(managerId, pagesPath, templates, mappings) { 450 var manager = $find(managerId); 451 var wnd = manager.Open(pagesPath + "/MembershipApplicationNavigationMappingConfig.aspx" + "?Templates=" + templates + "&mappings=" + mappings + "&WindowTitle=Config. Membership Application Navigation&DisplayTitle=Map Benefits to Navigation Templates", GetRadWindowName()); 452} 453/* End Membership Navigation */ 454 455/* SignIn Popup */ 456function OpenSignInPopupWindow(managerId, pagesPath, controlId, createNewUserAccountUrl, popupMode, returnUrl) { 457 var manager = $find(managerId); 458 var wnd = manager.Open(pagesPath + "/SignInPopup.aspx?ControlId=" + controlId + "&CreateNewUserAccountUrl=" + createNewUserAccountUrl + "&PopupMode=" + popupMode + "&ReturnUrl=" + returnUrl); 459} 460 461function SignInPopupWindowClosing(wnd, args) { 462 if (args.get_argument() != null) { 463 if (args.get_argument().action == 'authenticated') { 464 var controlId = decodeURIComponent(args.get_argument().controlid.replace(/\+/g, ' ')); 465 466 ShowLoadingMessage(); 467 468 if (args.get_argument().popupMode == 'legacy') { 469 window.location.href = window.location.href; 470 } else { 471 __doPostBack(controlId, ''); 472 } 473 } else if (args.get_argument().action == 'redirect') { 474 if (args.get_argument().redirectUrl != null) { 475 ShowLoadingMessage(); 476 window.location.href = args.get_argument().redirectUrl; 477 } 478 } 479 } 480} 481 482function RedirectBackFromSignInPopup(arg) { 483 var returnonerror = GetQueryString('returnonerror', null).toLowerCase(); 484 485 if (returnonerror == "true" || returnonerror == "yes") 486 history.back(1); 487} 488/* End SignIn Popup */ 489 490/* SelectRegistrants */ 491 492var selectedOnClient = new Array(); 493var unSelectedOnClient = new Array(); 494 495function getIndexOfSelectedArray(contactid, collection) { 496 for (i = 0; i < collection.length; i++) { 497 if (collection[i].split(',')[0] == contactid) 498 return i; 499 } 500 return -1; 501} 502 503function updateClientSelections(contactId, selectionState) { 504 var indexInSelected = getIndexOfSelectedArray(contactId, selectedOnClient); 505 var indexInUnselected = getIndexOfSelectedArray(contactId, unSelectedOnClient); 506 //selectionState = 0 - No Selected 507 //selectionState = 1 - Selected 508 //selectionState = 2 - waitlisted 509 510 if (selectionState >= 1) { 511 if (indexInUnselected > -1) { 512 unSelectedOnClient.splice(indexInUnselected, 1); 513 } else { 514 if (indexInSelected > -1) 515 selectedOnClient.splice(indexInSelected, 1); 516 517 var aux = contactId; 518 aux = aux + ","; 519 if (selectionState == 2) 520 aux = aux + "true" 521 else 522 aux = aux + "false"; 523 selectedOnClient.push(aux); 524 } 525 } else { 526 if (indexInSelected > -1) { 527 selectedOnClient.splice(indexInSelected, 1); 528 } else { 529 unSelectedOnClient.push(contactId); 530 } 531 } 532} 533 534function ClientDropDownListIndexChange(ddl, contactId) { 535 if (ddl.disabled) return; 536 537 var selectionState = ddl.value; 538 539 updateClientSelections(contactId, selectionState); 540} 541 542function ClientCheckboxClick(check, contactId) { 543 if (check.disabled) return; 544 545 var selected = check.checked ? 1 : 0; 546 547 updateClientSelections(contactId, selected); 548} 549 550function SearchByNameClosing(wnd, args) { 551 if (args.get_argument() != null && args.get_argument().action == "select") { 552 ShowLoadingMessage(); 553 __doPostBack('Refresh', args.get_argument().selections); 554 } 555} 556 557/* End SelectRegistrants */ 558 559function RadGrid_CheckRowSelectability(sender, eventArgs) { 560 var dataItem = $get(eventArgs.get_id()); 561 var grid = sender; 562 var MasterTable = grid.get_masterTableView(); 563 var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()]; 564 var cell = MasterTable.getCellByColumnUniqueName(row, "Unselectable"); 565 if (cell.innerHTML == 'true') //Check for the condition, here cell.innerHTML holds the value of the cell 566 { 567 MasterTable.clearSelectedItems(); // Deselect any previous selection 568 } 569} 570 571addToPostBack = function (func) { 572 var old__doPostBack = __doPostBack; 573 if (typeof __doPostBack != 'function') { 574 __doPostBack = func; 575 } else { 576 __doPostBack = function (t, a) { 577 if (func(t, a)) old__doPostBack(t, a); 578 } 579 } 580}; 581 582if (window.addEventListener) // W3C standard 583{ 584 window.addEventListener('load', createWaitingImage, false); 585} 586else if (window.attachEvent) // Microsoft 587{ 588 window.attachEvent('onload', createWaitingImage); 589} 590 591// This is useful to insert a call to ShowLoadingMessage before other eventhandler like onchange (useful to display a messaje before __doPostBack) 592function addLoadingMessageBeforeEventHandler(element, eventName) { 593 if (!element) return; 594 595 var oldEventHandler = element[eventName]; 596 597 element[eventName] = function (t, a) { 598 ShowLoadingMessage(); 599 600 if (oldEventHandler) 601 oldEventHandler(t, a); 602 } 603} 604 605function createWaitingImage() { 606 var div = document.createElement("div"); 607 div.id = "loading"; 608 div.style.width = "50px"; 609 div.style.height = "50px"; 610 div.style.zIndex = "1002"; 611 div.innerHTML = "<i class=\"fa fa-spinner fa-spin fa-5x\"></i>"; 612 div.style.display = "none"; 613 614 document.body.appendChild(div); 615} 616
617function ShowLoadingMessage(action) { 618 try { 619 DisablePage(); 620 621 var div = document.getElementById("loading"); 622 623 if (div) { 624 div.style.display = ""; 625 centerElementOnScreen(div); 626 } 627 } 628 catch (ex) { 629 console.error(ex.message); 630 } 631} 632 633function DisablePage() { 634 var div = document.createElement("div"); 635 div.id = "disablingDiv"; 636 637 var opacity = 6; 638 var minWidth = 960; 639 var width = document.body.offsetWidth < minWidth ? minWidth : document.body.offsetWidth; 640 var height = document.body.offsetHeight; 641 642 div.style.position = "absolute"; 643 div.style.top = "0%"; 644 div.style.left = "0%"; 645 div.style.width = width + "px"; 646 div.style.height = height + "px"; 647 div.style.backgroundColor = "White"; 648 div.style.opacity = opacity / 10; 649 div.style.filter = "alpha(opacity=" + opacity * 10 + ")"; 650 div.style.zIndex = "1001"; 651 652 if (document.body.firstChild) { 653 document.body.insertBefore(div, document.body.firstChild); 654 } else { 655 document.body.appendChild(div); 656 } 657} 658 659function centerElementOnScreen(element) { 660 element.style.position = "absolute"; 661 element.style.top = "50%"; 662 element.style.left = "50%"; 663} 664 665// SelectSessionGroupGrid Date/Time validation 666 667function DateTimeConflictValidation(managerId, gridClientIds, row, comboClientId, hdnUserSelectionClientIds, validateAgainstViewState, hdnUserSelectionInOtherPagesId, dateConflictMessage) { 668 var firstDateColumnIndex = 1; 669 var grids = gridClientIds.split(','); 670 var masterTables = []; 671 672 // Get all Master Tables 673 for (i = 0; i < grids.length; i++) { 674 if (grids[i]) // Not null or empty 675 masterTables[i] = $find(grids[i]).get_masterTableView().get_element(); 676 } 677 678 row++; // 0 in codebehind means first row but here means title row; 679 var comboClient = document.getElementById(comboClientId); 680 681 // Only if the user made a selection 682 if (comboClient.selectedIndex > 0) { 683 var selectedName = comboClient.options[comboClient.selectedIndex].getAttribute("SessionName"); 684 var selectedStartDate = comboClient.options[comboClient.selectedIndex].getAttribute("StartDate"); 685 var selectedEndDate = comboClient.options[comboClient.selectedIndex].getAttribute("EndDate"); 686 var selectedParticipantId = comboClient.options[comboClient.selectedIndex].getAttribute("ParticipantId"); 687 var selectedDisableConflictValidation = comboClient.options[comboClient.selectedIndex].getAttribute("DisableConflictValidation"); 688 689 // Validate the new selection against CRM actual selection (previous pages) 690 var oldSelections = document.getElementById(hdnUserSelectionInOtherPagesId).value.split(";"); 691 for (i = 0; i < oldSelections.length; i++) { 692 var oldParticipantId = oldSelections[i].split("|")[0]; 693 694 if (oldParticipantId == selectedParticipantId) { 695 var sessionName = oldSelections[i].split("|")[1]; 696 var startDate = oldSelections[i].split("|")[2]; 697 var endDate = oldSelections[i].split("|")[3]; 698 var disableConflictValidation = oldSelections[i].split("|")[4]; 699 700 if (selectedDisableConflictValidation == "False" && disableConflictValidation == "False") { 701 // If it is different day or a different instance of component then validate 702 if (sessionName != selectedName && TimePeriodOverlaps(startDate, endDate, selectedStartDate, selectedEndDate)) { 703 ShowAlertDialog(managerId, 'callBackFunction', replaceDateConflictMessage(dateConflictMessage, sessionName, startDate, endDate), "Date Conflict"); 704 comboClient.selectedIndex = 0; 705 return; 706 } 707 } 708 } 709 } 710 711 // Validate the new selection against ViewState (but the current day selection, which is validated against the grid) 712 if (validateAgainstViewState) { 713 var hiddens = hdnUserSelectionClientIds.split(','); 714 for (j = 0; j < hiddens.length; j++) { 715 if (hiddens[j]) { // Not null or empty 716 var selections = document.getElementById(hiddens[j].split(';')[0]).value.split(";"); 717 var dayNotValidateWithViewState = hiddens[j].split(';')[1]; 718 for (i = 0; i < selections.length; i++) { 719 var participantId = selections[i].split("|")[0]; 720 721 if (participantId == selectedParticipantId) { 722 var sessionName = selections[i].split("|")[1]; 723 var startDate = selections[i].split("|")[2]; 724 var endDate = selections[i].split("|")[3]; 725 var disableConflictValidation = selections[i].split("|")[4]; 726 727 if (selectedDisableConflictValidation == "False" && disableConflictValidation == "False") { 728 // If it is different day or a different instance of component then validate 729 if (startDate.substring(0, 8) != dayNotValidateWithViewState && TimePeriodOverlaps(startDate, endDate, selectedStartDate, selectedEndDate)) { 730 ShowAlertDialog(managerId, 'callBackFunction', replaceDateConflictMessage(dateConflictMessage, sessionName, startDate, endDate), "Date Conflict"); 731 comboClient.selectedIndex = 0; 732 return; 733 } 734 } 735 } 736 } 737 } 738 } 739 } 740 741 // Validate the new selection against other selections in these grids 742 for (i = 0; i < masterTables.length; i++) { 743 for (var column = firstDateColumnIndex; column < masterTables[i].rows[row].cells.length; column++) { 744 var cell = masterTables[i].rows[row].cells[column]; 745 var dropDown = cell.firstChild; 746 747 if (dropDown != null && dropDown.id != comboClientId) { 748 var sessionName = dropDown.options[dropDown.selectedIndex].getAttribute("SessionName"); 749 var startDate = dropDown.options[dropDown.selectedIndex].getAttribute("StartDate"); 750 var endDate = dropDown.options[dropDown.selectedIndex].getAttribute("EndDate"); 751 var disableConflictValidation = dropDown.options[dropDown.selectedIndex].getAttribute("DisableConflictValidation"); 752 753 if (selectedDisableConflictValidation == "False" && disableConflictValidation == "False") { 754 if (TimePeriodOverlaps(startDate, endDate, selectedStartDate, selectedEndDate)) { 755 ShowAlertDialog(managerId, 'callBackFunction', replaceDateConflictMessage(dateConflictMessage, sessionName, startDate, endDate), "Date Conflict"); 756 comboClient.selectedIndex = 0; 757 return; 758 } 759 } 760 } 761 } 762 } 763 } 764} 765 766function TimePeriodOverlaps(firstDateStart, firstDateEnd, secondDateStart, secondDateEnd) { 767 return !((secondDateStart <= firstDateStart && secondDateStart <= firstDateEnd && secondDateEnd <= firstDateStart && secondDateEnd <= firstDateEnd) || (secondDateStart >= firstDateStart && secondDateStart >= firstDateEnd && secondDateEnd >= firstDateStart && secondDateEnd >= firstDateEnd)); 768} 769 770function replaceDateConflictMessage(message, sessionName, startDate, endDate) { 771 var newStartDate = new Date(startDate.substring(0, 4) + "/" + startDate.substring(4, 6) + "/" + startDate.substring(6, 8) + " " + startDate.substring(8, 10) + ":" + startDate.substring(10, 12)); 772 var newEndDate = new Date(endDate.substring(0, 4) + "/" + endDate.substring(4, 6) + "/" + endDate.substring(6, 8) + " " + endDate.substring(8, 10) + ":" + endDate.substring(10, 12)); 773 774 return message.replace("[pa_eventsessioncodeidname]", sessionName).replace("[pa_sessionstartdate]", dateFormat(newStartDate, "mm/dd/yyyy hh:MM TT")).replace("[pa_sessionenddate]", dateFormat(newEndDate, "mm/dd/yyyy hh:MM TT")); 775} 776 777function UpdateConflictValidationInput(comboClientId, hdnUserSelectionInOtherPagesId) { 778 779 var comboClient = document.getElementById(comboClientId); 780 var selectedParticipantId; 781 var selectedName; 782 783 for (var i = 0; i < comboClient.options.length; i++) { 784 if (i != comboClient.selectedIndex) { 785 selectedParticipantId = comboClient.options[i].getAttribute("ParticipantId"); 786 selectedName = comboClient.options[i].getAttribute("SessionName"); 787 788 if (selectedParticipantId != null && selectedName != null) { 789 RemoveFromConflictValidationInputIfPresent(selectedParticipantId, selectedName, hdnUserSelectionInOtherPagesId); 790 } 791 } 792 } 793 794 // We set this value here for letting know other instances of this same component the changes done by this particular instance 795 $("input[name*='hdnUserSelectionInOtherPages']").val(document.getElementById(hdnUserSelectionInOtherPagesId).value); 796} 797 798function RemoveFromConflictValidationInputIfPresent(selectedParticipantId, sessionName, hdnUserSelectionInOtherPagesId) { 799 var oldSelections = document.getElementById(hdnUserSelectionInOtherPagesId).value.split(";"); 800 var updatedSelections = []; 801 802 for (i = 0; i < oldSelections.length; i++) { 803 var oldParticipantId = oldSelections[i].split("|")[0]; 804 var oldSessionName = oldSelections[i].split("|")[1]; 805 806 if (!(oldParticipantId == selectedParticipantId && oldSessionName == sessionName)) { 807 //if it hasn't been removed, keep the selection in the hidden field 808 updatedSelections.push(oldSelections[i]); 809 } 810 } 811 812 document.getElementById(hdnUserSelectionInOtherPagesId).value = updatedSelections.join(";"); 813} 814 815// SelectSessionsWaitList 816function OpenMeetingRegistrationSelectSessionsWaitList(managerId, pagesPath, message, containerPageTypeName, parentModuleName, parentControlTypeName, settingsControlId) { 817 // Open the popup 818 var manager = $find(managerId); 819 var wnd = manager.Open(pagesPath + "/MeetingRegistrationSelectSessionsWaitList.aspx?Message=" + escape(message) + "&ContainerPageTypeName=" + containerPageTypeName + "&ParentModuleName=" + parentModuleName + "&ParentControlTypeName=" + parentControlTypeName + "&SettingsControlId=" + settingsControlId); 820} 821 822function SelectSessionsWaitListClose(wnd, args) { 823 if (args.get_argument() != null && args.get_argument().action == "save") { 824 ShowLoadingMessage(); 825 __doPostBack('UpdateSessionsWaitList', ''); 826 } 827} 828 829// RadTabStrip 830function selectTabByText(tabStripClientId, tabText) { 831 var tabStrip = $find(tabStripClientId); 832 var tab = tabStrip.findTabByText(tabText); 833 if (tab && !tab.get_selected()) { 834 tab.set_selected(true); 835 } 836} 837 838// Billing and Shipping section within MX Shopping Cart 839function SetStateProvinceFieldVisibility(countriesDropDown, ddlStateProvinceId, txtStateProvinceId) { 840 var Country = countriesDropDown.options[countriesDropDown.selectedIndex].text.toLowerCase(); 841 842 if (Country == "united states" || Country == "us" || Country == "u.s." || Country == "usa" || Country == "u.s.a." || Country == "canada" || Country == "ca") { 843 document.getElementById(ddlStateProvinceId).style.display = 'block'; 844 document.getElementById(txtStateProvinceId).style.display = 'none'; 845 } 846 else { 847 document.getElementById(ddlStateProvinceId).style.display = 'none'; 848 document.getElementById(txtStateProvinceId).style.display = 'block'; 849 } 850} 851 852function SetStateProvinceAndPostalCodeFieldsIfRequired(countriesDropDown, divStateProvinceId, divPostalCodeId) { 853 var Country = countriesDropDown.options[countriesDropDown.selectedIndex].text.toLowerCase(); 854 855 if (Country == "united states" || Country == "us" || Country == "u.s." || Country == "usa" || Country == "u.s.a." || Country == "canada" || Country == "ca") { 856 document.getElementById(divStateProvinceId).classList.add("required"); 857 document.getElementById(divPostalCodeId).classList.add("required"); 858 } 859 else { 860 document.getElementById(divStateProvinceId).classList.remove("required"); 861 document.getElementById(divPostalCodeId).classList.remove("required"); 862 } 863} 864
865function OpenMembershipApplicationDuplicateRatesWindow(managerId, pagesPath, callerPageName, callerControlId, callerModule, callerComponent, callerResourceFilePrefix) { 866 // Open the popup 867 var manager = $find(managerId); 868 var wnd = manager.Open(pagesPath + "/MembershipApplicationDuplicateRates.aspx?pagesPath=" + pagesPath + " &callerPageName=" + callerPageName + "&callerControlId=" + callerControlId + "&callerModule=" + callerModule + "&callerComponent=" + callerComponent + "&callerResourceFilePrefix=" + callerResourceFilePrefix); 869} 870 871function Toggle(showHideDiv, switchTextDiv, textShow, textHide) { 872 var ele = document.getElementById(showHideDiv); 873 var text = document.getElementById(switchTextDiv); 874 875 if (ele.style.display == "block") { 876 ele.style.display = "none"; 877 text.innerHTML = textShow; 878 } 879 else { 880 ele.style.display = "block"; 881 text.innerHTML = textHide; 882 } 883} 884 885// This is just for responsive design in STD grids 886function AddHorizontalScrollToRadGrid(sender, args) { 887 $('.rgDataDiv').removeAttr('style'); 888 $('.rgDataDiv').attr('style', 'overflow-x: scroll;'); 889} 890 891function formatCurrency(n, currency) { 892 return currency + n.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,"); 893} 894 895function OnRadWindowClientShow(sender, args) {
896 var loadingObject = $get("loading"); 897 if (typeof loadingObject === 'object' && loadingObject !== null && 'cloneNode' in loadingObject) { 898 var loadingSign = loadingObject.cloneNode(true); 899 var contentCell = sender._contentCell; 900 901 if (contentCell && loadingSign) { 902 contentCell.classList.remove("rwLoading"); 903 contentCell.style.verticalAlign = "middle"; 904 contentCell.appendChild(loadingSign); 905 loadingSign.style.width = "100%"; 906 loadingSign.style.textAlign = "center"; 907 loadingSign.style.display = ""; 908 } 909 } 910} 911 912function OnRadWindowClientPageLoad(sender, args) { 913 var loadingSign = $get("loading"); 914 var contentCell = sender._contentCell; 915 916 if (contentCell && (contentCell.lastChild.id == "loading")) { 917 contentCell.removeChild(contentCell.lastChild); 918 contentCell.style.verticalAlign = ""; 919 } 920} 921 922function scrollToPosition(el) { 923 var xPos = 0; 924 var yPos = 0; 925 926 while (el) { 927 if (el.tagName == "BODY") { 928 // deal with browser quirks with body/window/document and page scroll 929 var xScroll = el.scrollLeft || document.documentElement.scrollLeft; 930 var yScroll = el.scrollTop || document.documentElement.scrollTop; 931 932 xPos += (el.offsetLeft - xScroll + el.clientLeft); 933 yPos += (el.offsetTop - yScroll + el.clientTop); 934 } else { 935 // for all other non-BODY elements 936 xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft); 937 yPos += (el.offsetTop - el.scrollTop + el.clientTop); 938 } 939 940 el = el.offsetParent; 941 } 942 943 window.scrollTo(0, yPos); 944} 945 946function isNumber(event) { 947 keys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] 948 return keys.indexOf(event.key) > -1; 949} 950 951function ddlQuantity_Change(ddlQuantity, txtQuantity, doPostBack) { 952 if (ddlQuantity.value == "") { 953 txtQuantity.classList.add("d-block"); 954 txtQuantity.focus(); 955 ddlQuantity.classList.remove("d-inline-block"); 956 ddlQuantity.classList.add("d-none"); 957 } 958 else { 959 txtQuantity.value = ddlQuantity.value; 960 if (doPostBack) __doPostBack(ddlQuantity.id); 961 } 962} 963 964function txtQuantity_KeyUp(txtQuantity, hidQuantity, btnUpdate) { 965 if (txtQuantity.value != hidQuantity.value && txtQuantity.value != "") 966 btnUpdate.classList.add("d-block"); 967 else 968 btnUpdate.classList.remove("d-block"); 969} 970 971function txtQuantity_Blur(txtQuantity, hidQuantity) { 972 if (txtQuantity.value == "") 973 txtQuantity.value = hidQuantity.value; 974} 975 976function SaveMoreModal(modalId) { 977 $('#' + modalId).modal('hide'); 978 return true; 979} 980 981function expandAll(sectionId) { 982 // Main fieldset and second level 983 if ($("#" + sectionId).hasClass("collapse")) { 984 $("#" + sectionId).addClass('show'); 985 $("#" + sectionId + " .collapse").addClass('show'); 986 } 987 else { 988 // Only Second level 989 $("#" + sectionId + " .collapse").addClass('show'); 990 } 991} 992 993function collapseAll(sectionId) { 994 // Main fieldset and second level 995 if ($("#" + sectionId).hasClass("collapse")) { 996 $("#" + sectionId).removeClass('show'); 997 $("#" + sectionId + " .collapse").removeClass('show'); 998 } 999 else { 1000 // Only Second level 1001 $("#" + sectionId + " .collapse").removeClass('show'); 1002 } 1003} 1004 1005function ShowProcessLoadingMessage(action) { 1006 try { 1007 createProcessingText(); 1008 DisablePaymentsPage(); 1009 1010 var div = document.getElementById("loading"); 1011 1012 if (div) { 1013 div.style.display = ""; 1014 div.style.color = "#ffffff"; 1015 centerLoaderOnScreen(div); 1016 } 1017 } 1018 catch (ex) { 1019 console.error(ex.message); 1020 } 1021} 1022 1023 1024function createProcessingText() { 1025 1026 var processingdiv = document.createElement("div"); 1027 processingdiv.id = "processdiv"; 1028 processingdiv.style.position = "fixed"; 1029 processingdiv.style.top = "50%"; 1030 processingdiv.style.left = "3%"; 1031 processingdiv.style.alignContent = "center"; 1032 processingdiv.style.width = "95vw"; 1033 processingdiv.style.height = "50px"; 1034 processingdiv.style.zIndex = "1003"; 1035 processingdiv.style.textAlign = "center"; 1036 processingdiv.style.color = "#ffffff"; 1037 processingdiv.innerHTML = "<div><h3 style='color:#ffffff;'>
1037Payment in progress... Thank you for your patience. <br/> Please do not refresh or leave the page.</h3></div>"; 1038 1039 document.body.appendChild(processingdiv); 1040} 1041 1042function DisablePaymentsPage() { 1043 var div = document.createElement("div"); 1044 div.id = "disablingDiv"; 1045 1046 var opacity = 8; 1047 var height = document.body.offsetHeight; 1048 1049 div.style.position = "absolute"; 1050 div.style.top = "0%"; 1051 div.style.left = "0%"; 1052 div.style.width = "100%"; 1053 div.style.height = height + "px"; 1054 div.style.backgroundColor = "#000000"; 1055 div.style.opacity = opacity / 10; 1056 div.style.filter = "alpha(opacity=" + opacity * 10 + ")"; 1057 div.style.zIndex = "1001"; 1058 1059 if (document.body.firstChild) { 1060 document.body.insertBefore(div, document.body.firstChild); 1061 } else { 1062 document.body.appendChild(div); 1063 } 1064} 1065 1066function centerLoaderOnScreen(element) { 1067 element.style.position = "fixed"; // Use 'fixed' for consistent positioning 1068 element.style.top = "40%"; // Center vertically 1069 element.style.left = "50%"; // Center horizontally 1070 element.style.transform = "translate(-50%, -50%)"; // Adjust to truly center the element 1071} 1072function hideloadingMessage() { 1073 var div = document.getElementById("loading"); 1074 if (div) div.style.display = "none"; 1075 1076 var divprocesses = document.querySelectorAll("#processdiv"); 1077 divprocesses.forEach(function (divprocess) { 1078 divprocess.style.display = "none"; 1079 }); 1080 1081 var disabledivs = document.querySelectorAll("#disablingDiv"); 1082 disabledivs.forEach(function (disablediv) { 1083 disablediv.style.display = "none"; 1084 }); 1085}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.