// last modified:  1/5/05

function moz(t){
var p = eval (t);
alert(p);
}


function maxwindow() {

top.window.moveTo(0,0); 
if (document.all) 
   { top.window.resizeTo(screen.availWidth,screen.availHeight); } 
else if 
   (document.layers || document.getElementById) 
   { 
   if 
    (top.window.outerHeight < screen.availHeight || top.window.outerWidth < 
screen.availWidth)
     { top.window.outerHeight = top.screen.availHeight; 
       top.window.outerWidth = top.screen.availWidth; } 
   } 
}



function errorhighlight(inval_box,inval_msg){

var errorbox = document.getElementById(inval_box).style;
var errorline = document.getElementById(inval_msg).style;
	// no eval() needed for above variables as would be if you had used "document.all." + words + ".style" to make a string

var state = errorbox.visibility;
	// does not work if you skip var state part and just slap .visibility onto textline definition.
	
if (state == "visible"){
	errorline.visibility="hidden";
	errorbox.backgroundColor="#c6e0fd";
	errorbox.border="0px";
	}
else {
	errorline.visibility="visible";
	errorbox.backgroundColor="#e4edfc";
	errorbox.border="1px dotted #330099";

	}

document.sigmaa_logon.v_id1.value="";
document.sigmaa_logon.v_id2.value="";
document.sigmaa_logon.v_id1.focus();

}//end of errorhighlight function



function checkEmail(the_email)
{
    var the_at = the_email.indexOf("@");
    var the_dot = the_email.lastIndexOf(".");
    var a_space = the_email.indexOf(" ");
    if ((the_at != -1) &&  // if there's an '@'
        (the_at != 0) &&  // and it's not at position 0
        (the_dot != -1) && // and there's a '.'
        (the_dot > the_at + 1) &&  // and something between the '@' and '.'
        (the_dot < the_email.length - 1) && // and something after the '.'
        (a_space  == -1))  // and there're no spaces
    	{
        	    
        	    return true;
    	}  else {
        	    alert("Your email address appears invalid.\nPlease check it closely for errors.");
        	    return false;
    	}
}//end of checkEmail function





function functioncontrol(){
				
		
/*
		alert("email =" + document.sigmaa_logon.email.value);
		return false;
		end of new stuff
		*/
	var eok = checkEmail(document.sigmaa_logon.email.value);
		if (eok == false) {
			return false;
			}	
	
	_CF_checksigmaa_logon(document.sigmaa_logon);//CF's script must be passed control last.
	
}//end of functioncontrol function	




	/*return _CF_checkprogform(document.progform); is a hack, but it passes control back to the form.  It's what coldfusion puts in the form tag, except i substituted "document.progform" for "this".  If i put in:
	
				document.progform.submit();
				
	up above, it will not pass control back properly.  It will let the form submit without the coldfusion checks.  Coldfusion has Progform say 'this' on the page (Verbatim:****   onSubmit="return _CF_checkprogform(this)  *****[although i'm not sure this line is even used, as my line below may be the one of the two that does the submit]), so in the <cfform> tag (preprocess), i put:
	
				 onsubmit="document.progform.submit();"
	
	This is inserted by coldfusion right before its last "return true;"  Putting "this" in there would kill it, even though it resides in the proper element, as it does get passed up to the top of the page.
	
	Called from form's submit button:   <input type="button" value="submit" class="steelsubmitbutton" onClick="functioncontrol();">
	*/





