
//Check member form
function MemberFormCheck(obj) {
    if (obj.m_account.value == "") {
		alert("Notice! The field of Account was still blank.");
		obj.m_account.focus();
		return false;   
	}
	if (obj.m_password.value == "") {
		alert("Notice! The field of Password was still blank.");
		obj.m_password.focus();
		return false;   
	}
	if (obj.m_password.value != obj.v_password.value) {
		alert("Password and Confirm Password must be the same.");
		obj.v_password.focus();
		return false;   
	}
	if (obj.m_name.value == "") {
		alert("Notice! The field of Name was still blank.");
		obj.m_name.focus();
		return false;   
	}
	if (obj.m_birthday.value == "") {
		alert("Notice! The field of Birthday was still blank.");
		obj.m_birthday.focus();
		return false;   
	}
	if (obj.m_address.value == "") {
		alert("Notice! The field of Address was still blank.");
		obj.m_address.focus();
		return false;   
	}
	if (obj.m_tel.value == "") {
		alert("Notice! The field of Tel was still blank.");
		obj.m_tel.focus();
		return false;   
	}
	if (obj.m_email.value == "") {
		alert("Notice! The field of e-mail was still blank");
		obj.m_email.focus();
		return false;   
	} else {
		if (obj.m_email.value.indexOf("@") == -1 || obj.m_email.value.indexOf(".") == -1) {
			alert("Your e-mail are not in correct format.");
			obj.m_email.focus();
			return false;
		}
	}
	return true;
}
function CartMemberFormCheck(obj) {
	if (obj.m_name.value == "") {
		alert("Notice! The field of Name was still blank.");
		obj.m_name.focus();
		return false;   
	}
	if (obj.m_address.value == "") {
		alert("Notice! The field of Address was still blank.");
		obj.m_address.focus();
		return false;   
	}
	if (obj.m_tel.value == "") {
		alert("Notice! The field of Tel was still blank.");
		obj.m_tel.focus();
		return false;   
	}
	if (obj.m_email.value == "") {
		alert("Notice! The field of e-mail was still blank");
		obj.m_email.focus();
		return false;   
	} else {
		if (obj.m_email.value.indexOf("@") == -1 || obj.m_email.value.indexOf(".") == -1) {
			alert("Your e-mail are not in correct format.");
			obj.m_email.focus();
			return false;
		}
	}
	return true;
}

//Check contact us form
function ContactusFormCheck(obj) {
	if (obj.cu_name.value == "") {
		alert("Notice! The field of Name was still blank.");
		obj.cu_name.focus();
		return false;   
	}
	if (obj.cu_company_name.value == "") {
		alert("Notice! The field of Company Name was still blank.");
		obj.cu_company_name.focus();
		return false;
	}
	if (obj.cu_email.value == "") {
		alert("Notice! The field of e-mail was still blank.");
		obj.cu_email.focus();
		return false;
	} else {
		if (obj.cu_email.value.indexOf("@") == -1 || obj.cu_email.value.indexOf(".") == -1) {
			alert("Your e-mail are not in correct format.");
			obj.cu_email.focus();
			return false;
		}
	}
	if (obj.cu_country.value == "") {
		alert("Notice! The field of Country was still blank.");
		obj.cu_country.focus();
		return false;
	}
	if (obj.cu_tel.value == "") {
		alert("Notice! The field of Tel was still blank.");
		obj.cu_tel.focus();
		return false;   
	}
	if (obj.cu_fax.value == "") {
		alert("Notice! The field of Fax was still blank.");
		obj.cu_fax.focus();
		return false;
	}
  var itemsChecked=0;
  var checkbox = obj['cu_items[]'];
  if (checkbox.length==null) {
    if (checkbox.checked==true) {
      itemsChecked++;
    }else{
      itemsChecked=0;
    }
  } else if(checkbox.length > 1) {
      for (var i=0;i<checkbox.length;i++) {
          var e = checkbox[i];
          if (e.checked==true) {
              itemsChecked++; }
      }
  }
  if (itemsChecked==0) {
      alert("Please check Interested Items!!")
      return false;
  }
	return true;
}

function CheckTerm(form){
    if(form.m_agree_term.checked){
        document.getElementById('div_send_show').style.display='';
    }else{
        document.getElementById('div_send_show').style.display='none';
    }
}

