// 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
		cccountry.value=country.value
		//ccphone.value=phone.value
		//ccemail.value=email.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
		//semail.value=email.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 Email Address")
                  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
          }
          testing=ccnum.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please Enter Your Card Number")
                  return false
          }
          testing=ccaddr1.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter the Address on your Credit Card Statement")
                  return false
          }
          testing=cccity.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Credit Card City")
                  return false
          }
          testing=ccstate.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Credit Card State")
                  return false
          }
          testing=cczip.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Credit Card Zip")
                  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
   }
}
function everythingokContact() {
   with (document.contact) {
          testing=first.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your First Name")
                  return false
          }          testing=last.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Last Name")
                  return false
          }
          testing=email.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Email Address")
                  return false
          }          
          testing=phone.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Phone Number")
                  return false
          }
          testing=company.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your Company Name")
                  return false
          }
          testing=compstate.value;
          if (testing.length == 0 || testing=="") {
                  alert("Please enter your State or Province")
                  return false
          }
          return true
   }
}
