//===show and hide rollover effects on Main menu

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




//===show and hide rollover effects on side menus
function fShowEffect(vID) {
	var obj = document.getElementById(vID)
	obj.style.background = '#FFCC66'
	obj.style.margin = '0px'
	obj.style.borderTop = 'black 1px ridge'
	obj.style.borderRight = 'black 1px ridge'
	obj.style.borderBottom = 'black 1px ridge'
	obj.style.borderLeft = 'black 1px ridge'
	obj.style.paddingTop = '0px'
	obj.style.paddingRight = '0px'
	obj.style.paddingBottom = '0px'
	obj.style.paddingLeft = '0px'
}
function fHideEffect(vID) {
	var obj = document.getElementById(vID)
	obj.style.background = ''
	obj.style.margin = ''
	obj.style.borderTop = ''
	obj.style.borderRight = ''
	obj.style.borderBottom = ''
	obj.style.borderLeft = ''
	obj.style.paddingTop = ''
	obj.style.paddingRight = ''
	obj.style.paddingBottom = ''
	obj.style.paddingLeft = ''
}

function windowOpenEnlarge(test) {
	var imagename = test
	enlargeWindow = window.open('',"largeArtworkView",'location=no,status=yes,scrollbars=no,resizable=yes,toolbar=no,menubar=no,width=500,height=500');
    enlargeWindow.document.write('<HTML><HEAD><TITLE>Art Accessories<\/TITLE><\/HEAD><BODY BGCOLOR=BLACK><div style=position:absolute;left:0px;top:0px><IMG SRC=http://www.art-accessories.com/images/products/' + imagename  + '  border=0><\/div><\/BODY><\/HTML>');
    enlargeWindow.document.close();
    enlargeWindow.focus();

}

//===redirect user based on navigation selection
function fViewProductDetails(vItemID) {
	self.location.href = "catalog.asp?itemid="+ vItemID
}



//===make sure shopping cart is not empty
function fCheckCartItems(vThisForm) {
	if (document[vThisForm].emptycart) {
		alert("There are no items in your shopping cart at this time.")
		return(false)
	}
	if (document[vThisForm].shipping.selectedIndex < 1) {
		alert("The field -shipping- cannot be left blank.")
		return(false)
	}
}



//===make sure shopping cart is not empty
function fCheckCartQuantities(vItemCount) {
	for (i = 1; i < vItemCount + 1; i++) {
		var vThisField = "quantity" +vItemCount
		var vThisNumber = document.shoppingcart[vThisField].value
		if (isNaN(vThisNumber)) {
			alert("The field -quantity- must be numeric.")
			return (false)
		} else if (!(isNaN(vThisNumber))) {
			if (document.shoppingcart[vThisField].value < 1) {
				alert("The field -quantity- must be a whole number (ie. 1 or greater).")
				return (false)
			} else if (document.shoppingcart[vThisField].value > 1) {
				var vOldNumber = document.shoppingcart[vThisField].value
				var vNewNumber = parseInt(vOldNumber).toString()
				if (vOldNumber.length == vNewNumber.length && vNewNumber != "NaN") {
					return (true)
				} else {
					alert("The field -quantity- must be a whole number (ie. 1 or greater).")
					return (false)
				}
			}
		}
	}
}



