function isValidPwd(pwd){
	if(pwd.match(/^[\w\d-_\.]*$/))
		return true;
	else
		return false;
}
function isValidInput(fieldname, requiredLen, fieldTxt){
	var input = eval("document.Form1." + new String(fieldname) + ".value");
	if(input.length < requiredLen){
		alert(fieldTxt + " requires to have at least " + new String(requiredLen) + " characters");
		return false;
	}
	
	return true;
}
function isValidEmail(email){
	if(email.match(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/)){
		return true;
	}
	return false;
}
function getValue(inputType, name){
	var ele = document.Form1.elements;
	var ret = "";
	for(var i=0; i<ele.length; i++){
		if(ele[i].type == inputType && ele[i].name == name){
			ret = ele[i].value;
			break;
		}
	}
	
	return ret;
}
function isValidZip(zip){
	//if(zip.match(/\d{5}(-\d{4})?/)){
	if(zip.length >= 3){
		return true;
	}
	return false;
}

function checkHearAbout(){
	var list = document.Form1.lead_source;
	if(list.selectedIndex == 0){
		alert("Please make a selection in the \"How did you hear about...\" field.");
		list.focus();
		return false;
	}
	
	return true;
}

function checkSQLInjection(val){
	if(val.match(/!|'|<|>|;|(--)/))
		return false;
	else
		return true;
}
		