	function funEmailIsValid(strEmail) {

		// return either true or false
		var blnEmail = true;
		strEmail = new String(strEmail);

		lblEmailCheck: {

			// is this empty?
			if (strEmail == "") {
				// leave as valid
				break lblEmailCheck;
			}
			var intLen = strEmail.length;

			// check '@ sign
			var intOffA = strEmail.indexOf("@");
			if (intOffA == intLen-1 || intOffA <= 0) {
				blnEmail = false;
				break lblEmailCheck;
			} 
			// check full-stop
			var intOffP = strEmail.indexOf(".",intOffA+1);
			if (intOffP == -1 || intOffP == intLen-1) {
				blnEmail = false;
				break lblEmailCheck;
			}
			// check ASCII codes 97->122, 48->57, 64 or 95 OR 46 or 39
			strEmail = strEmail.toLowerCase();
			for (var i=0; i<intLen; i++) {
				var intAscii = strEmail.charCodeAt(i);
				if ((intAscii < 48 && intAscii != 45 && intAscii != 46 && intAscii != 39) || (intAscii == 32) || (intAscii > 122) || (intAscii > 57 && intAscii < 97 && intAscii != 64 && intAscii != 95)) {
					blnEmail = false;
					break lblEmailCheck;
				}
			}
		}

		return blnEmail;	
	}

	function popUp(strFileName, intWidth, intHeight) {
		var newWin = getPopUp(strFileName, intWidth, intHeight);
		newWin.focus();
	}

	function getPopUp(strFileName, intWidth, intHeight) {
		if (intWidth == null) { intWidth = 500; }
		if (intHeight == null) { intHeight = 475; }
		featuresString = "height=" + intHeight + ",width=" + intWidth + ",scrollbars=yes,resizable=yes"
		var objWin = window.open(strFileName, "PopUp", featuresString);
		objWin.focus();
		return objWin;
	}

	function imagePopUp(strFileName, intWidth, intHeight) {
		var newWin = getImagePopUp(strFileName, intWidth, intHeight);
		newWin.focus();
	}

	function getImagePopUp(strFileName, intWidth, intHeight) {
		if (intWidth == null) { intWidth = 500; }
		if (intHeight == null) { intHeight = 475; }
		featuresString = "height=" + intHeight + ",width=" + intWidth + ",scrollbars=no,resizable=yes"
		var objWin = window.open(strFileName, "PopUp", featuresString);
		objWin.focus();
		return objWin;
	}

