
function stripChar(sValue, sChar) {
	var i, tempChar, buildString;
	buildString = ""
	for (var i=0; i<sValue.length; i++) {
		tempChar = sValue.charAt(i);
		if (tempChar != sChar) {
			buildString = buildString + tempChar;
		}
	}
	return buildString;
}

function isNumber(value) {
	for (var i=0; i < value.length; i++) {
		a = parseInt(value.charAt(i));
		if (isNaN(a)) {
			return false;			
			break;
		}
	}
	return true;
}

function CheckRequired(form) {
	var e, title, empty_fields, char_check, invalid_card, month, year, invalid_date, eMail, invalid_eMail 
	var iQuantity, quantity_check, checkSpecial, tempError, special_Error, msg, upperLine, lowerLine
	var num, invalid_phoneNumber, passwd_mismatch
	msg = "";
	empty_fields = false;
	char_check = "";
	special_Error = "";
	tempError = "";
	num = form.length
	for (var i = 0; i < form.length; i++) {
		e = form.elements[i]
		if ((e.type == "text") || (e.type == "textarea")) {
			if (e.name == "FirstName") {
			    if (e.value.length <= 0) {
					empty_fields = true;
					continue;
				}
			}
			if (e.name == "LastName") {
			    if (e.value.length <= 0) {
					empty_fields = true;
					continue;
				}
			}
			if (e.name == "Phone") {
			    if (e.value.length <= 0) {
					empty_fields = true;
					continue;
				}
			}
			if (e.name == "Email") {
			    if (e.value.length <= 0) {
					empty_fields = true;
					continue;
				}
			}
		}
	}
	
	if (!empty_fields)
	   {return true};

    msg = "Please fill in required fields.";
	alert(msg);
	return false;
}	

function CheckRequired2(form) {
	var e, title, empty_fields, char_check, invalid_card, month, year, invalid_date, eMail, invalid_eMail 
	var iQuantity, quantity_check, checkSpecial, tempError, special_Error, msg, upperLine, lowerLine
	var num, invalid_phoneNumber, passwd_mismatch
	msg = "";
	empty_fields = false;
	char_check = "";
	special_Error = "";
	tempError = "";
	num = form.length
	for (var i = 0; i < form.length; i++) {
		e = form.elements[i]
		if ((e.type == "text") || (e.type == "textarea")) {
			if (e.name == "FirstName") {
			    if (e.value.length <= 0) {
					empty_fields = true;
					continue;
				}
			}
			if (e.name == "LastName") {
			    if (e.value.length <= 0) {
					empty_fields = true;
					continue;
				}
			}
			if (e.name == "Email") {
			    if (e.value.length <= 0) {
					empty_fields = true;
					continue;
				}
			}
		}
	}
	
	if (!empty_fields)
	   {return true};

    msg = "Please fill in required fields.";
	alert(msg);
	return false;
}	
