<!--
// for use in login.xal and guestlogin.xsl

function submit_login(e)
{
    if (document.frm_main.email.value == "") {
        alert('Please provide your username.');
        document.frm_main.email.focus();
        return false;
    } else if (document.frm_main.pass.value == "") {
        alert('Please provide your password.');
        document.frm_main.pass.focus();
        return false;
    }
	if (typeof e != 'undefined' && !enter_key_trap(e)) {
        return;
    }
	
	var form = document.frm_main;
	
	var email = form.email.value;
	var	username = email;
	var	domain = "csoftinc.com";
	var	action = form.action;
	
	form.user.value = username.toLowerCase();
	form.domain.value = 'csoftinc.com';
	form.action = action;
	
	document.frm_main.login.disabled = true;
	document.frm_main.submit();
	return true;
    
}

function enter_key_trap(e)
{
    var keyPressed;

    if (document.layers) {
        keyPressed = String.fromCharCode(e.which);
    } else if (document.all) {
        keyPressed = String.fromCharCode(window.event.keyCode);
    } else if (document.getElementById) {
        keyPressed = String.fromCharCode(e.keyCode);
    }

    return (keyPressed == "\r" || keyPressed == "\n");
}
-->