//===validate forms before submission
function fValidate(vThisForm){

	//designer registration
	if (vThisForm == "frmGiftCertificate") {
		if (document[vThisForm].GFName.value == "") {
			alert("Gift Certificate Information: \n\n The field -Name- cannot be left blank.")
			document[vThisForm].GFName.focus()
			return(false)
		}
		if (document[vThisForm].GFAddress1.value == "") {
			alert("Gift Certificate Information: \n\n The field -Address- cannot be left blank.")
			document[vThisForm].GFAddress1.focus()
			return(false)
		}
		if (document[vThisForm].GFCity.value == "") {
			alert("Gift Certificate Information: \n\n The field -City- cannot be left blank.")
			document[vThisForm].GFCity.focus()
			return(false)
		}
		if (document[vThisForm].GFState.selectedIndex < 1) {
			alert("Gift Certificate Information: \n\n The field -State- cannot be left blank.")
			document[vThisForm].GFState.focus()
			return(false)
		}
		if (document[vThisForm].GFZip.value == "") {
			alert("Gift Certificate Information: \n\n The field -Zip- cannot be left blank.")
			document[vThisForm].GFZip.focus()
			return(false)
		}
		if (document[vThisForm].GFCountry.value == "") {
			alert("Gift Certificate Information: \n\n The field -Country- cannot be left blank.")
			document[vThisForm].GFCountry.focus()
			return(false)
		}		
		var vThisEmail = new String(document[vThisForm].GFEmail.value)
		if (document[vThisForm].GFEmail.value == "" || vThisEmail.search("@") == -1) {
			alert("Gift Certificate Information: \n\n The field -Email- cannot be left blank and must be properly formatted.")
			document[vThisForm].GFEmail.focus()	
			return(false)
		}	
		if (document[vThisForm].description.value == "") {
			alert("Gift Certificate Information: \n\n The field -Your Message- cannot be left blank.")
			document[vThisForm].description.focus()
			return(false)
		}
		if (document[vThisForm].price[0].checked != true) {
			if (document[vThisForm].price[1].checked != true) {
				if (document[vThisForm].price[2].checked != true) {
					if (document[vThisForm].price[3].checked != true) {
						if (document[vThisForm].price[4].checked != true) {
							if (document[vThisForm].price[5].checked != true) {
							alert("Gift Certificate Information: \n\n Please select Amount for the Gift Certificate.")
							return(false)
							}
							else
							{
								if (document[vThisForm].otheramt.value == "") {
									alert("Gift Certificate Information: \n\n Please enter an amount in the -Other- field.")
									document[vThisForm].otheramt.focus()
									return(false)
								
								}
								var vThisNumber = document[vThisForm].otheramt.value
								if (isNaN(vThisNumber)) {
									alert("The field -Other- must be numeric.")
									return (false)
								}
							}
						}
					}
				}
			}
		}
		
	}


	//designer registration
	if (vThisForm == "frmDesignerRegistration") {

		if (document[vThisForm].firstname.value == "") {
			alert("Designer Information: \n\n The field -First Name- cannot be left blank.")
			document[vThisForm].firstname.focus()
			return(false)
		}
		if (document[vThisForm].lastname.value == "") {
			alert("Designer Information: \n\n The field -Last Name- cannot be left blank.")
			document[vThisForm].lastname.focus()
			return(false)
		}
		if (document[vThisForm].company.value == "") {
			alert("Designer Information: \n\n The field -Firm Name- cannot be left blank.")
			document[vThisForm].company.focus()
			return(false)
		}
		if (document[vThisForm].principal.value == "") {
			alert("Designer Information: \n\n The field -Principal- cannot be left blank.")
			document[vThisForm].principal.focus()
			return(false)
		}
		if (document[vThisForm].address1.value == "") {
			alert("Designer Information: \n\n The field -Street- cannot be left blank.")
			document[vThisForm].address1.focus()
			return(false)
		}
		if (document[vThisForm].city.value == "") {
			alert("Designer Information: \n\n The field -City- cannot be left blank.")
			document[vThisForm].city.focus()
			return(false)
		}
		if (document[vThisForm].zip.value == "") {
			alert("Designer Information: \n\n The field -Zip- cannot be left blank.")
			document[vThisForm].zip.focus()
			return(false)
		}
		if (document[vThisForm].phone.value == "") {
			alert("Designer Information: \n\n The field -Phone- cannot be left blank.")
			document[vThisForm].phone.focus()
			return(false)
		}
	
		var vThisEmail = new String(document[vThisForm].email.value)
		if (document[vThisForm].email.value == "" || vThisEmail.search("@") == -1) {
			alert("Designer Information: \n\n The field -email- cannot be left blank and must be properly formatted.")
			document[vThisForm].email.focus()	
			return(false)
		}		

		
		if (document[vThisForm].architect.checked == false) {
			if (document[vThisForm].builder.checked == false) {
				if (document[vThisForm].corporatepurchaser.checked == false) {
					if (document[vThisForm].decorator.checked == false) {
						if (document[vThisForm].manager.checked == false) {
							if (document[vThisForm].interior.checked == false) {
								if (document[vThisForm].stocking.checked == false) {
									if (document[vThisForm].other.checked == false) {
									alert("Designer Information: \n\n Please select atleast one of the profession.")
									document[vThisForm].architect.focus()							
									return(false)
									}
								}
							}
						}
					}
				}
			}
		}

		if (document[vThisForm].contract.checked == false) {
			if (document[vThisForm].residential.checked == false) {
				if (document[vThisForm].hospitality.checked == false) {
					if (document[vThisForm].healthcare.checked == false) {
						if (document[vThisForm].specialty.checked == false) {
						alert("Designer Information: \n\n Please specify atleast one option from below \n --------------------------------------- \n Contract/Commercial \n Residential \n Hospitality \n Healthcare \n Speciality. \n ---------------------------------------")
						document[vThisForm].contract.focus()							
						return(false)

						}
						else
						{
							if (document[vThisForm].specialitytext.value == "") {
							alert("Designer Information: \n\n The field - Speciality - canot be left blank.")
							document[vThisForm].specialitytext.focus()							
							return(false)

							}
						
						}

					}

				}	
			}

		}
		if (document[vThisForm].staff1.checked == false) {
			if (document[vThisForm].staff2.checked == false) {
				if (document[vThisForm].staff3.checked == false) {
					if (document[vThisForm].staff4.checked == false) {
						if (document[vThisForm].staff5.checked == false) {
						alert("Designer Information: \n\n Please select the - Staff - option.")
						document[vThisForm].staff1.focus()							
						return(false)
							
						}
					}
				}
			}
		}

		if (document[vThisForm].range1.checked == false) {
			if (document[vThisForm].range2.checked == false) {
				if (document[vThisForm].range3.checked == false) {
					if (document[vThisForm].range4.checked == false) {
						if (document[vThisForm].range5.checked == false) {
							if (document[vThisForm].range6.checked == false) {
								if (document[vThisForm].range7.checked == false) {
									if (document[vThisForm].range8.checked == false) {
									alert("Designer Information: \n\n Please select the - Annual Sales Range - option.")
									document[vThisForm].staff1.focus()							
									return(false)

									}
								}
							}	
						}
					}
				}
			}
		}



	}


	
	if (vThisForm == "checkoutstep2") {
		if (document[vThisForm].accountid.value == "") {
			if (document[vThisForm].createnewcustomer.checked == true) {
				if (document[vThisForm].password.value == "") {
					alert("New Customers: \n\n The field -password- cannot be left blank.")
					return(false)
				}
			}
		}	
		var vThisEmail = new String(document[vThisForm].email.value)
		if (document[vThisForm].email.value == "" || vThisEmail.search("@") == -1) {
			alert("Billing Information: \n\n The field -email- cannot be left blank and must be properly formatted.")
			return(false)
		}
		if (document[vThisForm].firstname.value == "") {
			alert("Billing Information: \n\n The field -firstname- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].lastname.value == "") {
			alert("Billing Information: \n\n The field -lastname- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].address.value == "") {
			alert("Billing Information: \n\n The field -address- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].city.value == "") {
			alert("Billing Information: \n\n The field -city- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.selectedIndex < 1) {
			alert("Billing Information: \n\n The field -state- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value == "Other" && document[vThisForm].province.value == "") {
			alert("Billing Information: \n\n The field -province- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value != "Other" && document[vThisForm].province.value != "") {
			alert("Billing Information: \n\n You must first select -other- in the field State in order to submit a province.")
			return(false)
		}
		if (document[vThisForm].zip.value == "") {
			alert("Billing Information: \n\n The field -zip- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].country.value == "") {
			alert("Billing Information: \n\n The field -country- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].phone.value == "") {
			alert("Billing Information: \n\n The field -phone- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].shippingsameasbilling.checked == false) {
			if (document[vThisForm].shippingfirstname.value == "") {
				alert("Shipping Information: \n\n The field -firstname- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippinglastname.value == "") {
				alert("Shipping Information: \n\n The field -lastname- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingaddress.value == "") {
				alert("Shipping Information: \n\n The field -address- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingcity.value == "") {
				alert("Shipping Information: \n\n The field -city- cannot be left blank.")
				return(false)
			}     
			if (document[vThisForm].shippingstate.selectedIndex < 1) {
				alert("Shipping Information: \n\n The field -state- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value == "Other" && document[vThisForm].shippingprovince.value == "") {
				alert("Shipping Information: \n\n The field -province- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value != "Other" && document[vThisForm].shippingprovince.value != "") {
				alert("Shipping Information: \n\n You must first select -other- in the field State in order to submit a province.")
				return(false)
			}
			if (document[vThisForm].shippingzip.value == "") {
				alert("Shipping Information: \n\n The field -zip- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingcountry.value == "") {
				alert("Shipping Information: \n\n The field -country- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingphone.value == "") {
				alert("Shipping Information: \n\n The field -phone- cannot be left blank.")
				return(false)
			}
		}
		if (document[vThisForm].cardholder.value == "") {
			alert("Credit Card Information: \n\n The field -holdername- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardbillingzip.value == "") {
			alert("Credit Card Information: \n\n The field -billingzip- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardtype.selectedIndex < 1) {
			alert("Credit Card Information: \n\n The field -type- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardnumber.value == "") {
			alert("Credit Card Information: \n\n The field -number- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardexpdate.value == "") {
			alert("Credit Card Information: \n\n The field -expdate- cannot be left blank.")
			return(false)
		}
		
		if (document[vThisForm].cardexpdate.value == "" || document[vThisForm].cardexpdate.value.length < 5 || document[vThisForm].cardexpdate.value.charAt(2) != "/") {
			alert("Credit Card Information: \n\n The field -expdate- cannot be left blank and must be entered in the following format: mm/yy.")
			return(false)
		}
			for (i = 0; i < document[vThisForm].cardexpdate.value.length; i++) {
				if (i != 2) {
					var thisChar = new Number(document[vThisForm].cardexpdate.value.charAt(i))
					if (isNaN(thisChar)) {
						alert("Credit Card Information: \n\n The field -expdate- must be numeric and entered in the following format: mm/yy.")
						return(false)
					}
				}
			}
			var vMonth = new Number(document[vThisForm].cardexpdate.value.charAt(0) * 10 + document[vThisForm].cardexpdate.value.charAt(1) * 1)
			//var vDay = new Number(document[vThisForm].cardexpdate.value.charAt(3) * 10 + document[vThisForm].cardexpdate.value.charAt(4) * 1)
			if (vMonth > 12) {
				alert("Credit Card Information: \n\n The value for the Month in the field -expdate- is not valid.")
				return(false)
			}
			//if (vDay > 31) {
			//	alert("Credit Card Information: \n\n The value for the Day in the field -expdate- is not valid.")
			//	return(false)
			//}
			//if (vMonth != 1 && vMonth != 3 && vMonth != 4 && vMonth != 5 && vMonth != 6 && vMonth != 7 && vMonth != 8 && vMonth != 9 && vMonth != 10 && vMonth != 11 && vMonth != 12 && vDay > 29) {
			//	alert("Credit Card Information: \n\n The value for the Day in the field -expdate- is not valid. This month cannot have more than 29 days.")
			//	return(false)
			//}
			//if (vMonth != 1 && vMonth != 3 && vMonth != 5 && vMonth != 7 && vMonth != 8 && vMonth != 10 && vMonth != 12 && vDay > 30) {
			//	alert("Credit Card Information: \n\n The value for the Day in the field -expdate- is not valid. This month cannot have more than 30 days.")
			//	return(false)
			//}		
	}
	
	//--forgot password
	if (vThisForm == "frmReturningCustomer") {
		var vThisEmail = new String(document[vThisForm].email.value)	
		if (document[vThisForm].email.value == "" || vThisEmail.search("@") == -1) {
			alert("The field -email- cannot be left blank and must be properly formatted.")
			document[vThisForm].email.focus()
			return(false)
		}
			if (document[vThisForm].password.value == "") {
			alert("The field -Password- cannot be left blank.")
			document[vThisForm].password.focus()
			return(false)
		}
	}
	
	//--artist search
	if (vThisForm == "frmSearchByArtist") {
		if (document[vThisForm].Designer.selectedIndex < 1) {
			if (document[vThisForm].astatement.value == "") {			
			alert("Please either select an Artist or enter in Artist Statement to search for.")
			document[vThisForm].Designer.focus()
			return(false)
			}
		}
	}

	
	//--Create New WishList User
	if (vThisForm == "frmCreateNewWishListUser") {
		var vThisEmail = new String(document[vThisForm].username.value)	
		if (document[vThisForm].username.value == "" || vThisEmail.search("@") == -1) {
			alert("The field -Email- cannot be left blank and must be properly formatted.")
			document[vThisForm].username.focus()
			return(false)
		}
		if (document[vThisForm].password.value == "") {
			alert("The field -Password- cannot be left blank.")
			document[vThisForm].password.focus()
			return(false)
		}
		if (document[vThisForm].repassword.value == "") {
			alert("The field -Retype Password- cannot be left blank.")
			document[vThisForm].repassword.focus()
			return(false)
		}
		if (document[vThisForm].repassword.value != document[vThisForm].password.value) {
			alert("The field -Retype Password - did not match with the password you entered.")
			document[vThisForm].repassword.focus()
			return(false)
		}
		if (document[vThisForm].birthcity.value == "") {
			alert("The field -Birth City- cannot be left blank.")
			document[vThisForm].birthcity.focus()
			return(false)
		}
	}



	//--search by media
	if (vThisForm == "frmSearchByMedia") {
		if (document[vThisForm].Media.selectedIndex < 1) {
			alert("Please select a Media from the list.")
			document[vThisForm].Media.focus()
			return(false)
		}		
	}

	//--add item to cart
//	if (vThisForm == "additemtocart") {
	//	if (document[vThisForm].size.selectedIndex < 1) {
	//	alert("Please select the dimensions of the product.")
	//	document[vThisForm].size.focus()
	//	return(false)
	//	}
	//	if (document[vThisForm].color.selectedIndex < 1) {
	//	alert("Please select the color of the product.")
	//	document[vThisForm].color.focus()
	//	return(false)
	//	}
		
//	}
	//--create event for the registry
	if (vThisForm == "frmCreateGiftRegistry") {
		if (document[vThisForm].eventname.value == "") {
			alert("The field -Event Name- cannot be left blank.")
			document[vThisForm].eventname.focus()
			return(false)
		}
		if (document[vThisForm].eventdate.value == "") {
			alert("The field -Event Date- cannot be left blank.")
			document[vThisForm].eventdate.focus()
			return(false)
		}
		
	}
	
	//--forgot password
	if (vThisForm == "frmforgotPassword") {
		var vThisEmail = new String(document[vThisForm].email.value)	
		if (document[vThisForm].email.value == "" || vThisEmail.search("@") == -1) {
			alert("The field -email- cannot be left blank and must be properly formatted.")
			document[vThisForm].email.focus()
			return(false)
		}
	}

	//--add gift registry
	if (vThisForm == "frmGiftRegistry") {
		var vThisEmail = new String(document[vThisForm].username.value)	
		if (document[vThisForm].username.value == "" || vThisEmail.search("@") == -1) {
			alert("The field -email- cannot be left blank and must be properly formatted.")
			document[vThisForm].username.focus()
			return(false)
		}
		if (document[vThisForm].password.value == "") {
			alert("The field -Password- cannot be left blank.")
			document[vThisForm].password.focus()
			return(false)
		}
		if (document[vThisForm].repassword.value == "") {
			alert("The field -Retype Password- cannot be left blank.")
			document[vThisForm].repassword.focus()
			return(false)
		}
		
		if (document[vThisForm].repassword.value != document[vThisForm].password.value) {
			alert("The field -Retype Password - did not match with the password you entered.")
			document[vThisForm].repassword.focus()
			return(false)
		}
		
		
		
		if (document[vThisForm].birthcity.value == "") {
			alert("The field -City- cannot be left blank.")
			document[vThisForm].birthcity.focus()
			return(false)
		}	
	}
	
		//***************************
	
	if (vThisForm == "frmGifttRegistryOwner") {
		if (document[vThisForm].firstname.value == "") {
			alert("Registrant: \n\n The field -firstname- cannot be left blank.")
			document[vThisForm].firstname.focus()
			return(false)
		}
		if (document[vThisForm].lastname.value == "") {
			alert("Registrant: \n\n The field -lastname- cannot be left blank.")
			document[vThisForm].lastname.focus()
			return(false)
		}
		if (document[vThisForm].company.value == "") {
			alert("Registrant: \n\n The field -Company- cannot be left blank.")
			document[vThisForm].company.focus()
			return(false)
		}
		if (document[vThisForm].address.value == "") {
			alert("Registrant: \n\n The field -address- cannot be left blank.")
			document[vThisForm].address.focus()
			return(false)
		}
		if (document[vThisForm].city.value == "") {
			alert("Registrant: \n\n The field -city- cannot be left blank.")
			document[vThisForm].city.focus()
			return(false)
		}
		if (document[vThisForm].state.selectedIndex < 1) {
			alert("Registrant: \n\n The field -state- cannot be left blank.")
			document[vThisForm].state.focus()
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value == "Other" && document[vThisForm].province.value == "") {
			alert("Registrant: \n\n The field -province- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value != "Other" && document[vThisForm].province.value != "") {
			alert("Registrant: \n\n You must first select -other- in the field State in order to submit a province.")
			return(false)
		}
		if (document[vThisForm].zip.value == "") {
			alert("Registrant: \n\n The field -zip- cannot be left blank.")
			document[vThisForm].zip.focus()
			return(false)
		}
		if (document[vThisForm].country.value == "") {
			alert("Registrant: \n\n The field -country- cannot be left blank.")
			document[vThisForm].country.focus()
			return(false)
		}
		if (document[vThisForm].phone.value == "") {
			alert("Registrant: \n\n The field -phone- cannot be left blank.")
			document[vThisForm].phone.focus()
			return(false)
		}
		
		if (document[vThisForm].eventname.value == "") {
				alert("Event Information: \n\n The field -Event Name- cannot be left blank.")
				document[vThisForm].eventname.focus()
				return(false)
			}
			
			if (document[vThisForm].month.selectedIndex < 1) {
				alert("Event Information: \n\n The field -Event Month- cannot be left blank.")
				document[vThisForm].month.focus()
				return(false)
			}
			if (document[vThisForm].year.selectedIndex < 1) {
				alert("Event Information: \n\n The field -Event Year- cannot be left blank.")
				document[vThisForm].year.focus()
				return(false)
			}
		
		if (document[vThisForm].shiptoperson[0].checked != true) 
			{
				if (document[vThisForm].shiptoperson[1].checked != true)
				{
					if (document[vThisForm].shiptoperson[2].checked != true)
					{
					alert("Donor Information: \n\n Please check one of the shipping options.")
					return(false)
					}
					
			}
		}
		
		if (document[vThisForm].shiptoperson[2].checked == true) {
			if (document[vThisForm].shippingfirstname.value == "") {
				alert("Shipping Information: \n\n The field -firstname- cannot be left blank.")
				document[vThisForm].shippingfirstname.focus()
				return(false)
			}
			if (document[vThisForm].shippinglastname.value == "") {
				alert("Shipping Information: \n\n The field -lastname- cannot be left blank.")
				document[vThisForm].shippinglastname.focus()
				return(false)
			}
			if (document[vThisForm].shippingcompany.value == "") {
				alert("Shipping Information: \n\n The field -company- cannot be left blank.")
				document[vThisForm].shippingcompany.focus()
				return(false)
			}
			if (document[vThisForm].shippingaddress.value == "") {
				alert("Shipping Information: \n\n The field -address- cannot be left blank.")
				document[vThisForm].shippingaddress.focus()
				return(false)
			}
			if (document[vThisForm].shippingcity.value == "") {
				alert("Shipping Information: \n\n The field -city- cannot be left blank.")
				document[vThisForm].shippingcity.focus()
				return(false)
			}     
			if (document[vThisForm].shippingstate.selectedIndex < 1) {
				alert("Shipping Information: \n\n The field -state- cannot be left blank.")
				document[vThisForm].shippingstate.focus()
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value == "Other" && document[vThisForm].shippingprovince.value == "") {
				alert("Shipping Information: \n\n The field -province- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value != "Other" && document[vThisForm].shippingprovince.value != "") {
				alert("Shipping Information: \n\n You must first select -other- in the field State in order to submit a province.")
				return(false)
			}
			if (document[vThisForm].shippingzip.value == "") {
				alert("Shipping Information: \n\n The field -zip- cannot be left blank.")
				document[vThisForm].shippingzip.focus()
				return(false)
			}
			if (document[vThisForm].shippingcountry.value == "") {
				alert("Shipping Information: \n\n The field -country- cannot be left blank.")
				document[vThisForm].shippingcountry.focus()
				return(false)
			}
			if (document[vThisForm].shippingphone.value == "") {
				alert("Shipping Information: \n\n The field -phone- cannot be left blank.")
				document[vThisForm].shippingphone.focus()
				return(false)
			}
		}		
			
		if (document[vThisForm].coregistrantsameasregistrant.checked == false) {
			if (document[vThisForm].Cofirstname.value == "") {
				alert("Co-Registrant: \n\n The field -firstname- cannot be left blank.")
				document[vThisForm].Cofirstname.focus()
				return(false)
			}
			if (document[vThisForm].Colastname.value == "") {
				alert("Co-Registrant: \n\n The field -lastname- cannot be left blank.")
				document[vThisForm].Colastname.focus()
				return(false)
			}
			if (document[vThisForm].cocompany.value == "") {
			alert("Registrant: \n\n The field -Co Registrant's Company- cannot be left blank.")
			document[vThisForm].cocompany.focus()
			return(false)
			}
			if (document[vThisForm].Coaddress.value == "") {
				alert("Co-Registrant: \n\n The field -address- cannot be left blank.")
				document[vThisForm].Coaddress.focus()
				return(false)
			}
			if (document[vThisForm].Cocity.value == "") {
				alert("Co-Registrant: \n\n The field -city- cannot be left blank.")
				document[vThisForm].Cocity.focus()
				return(false)
			}     
			if (document[vThisForm].Costate.selectedIndex < 1) {
				alert("Co-Registrant: \n\n The field -state- cannot be left blank.")
				document[vThisForm].Costate.focus()
				return(false)
			}
			if (document[vThisForm].Costate.options[document[vThisForm].Costate.selectedIndex].value == "Other" && document[vThisForm].Coprovince.value == "") {
				alert("Co-Registrant: \n\n The field -province- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].Costate.options[document[vThisForm].Costate.selectedIndex].value != "Other" && document[vThisForm].Coprovince.value != "") {
				alert("Co-Registrant: \n\n You must first select -other- in the field State in order to submit a province.")
				return(false)
			}
			if (document[vThisForm].Cozip.value == "") {
				alert("Co-Registrant: \n\n The field -zip- cannot be left blank.")
				document[vThisForm].Cozip.focus()
				return(false)
			}
			if (document[vThisForm].Cocountry.value == "") {
				alert("Co-Registrant: \n\n The field -country- cannot be left blank.")
				document[vThisForm].Cocountry.focus()
				return(false)
			}
			if (document[vThisForm].Cophone.value == "") {
				alert("Co-Registrant: \n\n The field -phone- cannot be left blank.")
				document[vThisForm].Cophone.focus()
				return(false)
			}
		
	}
	}
	
	if (vThisForm == "frmCreateGifttRegistryOwner") {
		if (document[vThisForm].firstname.value == "") {
			alert("Registrant: \n\n The field -firstname- cannot be left blank.")
			document[vThisForm].firstname.focus()
			return(false)
		}
		if (document[vThisForm].lastname.value == "") {
			alert("Registrant: \n\n The field -lastname- cannot be left blank.")
			document[vThisForm].lastname.focus()
			return(false)
		}
		if (document[vThisForm].company.value == "") {
			alert("Registrant: \n\n The field -Company- cannot be left blank.")
			document[vThisForm].company.focus()
			return(false)
		}
		if (document[vThisForm].address.value == "") {
			alert("Registrant: \n\n The field -address- cannot be left blank.")
			document[vThisForm].address.focus()
			return(false)
		}
		if (document[vThisForm].city.value == "") {
			alert("Registrant: \n\n The field -city- cannot be left blank.")
			document[vThisForm].city.focus()
			return(false)
		}
		if (document[vThisForm].state.selectedIndex < 1) {
			alert("Registrant: \n\n The field -state- cannot be left blank.")
			document[vThisForm].state.focus()
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value == "Other" && document[vThisForm].province.value == "") {
			alert("Registrant: \n\n The field -province- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value != "Other" && document[vThisForm].province.value != "") {
			alert("Registrant: \n\n You must first select -other- in the field State in order to submit a province.")
			return(false)
		}
		if (document[vThisForm].zip.value == "") {
			alert("Registrant: \n\n The field -zip- cannot be left blank.")
			document[vThisForm].zip.focus()
			return(false)
		}
		if (document[vThisForm].country.value == "") {
			alert("Registrant: \n\n The field -country- cannot be left blank.")
			document[vThisForm].country.focus()
			return(false)
		}
		if (document[vThisForm].phone.value == "") {
			alert("Registrant: \n\n The field -phone- cannot be left blank.")
			document[vThisForm].phone.focus()
			return(false)
		}
		
		if (document[vThisForm].eventname.value == "") {
				alert("Event Information: \n\n The field -Event Name- cannot be left blank.")
				document[vThisForm].eventname.focus()
				return(false)
			}
			//if (document[vThisForm].eventdate.value == "") {
			//	alert("Event Information: \n\n The field -Event Date- cannot be left blank.")
			//	document[vThisForm].eventdate.focus()
			//	return(false)
			//}
			if (document[vThisForm].month.value == "") {
				alert("Event Information: \n\n The field -Event Month- cannot be left blank.")
				document[vThisForm].month.focus()
				return(false)
			}
			if (document[vThisForm].year.value == "") {
				alert("Event Information: \n\n The field -Event Year- cannot be left blank.")
				document[vThisForm].year.focus()
				return(false)
			}
		
		if (document[vThisForm].shiptoperson[0].checked != true) 
			{
				if (document[vThisForm].shiptoperson[1].checked != true)
				{
					if (document[vThisForm].shiptoperson[2].checked != true)
					{
					alert("Donor Information: \n\n Please check one of the shipping options.")
					return(false)
					}
					
			}
		}
		
		if (document[vThisForm].shiptoperson[2].checked == true) {
			if (document[vThisForm].shippingfirstname.value == "") {
				alert("Shipping Information: \n\n The field -firstname- cannot be left blank.")
				document[vThisForm].shippingfirstname.focus()
				return(false)
			}
			if (document[vThisForm].shippinglastname.value == "") {
				alert("Shipping Information: \n\n The field -lastname- cannot be left blank.")
				document[vThisForm].shippinglastname.focus()
				return(false)
			}
			if (document[vThisForm].shippingcompany.value == "") {
				alert("Shipping Information: \n\n The field -company- cannot be left blank.")
				document[vThisForm].shippingcompany.focus()
				return(false)
			}
			if (document[vThisForm].shippingaddress.value == "") {
				alert("Shipping Information: \n\n The field -address- cannot be left blank.")
				document[vThisForm].shippingaddress.focus()
				return(false)
			}
			if (document[vThisForm].shippingcity.value == "") {
				alert("Shipping Information: \n\n The field -city- cannot be left blank.")
				document[vThisForm].shippingcity.focus()
				return(false)
			}     
			if (document[vThisForm].shippingstate.selectedIndex < 1) {
				alert("Shipping Information: \n\n The field -state- cannot be left blank.")
				document[vThisForm].shippingstate.focus()
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value == "Other" && document[vThisForm].shippingprovince.value == "") {
				alert("Shipping Information: \n\n The field -province- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value != "Other" && document[vThisForm].shippingprovince.value != "") {
				alert("Shipping Information: \n\n You must first select -other- in the field State in order to submit a province.")
				return(false)
			}
			if (document[vThisForm].shippingzip.value == "") {
				alert("Shipping Information: \n\n The field -zip- cannot be left blank.")
				document[vThisForm].shippingzip.focus()
				return(false)
			}
			if (document[vThisForm].shippingcountry.value == "") {
				alert("Shipping Information: \n\n The field -country- cannot be left blank.")
				document[vThisForm].shippingcountry.focus()
				return(false)
			}
			if (document[vThisForm].shippingphone.value == "") {
				alert("Shipping Information: \n\n The field -phone- cannot be left blank.")
				document[vThisForm].shippingphone.focus()
				return(false)
			}
		}		
			
		if (document[vThisForm].coregistrantsameasregistrant.checked == false) {
			if (document[vThisForm].Cofirstname.value == "") {
				alert("Co-Registrant: \n\n The field -firstname- cannot be left blank.")
				document[vThisForm].Cofirstname.focus()
				return(false)
			}
			if (document[vThisForm].Colastname.value == "") {
				alert("Co-Registrant: \n\n The field -lastname- cannot be left blank.")
				document[vThisForm].Colastname.focus()
				return(false)
			}
			if (document[vThisForm].cocompany.value == "") {
			alert("Registrant: \n\n The field -Co Registrant's Company- cannot be left blank.")
			document[vThisForm].cocompany.focus()
			return(false)
			}
			if (document[vThisForm].Coaddress.value == "") {
				alert("Co-Registrant: \n\n The field -address- cannot be left blank.")
				document[vThisForm].Coaddress.focus()
				return(false)
			}
			if (document[vThisForm].Cocity.value == "") {
				alert("Co-Registrant: \n\n The field -city- cannot be left blank.")
				document[vThisForm].Cocity.focus()
				return(false)
			}     
			if (document[vThisForm].Costate.selectedIndex < 1) {
				alert("Co-Registrant: \n\n The field -state- cannot be left blank.")
				document[vThisForm].Costate.focus()
				return(false)
			}
			if (document[vThisForm].Costate.options[document[vThisForm].Costate.selectedIndex].value == "Other" && document[vThisForm].Coprovince.value == "") {
				alert("Co-Registrant: \n\n The field -province- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].Costate.options[document[vThisForm].Costate.selectedIndex].value != "Other" && document[vThisForm].Coprovince.value != "") {
				alert("Co-Registrant: \n\n You must first select -other- in the field State in order to submit a province.")
				return(false)
			}
			if (document[vThisForm].Cozip.value == "") {
				alert("Co-Registrant: \n\n The field -zip- cannot be left blank.")
				document[vThisForm].Cozip.focus()
				return(false)
			}
			if (document[vThisForm].Cocountry.value == "") {
				alert("Co-Registrant: \n\n The field -country- cannot be left blank.")
				document[vThisForm].Cocountry.focus()
				return(false)
			}
			if (document[vThisForm].Cophone.value == "") {
				alert("Co-Registrant: \n\n The field -phone- cannot be left blank.")
				document[vThisForm].Cophone.focus()
				return(false)
			}
		
	}
	}
	
	
	//===search site
	if (vThisForm == "searchcatalog") {
		if (document[vThisForm].criteria.value == "") {
			alert("The field -criteria- cannot be left blank.")
			return(false)
		}
	}
	
	//===add items to cart
	//if (vThisForm == "additemtocart") {
		//var vThisNumber = document[vThisForm].quantity.value
		//if (isNaN(vThisNumber)) {
		//	alert("The field -quantity- must be numeric.")
		//	return (false)
	//	} else if (!(isNaN(vThisNumber))) {
	//		if (document[vThisForm].quantity.value < 1) {
	//			alert("The field -quantity- must be a whole number (ie. 1 or greater).")
	///			return (false)
	//		} else if (document[vThisForm].quantity.value > 1) {
	//			var vOldNumber = document[vThisForm].quantity.value
	//			var vNewNumber = parseInt(vOldNumber).toString()
	//			if (vOldNumber.length == vNewNumber.length && vNewNumber != "NaN") {
	//				return (true)
	//			} else {
	//				alert("The field -quantity- must be a whole number (ie. 1 or greater).")
	//				return (false)
	//			}
	//		}
	//	}
	//}
	
	//===check out
	if (vThisForm == "checkoutstep1") {
		if (document[vThisForm].email.value == "") {
			alert("The field -email- cannot be left blank.")
			return(false)
		}
		//if (document[vThisForm].password.value == "") {
		//	alert("The field -password- cannot be left blank.")
		//	return(false)
		//}
	}
	
	//===search site
	if (vThisForm == "orderstatus_search") {
		if (document[vThisForm].email.value == "") {
			alert("The field -email- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].authorizationnumber.value == "") {
			alert("The field -authorizationnumber- cannot be left blank.")
			return(false)
		}
	}
	
	//===add / edit accounts
	if (vThisForm == "addaccounts" || vThisForm == "editaccounts") {
		if (document[vThisForm].accounttype.selectedIndex < 1) {
			alert("Account Information: \n\n The field -accounttype- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].username.value == "") {
			alert("Account Information: \n\n The field -username- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].password.value == "") {
			alert("Account Information: \n\n The field -password- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value == "Other" && document[vThisForm].province.value == "") {
			alert("Billing Information: \n\n The field -province- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value != "Other" && document[vThisForm].province.value != "") {
			alert("Billing Information: \n\n You must first select -other- in the field State in order to submit a province.")
			return(false)
		}
		if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value == "Other" && document[vThisForm].shippingprovince.value == "") {
				alert("Shipping Information: \n\n The field -province- cannot be left blank.")
				return(false)
		}
		if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value != "Other" && document[vThisForm].shippingprovince.value != "") {
			alert("Shipping Information: \n\n You must first select -other- in the field State in order to submit a province.")
			return(false)
		}
		if (document[vThisForm].cardnumber.value != 1) {
			var vThisNumber = ""
			for (i = 1; i < document[vThisForm].cardnumber.value.length; i++) {
				vThisNumber = vThisNumber + document[vThisForm].cardnumber.value.charAt(i)
			}
			//alert("vThisNumber = " +vThisNumber)
			if (isNaN(vThisNumber)) {
				alert("The field -cardnumber- must be numeric.")
				return (false)
			}
		}
		if (document[vThisForm].cardexpdate.value != "") {
			if (document[vThisForm].cardexpdate.value.length < 5 || document[vThisForm].cardexpdate.value.charAt(2) != "/") {
				alert("Credit Card Information: \n\n The field -expdate- must be entered in the following format: mm/yy.")
				return (false)
			}
			for (i = 0; i < document[vThisForm].cardexpdate.value.length; i++) {
				if (i != 2) {
					var thisChar = new Number(document[vThisForm].cardexpdate.value.charAt(i))
					if (isNaN(thisChar)) {
						alert("Credit Card Information: \n\n The field -expdate- must be numeric and entered in the following format: mm/yy.")
						return (false)
					}
				}
			}
			var vMonth = new Number(document[vThisForm].cardexpdate.value.charAt(0) * 10 + document[vThisForm].cardexpdate.value.charAt(1) * 1)
			if (vMonth > 12) {
				alert ("Credit Card Information: \n\n The value for the Month in the field -expdate- is not valid.")
				return (false)
			}
		}
	}
	
	//===add / edit categories
	if (vThisForm == "addcategories" || vThisForm == "editcategories") {
		if (document[vThisForm].name.value == "") {
			alert("The field -name- cannot be left blank.")
			return(false)
		}
	}
	
	//===add / edit items
	if (vThisForm == "additems" || vThisForm == "edititems") {
		if (document[vThisForm].category.selectedIndex < 1) {
			alert("The field -category- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].name.value == "") {
			alert("The field -name- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].weight.value != "") {
			if (isNaN(document[vThisForm].weight.value)) {
				alert("The field -weight- must be numeric.")
				return (false)
			}
		}
		if (document[vThisForm].price.value.length <= 1) {
			alert("The field -price- cannot be left blank.")
			return(false)
		}
			var thisPrice = ""
			for (i = 1; i < document[vThisForm].price.value.length; i++) {
				thisPrice = thisPrice + document[vThisForm].price.value.charAt(i)
			}
			//alert("thisPrice = " +thisPrice)
			if (isNaN(thisPrice)) {
				alert("The field -price- must be numeric.")
				return (false)
			}
		if (document[vThisForm].description.value == "") {
			alert("The field -description- cannot be left blank.")
			return(false)
		}
	}
	
	//===update orders status
	if (vThisForm == "updateorderstatus") {
		if (document[vThisForm].filled.selectedIndex < 1) {
			alert("Order Information: \n\n The field -orderfilled- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].filled.options[document[vThisForm].filled.selectedIndex].value == "Filled" && document[vThisForm].approved.options[document[vThisForm].approved.selectedIndex].value != "Yes") {
			alert("Order Information: \n\n Orders cannot be considered filled if they have not yet been approved.")
			return(false)
		}
		if (document[vThisForm].filled.options[document[vThisForm].filled.selectedIndex].value == "Not Filled" && document[vThisForm].reasonnotfilled.value == "") {
			alert("Order Information: \n\n The field -reasonnotfilled- cannot be left blank.")
			return(false)
		}
		var thisEmail = new String(document[vThisForm].email.value)
		if (document[vThisForm].email.value == "" || thisEmail.match( "@" ) == null) {
			alert("Billing Information: \n\n The field -email- cannot be left blank and must be properly formatted.")
			return(false)
		}
		if (document[vThisForm].firstname.value == "") {
			alert("Billing Information: \n\n The field -firstname- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].lastname.value == "") {
			alert("Billing Information: \n\n The field -lastname- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].address.value == "") {
			alert("Billing Information: \n\n The field -address- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].city.value == "") {
			alert("Billing Information: \n\n The field -city- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.selectedIndex < 1) {
			alert("Billing Information: \n\n The field -state- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value == "Other" && document[vThisForm].province.value == "") {
			alert("Billing Information: \n\n The field -province- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].state.options[document[vThisForm].state.selectedIndex].value != "Other" && document[vThisForm].province.value != "") {
			alert("Billing Information: \n\n You must first select -other- in the field State in order to submit a province.")
			return(false)
		}
		if (document[vThisForm].zip.value == "") {
			alert("Billing Information: \n\n The field -zip- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].country.value == "") {
			alert("Billing Information: \n\n The field -country- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].phone.value == "") {
			alert("Billing Information: \n\n The field -phone- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].shippingsameasbilling.checked == false) {
			if (document[vThisForm].shippingfirstname.value == "") {
				alert("Shipping Information: \n\n The field -firstname- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippinglastname.value == "") {
				alert("Shipping Information: \n\n The field -lastname- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingaddress.value == "") {
				alert("Shipping Information: \n\n The field -address- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingcity.value == "") {
				alert("Shipping Information: \n\n The field -city- cannot be left blank.")
				return(false)
			}     
			if (document[vThisForm].shippingstate.selectedIndex < 1) {
				alert("Shipping Information: \n\n The field -state- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value == "Other" && document[vThisForm].shippingprovince.value == "") {
				alert("Shipping Information: \n\n The field -province- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingstate.options[document[vThisForm].shippingstate.selectedIndex].value != "Other" && document[vThisForm].shippingprovince.value != "") {
				alert("Shipping Information: \n\n You must first select -other- in the field State in order to submit a province.")
				return(false)
			}
			if (document[vThisForm].shippingzip.value == "") {
				alert("Shipping Information: \n\n The field -zip- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingcountry.value == "") {
				alert("Shipping Information: \n\n The field -country- cannot be left blank.")
				return(false)
			}
			if (document[vThisForm].shippingphone.value == "") {
				alert("Shipping Information: \n\n The field -phone- cannot be left blank.")
				return(false)
			}
		}
		if (document[vThisForm].cardholder.value == "") {
			alert("Credit Card Information: \n\n The field -holdername- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardbillingzip.value == "") {
			alert("Credit Card Information: \n\n The field -billingzip- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardtype.selectedIndex < 1) {
			alert("Credit Card Information: \n\n The field -type- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardnumber.value == "") {
			alert("Credit Card Information: \n\n The field -number- cannot be left blank.")
			return(false)
		}
		if (document[vThisForm].cardexpdate.value == "") {
			alert("Credit Card Information: \n\n The field -expdate- cannot be left blank.")
			return(false)
		}
		
		if (document[vThisForm].cardexpdate.value == "" || document[vThisForm].cardexpdate.value.length < 5 || document[vThisForm].cardexpdate.value.charAt(2) != "/") {
			alert("Credit Card Information: \n\n The field -expdate- cannot be left blank and must be entered in the following format: mm/yy.")
			return(false)
		}
		for (i = 0; i < document[vThisForm].cardexpdate.value.length; i++) {
			if (i != 2) {
				var thisChar = new Number(document[vThisForm].cardexpdate.value.charAt(i))
				if (isNaN(thisChar)) {
					alert("Credit Card Information: \n\n The field -expdate- must be numeric and entered in the following format: mm/yy.")
					return(false)
				}
			}
		}
		var vMonth = new Number(document[vThisForm].cardexpdate.value.charAt(0) * 10 + document[vThisForm].cardexpdate.value.charAt(1) * 1)
		//var vDay = new Number(document[vThisForm].cardexpdate.value.charAt(3) * 10 + document[vThisForm].cardexpdate.value.charAt(4) * 1)
		if (vMonth > 12) {
			alert("Credit Card Information: \n\n The value for the Month in the field -expdate- is not valid.")
			return(false)
		}
	}
	
	//===contact info
	if (vThisForm == "contactinfo") {
		if (document[vThisForm].name.value == "") {
			alert("The field -name- cannot be left blank.")
			return(false)
		}
		var vThisEmail = document[vThisForm].email.value
		if (document[vThisForm].email.value == "" || vThisEmail.search("@") == -1) {
			alert("The field -email- cannot be left blank and must be properly formatted.")
			return(false)
		}
	}
}



//===prompt user before deleting records
function fConfirmDeletion() {
	if (!(confirm("This record will be permanently removed from the database. \n\n Are you sure you wish to delete this record?"))) {
		return(false)
	}
}



//===print page
function fPrint() {
	if (window.print) {
		setTimeout('window.print()',1)
	} else if (agt.indexOf("mac") != -1) {
		alert("Press 'Cmd + P' on your keyboard to print this order.")
	} else {
		alert("Press 'Ctrl + P' on your keyboard to print this order.")
	}
}

function textLimit(field, maxlen) 
{
	if (field.value.length > maxlen + 1)
		alert("your input has been truncated!");
	if (field.value.length > maxlen)
		field.value = field.value.substring(0, maxlen);
}
function getDaysInMonth(aDate){
   // returns the last day of a given month
    var m = new Number(aDate.getMonth());
    var y = new Number(aDate.getYear());

    var tmpDate = new Date(y, m, 28);
    var checkMonth = tmpDate.getMonth();
    var lastDay = 27;

    while(lastDay <= 31){
        temp = tmpDate.setDate(lastDay + 1);
        if(checkMonth != tmpDate.getMonth())
            break;
        lastDay++
    }
    return lastDay;
}