	function SubmitForm()
	{
		SubmitPassedForm('frmLogin');
	}
	
	function SubmitPassedForm(pstrFormName)
	{
	
		//validate inputs
		if(document.forms[pstrFormName].inpUsername.value.length < 1)
		{
			alert("Please enter your username.");
		}
		else if(document.forms[pstrFormName].inpPassword.value.length < 1)
		{
			alert("Please enter your password.");
		}		
		else
		{	
			document.forms[pstrFormName].action = 'https://' + document.frmHost.inpHost.value + "/Security/Login/ServeLogin.asp";
			document.forms[pstrFormName].submit();
		}
	}
	
	function submitRegistrationType(pstrFormName)
	{
		var strEMail = document.forms[pstrFormName].inpEmail.value;
		var strConfirmEMail=document.forms[pstrFormName].inpConfirmEmail.value;
		var inpRegType = document.forms[pstrFormName].inpRegType;
		var bResult = true;
		var bChecked = false;
		var strMessage = '';

		markLabel(document.getElementById('divEmail'),false);
		markLabel(document.getElementById('divConfirmEmail'),false);

		if (inpRegType && inpRegType.type != 'hidden') {
			// Validate registration type
			for (i=inpRegType.length-1; i > -1; i--)
			{
				if (inpRegType[i].checked)
				{
					bChecked = true;
				}
			}
			if (bChecked == false)
			{
				strMessage = 'We need to know on whose behalf you are registering\n';
				bResult = false;
			}
		}
	
		if (strEMail.length == '0' || checkEmail(strEMail) == false )
		{
			strMessage = strMessage + 'You must enter a valid email address\n';
			markLabel(document.getElementById('divEmail'),true);
			bResult = false;		
		}
		else if (strConfirmEMail != strEMail)
		{
			strMessage = strMessage +'Email Address and Confirm Email Address fields should be the same\n';
			markLabel(document.getElementById('divEmail'),true);
			markLabel(document.getElementById('divConfirmEmail'),true);
			bResult = false;
		}

		if(!bResult)
		{
			alert('The following errors have been found. Please correct and continue.\n\n' + strMessage );		
		}	 		
		else
		{
			document.forms[pstrFormName].action = 'https://' + document.frmHost.inpHost.value + '/ContactUs/RegistrationType.asp';
			document.forms[pstrFormName].submit();
		}
	}	

	
	function submitRegistrationNoCC(pstrFormName, pstrAction)
	{
		// register when CC Payment switched off
		document.forms[pstrFormName].inpAction.value = pstrAction;
		document.forms[pstrFormName].action = '../ContactUs/Register.asp';
		document.forms[pstrFormName].submit();
	}	

	
	var mbCapsWarning=false;
	var mbIE3 = ( navigator.appName != "Netscape" && navigator.appVersion.substring(0,3) < 4 );
	var mbIE55 = (navigator.appVersion.indexOf("MSIE 5.5") > 0);

	function capsDetect(poInput, e, poObject ) 
	{	
		if(!mbIE3) {		
			if( !e ) { e = window.event; } 
			//what (case sensitive in good browsers) key was pressed
			var theKey = e.which ? e.which : ( e.keyCode ? e.keyCode : ( e.charCode ? e.charCode : 0 ) );
			//was the shift key was pressed
			var theShift = e.shiftKey || ( e.modifiers && ( e.modifiers & 4 ) ); //bitWise AND
			//if upper case, check if shift is not pressed. if lower case, check if shift is pressed
			
			if(!mbCapsWarning && ((theKey > 64 && theKey < 91 && !theShift ) || ( theKey > 96 && theKey < 123 && theShift ))) {		
				poObject.style.display='inline';
				mbCapsWarning=true;			
			}
			else {
				poObject.style.display='none';
				mbCapsWarning=false;
			}		
		}
		mbCapsWarning=false;
	}
	
	function openRememberMeExplainedPopUp() {
		window.open('http://' + document.frmHost.elements['inpHost'].value + '/Generic.asp?Pagename=RememberMeExplained');
	}
	
	function showeduemailmsg(pbShow)
	{
		if (pbShow==true) {
			document.getElementById('eduemailmsg').style.display = 'block';
		}
		else {
			document.getElementById('eduemailmsg').style.display = 'none';
		}
	}


	function markLabel(poLabel, pbMissing)
	{
		var strErrClass = ' missingfield';
		var oErrorRegExp = new RegExp(strErrClass + '$');
		var bMarked = (poLabel.className.search(oErrorRegExp) > -1);

		if (pbMissing && !bMarked) // need to mark
		{
			poLabel.className = poLabel.className + strErrClass;
		}
		else if (!pbMissing && bMarked) // need to unmark
		{
			poLabel.className = poLabel.className.replace(oErrorRegExp,'');
		}
	}
	
	function submitEmail(pstrFormName) {
	
		var strEMail = document.forms[pstrFormName].inpEmail.value;
		var strConfirmEMail=document.forms[pstrFormName].inpConfirmEmail.value;
		var strMessage = '';

		if (strEMail.length == '0' || checkEmail(strEMail) == false ) {
			strMessage = strMessage + 'You must enter a valid email address\n';
		}
		if (strConfirmEMail != strEMail) {
			strMessage = strMessage + 'Email Address and Confirm Email Address fields should be the same\n';
		}
		if (document.forms[pstrFormName].inpPassword.value.length < 1) {
			strMessage = strMessage + 'You must enter your password\n';
		}
		if (strMessage.length > 0) {
			alert('The following errors have been found. Please correct and continue.\n\n' + strMessage );		
		} else {
			document.forms[pstrFormName].action = 'https://' + document.frmHost.inpHost.value + "/Security/Login/ServeLogin.asp";
			document.forms[pstrFormName].submit();
		}
	}