	function ajxLogin() {
		document.getElementById('divLoginError').innerHTML = "";
		if (document.frmLogin.txtCID.value.length > 0 && document.frmLogin.txtPASS.value.length > 0) {
			x_ajxLogin(document.frmLogin.txtCID.value,document.frmLogin.txtPASS.value,ajxLogin_cb);
		}
	}

	function ajxLogin_cb(z) {
		if (z != '!') {
			document.getElementById('divLoginError').innerHTML = z;
		} else { document.frmLogin.submit(); }
	}
	
	function jvaSelectRate() {
		cOption = -1;
		for (i=document.frmRates.radRate.length-1; i > -1; i--) {
			if (document.frmRates.radRate[i].checked) {
				cOption = i; i = -1;
			}
		}
		if (cOption == -1) {
			alert('You must select a rate before continuing.');
			return false;
		} else {
			document.frmRates.txtPlan.value = document.frmRates.radRate[cOption].value;
			if (document.frmRates.txtPlan.value != '') {
				document.frmRates.submit();	
			}
		}
	}
	
	function jvaTermsOfUse() {
		window.open("terms.php","windowX","menubar=no,status=no,location=no,directories=no,resizeable=no,scrollbars=yes,width=640,height=480,toolbar=no");
	}
	
	function ajxSignupValidate() {
		var e = '';
		document.frmSignup.txtMethod.value = 'signup';
		if (document.frmSignup.txtName.value.length == 0)					{ e = e + '- Name\n'; }
		if (document.frmSignup.txtAddress.value.length == 0)				{ e = e + '- Address\n'; }
		if (document.frmSignup.txtCity.value.length == 0)					{ e = e + '- City\n'; }
		if (document.frmSignup.selProvince.value.length == 0)				{ e = e + '- State/Province\n'; }
		if (document.frmSignup.txtPostalCode.value.length == 0)			{ e = e + '- Zip/Postal Code\n'; }
		if (document.frmSignup.selCountry.value.length == 0)				{ e = e + '- Country\n'; }
		if (document.frmSignup.txtEmail.value.length == 0)					{ e = e + '- Email\n'; }
		if (document.frmSignup.txtUsername.value.length == 0)				{ e = e + '- Username\n'; }
		if (document.frmSignup.txtPassword.value.length == 0)				{ e = e + '- Password\n'; }
		if (document.frmSignup.chkTerms.checked == false) {
			e = 'You must accept the Terms of Use to continue.\n';
		}
		if (document.frmSignup.txtPassword.value != document.frmSignup.txtPasswordConfirm.value) {
			e = 'Password & Confirm do not match.\n';
		}

		if (e != '') { alert('Please fill in the following fields:\n'+e); }
		else { x_ajxSignupValidate(document.frmSignup.txtUsername.value,ajxSignupValidate_cb); }
	}
	
	function ajxSignupValidate_cb(z) {
		if (z != '!') {
			document.getElementById('divSignupError').innerHTML = z;
		} else { document.frmSignup.submit(); }
	}
	
	function ajxLoginValidate() {
		var e = '';
		document.frmSignup.txtMethod.value = 'login';
		if (document.frmSignup.txtCID.value.length == 0)					{ e = e + '- Client ID\n'; }
		if (document.frmSignup.txtPASS.value.length == 0)					{ e = e + '- Password\n'; }
		if (e != '') { alert('Please fillin the following fields:\n'+e); }
		else { x_ajxLoginValidate(document.frmSignup.txtCID.value,document.frmSignup.txtPASS.value,ajxLoginValidate_cb); }
	}
	
	function ajxLoginValidate_cb(z) {
		if (z != '!') {
			document.getElementById('divLoginError').innerHTML = z;
		} else { document.frmSignup.submit(); }
	}