<!--

// set the common variables
frm = document.test

function writE( dom2, dom1, dom3, name, text )
	{
	var aaa = "a"
	var a2t = "@"
	var dot = "."
	
	document.write( "<" + aaa + " hr" + "ef='mai" );
	document.write( "lto:" + name + a2t + dom1 );
	document.write( dot + dom2 ); 
	if (dom3 != "")
		{
		document.write( dot + dom3 );
		}
	document.write("'>"); 
	if (text != "")
		{
		document.write( text );
		}
	else
		{
		document.write( name + a2t + dom1 + dot + dom2 ); 
		if (dom3 != "")
			{
			document.write( dot + dom3 );
			}
		}
	document.write("</" + aaa + ">"); 
	}

function checkSelect( strCase )
	{
	if ( strCase == "Council" )
		{
		document.search.submit();
		}
	}

function checkEmail( src )
	{
	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex = new RegExp( emailReg );
	var emailValid = regex.test( src.value );
	if ( !emailValid )
		{
		alert( 'Please enter a valid email address' );
		src.select();
		src.focus();
		}
	return emailValid;
	}

function checkNotBlank( src, fieldName )
	{
	var fieldValid = true;
	if ( !src.value )
		{
		fieldValid = false;
		alert( 'Please enter a valid ' + fieldName );
		src.select();
		src.focus();
		}
	return fieldValid;
	}

function checkPCNotes( src )
	{
	var fieldValid = true;
	if ( !src.value )
		{
		fieldValid = false;
		alert( 'Please click on the \"Get Notes for the PC\"\nlink to obtain notes for this PC.\n\nSelect \"Open\" or \"Run\" when prompted to allow the test to be performed.\n\nCopy and Paste the test results into the Notes text box.' );
		src.select();
		src.focus();
		}
	return fieldValid;
	}

function checkSelected( src, fieldName )
	{
	var fieldValid = true;
	if ( !src.options [src.selectedIndex].value )
		{
		fieldValid = false;
		alert( 'Please select a valid ' + fieldName );
//		src.select();
		src.focus();
		}
	return fieldValid;
	}

function checkSiteForm( srcForm )
	{
	var validSite = true;
	if ( validSite ) { validSite = checkSelected ( srcForm.intCouncilID, 'Council' ); }
	if ( validSite ) { validSite = checkNotBlank ( srcForm.strSite, 'Site Name' ); }
	return validSite; 
	}

function checkPCForm( srcForm )
	{
	var validPC = true;
	if ( validPC ) { validPC = checkNotBlank ( srcForm.strPC, 'PC Name' ); }
	if ( validPC ) { validPC = checkEmail( srcForm.strUserEmail ); }
	return validPC; 
	}

function checkPCAddForm( srcForm )
	{
	var validPC = true;
	if ( validPC ) { validPC = checkNotBlank ( srcForm.strPC, 'PC Name' ); }
	if ( validPC ) { validPC = checkEmail( srcForm.strUserEmail ); }
	if ( validPC ) { validPC = checkPCNotes( srcForm.strPCNotes ); }
	return validPC; 
	}

function checkLIASEAddForm( srcForm )
	{
	var validPC = true;
	if ( validPC ) { validPC = checkNotBlank ( srcForm.UID, 'DLI Unique Identifier' ); }
	if ( validPC ) { validPC = checkNotBlank ( srcForm.PCName, 'PC Name' ); }
	if ( validPC ) { validPC = checkEmail( srcForm.Email ); }
	return validPC; 
	}


//-->
