// JavaScript Document


//Errorcheck  subs
function _CF_hasValue(obj, obj_type){
    if (obj_type == "TEXT"){
    	if (obj.value.length == 0) 
      		return false;
    	else 
      		return true;
    }
    else if (obj_type == "EMAIL"){
       	if (obj.value.length == 0){ 
      		alert('Missing Email Field\r\n\nYou must fill this in.');
			return false;
		}else if ((obj.value.indexOf('@') < 0) || (obj.value.indexOf('.') < 0 )){
			alert("Email invalid");
			return false; 
		}else
	 	 	return true;	
	}
}


function _CF_onError(form_object, input_object, object_value, error_message){
	alert(error_message);
	input_object.focus(); input_object.select();
    return false;	
}


/*==================================================*/



// JavaScript Document
function  _CF_loginform(_CF_this){
	//Check for your name
	if  (!_CF_hasValue(_CF_this.username, "TEXT" )) {
		if  (!_CF_onError(_CF_this, _CF_this.username, _CF_this.username.value, "Please enter your username.")){ 
			_CF_this.username.focus(); _CF_this.username.select();
			return false; 
		}
    }

	//Check for your email	
	if  (!_CF_hasValue(_CF_this.password, "TEXT" )) {
        if  (!_CF_onError(_CF_this, _CF_this.password, _CF_this.password.value, "Please enter your password.")){
			_CF_this.password.focus(); _CF_this.password.select();
			return false; 
		}
    }

    return true;
}// JavaScript Document


/*==================================================*/



// JavaScript Document
function  _CF_contactform(_CF_this){
	//Check for your first name
	if  (!_CF_hasValue(_CF_this.first_name, "TEXT" )) {
		if  (!_CF_onError(_CF_this, _CF_this.first_name, _CF_this.first_name.value, "Please enter your first name.")){ 
			_CF_this.first_name.focus(); _CF_this.first_name.select();
			return false; 
		}
    }
	
	//Check for your last name
	if  (!_CF_hasValue(_CF_this.last_name, "TEXT" )) {
		if  (!_CF_onError(_CF_this, _CF_this.last_name, _CF_this.last_name.value, "Please enter your last name.")){ 
			_CF_this.last_name.focus(); _CF_this.last_name.select();
			return false; 
		}
    }	

	//Check for your email	
	if  (!_CF_hasValue(_CF_this.from_email_address, "TEXT" )) {
        if  (!_CF_onError(_CF_this, _CF_this.from_email_address, _CF_this.from_email_address.value, "Please enter your email address.")){
			_CF_this.from_email_address.focus(); _CF_this.from_email_address.select();
			return false; 
		}
    }

	//Check for your phone	
	if  (!_CF_hasValue(_CF_this.phone, "TEXT" )) {
        if  (!_CF_onError(_CF_this, _CF_this.phone, _CF_this.phone.value, "Please enter your telephone number.")){
			_CF_this.phone.focus(); _CF_this.phone.select();
			return false; 
		}
    }	
	/*
	//Check CAPTCHA field
	if  (!_CF_hasValue(_CF_this.keystring, "TEXT")){ 
		if  (!_CF_onError(_CF_this, _CF_this.keystring, _CF_this.keystring.value, "Enter the letters as they are shown in the image.")){ 
			_CF_this.keystring.focus(); _CF_this.keystring.select();return false;
		}
	}
*/
    return true;
}// JavaScript Document


/*==================================================*/




function  _CF_seminarform(_CF_this){
	//Check for your name
	if  (!_CF_hasValue(_CF_this.first_name, "TEXT" )) {
		if  (!_CF_onError(_CF_this, _CF_this.first_name, _CF_this.name.first_name, "Please enter your First Name.")){ 
			_CF_this.first_name.focus(); _CF_this.first_name.select();
			return false; 
		}
    }
	//Check for your name
	if  (!_CF_hasValue(_CF_this.last_name, "TEXT" )) {
		if  (!_CF_onError(_CF_this, _CF_this.last_name, _CF_this.name.last_name, "Please enter your Last Name.")){ 
			_CF_this.last_name.focus(); _CF_this.last_name.select();
			return false; 
		}
    }

	//Check for your email	
	if  (!_CF_hasValue(_CF_this.from_email_address, "TEXT" )) {
        if  (!_CF_onError(_CF_this, _CF_this.from_email_address, _CF_this.from_email_address.value, "Please enter your email address.")){
			_CF_this.from_email_address.focus(); _CF_this.from_email_address.select();
			return false; 
		}
    }
	
	//Check CAPTCHA field
	/*
	if  (!_CF_hasValue(_CF_this.keystring, "TEXT")){ 
		if  (!_CF_onError(_CF_this, _CF_this.keystring, _CF_this.keystring.value, "Enter the letters as they are shown in the image.")){ 
			_CF_this.keystring.focus(); _CF_this.keystring.select();return false;
		}
	}
	*/

    return true;
}// JavaScript Document