
function vaildateSubmit(formObj) {
	
	if(formObj.q) var partVal = formObj.q.value;
	else var partVal = formObj.part.value;
	var PN = String(partVal).replace(new RegExp('[^A-Z^a-z^0-9]','gi'),'');
	
	if(PN.length == 0) {
		alert('You must enter a part number.');
		return false;
	}
	if(PN.length < 4) {
		alert('A manufacturer part number must be four (4) or more\ncharacters in length (excluding non-alpha and non-numeric characters).');
		return false;
	}
	if(formObj.qty) {
		if(formObj.qty.value.match('[^0-9]') || formObj.qty.value < 1) {
			alert('Please enter a quantity. (Numbers Only)');
			return false;
		}
	}
	
	if(formObj.email) {
		if(formObj.email.value == '') {
			alert('Please enter an email.');
			return false;
		}
	}
	return true;
}


$(document).ready(function(){
// Focus auto-focus fields
$('.auto-focus:first').focus();
// Initialize auto-hint fields
$('INPUT.auto-hint, TEXTAREA.auto-hint').focus(function(){
if($(this).val() == $(this).attr('title')){
$(this).val('');
$(this).removeClass('auto-hint');
}
});
$('INPUT.auto-hint, TEXTAREA.auto-hint').blur(function(){
if($(this).val() == '' && $(this).attr('title') != ''){
$(this).val($(this).attr('title'));
$(this).addClass('auto-hint');
}
});
$('INPUT.auto-hint, TEXTAREA.auto-hint').each(function(){
if($(this).attr('title') == ''){ return; }
if($(this).val() == ''){ $(this).val($(this).attr('title')); }
else { $(this).removeClass('auto-hint'); }
});
});
