1var loadingAsMobile = false; 2 3try { 4 loadingAsMobile = (getCookie("LoadingAsMobile") == "true"); 5} catch (e) { 6} 7 8var sitePath = ""; 9 10try { 11 sitePath = (getCookie("_SitePath")); 12} catch (e) { 13} 14 15Date.now = Date.now || function () { return +new Date; }; 16 17$j(document).ready(function () { 18 if (!window.JSON) $j.getScript("A_Master/library/js/json2.js"); 19 prependSploaders(); moveSwaps(); crm_Init(); 20 try { if (document.location.href.indexOf("autoLaunchBL=true") > 0) LaunchbuddyListiframe(); } catch (e) { } 21 initBackToMobile(); 22 23 if ($j(".formDatePicker").length !== 0) { 24 $j(".formDatePicker").datepicker({ 25 minDate: "1/1/1900", 26 maxDate: "1/1/2100" 27 }); 28 $j("#ui-datepicker-div").hide(); 29 } 30 31 if ($j(".formControlCell .maskTextbox").length !== 0) { 32 33 $j(".formControlCell .maskDisplayTextbox").hide(); 34 35 $j(".formControlCell .maskTextbox").focus(function () { 36 $j("#" + $j(this).attr("id").replace("_mask", "")).show().select(); 37 $j(this).hide(); 38 }); 39 40 $j(".formControlCell .maskDisplayTextbox").blur(function () { 41 $j(this).hide(); 42 $j("#" + $j(this).attr("id") + "_mask").show(); 43 44 if ($j(this).val() !== "") { 45 $j("#" + $j(this).attr("id") + "_mask").val("00000000"); 46 } else { 47 $j("#" + $j(this).attr("id") + "_mask").val(""); 48 } 49 }); 50 51 } 52 53 if ($j(".formMaskedInput").length !== 0) { 54 $j(".formMaskedInput").hover( 55 function () { $j(this).html($j(this).attr("value")); }, 56 function () { $j(this).html("********"); } 57 ); 58 } 59 60 if ($j(".dialogToolbar").length !== 0) { 61 $j("<div/>").addClass("dialogToolbarPad").appendTo("body"); 62 /* toolbars disappear in safari, this fixes it */ 63 $j(".dialogToolbar").css("position", "absolute"); 64 window.setTimeout("$j(\".dialogToolbar\").css(\"position\", \"fixed\");", 100); 65 } 66 67 if (getCookie("clearSessionStorage") == "true") { 68 clearSessionStorage(); 69 setCookie("clearSessionStorage", "false", 1) 70 } 71 72 window.setTimeout(function () { $j(".dialogToolbar .dialogToolbarMessage").fadeOut(); }, 2500); 73}); 74 75function getParameterByName(name) { 76 name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); 77 var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), 78 results = regex.exec(location.search); 79 return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); 80} 81 82function clearSessionStorage() { 83 if (useSessionStorage()) { 84 try { 85 window.opener.sessionStorage.clear(); 86 } catch (e) { } 87 try { 88 window.sessionStorage.clear(); 89 } catch (e) { } 90 } 91} 92function initBackToMobile() { 93 var btm = $j("#returnToMobileVersion").html("View Mobile Site<div></div>").click(function () { 94 document.location.href = 'default.aspx?p=membersdefault&setAsMobile=true'; 95 }); 96 if (btm) { 97 btm.find("div").click(function (event) { 98 $j("#returnToMobileVersion").hide("slide", { direction: "down" }); 99 $j(window).unbind("resize"); 100 if (useSessionStorage()) sessionStorage.setItem("hideMobile", true); 101 event.stopPropagation(); 102 }); 103 if (useSessionStorage() && sessionStorage.getItem("hideMobile")) { 104 btm.detach(); 105 } else if (window.location.href.toLowerCase().indexOf('=crm_') > 0) { 106 btm.detach(); 107 } else { 108 $j(window).resize(function () { 109 if ((document.documentElement.clientWidth / window.innerWidth) <= 1.25) { 110 $j("#returnToMobileVersion").show(); 111 } else { 112 $j("#returnToMobileVersion").hide(); 113 } 114 }); 115 } 116 } 117} 118function useSessionStorage() { 119 try { 120 if (sessionStorage) { 121 try { 122 sessionStorage.setItem("testKey", 1); 123 sessionStorage.removeItem("testKey"); 124 return true; 125 } catch (error) { 126 if (error.code === DOMException.QUOTA_EXCEEDED_ERR && sessionStorage.length === 0) return false; 127 } 128 } 129 } catch (error) { 130 return false; 131 } 132 return false; 133} 134 135function isCheckboxChecked(cb) { 136 if (cb.attr("checked") == "checked") return true; 137 if (cb.attr("checked")) return true; 138 return false; 139} 140function dataFix(d) { 141 try { 142 return (d.d) ? d.d : d; 143 } catch (e) { 144 return d; 145 } 146} 147function prependSploaders() { 148 var Sploders = $j("body").find(".sploder"); 149 150 for (i = 0; i < Sploders.length; i++) { 151 $j(Sploders[i]).css('display', 'none'); 152 var iframeSrc = GetIFrameSource($j(Sploders[i]).find('iframe').get(0)); 153 var MoveDiv = $j(Sploders[i]).detach(); 154 $j("#defaultnetform").prepend(MoveDiv); 155 $j("#BillPayForm").prepend(MoveDiv); 156 $j("#frmAdminConsole").prepend(MoveDiv); 157 if (iframeSrc.toLowerCase().indexOf('http') >= 0) { SetIFrameSource($j(MoveDiv).find('iframe').get(0), iframeSrc); } 158 } 159} 160function moveSwaps() { 161 var Swaps = $j("body").find(".swap"); 162 163 for (i = 0; i < Swaps.length; i++) { 164 var moveTo = $j(Swaps[i]).attr('moveTo'); 165 var MoveDiv = $j(Swaps[i]).detach(); 166 $j("#" + moveTo).append(MoveDiv); 167 } 168} 169function GetIFrameSource(myframe) { 170 try { 171 if (myframe !== null) {
172 if (myframe.src) { 173 return myframe.src; 174 } 175 else if (myframe.contentWindow !== null && myframe.contentWindow.location !== null) { 176 return myframe.contentWindow.location.href; 177 } 178 else { return myframe.getAttribute('src'); } 179 } 180 } catch (e) { return ''; } 181} 182function SetIFrameSource(myframe, src) { 183 if (myframe !== null) { 184 if (myframe.src) { 185 myframe.src = src; 186 } 187 else if (myframe.contentWindow !== null && myframe.contentWindow.location !== null) { 188 myframe.contentWindow.location.href = src; 189 } 190 else { return myframe.setAttribute('src', src); } 191 } 192} 193function urlWithoutHash() { 194 var url = window.location.href; 195 var hash = window.location.hash; 196 var index_of_hash = url.indexOf(hash) || url.length; 197 var hashless_url = url.substr(0, index_of_hash); 198 return hashless_url; 199} 200function doSpell(frm, fld) { 201 //window.open("spellchecker/window.asp?jsvar=document."+frm+"."+fld+".value", null, "height=230,width=450,status=no,toolbar=no,menubar=no,location=no"); 202 window.open("spellchecker/default.asp?jsvar=document." + frm + "." + fld + ".value", null, "height=230,width=450,status=no,toolbar=no,menubar=no,location=no"); 203} 204function KeepAlive() { 205 var urlpath = document.location.href; 206 urlpath = urlpath.substring(7, urlpath.length - 7); 207 var i 208 if (urlpath.indexOf('ceclients') >= 0) { 209 i = urlpath.indexOf('/d'); 210 if (i < 0) { 211 i = urlpath.indexOf('/D'); 212 } 213 214 } 215 else { 216 i = urlpath.indexOf('/'); 217 } 218 219 urlpath = 'http://' + urlpath.substring(0, i + 1); 220 if (urlpath.length <= 7) { 221 urlpath = document.location.href + ''; 222 } 223 KeepAliveDiv.innerHTML = "<img src='" + urlpath + "/A_master/NET/RadEditor/getImage.aspx?ID=522142' alt=''>"; 224 setTimeout('KeepAlive()', 600000); 225} 226function sessionExpire() { 227 // The URL for the facility detail 228 var url = 'default.aspx?p=home&logout=true'; 229 var urlpath = document.location.href; 230 urlpath = urlpath.substring(7, urlpath.length - 7); 231 var i 232 if (urlpath.indexOf('ceclients') >= 0) { 233 i = urlpath.indexOf('/d'); 234 if (i < 0) { 235 i = urlpath.indexOf('/D'); 236 } 237 238 } 239 else { 240 i = urlpath.indexOf('/'); 241 } 242 243 urlpath = 'http://' + urlpath.substring(0, i + 1); 244 if (urlpath.length <= 7) { 245 urlpath = document.location.href + ''; 246 } 247 248 url = urlpath + url; 249 if (window.parent == null) { 250 document.location.href = url; 251 } 252 else { 253 window.parent.location.href = url; 254 } 255 alert("Your Session Has Expired.\nPlease Log Back in to Continue."); 256} 257 258function OpenNewWindow(url, name, options) { 259 var temp = window.open(url, name, options); 260 if (temp) { 261 temp.focus(); 262 } else { 263 alert('Please Enable popups for this site to continue'); return false; 264 } 265 return temp; 266} 267function OpenModule(WName, PageName, Width, Height, Parameters) { 268 var temp = OpenModule2(WName, PageName, Width, Height, Parameters, 0, 0, 0, 1, 0, 1); 269} 270function OpenModule2(WName, PageName, Width, Height, Parameters, Menubar, ToolBar, Location, ScrollBar, StatusBar, Resize) { 271 // The URL for the facility detail 272 var url = 'default.aspx?p=' + PageName + '&NoModResize=1&NoNav=1&ShowFooter=False&' + Parameters; 273 var urlpath = document.location.href; 274 275 var isHTTPS = (urlpath.indexOf("https://") != -1) ? true : false; 276 277 urlpath = (isHTTPS) ? urlpath.substring(8, urlpath.length - 8) : urlpath.substring(7, urlpath.length - 7); 278 279 var i; 280 281 282 if (urlpath.indexOf('ceclients') >= 0) { 283 i = urlpath.indexOf('/d'); 284 if (i < 0) { 285 i = urlpath.indexOf('/D'); 286 } 287 288 } 289 else { 290 i = urlpath.indexOf('/'); 291 } 292 293 var directive = (isHTTPS) ? "https://" : "http://"; 294 295 urlpath = directive + urlpath.substring(0, i + 1); 296 297 if (urlpath.length <= 7) { 298 urlpath = document.location.href + ''; 299 } 300 301 url = urlpath + url; 302 // Open the window 303 var temp = OpenURL(url, WName, Width, Height, Menubar, ToolBar, Location, ScrollBar, StatusBar, Resize); 304} 305 306function OpenURL(url, WName, Width, Height, Menubar, ToolBar, Location, ScrollBar, StatusBar, Resize) { 307 308 // Get the window settings, set defaults if no settings are provided 309 if (ToolBar == 1) { showToolBar = 'toolbar=yes'; } else { showToolBar = 'toolbar=no'; } 310 if (Menubar == 1) { showMenuBar = 'menubar=yes'; } else { showMenuBar = 'menubar=no'; } 311 if (Location == 1) { showLocation = 'location=yes'; } else { showLocation = 'location=no'; } 312 if (ScrollBar == 1) { showScrollBar = 'scrollbars=yes'; } else { showScrollBar = 'scrollbars=no'; } 313 if (StatusBar == 1) { showStatusBar = 'status=yes'; } else { showStatusBar = 'status=no'; } 314 if (Resize == 1) { showResize = 'resizable=yes'; } else { showResize = 'resizable=no'; } 315 316 // Get this window's position 317 var x = 0; 318 var y = 0; 319 var w = 0; 320 var h = 0; 321 w = screen.AvailWidth; 322 h = screen.AvailHeight; 323 324 // Modify the position - CENTER THE NEW WINDOW 325 x = (w - Width) / 2; 326 y = (h - Height) / 2; 327 328 // Open the window 329 var temp = OpenNewWindow(url, WName, 'width=' + Width + ',height=' + Height + ',' + showStatusBar + ',' + showToolBar + ',' + showMenuBar + ',' + showLocation + ',' + showScrollBar + ',' + showResize + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y); 330 if (WName == 'billing') { setTimeout('try{parent.navmenu.location.href = parent.navmenu.location.href;}catch(e){} window.location.href=window.location.href;', 5000); } 331} 332 333 334function underconstruction() { 335 alert('This feature is under construction'); 336} 337 338function rowon(row) { 339 row.className = 'rowhighlight'; 340} 341 342function rowoff(row) { 343 row.className = 'tnavTabContent'; 344} 345 346function rowHoverOn(row) { 347 row.className = 'rowHover'; 348} 349 350function rowHoverOff(row) { 351 row.className = 'rowNormal'; 352} 353 354 355function Left(str, n) { 356 if (n <= 0) // Invalid bound, return blank string 357 return ''; 358 else if (n > String(str).length) // Invalid bound, return 359 return str;
359 // entire string 360 else // Valid bound, return appropriate substring 361 return String(str).substring(0, n); 362} 363 364function Right(str, n) { 365 if (n <= 0) // Invalid bound, return blank string 366 return ""; 367 else if (n > String(str).length) // Invalid bound, return 368 return str; // entire string 369 else { // Valid bound, return appropriate substring 370 var iLen = String(str).length; 371 return String(str).substring(iLen, iLen - n); 372 } 373} 374 375 376 377 378 379 380 381 382/** 383* DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/) 384**/ 385 386// Declaring valid date character, minimum year and maximum year 387var dtCh = "/"; 388var minYear = 1900; 389var maxYear = 2100; 390 391function isInteger(s) { 392 var i; 393 for (i = 0; i < s.length; i++) { 394 // Check that current character is number. 395 var c = s.charAt(i); 396 if (((c < "0") || (c > "9"))) return false; 397 } 398 // All characters are numbers. 399 return true; 400} 401 402function stripCharsInBag(s, bag) { 403 var i; 404 var returnString = ""; 405 // Search through string's characters one by one. 406 // If character is not in bag, append to returnString. 407 for (i = 0; i < s.length; i++) { 408 var c = s.charAt(i); 409 if (bag.indexOf(c) == -1) returnString += c; 410 } 411 return returnString; 412} 413 414function daysInFebruary(year) { 415 // February has 29 days in any year evenly divisible by four, 416 // EXCEPT for centurial years which are not also divisible by 400. 417 return (((year % 4 == 0) && ((!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28); 418} 419function DaysArray(n) { 420 for (var i = 1; i <= n; i++) { 421 this[i] = 31 422 if (i == 4 || i == 6 || i == 9 || i == 11) { this[i] = 30 } 423 if (i == 2) { this[i] = 29 } 424 } 425 return this 426} 427 428function isDate(dtStr) { 429 var daysInMonth = DaysArray(12) 430 var pos1 = dtStr.indexOf(dtCh) 431 var pos2 = dtStr.indexOf(dtCh, pos1 + 1) 432 var strMonth = dtStr.substring(0, pos1) 433 var strDay = dtStr.substring(pos1 + 1, pos2) 434 var strYear = dtStr.substring(pos2 + 1) 435 strYr = strYear 436 if (strDay.charAt(0) == "0" && strDay.length > 1) strDay = strDay.substring(1) 437 if (strMonth.charAt(0) == "0" && strMonth.length > 1) strMonth = strMonth.substring(1) 438 for (var i = 1; i <= 3; i++) { 439 if (strYr.charAt(0) == "0" && strYr.length > 1) strYr = strYr.substring(1) 440 }
441 month = parseInt(strMonth) 442 day = parseInt(strDay) 443 year = parseInt(strYr) 444 if (pos1 == -1 || pos2 == -1) { 445 alert("The date format should be : mm/dd/yyyy") 446 return false 447 } 448 if (strMonth.length < 1 || month < 1 || month > 12) { 449 alert("Please enter a valid month") 450 return false 451 } 452 if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day > daysInFebruary(year)) || day > daysInMonth[month]) { 453 alert("Please enter a valid day") 454 return false 455 } 456 if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear) { 457 alert("Please enter a valid 4 digit year between " + minYear + " and " + maxYear) 458 return false 459 } 460 if (dtStr.indexOf(dtCh, pos2 + 1) != -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false) { 461 alert("Please enter a valid date") 462 return false 463 } 464 return true 465} 466 467 468 469function dateDiff(psDateVal1, psDateVal2) { 470 date1 = new Date(); 471 date2 = new Date(); 472 diff = new Date(); 473 474 var psTimeVal1 = '01:00:00'; 475 var psTimeVal2 = '01:00:00'; 476 477 if (isDate(psDateVal1)) { // Validates first date 478 date1temp = new Date(psDateVal1 + " " + psTimeVal1); 479 date1.setTime(date1temp.getTime()); 480 } 481 else return false; // otherwise exits 482 483 484 if (isDate(psDateVal2)) { // Validates second date 485 date2temp = new Date(psDateVal2 + " " + psTimeVal2); 486 date2.setTime(date2temp.getTime()); 487 } 488 else return false; // otherwise exits 489 490 // sets difference date to difference of first date and second date 491 492 diff.setTime(date2.getTime() - date1.getTime()); 493 494 timediff = diff.getTime(); 495 496 if (timediff >= 0) { 497 return true; 498 } else { 499 return false; 500 } 501 502} 503 504 505function checkadate(chkMonth, chkDay, chkYear) { 506 /*Validate Date DropDown Selection fields (Dropdown Month, Dropdown Day, text field Year)*/ 507 var checkOK = "0123456789"; 508 var checkStr = chkYear.value; 509 var allValid = true; 510 var decPoints = 0; 511 var allNum = ""; 512 for (i = 0; i < checkStr.length; i++) { 513 ch = checkStr.charAt(i); 514 for (j = 0; j < checkOK.length; j++) 515 if (ch == checkOK.charAt(j)) 516 break; 517 if (j == checkOK.length) { 518 allValid = false; 519 break; 520 } 521 allNum += ch; 522 } 523 524 if (!allValid) { 525 alert("Please enter only numbers in the \"chkYear\" field."); 526 chkYear.focus(); 527 return (false); 528 } 529 530 var chkVal = allNum; 531 var prsVal = parseInt(allNum); 532 if (chkVal != "" && !(prsVal >= "1900" && prsVal <= "2100")) { 533 alert("Please enter a value greater than or equal to \"1900\" and less than or equal to \"2100\" in the Year field."); 534 chkYear.focus(); 535 return (false); 536 } 537 538 var piSumDate = 0; 539 if (chkMonth.selectedIndex != 0) { piSumDate = 1; } 540 if (chkDay.selectedIndex != 0) { piSumDate = piSumDate + 1; } 541 if (chkYear.value != "") { piSumDate = piSumDate + 1; } 542 543 if (piSumDate == 0) { 544 //no field values entered... no checking required 545 } else if (piSumDate == 3) { 546 var usrBirthDate = chkMonth.value + '/' + chkDay.value + '/' + chkYear.value; 547 if (isDate(usrBirthDate) == false) { 548 chkDay.focus(); 549 return (false); 550 } 551 } else { 552 alert('Please enter the Month, Day and Year for the date'); 553 chkYear.focus(); 554 return (false); 555 } 556 557 return (true); 558} 559 560function checkanumber(chkNumber) { 561 var checkOK = "0123456789"; 562 var checkStr = chkNumber.value; 563 var allValid = true; 564 var decPoints = 0; 565 var allNum = ""; 566 for (i = 0; i < checkStr.length; i++) { 567 ch = checkStr.charAt(i); 568 for (j = 0; j < checkOK.length; j++) 569 if (ch == checkOK.charAt(j)) 570 break; 571 if (j == checkOK.length) { 572 allValid = false; 573 break; 574 } 575 allNum += ch; 576 } 577 if (!allValid) { 578 alert("Please enter only numbers in the field."); 579 chkNumber.focus(); 580 return (false); 581 } 582 583} 584 585function ScrollIt() { 586 //if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) 587 //{ 588 // theform = document.defaultnetform; 589 //} else { 590 // theform = document.forms["defaultnetform"]; 591 // } 592 //alert(document.getElementById("PageX").value); 593 // window.scrollTo(theform.PageX.value, theform.PageY.value); 594 window.scrollTo(document.getElementById("PageX").value, document.getElementById("PageY").value); 595} 596function setcoords() { 597 var myPageX; 598 var myPageY; 599 try { 600 if (typeof (window.pageYOffset) == 'number') { 601 //Netscape compliant 602 myPageY = window.pageYOffset; 603 myPageX = window.pageXOffset; 604 } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { 605 //DOM compliant 606 myPageY = document.body.scrollTop; 607 myPageX = document.body.scrollLeft; 608 } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { 609 //IE6 standards compliant mode 610 myPageY = document.documentElement.scrollTop; 611 myPageX = document.documentElement.scrollLeft; 612 } 613 //if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) 614 // { 615 // theform = document.defaultnetform; 616 // } else { 617 // theform = document.forms["defaultnetform"]; 618 // } 619 document.getElementById("PageX").value = myPageX; 620 document.getElementById("PageY").value = myPageY; 621 } catch (ex) { } 622 var AdminBarDiv = document.getElementById('SlidingAdminDiv'); 623 try { 624 setAdminBarPosition(); 625 } 626 catch (err) { } 627 try { 628 if (AdminBarDiv != null) { 629 AdminBarDiv.style.top = myPageY; 630 } 631 } 632 catch (err) { 633 if (AdminBarDiv != null) { 634 AdminBarDiv.style.top = 0; 635 } 636 } 637 try { 638 ScrollTheDiv(); 639 } 640 catch (err) { 641 } 642 643} 644 645var datePickerDivID = "datepicker"; 646var iFrameDivID = "datepickeriframe"; 647var updateDateFunctionName = "updateDateField"; 648var dateSeparator; 649var dateFormat; 650 651var dayArray = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'); 652var monthArray = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); 653 654function displayDatePicker(dateFieldName, displayBelowThisObject) { 655 dateSeparator = "/"; 656 dateFormat = "mdy"; 657 targetDatePicker(dateFieldName, displayBelowThisObject); 658} 659 660function displayDatePickerYearMonthDay(dateFieldName, displayBelowThisObject) { 661 dateSeparator = "-"; 662 dateFormat = "ymd"; 663 targetDatePicker(dateFieldName, displayBelowThisObject); 664} 665 666function targetDatePicker(dateFieldName, displayBelowThisObject) { 667 var targetDateField; 668 targetDateField = document.getElementById(dateFieldName); 669 if (!displayBelowThisObject) displayBelowThisObject = targetDateField; 670
671 var x = displayBelowThisObject.offsetLeft; 672 var y = displayBelowThisObject.offsetTop + displayBelowThisObject.offsetHeight; 673 // deal with elements inside tables and such 674 var parent = displayBelowThisObject; 675 while (parent.offsetParent) { 676 parent = parent.offsetParent; 677 x += parent.offsetLeft; 678 y += parent.offsetTop; 679 } 680 drawDatePicker(targetDateField, x, y); 681} 682 683function drawDatePicker(targetDateField, x, y) { 684 var dt = getFieldDate(targetDateField.value); 685 if (!document.getElementById(datePickerDivID)) { 686 var newNode = document.createElement("div"); 687 newNode.setAttribute("id", datePickerDivID); 688 newNode.setAttribute("class", "dpDiv"); 689 newNode.setAttribute("style", "visibility: hidden;"); 690 document.body.appendChild(newNode); 691 } 692 var pickerDiv = document.getElementById(datePickerDivID); 693 pickerDiv.style.position = "absolute"; 694 pickerDiv.style.left = x + "px"; 695 pickerDiv.style.top = y + "px"; 696 pickerDiv.style.visibility = (pickerDiv.style.visibility == "visible" ? "hidden" : "visible"); 697 pickerDiv.style.display = (pickerDiv.style.display == "block" ? "none" : "block"); 698 pickerDiv.style.zIndex = 99998; 699 refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate()); 700} 701function drawStaticDatePicker(customDatePickerDivID, dateFieldName) { 702 var targetDateField; 703 dateSeparator = "/"; 704 dateFormat = "mdy" 705 targetDateField = document.getElementById(dateFieldName); 706 var dt = getFieldDate(targetDateField.value); 707 datePickerDivID = customDatePickerDivID; 708 var pickerDiv = document.getElementById(datePickerDivID); 709 pickerDiv.style.visibility = "visible" 710 pickerDiv.style.display = "block" 711 pickerDiv.style.zIndex = 99998; 712 updateDateFunctionName = "updateDateFieldStatic"; 713 refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate()); 714} 715function refreshDatePicker(dateFieldName, year, month, day) { 716 var thisDay = new Date(); 717 if ((month >= 0) && (year > 0)) { 718 thisDay = new Date(year, month, 1); 719 } else { 720 day = thisDay.getDate(); 721 thisDay.setDate(1); 722 } 723 var crlf = "\r\n"; 724 var TABLE = "<table cellpadding=0 cellspacing=0 width=210 cols=7 class='page'>" + crlf; 725 var xTABLE = "</table>" + crlf; 726 var TR = "<tr class='plgHeaderBar'>"; 727 var TR_title = "<tr height=25 class='plgCalendarHeader'>"; 728 var TR_days = "<tr align=center class='plgCalendarHeader'>"; 729 var TR_todaybutton = "<tr height=18 class='plgCalendarHeader'>"; 730 var xTR = "</tr>" + crlf; 731 var TD = "<td align=center width=14% height=10 valign=middle class='plgCalendarWeekday' onMouseOut='this.className=\"plgCalendarWeekday\";' style='text-decoration:none;cursor:hand;border:1px solid #FFFFFF;' onMouseOver='this.className=\"plgCalendarDayOn\";' "; // leave this tag open, because we'll be adding an onClick event 732 var TD_title = "<td align=center colspan=5 class='plgHeaderBar'>"; 733 var TD_buttons = "<td align=center class='plgHeaderBar'>"; 734 var TD_todaybutton = "<td align=center colspan=7 class='plgHeaderBar'>"; 735 var TD_days = "<td width=14% align=center class='plgCalendarHeader'>"; 736 var TD_selected = "<td align=center width=14% height=10 valign=middle class='plgCalendarWeekday' onMouseOut='this.className=\"plgCalendarWeekday\";' style='text-decoration:none;cursor:hand;border:1px solid #FF0000;' onMouseOver='this.className=\"plgCalendarDayOn\";' "; // leave this tag open, because we'll be adding an onClick event 737 var xTD = "</td>" + crlf; 738 var DIV_title = "<div class='plgHeaderBar'>"; 739 var DIV_selected = "<div>"; 740 var xDIV = "</div>"; 741 var html = TABLE; 742 html += TR_title; 743 html += TD_buttons + getButtonCode(dateFieldName, thisDay, -1, "<font size=2>«</font>") + xTD; 744 html += TD_title + DIV_title + monthArray[thisDay.getMonth()] + " " + thisDay.getFullYear() + xDIV + xTD; 745 html += TD_buttons + getButtonCode(dateFieldName, thisDay, 1, "<font size=2>»</font>") + xTD; 746 html += xTR; 747 html += TR_days; 748 for (i = 0; i < dayArray.length; i++) 749 html += TD_days + dayArray[i] + xTD; 750 html += xTR; 751 html += TR; 752 for (i = 0; i < thisDay.getDay(); i++) 753 html += "<td class=page>
753" + " " + "</td>"; 754 do { 755 dayNum = thisDay.getDate(); 756 TD_onclick = " onclick=\"" + updateDateFunctionName + "('" + dateFieldName + "', '" + getDateString(thisDay) + "');\">"; 757 if (dayNum == day) 758 html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD; 759 else 760 html += TD + TD_onclick + dayNum + xTD; 761 if (thisDay.getDay() == 6) 762 html += xTR + TR; 763 thisDay.setDate(thisDay.getDate() + 1); 764 } while (thisDay.getDate() > 1) 765 if (thisDay.getDay() > 0) { 766 for (i = 6; i > thisDay.getDay(); i--) 767 html += "<td class=page>" + " " + "</td>"; 768 } 769 html += xTR; 770 var today = new Date(); 771 var todayString = "Today is " + dayArray[today.getDay()] + ", " + monthArray[today.getMonth()] + " " + today.getDate(); 772 html += TR_todaybutton; 773 html += "<td align=left colspan=4 class='plgHeaderBar'><a class='plgHeaderBarAction' style='cursor:hand;' onClick='refreshDatePicker(\"" + dateFieldName + "\");'>Jump To Today</a></td>"; 774 html += "<td align=right colspan=3 class='plgHeaderBar'><a class='plgHeaderBarAction' style='cursor:hand;' onClick='" + updateDateFunctionName + "(\"" + dateFieldName + "\");'>Close X</a></td>"; 775 html += xTR; 776 html += xTABLE; 777 778 document.getElementById(datePickerDivID).innerHTML = html; 779 adjustiFrame(); 780} 781function getButtonCode(dateFieldName, dateVal, adjust, label) { 782 var newMonth = (dateVal.getMonth() + adjust) % 12; 783 var newYear = dateVal.getFullYear() + parseInt((dateVal.getMonth() + adjust) / 12); 784 if (newMonth < 0) { 785 newMonth += 12; 786 newYear += -1; 787 } 788 return "<a class='plgHeaderBarAction' style='cursor:hand;' onClick='refreshDatePicker(\"" + dateFieldName + "\", " + newYear + ", " + newMonth + ");'>" + label + "</a>"; 789} 790function getDateString(dateVal) { 791 var dayString = "00" + dateVal.getDate(); 792 var monthString = "00" + (dateVal.getMonth() + 1); 793 dayString = dayString.substring(dayString.length - 2); 794 monthString = monthString.substring(monthString.length - 2); 795 switch (dateFormat) { 796 case "dmy": 797 return dayString + dateSeparator + monthString + dateSeparator + dateVal.getFullYear(); 798 case "ymd": 799 return dateVal.getFullYear() + dateSeparator + monthString + dateSeparator + dayString; 800 case "mdy": 801 default: 802 return monthString + dateSeparator + dayString + dateSeparator + dateVal.getFullYear(); 803 } 804} 805function getFieldDate(dateString) { 806 var dateVal; 807 var dArray; 808 var d, m, y; 809 try { 810 dArray = splitDateString(dateString); 811 if (dArray) { 812 switch (dateFormat) { 813 case "dmy": 814 d = parseInt(dArray[0], 10); 815 m = parseInt(dArray[1], 10) - 1; 816 y = parseInt(dArray[2], 10); 817 break; 818 case "ymd": 819 d = parseInt(dArray[2], 10); 820 m = parseInt(dArray[1], 10) - 1; 821 y = parseInt(dArray[0], 10); 822 break; 823 case "mdy": 824 default: 825 d = parseInt(dArray[1], 10); 826 m = parseInt(dArray[0], 10) - 1; 827 y = parseInt(dArray[2], 10); 828 break; 829 } 830 dateVal = new Date(y, m, d); 831 } else if (dateString) { 832 dateVal = new Date(dateString); 833 } else { 834 dateVal = new Date(); 835 } 836 } catch (e) { 837 dateVal = new Date(); 838 } 839 return dateVal; 840} 841function splitDateString(dateString) { 842 var dArray; 843 if (dateString.indexOf("/") >= 0) 844 dArray = dateString.split("/"); 845 else if (dateString.indexOf(".") >= 0) 846 dArray = dateString.split("."); 847 else if (dateString.indexOf("-") >= 0) 848 dArray = dateString.split("-"); 849 else if (dateString.indexOf("\\") >= 0) 850 dArray = dateString.split("\\"); 851 else 852 dArray = false; 853 return dArray; 854} 855function updateDateFieldStatic(dateFieldName, dateString) { 856 var targetDateField = document.getElementsByName(dateFieldName).item(0); 857 if (dateString) 858 targetDateField.value = dateString; 859 var pickerDiv = document.getElementById(datePickerDivID); 860 adjustiFrame(); 861 var dt = getFieldDate(targetDateField.value); 862 refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate()); 863 try { targetDateField.focus(); } catch (e) { } 864 if ((dateString) && (typeof (datePickerClosed) == "function")) 865 datePickerClosed(targetDateField); 866} 867function updateDateField(dateFieldName, dateString) { 868 var targetDateField = document.getElementsByName(dateFieldName).item(0); 869 if (dateString) 870 targetDateField.value = dateString; 871 var pickerDiv = document.getElementById(datePickerDivID); 872 pickerDiv.style.visibility = "hidden"; 873 pickerDiv.style.display = "none"; 874 adjustiFrame(); 875 try { targetDateField.focus(); } catch (e) { } 876 try { $j(targetDateField).change(); } catch (e) { } 877 if ((dateString) && (typeof (datePickerClosed) == "function")) 878 datePickerClosed(targetDateField); 879} 880function adjustiFrame(pickerDiv, iFrameDiv) { 881 var is_opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1); 882 if (is_opera) 883 return; 884 try { 885 if (!document.getElementById(iFrameDivID)) { 886 var newNode = document.createElement("iFrame"); 887 newNode.setAttribute("id", iFrameDivID); 888 newNode.setAttribute("src", "javascript:false;"); 889 newNode.setAttribute("scrolling", "no"); 890 newNode.setAttribute("frameborder", "0"); 891 document.body.appendChild(newNode); 892 } 893 if (!pickerDiv) 894 pickerDiv = document.getElementById(datePickerDivID); 895 if (!iFrameDiv) 896 iFrameDiv = document.getElementById(iFrameDivID); 897 try { 898 iFrameDiv.style.position = "absolute"; 899 iFrameDiv.style.width = pickerDiv.offsetWidth; 900 iFrameDiv.style.height = pickerDiv.offsetHeight; 901 iFrameDiv.style.top = pickerDiv.style.top; 902 iFrameDiv.style.left = pickerDiv.style.left; 903 iFrameDiv.style.zIndex = pickerDiv.style.zIndex - 1; 904 iFrameDiv.style.visibility = pickerDiv.style.visibility; 905 iFrameDiv.style.display = pickerDiv.style.display; 906 } catch (e) { 907 } 908 } catch (ee) { 909 } 910} 911 912function activateFlashPlugins() { 913 try { 914 objects = document.getElementsByTagName("object"); 915 for (var i = 0; i < objects.length; i++) { 916 try { 917 objects[i].outerHTML = objects[i].outerHTML; 918 } catch (err2) { } 919 } 920 } catch (err1) { } 921} 922 923 924 925var dragObj = new Object(); 926 927function dragStart(event, id) { 928 var el; 929 var x, y; 930 dragObj.elNode = window.document.getElementById(id); 931 if (navigator.appVersion.indexOf("MSIE") != -1) { 932 x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; 933 y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; 934 } else { 935 x = event.clientX + window.scrollX; 936 y = event.clientY + window.scrollY; 937 } 938 dragObj.cursorStartX = x; 939 dragObj.cursorStartY = y; 940 dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10); 941 dragObj.elStartTop = parseInt(dragObj.elNode.style.top, 10); 942 if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0; 943 if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 0; 944 if (navigator.appVersion.indexOf("MSIE") != -1) { 945 document.attachEvent("onmousemove", dragGo); 946 document.attachEvent("onmouseup", dragStop); 947 window.event.cancelBubble = true; 948 window.event.returnValue = false; 949 } else { 950 document.addEventListener("mousemove", dragGo, true); 951 document.addEventListener("mouseup", dragStop, true); 952 event.preventDefault(); 953 } 954} 955function dragGo(event) { 956 var x, y; 957 if (navigator.appVersion.indexOf("MSIE") != -1) { 958 x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; 959 y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; 960 } else { 961 x = event.clientX + window.scrollX; 962 y = event.clientY + window.scrollY; 963 } 964 dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px"; 965 dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px"; 966 if (navigator.appVersion.indexOf("MSIE") != -1) { 967 window.event.cancelBubble = true; 968 window.event.returnValue = false; 969 } else { 970 event.preventDefault(); 971 } 972} 973function dragStop(event) { 974 if (navigator.appVersion.indexOf("MSIE") != -1) { 975 document.detachEvent("onmousemove", dragGo); 976 document.detachEvent("onmouseup", dragStop); 977 } else { 978 document.removeEventListener("mousemove", dragGo, true); 979 document.removeEventListener("mouseup", dragStop, true); 980 } 981} 982 983var DivTop = null; 984var DivLeft = null; 985var ScrollDivID = null; 986var DivHeight = null; 987var DivWidth = null; 988var GrayedOut = false; 989var Centered = false; 990var divUnPinned = false; 991var autoResize = true; 992var oversizedWindow = false; 993function toggleDiv(id, height, width, centerme, grayOut) { 994 ScrollDivID = null; 995 DivHeight = height; 996 DivWidth = width; 997 var divObj = document.getElementById(id); 998 var grayOutDivObj = document.getElementById('grayOutDiv'); 999 if (divObj.style.visibility == 'hidden') { 1000 1001 1002 try { 1003 document.getElementById(id.replace("Div", "") + "LoadingDiv").style.display = 'block'; 1004 document.getElementById(id.replace("Div", "") + "iframe").style.display = 'none'; 1005 } catch (e) { } 1006 1007 divObj.style.visibility = 'visible'; 1008 divObj.style.display = 'block'; 1009 var winW = 0, winH = 0; 1010 1011 1012 if (parseInt(navigator.appVersion) > 3) { 1013 if (navigator.appName == "Netscape") { 1014 winW = window.innerWidth; 1015 winH = window.innerHeight; 1016 } 1017 if (navigator.appName.indexOf("Microsoft") != -1) { 1018 if (navigator.userAgent.indexOf("MSIE 10") != -1) { 1019 winW = window.innerWidth; 1020 winH = window.innerHeight; 1021 } else { 1022 winW = document.body.offsetWidth; 1023 winH = document.body.offsetHeight; 1024 } 1025 } 1026 } 1027 if (centerme == 'true') { 1028 divObj.style.top = (winH - height) / 2 + "px"; 1029 divObj.style.left = (winW - width) / 2 + "px"; 1030 Centered = true; 1031 } 1032 if (id != "socialItemsLightboxDiv" && height > winH) { 1033 divObj.style.top = 0; 1034 height = winH - 10; 1035 } 1036 divObj.style.height = height + 'px'; 1037 if (id != "socialItemsLightboxDiv" && width > winW) { 1038 divObj.style.left = 0; 1039 width = winW - 10; 1040 } 1041 divObj.style.width = width + 'px'; 1042 if (grayOut == 'true') { 1043 1044 try { 1045 var pageWidth = $j(document).width() + "px"; 1046 var pageHeight = $j(document).height() + "px"; 1047 } 1048 catch (e) { 1049 if (document.body && (document.body.scrollWidth || document.body.scrollHeight)) { 1050 var pageWidth = document.body.scrollWidth + 'px'; 1051 var pageHeight = document.body.scrollHeight + 'px'; 1052 } else if (document.body.offsetWidth) { 1053 var pageWidth = document.body.offsetWidth + 'px'; 1054 var pageHeight = document.body.offsetHeight + 'px'; 1055 } else { 1056 var pageWidth = '100%'; 1057 var pageHeight = '100%'; 1058 } 1059 } 1060 if (grayOutDivObj != null) { 1061 grayOutDivObj.style.display = 'block'; 1062 grayOutDivObj.style.height = pageHeight; 1063 grayOutDivObj.style.width = pageWidth; 1064 GrayedOut = true; 1065 } 1066 ScrollDivID = id; 1067 ScrollTheDiv(); 1068 } 1069 } else { 1070 divObj.style.visibility = 'hidden'; 1071 divObj.style.display = 'none'; 1072 try { 1073 grayOutDivObj.style.display = 'none'; 1074 GrayedOut = false; 1075 Centered = false; 1076 DivTop = null; 1077 DivLeft = null; 1078 grayOutDivObj.style.height = '1px'; 1079 grayOutDivObj.style.width = '1px'; 1080 } catch (err2) { 1081 } 1082 } 1083 if (id == "socialItemsLightboxDiv") 1084 window.scrollTo(0, 0); 1085} 1086function resizeEnabledDiv(height, width, noAxisDialog) { 1087 var axisDialogBoxes = $j(".axisDialogBox").length; 1088 if (axisDialogBoxes == 1 && !noAxisDialog) { 1089 $j(".axisDialogBox").trigger("setSize", { height: height, width: width }); 1090 return; 1091 } else if (axisDialogBoxes > 1 && !noAxisDialog) { 1092 1093 } 1094 1095 1096 if (!ScrollDivID) return; 1097 id = ScrollDivID; 1098 DivHeight = height; 1099 DivWidth = width; 1100 var divObj = document.getElementById(id); 1101 var winW = 0, winH = 0; 1102 if (!height) height = 0; 1103 if (!width) width = 0; 1104 if (parseInt(navigator.appVersion) > 3) { 1105 if (navigator.appName == "Netscape") { 1106 winW = window.innerWidth; 1107 winH = window.innerHeight; 1108 } 1109 if (navigator.appName.indexOf("Microsoft") != -1) { 1110 if (navigator.userAgent.indexOf("MSIE 10") != -1) { 1111 winW = window.innerWidth; 1112 winH = window.innerHeight; 1113 } else { 1114 winW = document.body.offsetWidth; 1115 winH = document.body.offsetHeight; 1116 } 1117 } 1118 } 1119 if (Centered) { 1120 if (height > 0) { divObj.style.top = (winH - height) / 2 + "px"; DivTop = (winH - height) / 2; } 1121 if (width > 0) { divObj.style.left = (winW - width) / 2 + "px"; DivLeft = (winW - width) / 2; } 1122 Centered = true; 1123 } 1124 if (id != "socialItemsLightboxDiv" && height > winH) { 1125 divObj.style.top = 0; 1126 if (autoResize) { height = winH - 10; } else { divObj.style.position = "absolute"; document.body.scrollTop = 0; oversizedWindow = true; } 1127 } 1128 if (height > 0) divObj.style.height = height + 'px'; 1129 if (id != "socialItemsLightboxDiv" && width > winW) { 1130 divObj.style.left = 0; 1131 if (autoResize) { width = winW - 10; } else { divObj.style.position = "absolute"; document.body.scrollLeft = 0; oversizedWindow = true; } 1132 } 1133 if (width > 0) divObj.style.width = width + 'px'; 1134 MoveSocialItemsLightbox(); 1135 ScrollTheDiv(); 1136} 1137function setEnabledDivTitle(title) { 1138 var axisDialogBoxes = $j(".axisDialogBox").length; 1139 if (axisDialogBoxes == 1) { 1140 $j(".axisDialogBox").trigger("setTitleBar", title); 1141 return; 1142 } else if (axisDialogBoxes > 1) { 1143 1144 } 1145 1146 if (!ScrollDivID) return; 1147 id = ScrollDivID; 1148 id = Left(id, id.length - 3) + "Span"; 1149 var titleObj = document.getElementById(id); 1150 if (titleObj) titleObj.innerHTML = title; 1151} 1152function closeAllAxisDialogs() { 1153 $j(".axisDialogBox").trigger("closeDialog"); 1154} 1155function closeDialog() { 1156 var axisDialogBoxes = $j(".axisDialogBox").length; 1157 if (axisDialogBoxes == 1) { 1158 if ($j(".axisDialogBox").parent().css("display") !== "none") { 1159 $j(".axisDialogBox").trigger("closeDialog"); 1160 return; 1161 } 1162 } else if (axisDialogBoxes > 1) { 1163 1164 } 1165 1166 if (!ScrollDivID && parent) closeThisAxisDialog(); 1167 if (!ScrollDivID) return; 1168 disableDiv(ScrollDivID); 1169} 1170function closeThisAxisDialog() { 1171 parent.setTimeout("closeDialog();", 100); 1172} 1173function enableDiv(id, height, width, centerme, grayOut) { 1174 autoResize = true; 1175 oversizedWindow = false; 1176 enableDiv2(id, height, width
1176, centerme, grayOut); 1177} 1178function enableDivNoResize(id, height, width, centerme, grayOut) { 1179 autoResize = false; 1180 oversizedWindow = false; 1181 enableDiv2(id, height, width, centerme, grayOut); 1182} 1183function enableDiv2(id, height, width, centerme, grayOut) { 1184 ScrollDivID = null; 1185 DivHeight = height; 1186 DivWidth = width; 1187 var divObj = document.getElementById(id); 1188 var grayOutDivObj = document.getElementById('grayOutDiv'); 1189 if (divObj !== null) { 1190 divObj.style.visibility = 'visible'; 1191 divObj.style.display = 'block'; 1192 } 1193 var winW = 0, winH = 0; 1194 if (!height) height = 0; 1195 if (!width) width = 0; 1196 if (parseInt(navigator.appVersion) > 3) { 1197 if (navigator.appName == "Netscape") { 1198 winW = window.innerWidth; 1199 winH = window.innerHeight; 1200 } 1201 if (navigator.appName.indexOf("Microsoft") != -1) { 1202 if (navigator.userAgent.indexOf("MSIE 10") != -1) { 1203 winW = window.innerWidth; 1204 winH = window.innerHeight; 1205 } else { 1206 winW = document.body.offsetWidth; 1207 winH = document.body.offsetHeight; 1208 } 1209 } 1210 } 1211 if (centerme == 'true') { 1212 if (height > 0) { 1213 if (divObj !== null) { 1214 divObj.style.top = (winH - height) / 2 + "px"; 1215 } 1216 } 1217 if (width > 0) { 1218 if (divObj !== null) { 1219 divObj.style.left = (winW - width) / 2 + "px"; 1220 } 1221 } 1222 1223 Centered = true; 1224 } 1225 if (height > winH) { 1226 if (divObj !== null) { 1227 divObj.style.top = 0; 1228 } 1229 1230 if (autoResize) { 1231 height = winH - 10; 1232 } 1233 else { 1234 if (divObj !== null) { 1235 divObj.style.position = "absolute"; 1236 } 1237 document.body.scrollTop = 0; 1238 oversizedWindow = true; 1239 } 1240 } 1241 if (height > 0) { 1242 if (divObj !== null) { 1243 divObj.style.height = height + 'px'; 1244 } 1245 } 1246 if (width > winW) { 1247 if (divObj !== null) { 1248 divObj.style.left = 0; 1249 } 1250 if (autoResize) { 1251 width = winW - 10; 1252 } 1253 else { 1254 if (divObj !== null) { 1255 divObj.style.position = "absolute"; 1256 } 1257 document.body.scrollLeft = 0; 1258 oversizedWindow = true; 1259 } 1260 } 1261 if (width > 0) { 1262 if (divObj !== null) { 1263 divObj.style.width = width + 'px'; 1264 } 1265 } 1266 1267 if ($j.browser.msie && parseInt($j.browser.version) >= 10) { 1268 // size iframe for ie 10 standard mode 1269 var idRoot = id.replace('Div', ''); 1270 var iframeH = $j('#' + idRoot + 'ContentCell').height(); 1271 $j('#' + idRoot + 'iframe').height(iframeH); 1272 } 1273 1274 if (grayOut == 'true') { 1275 try { 1276 var pageWidth = $j(document).width() + "px"; 1277 var pageHeight = $j(document).height() + "px"; 1278 } 1279 catch (e) { 1280 if (document.body && (document.body.scrollWidth || document.body.scrollHeight)) { 1281 var pageWidth = document.body.scrollWidth + 'px'; 1282 var pageHeight = document.body.scrollHeight + 'px'; 1283 } else if (document.body.offsetWidth) { 1284 var pageWidth = document.body.offsetWidth + 'px'; 1285 var pageHeight = document.body.offsetHeight + 'px'; 1286 } else { 1287 var pageWidth = '100%'; 1288 var pageHeight = '100%'; 1289 } 1290 } 1291 if (grayOutDivObj != null) { 1292 grayOutDivObj.style.display = 'block'; 1293 grayOutDivObj.style.height = pageHeight; 1294 grayOutDivObj.style.width = pageWidth; 1295 GrayedOut = true; 1296 } 1297 ScrollDivID = id; 1298 ScrollTheDiv(); 1299 } 1300 1301} 1302function disableDiv(id, height, width, centerme, grayOut) { 1303 ScrollDivID = null; 1304 var divObj = document.getElementById(id); 1305 1306 if (!divObj) { 1307 $j("#" + id.replace("Div", "")).trigger("closeDialog"); 1308 return; 1309 } 1310 1311 var grayOutDivObj = document.getElementById('grayOutDiv'); 1312 divObj.style.visibility = 'hidden'; 1313 divObj.style.display = 'none'; 1314 DivTop = null; 1315 DivLeft = null; 1316 Centered = false; 1317 try { 1318 grayOutDivObj.style.height = '1px'; 1319 grayOutDivObj.style.width = '1px'; 1320 grayOutDivObj.style.display = 'none'; 1321 GrayedOut = false; 1322 } 1323 catch (err2) { 1324 } 1325} 1326function minMaxDiv(id, minImageID, maxImageID, height, minHeight) { 1327 var myDiv = document.getElementById(id); 1328 var minImg = document.getElementById(minImageID); 1329 var maxImg = document.getElementById(maxImageID); 1330 if (minImg.style.position == 'absolute') { 1331 minImg.style.position = 'static'; 1332 minImg.style.margin = '0'; 1333 maxImg.style.position = 'absolute'; 1334 maxImg.style.margin = '-9999'; 1335 myDiv.style.height = height + 'px'; 1336 myDiv.style.overflow = 'auto'; 1337 } else { 1338 maxImg.style.position = 'static'; 1339 maxImg.style.margin = '0'; 1340 minImg.style.position = 'absolute'; 1341 minImg.style.margin = '-9999'; 1342 myDiv.style.height = minHeight + 'px'; 1343 myDiv.style.overflow = 'hidden'; 1344 } 1345 1346} 1347function SploderLoaded(id) { 1348 var iFrame = document.getElementById(id + "iframe"); 1349 if (iFrame) iFrame.style.display = 'block'; 1350 var loadDiv = document.getElementById(id + "LoadingDiv"); 1351 if (loadDiv) loadDiv.style.display = 'none'; 1352} 1353function unPinDiv(id, pinID) { 1354 GrayedOut = false; 1355 Centered = false; 1356 divUnPinned = true; 1357 var pin = document.getElementById(pinID); 1358 pin.style.position = 'static'; 1359 pin.style.margin = '0'; 1360 var grayOutDivObj = document.getElementById('grayOutDiv'); 1361 try { 1362 grayOutDivObj.style.height = '1px'; 1363 grayOutDivObj.style.width = '1px'; 1364 grayOutDivObj.style.display = 'none'; 1365 GrayedOut = false; 1366 } 1367 catch (err2) { 1368 } 1369} 1370function pinDiv(id, pinID) { 1371 var pin = document.getElementById(pinID); 1372 divUnPinned = false; 1373 pin.style.position = 'absolute'; 1374 pin.style.margin = '-9999'; 1375 GrayedOut = true; 1376 Centered = true; 1377 var grayOutDivObj = document.getElementById('grayOutDiv'); 1378 try { 1379 grayOutDivObj.style.height = '1px'; 1380 grayOutDivObj.style.width = '1px'; 1381 grayOutDivObj.style.display = 'block'; 1382 } 1383 catch (err2) { 1384 } 1385 OnPageResize() 1386} 1387function OnPageResize() { 1388 var grayOutDivObj = document.getElementById('grayOutDiv'); 1389 if (Centered && ScrollDivID != null) { 1390 var divObj = document.getElementById(ScrollDivID); 1391 var winW = 0, winH = 0; 1392 if (parseInt(navigator.appVersion) > 3) { 1393 if (navigator.appName == "Netscape") { 1394 winW = window.innerWidth; 1395 winH = window.innerHeight; 1396 } 1397 if (navigator.appName.indexOf("Microsoft") != -1) { 1398 if (navigator.userAgent.indexOf("MSIE 10") != -1) { 1399 winW = window.innerWidth; 1400 winH = window.innerHeight; 1401 } else { 1402 winW = document.body.offsetWidth; 1403 winH = document.body.offsetHeight; 1404 } 1405 } 1406 } 1407 DivTop = (winH - DivHeight) / 2; 1408 DivLeft = (winW - DivWidth) / 2; 1409 divObj.style.top = DivTop;
1410 divObj.style.left = DivLeft; 1411 if (DivHeight > winH) { 1412 divObj.style.top = 0; 1413 if (autoResize) { divObj.style.height = winH - 10 + 'px'; } else { divObj.style.position = "absolute"; document.body.scrollTop = 0; oversizedWindow = true; } 1414 DivTop = 0; 1415 } else { 1416 divObj.style.height = DivHeight + 'px'; 1417 } 1418 if (DivWidth > winW) { 1419 divObj.style.left = 0; 1420 if (autoResize) { divObj.style.width = winW - 10 + 'px'; } else { divObj.style.position = "absolute"; document.body.scrollLeft = 0; oversizedWindow = true; } 1421 DivLeft = 0; 1422 } else { 1423 divObj.style.width = DivWidth + 'px'; 1424 } 1425 if ($j.browser.msie && parseInt($j.browser.version) >= 10) { 1426 // size iframe for ie 10 standard mode 1427 var idRoot = id.replace('Div', ''); 1428 var iframeH = $j('#' + idRoot + 'ContentCell').height(); 1429 $j('#' + idRoot + 'iframe').height(iframeH); 1430 } 1431 ScrollTheDiv(); 1432 } 1433 if (GrayedOut) { 1434 grayOutDivObj.style.height = "1px"; 1435 grayOutDivObj.style.width = "1px"; 1436 try { 1437 var pageWidth = $j(document).width() + "px"; 1438 var pageHeight = $j(document).height() + "px"; 1439 } 1440 catch (e) { 1441 if (document.body && (document.body.scrollWidth || document.body.scrollHeight)) { 1442 var pageWidth = document.body.scrollWidth + 'px'; 1443 var pageHeight = document.body.scrollHeight + 'px'; 1444 } else if (document.body.offsetWidth) { 1445 var pageWidth = document.body.offsetWidth + 'px'; 1446 var pageHeight = document.body.offsetHeight + 'px'; 1447 } else { 1448 var pageWidth = '100%'; 1449 var pageHeight = '100%'; 1450 } 1451 } 1452 grayOutDivObj.style.height = pageHeight; 1453 grayOutDivObj.style.width = pageWidth; 1454 } 1455} 1456function AdminDashShown() { 1457 var Dash = document.getElementById("adminDashboard"); 1458 if (Dash) { 1459 //if(Dash.style.display=="none") return false; 1460 return true; 1461 } 1462 else { 1463 return false; 1464 } 1465} 1466function ScrollTheDiv() { 1467 var PageX = 0; var PageY = 0; 1468 if (typeof (window.pageYOffset) == 'number') { 1469 PageY = window.pageYOffset; 1470 PageX = window.pageXOffset; 1471 } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { 1472 PageY = document.body.scrollTop; 1473 PageX = document.body.scrollLeft; 1474 } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { 1475 PageY = document.documentElement.scrollTop; 1476 PageX = document.documentElement.scrollLeft; 1477 } 1478 try { 1479 var buddyListDivObj = document.getElementById("buddyListDiv"); 1480 buddyListDivObj.style.top = parseFloat(PageY) + 51; 1481 } catch (e) { 1482 } 1483 try { 1484 var buddyListDivObj = document.getElementById("buddyListDiv_opener"); 1485 if (AdminDashShown() && PageY < 52) { 1486 buddyListDivObj.style.top = "52px"; 1487 } else { 1488 buddyListDivObj.style.top = parseFloat(PageY) + 4 + "px"; 1489 } 1490 } catch (e) { 1491 } 1492 try { 1493 var Props = document.getElementById("rdpPagePropsOpener"); 1494 if (AdminDashShown() && PageY < 52) { 1495 Props.style.top = 52; 1496 } else { 1497 Props.style.top = parseFloat(PageY) + 4; 1498 } 1499 } 1500 catch (err) { 1501 } 1502 var divSubModalObj = document.getElementById(ScrollDivID); 1503 if (!divSubModalObj) return; 1504 if (MoveSocialItemsLightbox()) return; 1505 if (divSubModalObj.style.visibility != null && divUnPinned == false && oversizedWindow == false) { 1506 if (divSubModalObj.style.position == "fixed") return; 1507 if (DivTop == null && DivLeft == null) { 1508 DivTop = parseFloat(divSubModalObj.style.top.replace(/px/, '')); 1509 DivLeft = parseFloat(divSubModalObj.style.left.replace(/px/, '')); 1510 } 1511 var Top = DivTop + parseFloat(PageY);
1512 var Left = DivLeft + parseFloat(PageX); 1513 divSubModalObj.style.top = Top + "px"; 1514 divSubModalObj.style.left = Left + "px"; 1515 } else if (divUnPinned == true || oversizedWindow == true) { 1516 // its fiiiiiine 1517 } else { 1518 DivTop = null; 1519 DivLeft = null; 1520 } 1521} 1522function MoveSocialItemsLightbox() { 1523 if (ScrollDivID == "socialItemsLightboxDiv") { 1524 $j("#socialItemsLightboxDiv").css("position", "absolute"); 1525 $j("#socialItemsLightboxDiv").css("top", "25"); 1526 return true; 1527 } 1528 return false; 1529} 1530function MiniPageMouseover(id) { 1531 try { 1532 var MPDiv = document.getElementById("mpDiv" + id); 1533 MPDiv.style.zIndex = 100000; 1534 MPDiv.style.position = 'relative'; 1535 MPDiv.style.background = "#ffffff"; 1536 } catch (e) { 1537 } 1538 try { 1539 var CTEDiv = document.getElementById("clickToEditDiv" + id); 1540 CTEDiv.style.zIndex = 100000; 1541 CTEDiv.style.position = 'relative'; 1542 CTEDiv.style.background = "#ffffff"; 1543 } catch (e) { 1544 } 1545 var grayOutDivObj = document.getElementById('grayOutDiv'); 1546 if (document.body && (document.body.scrollWidth || document.body.scrollHeight)) { 1547 var pageWidth = document.body.scrollWidth + 'px'; 1548 var pageHeight = document.body.scrollHeight + 'px'; 1549 } else if (document.body.offsetWidth) { 1550 var pageWidth = document.body.offsetWidth + 'px'; 1551 var pageHeight = document.body.offsetHeight + 'px'; 1552 } else { 1553 var pageWidth = '100%'; 1554 var pageHeight = '100%'; 1555 } 1556 grayOutDivObj.style.display = 'block'; 1557 grayOutDivObj.style.height = pageHeight; 1558 grayOutDivObj.style.width = pageWidth; 1559} 1560function MiniPageMouseout(id) { 1561 try { 1562 var MPDiv = document.getElementById("mpDiv" + id); 1563 MPDiv.style.background = "none"; 1564 MPDiv.style.zIndex = 0; 1565 } catch (e) { 1566 } 1567 try { 1568 var MPDiv = document.getElementById("clickToEditDiv" + id); 1569 MPDiv.style.background = "none"; 1570 MPDiv.style.zIndex = 0; 1571 } catch (e) { 1572 } 1573 var grayOutDivObj = document.getElementById('grayOutDiv'); 1574 try { 1575 grayOutDivObj.style.display = 'none'; 1576 } catch (err2) { 1577 } 1578} 1579function GreyOutMouseOver(id) { 1580 var MPDiv = document.getElementById(id); 1581 MPDiv.style.zIndex = 100000; 1582 MPDiv.style.position = 'relative'; 1583 MPDiv.style.background = "#ffffff"; 1584 var grayOutDivObj = document.getElementById('grayOutDiv'); 1585 if (document.body && (document.body.scrollWidth || document.body.scrollHeight)) { 1586 var pageWidth = document.body.scrollWidth + 'px'; 1587 var pageHeight = document.body.scrollHeight + 'px'; 1588 } else if (document.body.offsetWidth) { 1589 var pageWidth = document.body.offsetWidth + 'px'; 1590 var pageHeight = document.body.offsetHeight + 'px'; 1591 } else { 1592 var pageWidth = '100%'; 1593 var pageHeight = '100%'; 1594 } 1595 grayOutDivObj.style.display = 'block'; 1596 grayOutDivObj.style.height = pageHeight; 1597 grayOutDivObj.style.width = pageWidth; 1598} 1599function GreyOutMouseout(id) { 1600 var MPDiv = document.getElementById(id); 1601 MPDiv.style.background = "none"; 1602 MPDiv.style.zIndex = 0; 1603 var grayOutDivObj = document.getElementById('grayOutDiv'); 1604 try { 1605 grayOutDivObj.style.display = 'none'; 1606 } catch (err2) { 1607 } 1608} 1609function scrollElement(id, direction, distance) { 1610 var ele = document.getElementById(id); 1611 if (direction == 'left') { 1612 try { ele.scrollLeft = ele.scrollLeft - distance; } catch (e) { ele.scrollLeft = 0; } 1613 } 1614 if (direction == 'right') { 1615 try { ele.scrollLeft = ele.scrollLeft + distance; } catch (e) { ele.scrollLeft = ele.scrollWidth; } 1616 } 1617 if (direction == 'up') { 1618 try { ele.scrollTop = ele.scrollTop - distance; } catch (e) { ele.scrollTop = 0; } 1619 } 1620 if (direction == 'down') { 1621 try { ele.scrollTop = ele.scrollTop + distance; } catch (e) { ele.scrollTop = ele.scrollHeight; } 1622 } 1623} 1624function FormatCurrency(tb) { 1625 var num = tb.value; 1626 tb.value = formatCurrency(num); 1627} 1628function formatCurrency(num, noCents) { 1629 num = num.toString().replace(/\$|\,/g, ''); 1630 if (isNaN(num)) num = "0"; 1631 sign = (num == (num = Math.abs(num))); 1632 num = Math.floor(num * 100 + 0.50000000001); 1633 cents = num % 100; 1634 num = Math.floor(num / 100).toString(); 1635 if (cents < 10) 1636 cents = "0" + cents; 1637 for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) 1638 num = num.substring(0, num.length - (4 * i + 3)) + ',' + 1639 num.substring(num.length - (4 * i + 3)); 1640 if (noCents) { 1641 return ((sign) ? '' : '-') + '$' + num; 1642 } else { 1643 return ((sign) ? '' : '-') + '$' + num + '.' + cents; 1644 } 1645} 1646function formatNumberCommas(x) { 1647 var parts = x.toString().split("."); 1648 parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); 1649 return parts.join("."); 1650} 1651function UnformatCurrency(tb) { 1652 var num = tb.value; 1653 num = num.toString().replace(/\$|\,/g, ''); 1654 tb.value = num; 1655} 1656function getXMLHttpObj() { 1657 if (typeof (XMLHttpRequest) != 'undefined') 1658 return new XMLHttpRequest(); 1659 1660 var axO = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.4.0', 1661 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'], i; 1662 for (i = 0; i < axO.length; i++) 1663 try { 1664 return new ActiveXObject(axO[i]); 1665 } catch (e) { } 1666 return null; 1667} 1668function EnableKeepAlive() { 1669 CreateKeepAliveCookie(); 1670 window.setInterval("CreateKeepAliveCookie();", 60000); 1671} 1672function CreateKeepAliveCookie() { 1673 var exdate = new Date(); 1674 var minutes = exdate.getMinutes(); 1675 minutes += 2; 1676 exdate.setMinutes(minutes); 1677 document.cookie = "keepAlive_" + escape(document.location.href) + "=open;expires=" + exdate.toGMTString() + ";path=/"; 1678} 1679function SelectMyTab(sender, eventArgs) { 1680 var multiPageID = sender.get_multiPageID(); 1681 var tab = eventArgs.get_tab(); 1682 sender.set_multiPageID(null); 1683 tab.select(); 1684} 1685function UnSelectMyTab(e, ctrl) { 1686 var tabStrip = $find(ctrl.id); 1687 if (!tabStrip) return; 1688 //Find the element which the mouse is over 1689 var destElement = e.relatedTarget || e.toElement;
1690 if ($telerik.isDescendant(tabStrip.get_element(), destElement)) 1691 return; 1692 var initialTab = tabStrip.findTabByText(tabStrip.get_attributes().getAttribute("InitialTab")); 1693 initialTab.unselect(); 1694 initialTab.selectParents(); 1695} 1696function getSessionUID() { 1697 var c_name = "ceSessionUID"; 1698 if (document.cookie.length > 0) { 1699 c_start = document.cookie.indexOf(c_name + "="); 1700 if (c_start != -1) { 1701 c_start = c_start + c_name.length + 1; 1702 c_end = document.cookie.indexOf(";", c_start); 1703 if (c_end == -1) c_end = document.cookie.length; 1704 return unescape(document.cookie.substring(c_start, c_end)); 1705 } 1706 } 1707 return ""; 1708} 1709function autoResizeIframe(id) { 1710 var newheight; 1711 var newwidth; 1712 if (document.getElementById) { 1713 newheight = document.getElementById(id).contentWindow.document.body.scrollHeight; 1714 newwidth = document.getElementById(id).contentWindow.document.body.scrollWidth; 1715 } 1716 document.getElementById(id).height = (newheight) + "px"; 1717 document.getElementById(id).width = "100%"; //(newwidth) + "px"; 1718} 1719function resizeSlideMenu(menuID) { 1720 var totalAdjust = 0; 1721 var m = $j('#' + menuID); 1722 totalAdjust += ($j(m).find('ul').outerWidth(true) - $j(m).find('ul').width()); 1723 totalAdjust += ($j(m).outerWidth(true) - $j(m).width()); 1724 if ($j.browser.msie) { 1725 $j(m).find('ul.rmRootGroup > li').each(function () { if (parseInt($j(this).css("margin-left").replace("px", ""))) { totalAdjust += parseInt($j(this).css("margin-left").replace("px", "")) }; if (parseInt($j(this).css("margin-right").replace("px", ""))) { totalAdjust += parseInt($j(this).css("margin-right").replace("px", "")) }; }); 1726 while (totalAdjust > 0) { 1727 $j(m).find('ul.rmRootGroup > li').each(function () { if ($j(this).width() > 0 && totalAdjust > 0) { $j(this).width(($j(this).width() - 1) + ((parseInt($j(this).css("padding-left").replace("px", ""))) ? parseInt($j(this).css("padding-left").replace("px", "")) : 0) + ((parseInt($j(this).css("padding-right").replace("px", ""))) ? parseInt($j(this).css("padding-right").replace("px", "")) : 0) + ((parseInt($j(this).css("border-left-width").replace("px", ""))) ? parseInt($j(this).css("border-left-width").replace("px", "")) : 0) + ((parseInt($j(this).css("border-right-width").replace("px", ""))) ? parseInt($j(this).css("border-right-width").replace("px", "")) : 0)); totalAdjust -= 1; } }); 1728 } 1729 } else { 1730 $j(m).find('ul.rmRootGroup > li').each(function () { totalAdjust += ($j(this).outerWidth(true) - $j(this).width()); }); 1731 while (totalAdjust > 0) { 1732 $j(m).find('ul.rmRootGroup > li').each(function () { if ($j(this).width() > 0 && totalAdjust > 0) { $j(this).width(($j(this).width() - 1)); totalAdjust -= 1; } }); 1733 } 1734 } 1735} 1736function getCookie(c_name) { 1737 if (document.cookie.length > 0) { 1738 var c_start = document.cookie.indexOf(c_name + "="); 1739 if (c_start != -1) { 1740 c_start = c_start + c_name.length + 1; 1741 var c_end = document.cookie.indexOf(";", c_start); 1742 if (c_end == -1) c_end = document.cookie.length; 1743 return unescape(document.cookie.substring(c_start, c_end)); 1744 } 1745 } 1746 return ""; 1747} 1748function setCookie(c_name, value, expiredays) { 1749 var exdate = new Date(); 1750 exdate.setDate(exdate.getDate() + expiredays); 1751 document.cookie = c_name + "=" + escape(value) + 1752 ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString()); 1753} 1754var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g, 1755 1756 meta = { 1757 1758 '\b': '\\b', 1759 1760 '\t': '\\t', 1761 1762 '\n': '\\n', 1763 1764 '\f': '\\f', 1765 1766 '\r': '\\r', 1767 1768 '"': '\\"', 1769 1770 '\\': '\\\\' 1771 1772 }; 1773function JSONescape(string) { 1774 if (string.match(escapeable)) { 1775 1776 return string.replace(escapeable, function (a) { 1777 1778 var c = meta[a]; 1779 1780 if (typeof c === 'string') { 1781 1782 return c; 1783 1784 } 1785 1786 c = a.charCodeAt(); 1787 1788 return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16); 1789 1790 }); 1791 1792 } 1793 1794 return string; 1795} 1796function hasTouchSupport() { 1797 var support = {}, 1798 events = ['touchstart', 'touchmove', 'touchend'], 1799 el = document.createElement('div'), i; 1800 1801 try { 1802 for (i = 0; i < events.length; i++) { 1803 var eventName = events[i]; 1804 eventName = 'on' + eventName; 1805 var isSupported = (eventName in el); 1806 if (!isSupported) { 1807 el.setAttribute(eventName, 'return;'); 1808 isSupported = typeof el[eventName] == 'function'; 1809 } 1810 support[events[i]] = isSupported; 1811 } 1812 return support.touchstart && support.touchend && support.touchmove; 1813 } 1814 catch (err) { 1815 return false; 1816 } 1817} 1818function axisShareThis(sender) { 1819 var senderOffset = $j(sender).offset(); 1820 var left = senderOffset.left; 1821 var top = senderOffset.top + $j(sender).height(); 1822 if (($j(window).width() / 2) < left) { 1823 $j("#shareBar").css("left", left - ($j("#shareBar").width() - $j(sender).width())); 1824 } else { 1825 $j("#shareBar").css("left", left); 1826 } 1827 $j("#shareBar").css("top", top); 1828 $j("#shareBar").fadeIn(); 1829} 1830function CloseAxisShareThisBox() { 1831 $j("#shareBar").hide(); 1832} 1833axisBrowser = function () { 1834 if (jQuery.parseJSON(getCookie("CEBrowser"))) { 1835 return jQuery.parseJSON(getCookie("CEBrowser")); 1836 } else { 1837 var obj = {}; 1838 return obj;
1839 } 1840} 1841 1842function setRadUL(menuID, r) { 1843 var u = $j('#' + menuID).find('.rmRootGroup'); 1844 var totalWidth = 1; 1845 if ($j.browser.mozilla) { totalWidth = 2; } 1846 $j('#' + menuID).find('.rmRootGroup.rmHorizontal .rmItem').each(function () { totalWidth += $j(this).width(); }); 1847 $j(u).css('width', totalWidth); 1848 if (r == 1) { var ww = $j(window).width(); if (totalWidth > ww) { $j(u).css('width', 'auto'); } } 1849} 1850function AttachCredentialValidation(UserID, Credential, TextboxID, ConfirmTextboxID, OutputDivID) { 1851 var Textbox; 1852 if (TextboxID !== "") Textbox = $j("#" + TextboxID); 1853 var ConfirmTextbox; 1854 if (ConfirmTextboxID !== "") ConfirmTextbox = $j("#" + ConfirmTextboxID); 1855 var OutputDiv; 1856 if (OutputDivID !== "") OutputDiv = $j("#" + OutputDivID); 1857 if (Textbox.length !== 1) return; 1858 var PathToASMX = sitePath + "/A_Master/NET/Login/Credentials.asmx"; 1859 $j.ajax({ 1860 type: "POST", 1861 contentType: "application/json; charset=utf-8", 1862 url: PathToASMX + "/GetValidateLoginCredentialJSON", 1863 data: "{\"UserID\": \"" + UserID + "\",\"Credential\": \"" + Credential + "\"}", 1864 dataType: "json", 1865 success: function (data) { 1866 var criteria = data.d; 1867 //alert(criteria); 1868 outputValidationCriteria(Textbox, ConfirmTextbox, OutputDiv, criteria); 1869 Textbox.focus(function () { if ($j(this).val().trim() === "********") $j(this).val(""); outputValidationCriteria(Textbox, ConfirmTextbox, OutputDiv, criteria); }); 1870 Textbox.blur(function () { if ($j(this).val().trim() === "" && $j(this).attr("isdefault") === "true") $j(this).val("********"); outputValidationCriteria(Textbox, ConfirmTextbox, OutputDiv, criteria); }); 1871 Textbox.keyup(function () { outputValidationCriteria(Textbox, ConfirmTextbox, OutputDiv, criteria); }); 1872 if (ConfirmTextbox && ConfirmTextbox.length === 1) { 1873 ConfirmTextbox.after($j("<span/>").addClass("credentialInputValidator").attr("id", ConfirmTextboxID + "_validator")); 1874 ConfirmTextbox.keyup(function () { checkValidationIsEqual(Textbox, ConfirmTextbox); }); 1875 } 1876 Textbox.after($j("<span/>").addClass("credentialInputValidator").attr("id", TextboxID + "_validator")); 1877 }, 1878 error: function (xhr, status, error) { 1879 //alert(xhr.responseText); 1880 } 1881 }); 1882} 1883function checkValidationIsEqual(Textbox, ConfirmTextbox) { 1884 var inputValidator = $j("#" + ConfirmTextbox.attr("id") + "_validator"); 1885 inputValidator.removeClass("isValid"); 1886 inputValidator.removeClass("notValid"); 1887 if (Textbox.val() === "" || ConfirmTextbox.val() === "") return; 1888 if (Textbox.val() === ConfirmTextbox.val()) { 1889 inputValidator.addClass("isValid"); 1890 } else { 1891 inputValidator.addClass("notValid"); 1892 } 1893} 1894function outputValidationCriteria(Textbox, ConfirmTextbox, OutputDiv, Criteria) { 1895 var evaled = eval("(" + Criteria + ")"); 1896 OutputDiv.html(""); 1897 OutputDiv.removeClass("criteriaValidationWrapper"); 1898 OutputDiv.addClass("criteriaValidationWrapper"); 1899 OutputDiv.hide(); 1900 var input = Textbox.val().trim(); 1901 var ul = $j("<ul/>").appendTo(OutputDiv); 1902 var inputIsValid = true; 1903 $j.each(evaled, function (key, Criteria) { 1904 var isValid = false; 1905 if (input !== "") { //do the validation 1906 switch (Criteria.Type) { 1907 case "AllowedChars": 1908 if (Criteria.Value.indexOf(":") !== -1) { 1909 var split = Criteria.Value.split(":"); 1910 if (split.length === 2) { 1911 if (input.length >= split[0] && input.length <= split[1]) isValid = true; 1912 break; 1913 } 1914 } 1915 case "MinChars": 1916 if (input.length >= Criteria.Value) isValid = true; 1917 break; 1918 case "MaxChars": 1919 if (input.length < Criteria.Value) isValid = true; 1920 break; 1921 case "LCaseChars": 1922 var LCaseCount = 0; 1923 for (var i = 0; i < input.length; i++) { 1924 if (input.charCodeAt(i) >= 97 && input.charCodeAt(i) <= 122) LCaseCount++; 1925 } 1926 if (LCaseCount >= Criteria.Value) isValid = true; 1927 break; 1928 case "UCaseChars": 1929 var UCaseCount = 0; 1930 for (var i = 0; i < input.length; i++) { 1931 if (input.charCodeAt(i) >= 65 && input.charCodeAt(i) <= 90) UCaseCount++; 1932 } 1933 if (UCaseCount >= Criteria.Value) isValid = true; 1934 break; 1935 case "NumericChars": 1936 var NumericCount = 0; 1937 for (var i = 0; i < input.length; i++) { 1938 if (input.charCodeAt(i) >= 48 && input.charCodeAt(i) <= 57) NumericCount++; 1939 } 1940 if (NumericCount >= Criteria.Value) isValid = true; 1941 break; 1942 case "SpecialChars": 1943 var SpecialCount = 0; 1944 for (var i = 0; i < input.length; i++) { 1945 if (input.charCodeAt(i) >= 33 && input.charCodeAt(i) <= 47) SpecialCount++; 1946 if (input.charCodeAt(i) >= 58 && input.charCodeAt(i) <= 64) SpecialCount++; 1947 if (input.charCodeAt(i) >= 91 && input.charCodeAt(i) <= 96) SpecialCount++; 1948 if (input.charCodeAt(i) >= 123 && input.charCodeAt(i) <= 126) SpecialCount++; 1949 } 1950 if (SpecialCount >= Criteria.Value) isValid = true; 1951 break; 1952 case "NoFirstName": 1953 if (input.toLowerCase().indexOf(Criteria.Value) === -1) isValid = true; 1954 break; 1955 case "NoLastName": 1956 if (input.toLowerCase().indexOf(Criteria.Value) === -1) isValid = true; 1957 break; 1958 case "NotOppositeReversed": 1959 if (input.toLowerCase() !== Criteria.Value) isValid = true; 1960 break; 1961 case "NotOpposite": 1962 if (input.toLowerCase() !== Criteria.Value) isValid = true; 1963 break; 1964 case "NoContainOpposite": 1965 if (input.toLowerCase().indexOf(Criteria.Value) === -1) isValid = true; 1966 break; 1967 case "AllowedPasswords": 1968 isValid = true 1969 break; 1970 default: 1971 isValid = true; 1972 } 1973 if (!isValid) inputIsValid = false; 1974 } 1975 var li = $j("<li/>").appendTo(ul); 1976 if (Criteria.Type === "AllowedPasswords" || Criteria.Type === "NotInUseByAnotherAccount") { 1977 } else { 1978 li.addClass((isValid) ? "isValid" : "notValid"); 1979 } 1980 var div = $j("<div/>
1980").appendTo(li); 1981 $j("<span/>").addClass("validateImage").addClass().appendTo(div); 1982 $j("<span/>").addClass("validateText").html(Criteria.DisplayString).appendTo(div); 1983 }); 1984 var inputValidator = $j("#" + Textbox.attr("id") + "_validator"); 1985 inputValidator.removeClass("isValid"); 1986 inputValidator.removeClass("notValid"); 1987 if (input !== "") inputValidator.addClass((inputIsValid) ? "isValid" : "notValid"); 1988 if (!inputIsValid || Textbox.is(":focus") || input === "") OutputDiv.show(); 1989 if (ConfirmTextbox) checkValidationIsEqual(Textbox, ConfirmTextbox); 1990 if (evaled.length === 0) { 1991 OutputDiv.hide(); 1992 inputValidator.hide(); 1993 } 1994 if (input === "********") { 1995 OutputDiv.hide(); 1996 inputValidator.removeClass("isValid"); 1997 inputValidator.removeClass("notValid"); 1998 } 1999} 2000jQuery.expr[':'].focus = function (elem) { 2001 return elem === document.activeElement && (elem.type || elem.href); 2002}; 2003function FloatHeader(tableId) { 2004 2005 if ($j("#" + tableId + "_floatedHeader").length !== 0) $j("#" + tableId + "_floatedHeader").remove(); 2006 2007 var $originalTable = $j("#" + tableId); 2008 2009 var $floatedHeader = $j("<div/>").attr("id", tableId + "_floatedHeader").attr("originaltableid", tableId).addClass("floatedTableHeader").hide(); 2010 $floatedHeader.offset({ left: $originalTable.offset().left }); 2011 2012 try { 2013 var browser = axisBrowser(); 2014 if (browser.Browser === "IE") { 2015 $floatedHeader.css("position", "absolute").css("top", $j(window).scrollTop()); 2016 } else { 2017 $floatedHeader.css("position", "fixed").css("top", "0"); 2018 } 2019 } catch (e) { 2020 $floatedHeader.css("position", "fixed").css("top", "0"); 2021 } 2022 2023 $originalTable.parent().append($floatedHeader); 2024 2025 var $table = $originalTable.clone().html("").attr("id", ""); 2026 var $originalRow = $originalTable.find("tr:first"); 2027 var $row = $originalRow.clone(); 2028 2029 $originalRow.children("td").each(function (index) { 2030 $j($row.children("td")[index]).width($j(this).width()); 2031 }); 2032 2033 $table.append($row); 2034 2035 $floatedHeader.append($table); 2036 2037 if ($j(window).scrollTop() > $originalTable.offset().top) { 2038 $floatedHeader.show(); 2039 } 2040 2041 if ($j(window).scrollTop() > $originalTable.offset().top + $originalTable.height()) { 2042 $floatedHeader.hide(); 2043 } 2044 2045 $j(document).scroll(function () { 2046 if ($j(window).scrollTop() > $originalTable.offset().top) { 2047 if ($floatedHeader.css("position") === "absolute") { 2048 $floatedHeader.css("top", $j(window).scrollTop()); 2049 } 2050 $floatedHeader.show(); 2051 } else { 2052 $floatedHeader.hide(); 2053 } 2054 if ($j(window).scrollTop() > $originalTable.offset().top + $originalTable.height()) { 2055 $floatedHeader.hide(); 2056 } 2057 }); 2058 2059} 2060String.prototype.replaceAll = function (target, replacement) { 2061 return this.split(target).join(replacement); 2062}; 2063 2064 2065// #### CRM Integration 2066function crm_Init() { 2067 $j('[data-crm-init="load"]').each(function () { 2068 crm_ReplaceContent(this); 2069 }); 2070} 2071function crm_ReplaceContent(obj) { 2072 if ($j(obj).attr("data-crm-init") != 'complete') { 2073 $j(obj).attr("data-crm-init", 'complete'); 2074 var postData = JSON.parse($j(obj).attr("data-crm-filters")); 2075 postData["prefix"] = $j(obj).attr("data-crm-prefix"); 2076 postData["content"] = $j(obj).html(); 2077 $j(obj).html('Loading ...'); 2078 2079 var jsonContent = JSON.stringify(postData); 2080 $j.ajax({ 2081 type: "POST", 2082 url: $j(obj).attr('data-crm-path') + "/content/replace", 2083 data: jsonContent, 2084 dataType: 'json', 2085 success: function (data, status, xhr) { 2086 $j(obj).html(data); 2087 }, 2088 error: function (xhr, status, error) { alert(xhr.responseText); } 2089 }); 2090 } 2091} 2092 2093 2094// #### End CRM Integration 2095 2096 2097// #### Date Formatting 2098function formatDate(date, format, utc) { 2099 var MMMM = ["\x00", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
2099November", "December"]; 2100 var MMM = ["\x01", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; 2101 var dddd = ["\x02", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; 2102 var ddd = ["\x03", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; 2103 2104 function ii(i, len) { 2105 var s = i + ""; 2106 len = len || 2; 2107 while (s.length < len) s = "0" + s; 2108 return s; 2109 } 2110 2111 var y = utc ? date.getUTCFullYear() : date.getFullYear(); 2112 format = format.replace(/(^|[^\\])yyyy+/g, "$1" + y); 2113 format = format.replace(/(^|[^\\])yy/g, "$1" + y.toString().substr(2, 2)); 2114 format = format.replace(/(^|[^\\])y/g, "$1" + y); 2115 2116 var M = (utc ? date.getUTCMonth() : date.getMonth()) + 1; 2117 format = format.replace(/(^|[^\\])MMMM+/g, "$1" + MMMM[0]); 2118 format = format.replace(/(^|[^\\])MMM/g, "$1" + MMM[0]); 2119 format = format.replace(/(^|[^\\])MM/g, "$1" + ii(M)); 2120 format = format.replace(/(^|[^\\])M/g, "$1" + M); 2121 2122 var d = utc ? date.getUTCDate() : date.getDate(); 2123 format = format.replace(/(^|[^\\])dddd+/g, "$1" + dddd[0]); 2124 format = format.replace(/(^|[^\\])ddd/g, "$1" + ddd[0]); 2125 format = format.replace(/(^|[^\\])dd/g, "$1" + ii(d)); 2126 format = format.replace(/(^|[^\\])d/g, "$1" + d); 2127 2128 var H = utc ? date.getUTCHours() : date.getHours(); 2129 format = format.replace(/(^|[^\\])HH+/g, "$1" + ii(H)); 2130 format = format.replace(/(^|[^\\])H/g, "$1" + H); 2131 2132 var h = H > 12 ? H - 12 : H === 0 ? 12 : H; 2133 format = format.replace(/(^|[^\\])hh+/g, "$1" + ii(h)); 2134 format = format.replace(/(^|[^\\])h/g, "$1" + h); 2135 2136 var m = utc ? date.getUTCMinutes() : date.getMinutes(); 2137 format = format.replace(/(^|[^\\])mm+/g, "$1" + ii(m)); 2138 format = format.replace(/(^|[^\\])m/g, "$1" + m); 2139 2140 var s = utc ? date.getUTCSeconds() : date.getSeconds(); 2141 format = format.replace(/(^|[^\\])ss+/g, "$1" + ii(s)); 2142 format = format.replace(/(^|[^\\])s/g, "$1" + s); 2143 2144 var f = utc ? date.getUTCMilliseconds() : date.getMilliseconds(); 2145 format = format.replace(/(^|[^\\])fff+/g, "$1" + ii(f, 3)); 2146 f = Math.round(f / 10); 2147 format = format.replace(/(^|[^\\])ff/g, "$1" + ii(f)); 2148 f = Math.round(f / 10); 2149 format = format.replace(/(^|[^\\])f/g, "$1" + f); 2150 2151 var T = H < 12 ? "AM" : "PM"; 2152 format = format.replace(/(^|[^\\])TT+/g, "$1" + T); 2153 format = format.replace(/(^|[^\\])T/g, "$1" + T.charAt(0)); 2154 2155 var t = T.toLowerCase(); 2156 format = format.replace(/(^|[^\\])tt+/g, "$1" + t); 2157 format = format.replace(/(^|[^\\])t/g, "$1" + t.charAt(0)); 2158 2159 var tz = -date.getTimezoneOffset(); 2160 var K = utc || !tz ? "Z" : tz > 0 ? "+" : "-"; 2161 if (!utc) { 2162 tz = Math.abs(tz); 2163 var tzHrs = Math.floor(tz / 60); 2164 var tzMin = tz % 60; 2165 K += ii(tzHrs) + ":" + ii(tzMin); 2166 } 2167 format = format.replace(/(^|[^\\])K/g, "$1" + K); 2168 2169 var day = (utc ? date.getUTCDay() : date.getDay()) + 1; 2170 format = format.replace(new RegExp(dddd[0], "g"), dddd[day]); 2171 format = format.replace(new RegExp(ddd[0], "g"), ddd[day]); 2172 2173 format = format.replace(new RegExp(MMMM[0], "g"), MMMM[M]); 2174 format = format.replace(new RegExp(MMM[0], "g"), MMM[M]); 2175 2176 format = format.replace(/\\(.)/g, "$1"); 2177 2178 return format; 2179} 2180 2181// #### End Date Formatting 2182 2183function time_ago(time) { 2184 2185 switch (typeof time) { 2186 case 'number': break; 2187 case 'string': time = +new Date(time); break; 2188 case 'object': if (time.constructor === Date) time = time.getTime(); break; 2189 default: time = +new Date(); 2190 } 2191 2192 var time_formats = [ 2193 [60, 'seconds', 1], // 60 2194 [120, '1 minute ago', '1 minute from now'], // 60*2 2195 [3600, 'minutes', 60], // 60*60, 60 2196 [7200, '1 hour ago', '1 hour from now'], // 60*60*2 2197 [86400, 'hours', 3600], // 60*60*24, 60*60 2198 [172800, 'Yesterday', 'Tomorrow'], // 60*60*24*2 2199 [604800, 'days', 86400], // 60*60*24*7, 60*60*24 2200 [1209600, 'Last week', 'Next week'], // 60*60*24*7*4*2 2201 [2419200, 'weeks', 604800], // 60*60*24*7*4, 60*60*24*7 2202 [4838400, 'Last month', 'Next month'], // 60*60*24*7*4*2 2203 [29030400, 'months', 2419200], // 60*60*24*7*4*12, 60*60*24*7*4 2204 [58060800, 'Last year', 'Next year'], // 60*60*24*7*4*12*2 2205 [2903040000, 'years', 29030400], // 60*60*24*7*4*12*100, 60*60*24*7*4*12 2206 [5806080000, 'Last century', 'Next century'], // 60*60*24*7*4*12*100*2 2207 [58060800000, 'centuries', 2903040000] // 60*60*24*7*4*12*100*20, 60*60*24*7*4*12*100 2208 ]; 2209 var seconds = (+new Date() - time) / 1000, 2210 token = 'ago', list_choice = 1; 2211 2212 if (seconds == 0) { 2213 return 'Just now' 2214 } 2215 if (seconds < 0) { 2216 seconds = Math.abs(seconds); 2217 token = 'from now'; 2218 list_choice = 2; 2219 } 2220 var i = 0, format; 2221 while (format = time_formats[i++]) 2222 if (seconds < format[0]) { 2223 if (typeof format[2] == 'string') 2224 return format[list_choice]; 2225 else 2226 return Math.floor(seconds / format[2]) + ' ' + format[1] + ' ' + token; 2227 } 2228 return time; 2229}
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.