function checkArray(arrayToCheck, valueToFind) {	//Checks if a certain value is contained in an array	for (m = 0; m < arrayToCheck.length; m++) {		if (arrayToCheck[m] == valueToFind) {			return true;		}	}}function checkArrayMulti(keyField, keyValues) {	//Checks if any one of the values passed in are what has been selected in the field	var returnVal = false;	var keyArray = new Array();	keyArray = keyValues.split(",");			for (i = 0; i < keyArray.length; i++) {		if(keyField[keyField.selectedIndex].text.toLowerCase() == keyArray[i]) {			returnVal = true;			break;		}		}		return returnVal;}function displayDiv(showList, fullList) {	//Goes through the full list and shows the items in the show list while hiding all the others	var showArray = new Array();	var fullArray = new Array();	showArray = showList.split(",");	fullArray = fullList.split(",");			for (i = 0; i < fullArray.length; i++) {		var divName = document.getElementById(fullArray[i]);		if (divName) {			if (checkArray(showArray, fullArray[i])) {				divName.style.display="";			} else {				divName.style.display="none";			}		}		}	}function getMultiSelect(multiField) {	//Get all of the text values of selected items in a multi select field	var jsMultiArray = new Array();	var jsMultiList = "";		for (i=0; i < multiField.length; i++) {			if (multiField.options[i].selected) {				if (	jsMultiList == "") {					jsMultiList = multiField.options[i].text.toLowerCase();				} else {					jsMultiList = jsMultiList + "," + multiField.options[i].text.toLowerCase();					}			}		}				jsMultiArray = jsMultiList.split(",");		return jsMultiArray;		}function checkNumeric(tmp, allowNeg) {	var isNumber = true 	for (var i = 0; i < tmp.length; i++)  {		var oneChar = tmp.charAt(i);		if (i==0 && oneChar == "-" && allowNeg)  {			continue;		} else if (oneChar < "0" || oneChar > "9") {			isNumber = false;			break;		}	}          return isNumber;}function checkdate(objName) {	var datefield = objName;	if (chkdate(objName) == false) {		//datefield.select();		alert("That date is invalid.  Please enter the date in the format of dd/mm/yyyy.");		datefield.focus();		return false;	} else {		return true; 	}	}function confirmCancel() {	if(confirm ("All information will be lost.  Are you sure you wish to continue?")) {		window.close();	} else {		return false;	}	}function confirmSubmit() {	if(confirm ("Please confirm submission of this information to CUA")) {		document.forms[0].submit();	} else {		return false;	}	}function confirmSubmitBank() {	if(confirm ("Please confirm submission of this information to CUA")) {		document.forms[0].memNo.disabled = false;			document.forms[0].submit();	} else {		return false;	}	}function confirmSubmitUserForms() {	if(confirm ("Please confirm submission of this information to CUA")) {	     document.forms["_UWA"].target = "xmlFrame";		document.forms["_UWA"].submit();	} else {		return false;	}	}function setActiveStyleSheet(title) {	//Original version	var i, a, main;	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {			a.disabled = true;			if(a.getAttribute("title") == title) a.disabled = false;		}	}}function setActiveStyleSheetOpera(title) {	//Modified for Opera browsers	var i, a, main;	for(i=0; (a = document.styleSheets[i]); i++) {			a.disabled = true;			if(a.title == title) a.disabled = false;	}	} function setInput(hide) {	//Used to disable all the input fields for preview	//parameter value 'true' = hide	if (!document.getElementsByTagName){ return; }	// loop through all input tags	var allfields = document.getElementsByTagName("input");		for (var i=0; i<allfields.length; i++){		var field = allfields[i];				if(hide == "true") {			field.disabled = true;		} else {			field.disabled = false;					}		}		// loop through all select boxes	var allfields = document.getElementsByTagName("select");		for (var i=0; i<allfields.length; i++){		var field = allfields[i];				if(hide == "true") {			field.disabled = true;		} else {			field.disabled = false;					}		}			// loop through all textareas	var allfields = document.getElementsByTagName("textarea");		for (var i=0; i<allfields.length; i++){		var field = allfields[i];				if(hide == "true") {			field.disabled = true;		} else {			field.disabled = false;					}		}			}function printit(){  	if (window.print) {		window.print();  	} else {		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);		WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  	}	}function checkSecurity(querystring) {	//Cross site scripting check for javascript injection into forms	var exclusions = new Array("<", ">", "\\");		for (i=0; i < exclusions.length; i++) {		if (querystring.indexOf(exclusions[i]) > -1) {			location.href = "http://" + location.hostname + location.pathname.substring(0, location.pathname.indexOf(".nsf/") + 5) + "security";			break;		}	}}