function ValidateQTY(){

	var frmMain = window.document.forms(0);
	var intX;
	var e;
	var bolValid = false;

	for (intX = 0; intX < frmMain.elements.length; intX++){

		e = frmMain.elements(intX);

		if (e.type == 'text'){

			if (isNaN(e.value) == false){

				if (e.value > 0){

					bolValid = true;

				}

			}

		}

	}

	if (bolValid == false){

		window.alert('Please enter a quatity for each item you wish to add to the cart.');

	}

	return bolValid;

}

function ValidateFeedBack(){

	var frmMain = window.document.forms(0);
	var intX;
	var intY;
	var e;
	var bolValid = true;
	var bolTypeChecked = false;
	var bolCcChecked = false;

	for (intX = 0; intX < frmMain.elements.length; intX++){

		e = frmMain.elements(intX);

		if (e.type == 'text'){

			if (e.value.replace(/\s+/, '') == ''){

					bolValid = false;
					break;

			}

		}
		else if(e.name == 'rblType'){

			if (e.checked == true){

					bolTypeChecked = true;

			}

		}
		else if(e.name == 'rblCC'){

			window.alert(e.name + ': length=' + e.length);

			if (e.checked == true){

					bolCcChecked = true;

			}

		}

	}

	if (bolTypeChecked == false || bolCcChecked == false){

		bolValid = false;

	}

	if (bolValid == false){

		window.alert('All fields are required.');

	}

	return bolValid;

}

function ValidateQuotes(){

	var frmMain = window.document.forms(0);
	var e;
	var bolValid = true;

	e = frmMain.txtfull_name;

	if (e.value.replace(/\s+/, '') == ''){

		bolValid = false;

	}

	e = frmMain.txtemail;

	if (e.value.replace(/\s+/, '') == ''){

		bolValid = false;

	}

	if (bolValid == false){

		var txtMsg;

		txtMsg = 'The following fields are required:\n\n';
		txtMsg = txtMsg + 'Full Name\n';
		txtMsg = txtMsg + 'Email Address\n';

		window.alert(txtMsg);

	}

	return bolValid;

}

function ValidateStockQuote(){

	var frmMain = window.document.forms(0);
	var intX;
	var e;
	var bolValid = true;

	for (intX = 0; intX < frmMain.elements.length; intX++){

		e = frmMain.elements(intX);

		if (e.type == 'text'){

			if (e.name != 'txtcustom_requirements'){

				if (e.value.replace(/\s+/, '') == ''){

						bolValid = false;
						break;

				}

			}

		}

	}

	if (bolValid == false){

		var txtMsg;

		txtMsg = 'The following fields are required:\n\n';

		txtMsg = txtMsg + 'Name\n';
		txtMsg = txtMsg + 'Phone Number\n';
		txtMsg = txtMsg + 'Email Address\n';
		txtMsg = txtMsg + 'Part Number\n';
		txtMsg = txtMsg + 'Type of Material\n';
		txtMsg = txtMsg + 'Custom Width\n';
		txtMsg = txtMsg + 'Custom Length';

		window.alert(txtMsg);

	}

	return bolValid;

}

function ValidateInvCopy(){

	var frmMain = window.document.forms(0);
	var intX;
	var intY;
	var e;
	var bolValid = true;
	var bolTypeChecked = false;
	var bolCcChecked = false;

	for (intX = 0; intX < frmMain.elements.length; intX++){

		e = frmMain.elements(intX);

		if (e.type == 'text'){

			if (e.name != 'txtfax'){

				if (e.value.replace(/\s+/, '') == ''){

						bolValid = false;
						break;

				}

			}

		}

	}

	if (bolValid == false){

		var txtMsg;

		txtMsg = 'The following fields are required:\n\n';
		txtMsg = txtMsg + 'Order ID\n';
		txtMsg = txtMsg + 'Full Name\n';
		txtMsg = txtMsg + 'Email Address\n';
		txtMsg = txtMsg + 'Phone Number';

		window.alert(txtMsg);

	}

	return bolValid;

}
