function validatePage(contactform) 
{
	var msg = '';
	if(contactform.interested_in.value == "Please choose..." || contactform.interested_in.value == '' ) 
	{
		msg += "Please select the reason you're interested in contacting us.\n";
	}
	if (contactform.fname.value=='' || contactform.lname.value=='') 
	{
		msg += "Your first and last name are required.\n";
	}
	if(contactform.company.value == "") 
	{
		msg += "Please enter your company name.\n";
	}	
	if (contactform.contact.value =='' || contactform.contact2.value == '' || contactform.contact.value != contactform.contact2.value || contactform.contact.value.indexOf ('@', 0) == -1 ) 
	{
		msg += "There was a problem with your email address. Please verify it is correct and the same in both fields.\n";
	}
	
	if(msg != '')
	{
		msg += "\nPlease try again.";
 
		alert(msg);
		event.returnValue=false;
		return false;
	}
	else
	{
		contactform.submit();
		return true;
	}
}
function validateTrainPage(contactform) 
{
	var msg = '';
	if(contactform.interested_in.value == "Please choose..." || contactform.interested_in.value == '' ) 
	{
		msg += "Please select the session you'd like to register for.\n";
	}
	if (contactform.fname.value=='' || contactform.lname.value=='') 
	{
		msg += "Your first and last name are required.\n";
	}
	if(contactform.company.value == "") 
	{
		msg += "Please enter your company name.\n";
	}	
	if (contactform.contact.value =='' || contactform.contact2.value == '' || contactform.contact.value != contactform.contact2.value || contactform.contact.value.indexOf ('@', 0) == -1 ) 
	{
		msg += "There was a problem with your email address. Please verify it is correct and the same in both fields.\n";
	}
	
	if(msg != '')
	{
		msg += "\nPlease try again.";
 
		alert(msg);
		event.returnValue=false;
		return false;
	}
	else
	{
		contactform.submit();
		return true;
	}
}
function validatePageExt(contactform) 
{
	var msg = '';
	if(contactform.purchasing_role.value == "Select one") 
	{
		msg += "Please indicate your role in the purchasing process.\n";
	}	
	if(contactform.purchasing_timeframe.value == "Select one") 
	{
		msg += "Please indicate the purchasing timeframe.\n";
	}	
	if(contactform.phone.value == "") 
	{
		msg += "A contact phone number is required.\n";
	}
	if(contactform.company.value == "") 
	{
		msg += "Please enter your company name.\n";
	}
	if (contactform.fname.value=='' || contactform.lname.value=='') 
	{
		msg += "Your first and last name are required.\n";
	}
	if (contactform.contact.value =='' || contactform.contact2.value == '' || contactform.contact.value != contactform.contact2.value || contactform.contact.value.indexOf ('@', 0) == -1 ) 
	{
		msg += "There was a problem with your email address. Please verify it is correct and the same in both fields.\n";
	}
	
	if(msg != '')
	{
		msg += "\nPlease try again.";
 
		alert(msg);
		return false;
	}
	else
	{
		contactform.submit();
		return true;
	}
}
function doChallengeResponse() {
    str = document.login.username.value + ":" + MD5(document.login.password.value) + ":" + document.login.challenge.value;
    document.login.response.value = MD5(str);
    document.login.password.value = "";
    document.login.challenge.value = "";
    //document.login.username.value = "Please Wait...";
    document.login.submit();
}
