var i = 0;
var ch=0;
var j=0;
var strj="0";

function remspaces(what) {
        result=""
        for (x=0;x<=what.length;x++) {
                if (what.substring(x,x+1) != " ") {
                    result=result+what.substring(x,x+1)
                }
        }
        return result
}

function everythingok() {
with (document.contact) {
	  testing=remspaces(name.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your Name")
		  return false
	  }
/*
	  testing=remspaces(company.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your Company")
		  return false
	  }
*/
	  testing=remspaces(address1.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your Address")
		  return false
	  }
/*
	  testing=remspaces(city.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your City ")
		  return false
	  }
	  testing=remspaces(state.value)
	  if ((testing.length == 0 || testing=="") && (testing.length == 0 || testing=="")){
		  alert("Please enter your State")
		  return false
	  }
	  testing=remspaces(zip.value)
	  if (testing.length == 0 || testing=="" || testing.length<5 ) {
		  alert("Please enter your Zip Code")
		  return false
	  }
*/

	  testing=remspaces(country.value)
	  if (testing.length == 0 || testing=="0") {
		  alert("Please enter your country")
		  return false
	  }
	  testing=remspaces(email.value)
	  if (testing.length < 8 || testing=="" || testing.indexOf("@") == -1  ) {
		  alert("Please enter A Valid E-Mail Account")
		  return false
	  }
	  testing=remspaces(phone_country.value)
	  if (testing.length == 0 || testing=="" || testing.length<2) {
		  alert("Please enter your Phone Country Code")
		  return false
	  }

/*
	  testing=remspaces(phone_area.value)
	  if (testing.length == 0 || testing=="" || testing.length<3) {
		  alert("Please enter your Phone City Code")
		  return false
	  }
*/
	  testing=remspaces(phone.value)
	  if (testing.length == 0 || testing=="" || testing.length<7) {
		  alert("Please enter your Phone Number")
		  return false
	  }

	  return true;
 }
}
function eeverythingok() {
with (document.contact) {
	  testing=remspaces(name.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your Name")
		  return false
	  }
	  testing=remspaces(company.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your Company")
		  return false
	  }
	  testing=remspaces(address1.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your Address")
		  return false
	  }
	  testing=remspaces(city.value)
	  if (testing.length == 0 || testing=="") {
		  alert("Please enter your City ")
		  return false
	  }
	  testing=remspaces(state.value)
	  if (testing.length == 0 || testing=="Select Country") {
		  alert("Please enter your State")
		  return false
	  }
	  testing=remspaces(zip.value)
	  if (testing.length == 0 || testing=="" || testing.length<5 ) {
		  alert("Please enter your Zip Code")
		  return false
	  }
	  return true
 }
}
function setCheckBox(chkb) {
  if (chkb.checked) {
    ch=ch+1;
  }
  else {
    ch=ch-1;
  }
}
