function validatefrm() {

	var errMsg="";
	
	// ship-to address
	if (document.orderfrm.txtsfirstname.value == "")
	{ errMsg = errMsg + "Ship-to First name cannot be blank. \n"; }
	if (document.orderfrm.txtslastname.value == "")
	{ errMsg = errMsg + "Ship-to Last name cannot be blank. \n"; }
	if (document.orderfrm.txtsaddress1.value == "")
	{ errMsg = errMsg + "Ship-to Address 1 cannot be blank. \n"; }
	if (document.orderfrm.txtsemail.value == "")
	{ errMsg = errMsg + "Ship-to Email cannot be blank. \n"; }
	if (document.orderfrm.txtscity.value == "")
	{ errMsg = errMsg + "Ship-to City cannot be blank. \n"; }
	if (document.orderfrm.txtsstate.value == "")
	{ errMsg = errMsg + "Ship-to State cannot be blank. \n"; }
	if (document.orderfrm.txtszipcode.value == "")
	{ errMsg = errMsg + "Ship-to Zip code cannot be blank. \n"; }
	if (document.orderfrm.shiptocountry.value == "")
	{ errMsg = errMsg + "Ship-to Country cannot be blank. \n"; }
	
	// Bill-to address
	if (document.orderfrm.billtocopy.checked == true)
	{
		if (document.orderfrm.txtfirstname.value == "")
		{ errMsg = errMsg + "Bill-to First name cannot be blank. \n"; }
		if (document.orderfrm.txtlastname.value == "")
		{ errMsg = errMsg + "Bill-to Last name cannot be blank. \n"; }
		if (document.orderfrm.txtaddress1.value == "")
		{ errMsg = errMsg + "Bill-to Address 1 cannot be blank. \n"; }
		if (document.orderfrm.txtemail.value == "")
		{ errMsg = errMsg + "Bill-to Email cannot be blank. \n"; }
		if (document.orderfrm.txtcity.value == "")
		{ errMsg = errMsg + "Bill-to City cannot be blank. \n"; }
		if (document.orderfrm.txtstate.value == "")
		{ errMsg = errMsg + "Bill-to State cannot be blank. \n"; }
		if (document.orderfrm.txtzipcode.value == "")
		{ errMsg = errMsg + "Bill-to Zip code cannot be blank. \n"; }
		if (document.orderfrm.billtocountry.value == "")
		{ errMsg = errMsg + "Bill-to Country cannot be blank. \n"; }
	}
	
	// card
	if (document.orderfrm.txtcc_name.value == "")
	{ errMsg = errMsg + "Name on Card cannot be blank. \n"; }
	if (document.orderfrm.cc_type.value == "")
	{ errMsg = errMsg + "Payment Type cannot be blank. \n"; }
	if (document.orderfrm.txtcc_number.value == "")
	{ errMsg = errMsg + "Card Number cannot be blank. \n"; }
	if (document.orderfrm.txtcc_id.value == "")
	{ errMsg = errMsg + "Security Code cannot be blank. \n"; }
	
	today = new Date();
	tmpMonth = today.getMonth();
	tmpYear = today.getFullYear();

	if ((document.orderfrm.cc_expmonth.value < tmpMonth && document.orderfrm.cc_expyear.value == tmpYear) || document.orderfrm.cc_expyear.value < tmpYear)
	{ errMsg = errMsg + "Please select valid expiration month / year. \n"; }
	
	if (document.orderfrm.agreeterms.checked == false)
	{ errMsg = errMsg + "You must agree to the Terms & Conditions. \n"; }
	
	if (errMsg != "")
	{	
		alert(errMsg); 
		return false;
	}
	else
	{
		return true;
	}
}

