function showForm() {
	document.getElementById('request_form').style.display = 'block';
	document.getElementById('strTitle').focus();
	return false;
}

function titleChanged(){
	objTitleSelect = document.getElementById( 'strTitle' );

	objInputTitleOther = document.getElementById( 'strTitleOther' );

	// show/hide the OTHER field
	if ( 'Other:' == objTitleSelect.options[ objTitleSelect.selectedIndex ].value ) {
		objInputTitleOther.style.display = 'inline';
		objInputTitleOther.value = '';
		objInputTitleOther.focus();
	} else {
		objInputTitleOther.style.display = 'none';
	}
}

function updateTitle( strValue ) {

	if ( strValue.length ) {
		objOption			= document.createElement( 'OPTION' );
		objOption.value		= strValue;
		objOption.innerHTML = strValue;

		objSelect = document.getElementById( 'strTitle' );
		objSelect.appendChild( objOption );
		objSelect.selectedIndex = objSelect.length -1;

		document.getElementById( 'strTitleOther' ).style.display = 'none';
	}
}

function checkForm() {

	blnReturn = true;

	if ( document.getElementById('strTitle').selectedIndex == 0 ) {
		alert( 'Please select your  title' );
		document.getElementById(  'strTitle' ).focus();
		blnReturn = false;
	} else if ( document.getElementById(  'strName' ).value.length < 3 ) {
		alert( 'Please enter your full name' );
		document.getElementById(  'strName' ).focus();
		blnReturn = false;
	} else if ( document.getElementById(  'strAddress1' ).value.length < 3 ) {
		alert( 'Please enter the first line of your address' );
		document.getElementById(  'strAddress1' ).focus();
		blnReturn = false;
	} else if ( document.getElementById(  'strCity' ).value.length < 3 ) {
		alert( 'Please enter your city' );
		document.getElementById(  'strCity' ).focus();
		blnReturn = false;
	} else if ( document.getElementById(  'strPhone' ).value.length < 3 ) {
		alert( 'Please enter the your phone number' );
		document.getElementById(  'strPhone' ).focus();
		blnReturn = false;
	} else if ( ( document.getElementById(  'strEmail' ).value.indexOf('@') + document.getElementById(  'strEmail' ).value.indexOf('.') ) < 5 ) {
		alert( 'Please enter a valid email address' );
		document.getElementById(  'strEmail' ).focus();
		blnReturn = false;
	}

//	document.getElementById( 'btnSubmit' ).disabled = blnReturn;

	if ( blnReturn ) {
		document.getElementById('frmCatalogue').submit();
		document.getElementById( 'btnSubmit' ).disabled = true;
	} else {
		return false;
	}

}

