// -------------------------------------------------------------------------------------------------------------------------
//                          script with various functions to manage browser stuff  on site
// -------------------------------------------------------------------------------------------------------------------------
function validate(frm){

	var errTrig = 0;
	var errMsg = new Array();
	errMsg[1]="Please fill in all input fields";
	errMsg[2]="Password fields do not match";

	// check firstname field
	if (frm.firstname.value ==""){
		errTrig = 1;
	} // if

	// check the lastname field
	if (frm.lastname.value ==""){
		errTrig = 1;
	} // if

	// check the email field
	if (frm.email.value ==""){
		errTrig = 1;
	} // if

	// check the jobtitle field
	if (frm.jobtitle.value ==""){
		errTrig = 1;
	} // if

	// check the seniority drop down
	if (frm.firstname.value ==""){
		errTrig = 1;
	} // if

	// check the department drop down
	if (frm.departmentvalue ==""){
		errTrig = 1;
	} // if

	// check the industry drop down
	if (frm.industry.value ==""){
		errTrig = 1;
	} // if

	// check the phone field
	if (frm.phone.value ==""){
		errTrig = 1;
	} // if

	// check the fax field
	//if (frm.fax.value ==""){
	//	errTrig = 1;
	//} // if

	// check the password field
	if (frm.password.value ==""){
		errTrig = 1;
	} // if

	// check the retype password field
	if (frm.retypepassword.value ==""){
		errTrig = 1;
	} // if

	// check the two password fields match
	if (frm.password.value != frm.retypepassword.value){
		errTrig = 2;
	} // if

	// check for error
	if (errTrig != 0) {
		document.getElementById("errorMsg").innerHTML = errMsg[errTrig];
		return false
	} else {
		document.getElementById("errorMsg").innerHTML = "all done";
		return true;
	} // if
}

// --------------------------------------------------------------------------------------------------------

function checContactForm(frm){

	if (frm.query.value == ""){
		return false;
	} else {
		return true;
	} // if

} // function