function checkLogin() {
	var validate = new validateForm();
	
	if( document.getElementById( 'clientLogin_username1' ).value == '- Username -' ){
		validate.addCustomError( 'Username' );
	} else {
		validate.checkText( 'clientLogin_username1', 'Username' );
	}
	
	validate.checkText( 'clientlogin_password1', 'Password' );
	
	if( validate.numberOfErrors() > 0 ) {
		validate.displayErrors();
		return false;
	}
}

function checkLoginTwo() {
	var validate = new validateForm();
	
	if( document.getElementById( 'clientLogin_username2' ).value == '' ){
		validate.addCustomError( 'Username' );
	} else {
		validate.checkText( 'clientLogin_username2', 'Username' );
	}
	
	validate.checkText( 'clientLogin_password2', 'Password' );
	
	if( validate.numberOfErrors() > 0 ) {
		validate.displayErrors();
		return false;
	}
}


function logout() {
	document.getElementById('logoutForm').submit();
}


function inputBoxBlur( input, defaultText, passwordField ) {
	if( input.value == '' ) {
		if( typeof( passwordField ) != 'undefined' ) {
			document.getElementById( passwordField ).style.display = 'none';
			document.getElementById( passwordField+'_text' ).style.display = '';
		} else {
			input.value = defaultText;
		}
	}
}
function inputBoxFocus( input, defaultText, passwordField ) {
	if( typeof( passwordField ) != 'undefined' ) {
		document.getElementById( passwordField ).style.display = '';
		document.getElementById( passwordField+'_text' ).style.display = 'none';
		document.getElementById( passwordField ).focus();
	} else {
		if( input.value == defaultText ) {
			input.value = '';
		}
	}
}

function checkForm() {
	var validate = new validateForm();
	
	if( document.getElementById( 'name' ).value == '- First Name *' ){
		validate.addCustomError( 'First Name' );
	} else {
		validate.checkText( 'name', 'Username' );
	}
	
	if( document.getElementById( 'lastName' ).value == '- Last Name *' ){
		validate.addCustomError( 'Last Name' );
	} else {
		validate.checkText( 'lastName', 'Last Name' );
	}
	
	if( document.getElementById( 'email_address' ).value == '- Contact Email *' ){
		validate.addCustomError( 'Email Address' );
	} else {
		validate.validateEmailAddress( 'email_address' );
	}
	
	if( document.getElementById( 'enquiry' ).value == '- Type enquiry here...*' ){
		validate.addCustomError( 'Your Enquiry' );
	} else {
		validate.checkText( 'enquiry' );
	}
	
	
	if( validate.numberOfErrors() > 0 ) {
		validate.displayErrors();
		return false;
	}
}
