function check_email(frm){
				var str = frm;
				var valid = false;
				var RE_symbol = /@/;
				var RE_strUsername = /\w/;
				var RE_strURL = /\./;

				// search string for @ symbol
				if ( str.search(RE_symbol) == -1 || str.search(RE_strURL) == -1 ) {
					valid = false;
				}
				else {
					valid = true;
				}
				return valid;
		}
		
		function checkForm(){
			var returnValue = false;
			var emailValid = true;
			
			if ( document.frmRFP.email.value != "" ){
				emailValid = check_email(document.frmRFP.email.value);
			}
			
			if (document.frmRFP.first_name.value == "" ){
				alert("Please fill in your First Name.");
				document.frmRFP.first_name.focus();
			}
			else if ( document.frmRFP.last_name.value == "" ){
				alert("Please fill in your Last Name.");
				document.frmRFP.last_name.focus();
			}
			else if ( document.frmRFP.email.value == "" ){
				alert("Please fill in an E-mail Address.");
				document.frmRFP.email.focus();
			}
			else if ( emailValid == false ){
				alert("Please enter a valid email: <user>@<organization>.<domain>");
				document.frmRFP.email.focus();
			}
			else if ( document.frmRFP.phone.value == "" ){
				alert("Please enter a Telephone Number.");
				document.frmRFP.phone.focus();
			}
			else if ( document.frmRFP.image_value.value==""){
				alert("Please enter code shown in image.");
				document.frmRFP.image_value.focus();
			}
			else if ( document.frmRFP.random_image_value.value != document.frmRFP.image_value.value ){
				alert("Please enter valid code shown in image.");
				document.frmRFP.image_value.focus();
			}
			
			else
				returnValue = true;
			
			return returnValue;
		}

function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * n + 1 ) );
}
var random_images = new Array ( );
random_images[0] = "mm07j5.gif";
random_images[1] = "ct74ft.gif";
random_images[2] = "zhtu78.gif";
random_images[3] = "903rk4.gif";
random_images[4] = "8bv64t.gif";
random_images[5] = "jvx53t.gif";
random_images[6] = "an53we.gif";
random_images[7] = "5k2w3v.gif";
random_images[8] = "w5imsb.gif";
random_images[9] = "l7sc4x.gif";

var random_image_value = new Array ( );
random_image_value[0] = "MM07J5";
random_image_value[1] = "CT74FT";
random_image_value[2] = "ZHTU78";
random_image_value[3] = "903RK4";
random_image_value[4] = "8BV64T";
random_image_value[5] = "JVX53T";
random_image_value[6] = "AN53WE";
random_image_value[7] = "5K2W3V";
random_image_value[8] = "W5IMSB";
random_image_value[9] = "17SC4X";

// Pick a random image from the list,
// and set the image source to that image

function pick_image ( )
{
	var intIndex=rand(10);
	var sImage=random_images[intIndex-1];
	var sImageValue=random_image_value[intIndex-1];
	document.getElementById("random_image").src = "../js/randomimage/" + sImage;
  	document.getElementById("random_image_value").value = sImageValue;
}


