// JScript File

// clicked=0
function copydata() {
	with (document.checkout) {
		ccname.value=custname.value
		ccaddr1.value=addr1.value
		ccaddr2.value=addr2.value
		cccity.value=city.value
		ccstate.value=state.value
		cczip.value=zip.value
		ccphone.value=phone.value
	}
}
function copydata2() {
	with (document.checkout) {
		shipname.value=custname.value
		saddr1.value=addr1.value
		saddr2.value=addr2.value
		scity.value=city.value
		sstate.value=state.value
		szip.value=zip.value
		sphone.value=phone.value
		scontact.value=contact.value
	}
}

function everythingok() {
   with (document.checkout) {
//      if (clicked==0) {
          testing=custname.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Billing Name")
                  return false
          }
          testing=addr1.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Billing Address")
                  return false
          }          
          testing=city.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Billing City")
                  return false
          }
          testing=state.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Billing State")
                  return false
          }
          testing=zip.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Billing Zip Code")
                  return false
          }
          testing=phone.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Billing Phone Number")
                  return false
          }
          testing=email.value;
          if (testing.length < 8 || testing=="" || testing.indexOf("@") == -1 || testing.indexOf(".") == -1 ) {
                  alert("Please enter your Valid Billing Email Address on the Checkout page form.")
                  return false
          }
          testing=shipname.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Shipping Name")
                  return false
          }
          testing=saddr1.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Shipping Address")
                  return false
          }
          testing=scity.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Shipping City")
                  return false
          }
          testing=sstate.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Shipping State")
                  return false
          }
          testing=szip.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Shipping Zip Code")
                  return false
          }
//          testing=ccname.value;
//          if (testing.length == 0 || testing=="") {
//                  alert("Please enter your Name as it appears on your Card")
//                  return false
//          }
	  if (ordertot.value > 0) {
		  if (cctype.value == "PO") {
		      testing=ccnum.value;
		      if (testing.length == 0 || testing=="") {
			      alert("Please Enter Your PO")
			      return false
		      }
		  } else {
		      testing=ccnum.value;
		      if (testing.length == 0 || testing=="") {
			      alert("Please Enter Your Card Number")
			      return false
		      }
		      testing=ccmonth.value;
		      if (testing.length == 0 || testing=="") {
			      alert("Please enter your Expiration Date")
			      return false
		      }
		      testing=ccyear.value;
		      if (testing.length == 0 || testing=="") {
			      alert("Please enter your Expiration Date")
			      return false
		      }
		      testing=ccCSV.value;
		      if (testing.length == 0 || testing=="") {
			      alert("Please enter your CSV Number")
			      return false
		      }
		  }
	   }
         
//          clicked=clicked+1
//	  	  document.checkout.submit()
//	  } else {
//	          alert("Please wait while we process your order.")
//	          return false
//	  }
          return true
   }
}
