		function validateZip()
		{
			var elm = document.forms['frmx'].elements['zip'];
			
			var txt = String(elm.value);

			if (!txt.match(/^([A-Z]\d[A-Z])[-\s]?(\d[A-Z]\d)$/mi))
				elm.style.backgroundColor = '#faa';
			else
				elm.style.backgroundColor = '';
		}
		
		function doVanc()
		{
			return;
			var zip = document.forms['frmx'].elements['zip'].value;
			
			zip = zip.toUpperCase();
			
			var goodZips = ['V1M', 'V2S', 'V2T', 'V2V', 'V2W', 'V2X', 'V2Y', 'V2Z', 'V3A', 'V3B', 'V3C', 'V3E',
					'V3G', 'V3H', 'V3J', 'V3K', 'V3L', 'V3M', 'V3N', 'V3R', 'V3S', 'V3T', 'V3V', 'V3W',
					'V3X', 'V3Y', 'V4A', 'V4B', 'V4C', 'V4E', 'V4G', 'V4K', 'V4L', 'V4M', 'V4N', 'V4P',
					'V4R', 'V4S', 'V4W', 'V4X', 'V5A', 'V5B', 'V5C', 'V5E', 'V5G', 'V5H', 'V5J', 'V5K',
					'V5L', 'V5M', 'V5N', 'V5P', 'V5R', 'V5S', 'V5T', 'V5V', 'V5W', 'V5X', 'V5Y', 'V5Z',
					'V6', 'V7'];
				
			var g = false;
				
			for (var i = 0; i < goodZips.length; ++i)
			{
				var xzip = goodZips[i];
				var yzip = zip.substr(0, xzip.length);
				
				if (xzip == yzip)
				{
					g = true;
					break;
				}
			}
			
			if (g)
				document.getElementById('trvanc').style.display = '';
			else
			{
				document.getElementById('trvanc').style.display = 'none';
				document.getElementById('translinklistensQuestion_yes').checked = false;
			}
		}
		
		function getCaretPos(ctrl)
		{
			var CaretPos = -1;
			
			if (document.selection)
			{
				ctrl.focus ();
				var Sel = document.selection.createRange ();

				Sel.moveStart ('character', -ctrl.value.length);

				CaretPos = Sel.text.length;
			}
			else if (ctrl.selectionStart || ctrl.selectionStart == '0')
				CaretPos = ctrl.selectionStart;

			return (CaretPos);
		}

		function setCaretPos(ctrl, pos)
		{
			if(ctrl.setSelectionRange)
			{
				ctrl.focus();
				ctrl.setSelectionRange(pos,pos);
			}
			else if (ctrl.createTextRange)
			{
				var range = ctrl.createTextRange();
				range.collapse(true);
				range.moveEnd('character', pos);
				range.moveStart('character', pos);
				range.select();
			}
		}

		function dotheupper(elm)
		{
			var pos = getCaretPos(elm);
			elm.value = elm.value.toUpperCase();
			setCaretPos(elm, pos);
		}
		
		function forcePhoneNumber(elm)
		{
			var pos = getCaretPos(elm);
			
			var phone = elm.value;
			
			for (var i = 0; i < phone.length; ++i)
				if (phone.charCodeAt(i) < '0'.charCodeAt(0) || phone.charCodeAt(i) > '9'.charCodeAt(0))
				{
					if (pos > i)
						--pos;
						
					phone = phone.substr(0, i) + phone.substr(i + 1);
					
					--i;
				}
				
			phone = phone.replace(/^(\d{0,3})(\d{0,3})(\d{0,4})\d*$/, '($1) $2-$3');
			//phone = phone.replace(/^(\d{3})?(\d{3})?(\d{4})?\d*$/, '($1) $2-$3');
			
			elm.value = phone;
			
			if (pos <= 3)
				pos += 1;
			else if (pos <= 6)
				pos += 3;
			else
				pos += 4;
			
			setCaretPos(elm, pos);
		}
		
		function makeAgex(frm)
		{
			var doby = frm.elements['doby'].value;
			
			if (doby != '')
			{
				var dt = new Date();
				var xage = dt.getFullYear() - doby;
				
				if (xage < 18)
					frm.elements['xage'].value = 'Under 18';
				else if (xage <= 25)
					frm.elements['xage'].value = '18-25';
				else if (xage <= 29)
					frm.elements['xage'].value = '26-29';
				else if (xage <= 39)
					frm.elements['xage'].value = '30-39';
				else if (xage <= 49)
					frm.elements['xage'].value = '40-49';
				else if (xage <= 59)
					frm.elements['xage'].value = '50-59';
				else
					frm.elements['xage'].value = '60 or Over';
			}
		}