1var returnToElement; 2// Generic PopUp Function 3function popUp(wname, url, width, height, statusbar, scrollbars, resizable, toolbar) { 4 returnToElement = document.activeElement; 5 var hostname = $(location).attr("hostname"); 6 7 /*injected dom*/ 8 if($("#black-content").length){ 9 closePopUp(); 10 } 11 if (height == "forceiframe") { 12 var $popupDOM = $("<div id='black-content'><div id='draggable'> <div id='popup-wrap' class='popup-name-" + wname + "'> <div id='fetched' style='width:100%;padding:0px;'><iframe scrolling='no' style='border:none;width:100%;height:770px;' src='" + url + "'/></div><center><a class='button popup-bottom-close' onclick='closePopUp();' >OK</a></center> </div> </div> </div>") 13 } else { 14 var $popupDOM = $("<div id='black-content'><div id='draggable'> <div id='popup-wrap' class='popup-name-" + wname + "'> <br/> <div aria-label=\"More Info\" aria-modal=\"true\" role=\"dialog\" tabindex=\"0\" id='fetched'></div><center><button id='popclose' class='button popup-bottom-close' onclick='closePopUp();' >OK</button ></center> </div> </div> </div>") 15 } 16 17 $("body").append($popupDOM) 18 if (height != "forceiframe") { 19 $.get(url, function( data ) { 20 $("#fetched").html(data); 21 $("#fetched").css("max-height", ($(window).height()*.65) + "px"); //65% of window height, allowing for menu and aread to close. 22 }); 23 } 24 25 //prepare container 26 var $wrap = $("#popup-wrap"); 27 if (width == "fill") { 28 $wrap.css("width", "90%").css("left", "auto").css("margin-left", "5%"); 29 } else { 30 $wrap.css({"margin-left": "-" + (width / 2) + "px", "width": width + "px"}); 31 $wrap.prepend("<span tabindex=\"0\" id='popup-head' class='heading-text clear'>" + wname + "<a class='popup-close-icon' aria-label='Close This Info Window' style='float:right;' onclick='closePopUp();' tabindex='0'><img aria-hidden='true' class='sw-icon close-icon' src='images/close-icon.svg' /></a></span>"); 32 $wrap.hide(); 33 $("#draggable").draggable({ handle: "#popup-head" }); 34 //show popup 35 $("#black-content").show("fade", 200, function () { 36 $("#popup-wrap").show("fade", 400, function () { 37 //focus popup 38 $("#popup-head").focus(); 39 $("#black-content").click(function () { 40 closePopUp(); 41 }).children().click(function (e) { 42 e.stopPropagation(); 43 }); 44 }); 45 }); 46 } 47 48 //switch icons to SVG 49 extractIcons(); 50} 51 52function closePopUp() { 53 if (returnToElement) { 54 returnToElement.focus(); 55 returnToElement = null; 56 } 57 $("#black-content").hide("fade", 400, function(){ 58 $("#black-content").remove(); 59 }); 60 $("#aria-modal-title").html(""); 61 $("#aria-modal-content").html(""); 62} 63 64//hover modal 65var modalHideTime, modalShowTime; 66function hoverModal() { 67 //add markup to modal object 68 $('.hover-modal').prepend("<div class='hover-modal-container info-box default-font'><span class='hover-modal-loading'></span><div style='display:none;' class='hover-modal-content no-content'></div></div>") 69 70 //control what is focused 71 $('.hover-modal').mouseenter(function () { 72 $('.hover-modal-container').removeClass('is-hover'); 73 74 $(this).children('.hover-modal-container').addClass('is-hover'); 75 76 hideModals(); //hide other modals if they're open 77 window.clearTimeout(modalHideTime); //clear modal hide timer - they're hidden 78 79 modalShowTime = window.setTimeout(showModals, 200); //start timer to see if we've been here a bit, if so, show that sucker. 80 }) 81 82 $('.hover-modal').mouseleave(function () { 83 $(this).children('.hover-modal-container').removeClass('is-hover'); 84 modalHideTime = window.setTimeout(hideModals, 400); 85 }) 86 87} 88function showModals() { 89 window.clearTimeout(modalShowTime); 90 var modalMe = $('.is-hover'); 91 modalMe.fadeIn(); 92 //load content 93 if (modalMe.find('.no-content')) { 94 $.get(modalMe.parent().attr('data-modal-link'), function (data) { 95 modalMe.find('.no-content').html(data).show(300); 96 modalMe.find('.no-content').removeClass('no-content'); 97 modalMe.find('.hover-modal-loading').hide(); 98 }); 99 100 } 101} 102function hideModals() { 103 window.clearTimeout(modalHideTime); 104 $('.hover-modal-container').not('.is-hover').hide(200); 105} 106 107function enableTooltipForSelector(idSelector){ 108 $('#'+idSelector).tooltip({ 109 items: "#"+idSelector, 110 content: $($("#"+idSelector)).attr("hover-message"), 111 classes: { 112 "ui-tooltip": "custom-tooltip-wrap", 113 "ui-tooltip-content": "custom-tooltip-inner" 114 } 115 }); 116 117 //also enable onclick for mobile 118 $('#'+idSelector).on('click', function () { 119 $(this).tooltip('enable').tooltip('open'); 120 }); 121} 122 123// Generic Datepicker 124function calendarpopUp(strControl, formname){ 125 $("input:text[name=" + strControl + "]").attr('id', strControl); 126 $("#" + strControl).datepicker({changeMonth: true,changeYear: true}).datepicker("show"); 127} 128 129function CallCenterpopUp(wname,url,width,height,statusbar,scrollbars,resizable,toolbar){ 130 131 //define height and width if they are not passed 132 //as arguments 133 if(!height) 134 height=300; 135 if(!width) 136 width=500; 137 if(!scrollbars) 138 scrollbars="yes"; 139 if(!resizable) 140 resizable="no"; 141 if(!toolbar) 142 toolbar="no"; 143 if(!statusbar) 144 toolbar="no"; 145 146 var theWidth = width; 147 var theHeight = height; 148 149 x = 0; 150 y = 0; 151 152 153 var settings = "status=" + statusbar + "toolbar=" + toolbar + ",resizable=" + resizable
153+ ",height=" + height + ",width=" + width + ",scrollbars=" + scrollbars + ',width='+theWidth+',height='+theHeight+',screenX='+x+', screenY='+y+', top='+y+',left='+x; 154 Testwin = window.open(url,wname,settings); 155 Testwin.focus(); 156} 157 158function isEmail(email) { 159 var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 160 return regex.test(email); 161} 162 163 164// Date Validation Functions 165function LeapYear(intYear) 166{ 167 if (intYear % 100 == 0) 168 { 169 if (intYear % 400 == 0) 170 { 171 return true; 172 } 173 } 174 else 175 { 176 if ((intYear % 4) == 0) 177 { 178 return true; 179 } 180 } 181 return false; 182} 183 184function chkdate(objName) 185{ 186var strDatestyle = "US"; //United States date style 187//var strDatestyle = "EU"; //European date style 188var strDate; 189var strDateArray; 190var strDay; 191var strMonth; 192var strYear; 193var intday; 194var intMonth; 195var intYear; 196var booFound = false; 197var datefield = objName; 198var strSeparatorArray = new Array("-"," ","/","."); 199var intElementNr; 200var err = 0; 201var strMonthArray = new Array(12); 202 strMonthArray[0] = "Jan"; 203 strMonthArray[1] = "Feb"; 204 strMonthArray[2] = "Mar"; 205 strMonthArray[3] = "Apr"; 206 strMonthArray[4] = "May"; 207 strMonthArray[5] = "Jun"; 208 strMonthArray[6] = "Jul"; 209 strMonthArray[7] = "Aug"; 210 strMonthArray[8] = "Sep"; 211 strMonthArray[9] = "Oct"; 212 strMonthArray[10] = "Nov"; 213 strMonthArray[11] = "Dec"; 214 strDate = datefield.value; 215 if (strDate.length < 1) 216 { 217 return true; 218 } 219 for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) 220 { 221 if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) 222 { 223 strDateArray = strDate.split(strSeparatorArray[intElementNr]); 224 if (strDateArray.length != 3) 225 { 226 err = 1; 227 return false; 228 } 229 else 230 { 231 strDay = strDateArray[0]; 232 strMonth = strDateArray[1]; 233 strYear = strDateArray[2]; 234 } 235 booFound = true; 236 } 237 } 238 if (booFound == false) 239 { 240 if (strDate.length>5) 241 { 242 strDay = strDate.substr(0, 2); 243 strMonth = strDate.substr(2, 2); 244 strYear = strDate.substr(4); 245 } 246 } 247 if (strYear.length == 2) 248 { 249 strYear = '20' + strYear; 250 } 251 // US style 252 if (strDatestyle == "US") 253 { 254 strTemp = strDay; 255 strDay = strMonth; 256 strMonth = strTemp; 257 } 258 intday = parseInt(strDay, 10); 259 if (isNaN(intday)) 260 { 261 err = 2; 262 return false; 263 } 264 intMonth = parseInt(strMonth, 10); 265 if (isNaN(intMonth)) 266 { 267 for (i = 0;i<12;i++) 268 { 269 if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) 270 { 271 intMonth = i+1; 272 strMonth = strMonthArray[i]; 273 i = 12; 274 } 275 } 276 if (isNaN(intMonth)) 277 { 278 err = 3; 279 return false; 280 } 281 } 282 intYear = parseInt(strYear, 10); 283 if (isNaN(intYear)) 284 { 285 err = 4; 286 return false; 287 } 288 if (intMonth>12 || intMonth<1) 289 { 290 err = 5; 291 return false; 292 } 293 if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) 294 { 295 err = 6; 296 return false; 297 } 298 if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) 299 { 300 err = 7; 301 return false; 302 } 303 if (intMonth == 2) 304 { 305 if (intday < 1) 306 { 307 err = 8; 308 return false; 309 } 310 if (LeapYear(intYear) == true) 311 { 312 if (intday > 29) 313 { 314 err = 9; 315 return false; 316 } 317 } 318 else 319 { 320 if (intday > 28) 321 { 322 err = 10; 323 return false; 324 } 325 } 326 } 327 return true; 328} 329function checkdate(objName,thedate) 330{ 331 332var datefield = objName; 333var datetext; 334 if (chkdate(datefield) == false) 335 { 336 //datefield.select(); 337 if (thedate == 'from') 338 { 339 datetext = 'from' 340 } 341 else 342 { 343 datetext = 'to' 344 } 345 alert("The " + datetext + " date is invalid. Please try again."); 346 //datefield.focus(); 347 return false; 348 } 349 else 350 { 351 return true; 352 } 353} 354 355function doDateCheck(from, to) 356{ 357 if (checkdate(from,'from')) 358 { 359 if (checkdate(to,'to')) 360 { 361 if (Date.parse(from.value) <= Date.parse(to.value)) 362 { 363 return true; 364 } 365 else 366 { 367 if (from.value == "" || to.value == "") 368 { 369 alert("Both dates must be entered."); 370 return false; 371 } 372 else 373 { 374 alert("To date must occur after the from date."); 375 return false;
376 } 377 } 378 } 379 } 380} 381 382 383//----------------------- Shopping Cart 384 function cartselectall() { 385 for (i=1;i<=parseInt(document.basket.NumTickets.value);++i) { 386 sTicket = "delitem_"+i; 387 if (document.basket[sTicket]) { 388 document.basket[sTicket].checked = true; 389 } 390 } 391 } 392 393 function cartdeselectall() { 394 for (i=1;i<=parseInt(document.basket.NumTickets.value);++i) { 395 sTicket = "delitem_"+i; 396 if (document.basket[sTicket]) { 397 document.basket[sTicket].checked = false; 398 } 399 } 400 } 401 function cartcanceltickets() { 402 var okay = 0 403 404 for (i=1;i<=parseInt(document.basket.NumTickets.value);++i) { 405 sTicket = "delitem_"+i; 406 if (document.basket[sTicket]) { 407 if (document.basket[sTicket].checked == true) { 408 okay = 1; 409 i = parseInt(document.basket.NumTickets.value)+1 410 } 411 } 412 } 413 414 if (okay==1) { 415 if (confirm('Are you sure that you want to remove the selected items?')) { 416 document.basket.activity.value="deltickets"; 417 document.basket.RemoveTickets.disabled= true; 418 document.basket.submit(); 419 } 420 } else { 421 alert('No items selected.'); 422 } 423 } 424 425 function updatePage(url, urlVariable, urlValue, option, preserveURL) { 426 //Updates the url, and history of the browser with variables for showare features. 427 //url variables is currently not used, but may be required for SEO optimizations when the current page is not ideal, or to remove data from the url. 428 // urlVariable == [] Array of variables to be set 429 // urlValue == [] Array of values, in order of urlVariable[] 430 // option == object to be added to the history.state for updating the page when back/forward are clicked 431 // preserveURL == optional boolean determines if previous url variables should be preserved, false by default 432 // ex: [string, number, string2], ["example", 1, "check"] result: [url]?string=example&number=1&string2=check 433 preserveURL = preserveURL || 0; 434 if (history.pushState) { 435 //Uses session history API. HTML5 436 var newState = {}; 437 var newURL = ""; 438 //collect current variables if any 439 var sPageURL = window.location.search.substring(1); 440 var sURLVariables = sPageURL.split('&'); 441 if (sURLVariables[0] != "" && preserveURL) { 442 for (var i = 0; i < sURLVariables.length; i++) { 443 var paramSplit = sURLVariables[i].split('='); 444 if (paramSplit.length) { 445 //any previous values should be overwritten below where newState[param] = newValue 446 newState[decodeURIComponent(paramSplit[0].replace(/\+/g, ' '))] = paramSplit.length > 1 ? decodeURIComponent(paramSplit[1].replace(/\+/g, ' ')) : ""; 447 } else { 448 newState[paramSplit[0]] = ""; 449 } 450 } 451 } 452 453 if (urlVariable.length == urlValue.length) { 454 for (var i = 0; i < urlVariable.length; i++) { 455 //update the newState object with each requested item 456 newState[urlVariable[i]] = urlValue[i]; 457 } 458 } else { 459 console.log("Failed URL Update: # of variables does not match # of values.") 460 } 461 //update the history state with the new url object, and the new url 462 var queryParts = []; 463 for (var index in newState) { 464 if (newState.hasOwnProperty(index)) { 465 queryParts.push(encodeURIComponent(index) + "=" + encodeURIComponent(newState[index])); 466 } 467 } 468 newURL = queryParts.length ? ("?" + queryParts.join("&")) : ""; 469 newState["option"] = option; 470 history.pushState(newState, null, newURL); 471 } else { 472 //optional support for html4 browsers - if needed. 473 } 474 } 475 window.onpopstate = function (event) { 476 if (!history.state || history.state === undefined) return; 477 if (history.state.option.eventList) { 478 //the history has ane eventList, update it 479 clearEventList(); 480 clearPerformanceList(); 481 eventListArgs = history.state.option.eventList; 482 doEventList(); 483 $(".pl-wrap").hide(); 484 $(".featured-wrap").show(); 485 486 } 487 if (history.state.option.performanceList) { 488 //the history has ane eventList, update it 489 clearEventList(); 490 clearPerformanceList(); 491 performanceListArgs = history.state.option.performanceList; 492 doPerformanceList(); 493 $(".pl-wrap").show(); 494 $(".featured-wrap").hide(); 495 } 496 } 497 498function sortDropDrown(dropdownId, topValue) { 499 var options = $('#' + dropdownId +' option'); 500 var arr = options.map(function(_, o) { 501 return { 502 t: $(o).text(), 503 v: o.value 504 }; 505 }).get(); 506 arr.sort(function(o1, o2) { 507 var t1 = o1.t.toLowerCase(), t2 = o2.t.toLowerCase(); 508 return t1 == topValue ? -1 : t2 == topValue ? 1 :t1 > t2 ? 1 : t1 < t2 ? -1 : 0; 509 }); 510 options.each(function(i, o) { 511 o.value = arr[i].v; 512 $(o).text(arr[i].t); 513 }); 514 $('#' + dropdownId).val(topValue); 515 } 516 517 function maskCreditCardNumber(cardNumber) { 518 if (typeof (cardNumber) != 'undefined' && cardNumber.length > 10) { 519 return cardNumber.slice(0, 6) + repeatString("x", cardNumber.length - 10) + cardNumber.slice(-4); 520 } else { 521 return cardNumber; 522 } 523 } 524 525 function repeatString(val, times) { 526 if (times < 0) { 527 return ""; 528 } 529 530 if (times === 1) { 531 return val; 532 } 533 534 else { 535 return val + repeatString(val, times - 1); 536 } 537 } 538 539 function isBlank(str) { 540 return ((!str || /^\s*$/.test(str)) && str !== 0); 541 } 542 543//yet another fix for IE 544 Number.isInteger = Number.isInteger || function (value) { 545 return typeof value === "number" && 546 isFinite(value) && 547 Math.floor(value) === value; 548 };
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.