﻿// JavaScript Document
//判断是否为空
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function ordercheck(){
	if(document.formOrder.keys.value==""){
		alert("Please enter the order number!");
		document.formOrder.keys.focus();
		return false
	}
}

//留言F
 function Fcheck(){
   if(document.formF.man.value==""){
      alert("Enter your name!");
	  document.formF.man.focus();
	  return false;
	  }
	if(document.formF.tel.value==""){
      alert("Please fill in your contact telephone!");
	  document.formF.tel.focus();
	  return false;
	  }
    if(document.formF.email.value==""){
      alert("Please fill in your E-mail!");
	  document.formF.email.focus();
	  return false;
	  }
    if(emailcheck(document.formF.email.value)){
		alert("E-mail format is not correct!");
		document.formF.email.focus();
		return false;
   }
   if(document.formF.title.value==""){
      alert("Input header!");
	  document.formF.title.focus();
	  return false;
	  }
	if(document.formF.content.value==""){
      alert("Your message content can not allow!");
	  document.formF.content.focus();
	  return false;
	  }
	if(document.formF.validatecode.value==""){
      alert("Verification Code should not be empty!");
	  document.formF.validatecode.focus();
	  return false;
	  }
}

//判断Email的正确性
function   emailcheck(string){     
  var   str_len   =   string.length;   
  if   (str_len<=5){   
        return   true   
          }       
  for(i=0;i<str_len;i++){   
          if   (string.charCodeAt(i)>127){   
  return   true     
  }   
  }   
  if   (string.indexOf("@")<2){   
          return   true   
          }       
    if   (string.indexOf(".")==1){   
          return   true   
          }       
  if   (string.indexOf(":")!=-1){   
          return   true   
  }   
 }