﻿function resize_iframe(a, b) { document.getElementById(a).height = 100; document.getElementById(a).height = window.frames[b].document.body.scrollHeight + 20 } function clearSearchBox(a) { var b = new PageScripts; b.ClearSearchBox(a.id, "Search...") } function PageScripts() { this.validationMessage = ""; this.validationSuccess = false; this.alertMessage = "" } function StringFunctions() { this.StringValue = "" } function validWhiteSpace(a) { var b = new StringFunctions; b.StringValue = a.value; b.regExpressionWhiteSpaceValidator(); b.trim(); a.value = b.StringValue } function validIntegerReplaceIfBlank(a) { var b = new StringFunctions; b.StringValue = a.value; b.regExpressionIntegerValidator(); b.trim(); if ("" == b.StringValue) { a.value = "0" } else { a.value = b.StringValue } } function validInteger(a) { var b = new StringFunctions; b.StringValue = a.value; b.regExpressionIntegerValidator(); b.trim(); a.value = b.StringValue } function validCurrency(a) { var b = new StringFunctions; b.StringValue = a.value; b.regExpressionCurrencyValidator(); b.trim(); a.value = b.StringValue } function textOnlyDescription(a) { var b = new StringFunctions; b.StringValue = a.value; b.regExpressionDescValidator(); a.value = b.StringValue } function validSplitDescription(a) { var b = new StringFunctions; b.StringValue = a.value; b.regExpressionDescValidator(); b.trim(); a.value = b.StringValue } function validTitle(a) { var b = new StringFunctions; b.StringValue = a.value; b.regExpressionTitleValidator(); b.trim(); a.value = b.StringValue } function CustomPageValidator() { this.customErrors = ""; this.validationGroup = "" } function CustomPageValidation() { var a = new CustomPageValidator; a.customValidation(); if ("" != a.customErrors) { alert("There was a problem with your submission. Please check and try again:\n\n" + a.customErrors + "\n\n " + "Unable to complete the form submission") } } function CustomValidateGroup() { var a = new CustomPageValidator; var b = true; a.customGroupValidation(); if ("" != a.customErrors) { alert("There was a problem with your submission. Please check and try again:\n\n" + a.customErrors + "\n\n " + "Unable to complete the form submission"); b = false } return b } function DefaultValidateGroup(a) { var b = new CustomPageValidator; var c = true; b.validationGroup = a; b.customGroupValidation(); if ("" != b.customErrors) { alert("There was a problem with your submission. Please check and try again:\n\n" + b.customErrors + "\n\n " + "Unable to complete the form submission"); c = false } return c } function CustomDefaultValidation() { var a = new CustomPageValidator; var b = true; a.customValidation(); if ("" != a.customErrors) { alert("There was a problem with your submission. Please check and try again:\n\n" + a.customErrors + "\n\n " + "Unable to complete the form submission"); b = false } return b } function DefaultValidation(a) { var b = new CustomPageValidator; var c = true; b.customValidation(); if ("" != a || "" != b.customErrors) { alert("There was a problem with your submission. Please check and try again:\n\n" + b.customErrors + a + "\n\n " + "Unable to complete the form submission"); c = false } return c } function CustomBookingValidator() { var a = new CustomPageValidator; var b = true; a.customValidation(); if (!document.getElementById("Main_mainContent_chkAgree").checked) { a.customErrors += "Terms and conditions tick box must be checked \n" } var c = document.getElementById("Main_mainContent_ddlCourse2").value; var d = document.getElementById("Main_mainContent_ddlCourse4").value; var e = document.getElementById("Main_mainContent_ddlCourse3").value; if (c == d || c == e || d == e) { a.customErrors += "Selected Courses 2,3 and 4 must be unique" } if ("" != a.customErrors) { alert("There was a problem with your submission. Please check and try again:\n\n" + a.customErrors + "\n\n " + "Unable to complete the form submission"); b = false } return b } function fadeFlyOutNote() { var a = document.getElementById("popoutNote"); var b = document.getElementById("popoutNotePointer"); a.style.visibility = "hidden"; b.style.visibility = "hidden"; a.style.left = "-1000px"; a.style.backgroundColor = ""; a.style.width = ""; b.style.left = "-1000px"; b.style.backgroundColor = ""; b.style.width = "" } function flyOutNote(a) { var b = document.getElementById("popoutNote"); var c = document.getElementById("popoutNotePointer"); b.innerHTML = a; b.style.backgroundColor = "lightyellow"; c.style.backgroundColor = "lightyellow"; if (MSIE) { c.style.top = "-33px"; if (IE8) { c.style.top = "-25px" } } else { c.style.top = "-25px" } b.style.visibility = "visible"; c.style.visibility = "visible"; return false } function refreshFlyoutTimer() { if (countDown > 0) { var a = parseInt(countDown % 60); setTimeout("countdownDisappearFlyout()", 1e3) } else { fadeFlyOutNote() } } function navigateToSelectedURL() { window.open(document.getElementById("selectLink").value) } function countdownDisappearFlyout() { countDown -= 1; refreshFlyoutTimer() } var MSIE = navigator.appVersion.indexOf("MSIE") > 0; var IE8 = navigator.appVersion.indexOf("MSIE 8") > 0; CustomPageValidator.prototype.customValidation = function () { var a = ""; var b = 0; for (b = 0; b < Page_Validators.length; b++) { var c = Page_Validators[b].evaluationfunction; var d = Page_Validators[b].id; if (("" + c).substring(0, 40).indexOf("RequiredFieldValidator") > 0) { var e = RequiredFieldValidatorEvaluateIsValid(Page_Validators[b]); if (!e) { a += "A valid " + document.getElementById(d).getAttribute("popupmessage") + " is required \n" } } if (("" + c).substring(0, 40).indexOf("RegularExpression") > 0) { var e = RegularExpressionValidatorEvaluateIsValid(Page_Validators[b]); if (!e) { a += "A valid " + document.getElementById(d).getAttribute("popupmessage") + " is required \n" } } } if ("" != a) { this.customErrors = a } }; CustomPageValidator.prototype.customGroupValidation = function () { var a = ""; var b = 0; for (b = 0; b < Page_Validators.length; b++) { var c = Page_Validators[b].evaluationfunction; var d = Page_Validators[b].id; if (this.validationGroup == document.getElementById(d).getAttribute("ValidationGroup")) { if (("" + c).substring(0, 40).indexOf("RequiredFieldValidator") > 0) { var e = RequiredFieldValidatorEvaluateIsValid(Page_Validators[b]); if (!e) { a += "A valid " + document.getElementById(d).getAttribute("popupmessage") + " is required \n" } } if (("" + c).substring(0, 40).indexOf("RegularExpression") > 0) { var e = RegularExpressionValidatorEvaluateIsValid(Page_Validators[b]); if (!e) { a += "A valid " + document.getElementById(d).getAttribute("popupmessage") + " is required \n" } } } } if ("" != a) { this.customErrors = a } }; StringFunctions.prototype.trim = function () { this.StringValue = this.StringValue.replace(/^\s+|\s+$/g, "") }; StringFunctions.prototype.ltrim = function () { this.StringValue = this.StringValue.replace(/^\s+/, "") }; StringFunctions.prototype.rtrim = function () { this.StringValue = this.StringValue.replace(/\s+$/, "") }; StringFunctions.prototype.regExpressionTitleValidator = function () { var a = /[\\\/\.\,\-\:\"\^\&\;\?\{\}\%\\{\}\<\>]/g; this.StringValue = this.StringValue.replace(a, "") }; StringFunctions.prototype.regExpressionDescValidator = function () { var a = /[\\\/\^\?\{\}\%\*\\{\}\<\>]/g; this.StringValue = this.StringValue.replace(a, "") }; StringFunctions.prototype.regExpressionCurrencyValidator = function () { var a = /[\\\/\,\{A-Z}\{a-z}\!\"\xA3\@\&\*\(\)\$\%\+\=\_\:\^\;\?\{\}\%\\{\}\<\>]/g; this.StringValue = this.StringValue.replace(a, "") }; StringFunctions.prototype.regExpressionIntegerValidator = function () { var a = /[\\\/\,\{A-Z}\{a-z}\!\"\xA3\@\&\*\(\)\$\%\+\=\_\.\:\^\;\?\{\}\%\\{\}\<\>]/g; this.StringValue = this.StringValue.replace(a, "") }; StringFunctions.prototype.regExpressionWhiteSpaceValidator = function () { var a = /[\s]/g; this.StringValue = this.StringValue.replace(a, "") }; PageScripts.prototype.ClearSearchBox = function (a, b) { var c = document.getElementById(a); if (b == c.value) { c.value = "" } }
