document.write("<script language=\"JavaScript\" src=\"/js/prototype.js\"></script>");
function change_img(eml,src_str){
	$(eml).src=src_str
}
function change_class(all_eml,eml,class_name){
	var ml=$(all_eml).getElementsByTagName("li");
	var nml=eml
	for(var i=0;i<ml.length;i++){
	ml[i].className=ml[i]==nml?class_name:"";
  }
	}
function load_img(){
	var as=arguments;
	var imgs=new Array();
	for(var i=0;i<arguments.length;i++){
		imgs[i]=new Image();
		imgs[i].src=as[i]
		}
	}
function hidden(id){if($(id)){$(id).style.display="none"}}
function block(id){if($(id)){$(id).style.display='block'}}

function check_form_feedback(language){
	var contact=$("contact").value;
	var phone=$("phone").value;
	var email=$("email").value;
	switch(language){
		case 1:
	if(contact==""){alert("请填写姓名！");return false;}
	if(phone==""){alert("请填写电话！");return false;}
	if(!check_email(email)&&email!=""){alert("E-mail填写错误！");return false;}
	  case 2:
	if(contact==""){alert("Please fill in the name ！");return false;}
	if(phone==""){alert("Please fill in the telephone！");return false;}
	if(!check_email(email)&&email!=""){alert("E-mail filling in mistake！");return false;}
  }
  return true;
	}
function check_form_order(language){
	var contact=$("contact").value;
	var phone=$("phone").value;
	var email=$("email").value;
	switch(language){
		case 1:
	if(contact==""){alert("请填写姓名！");return false;}
	if(phone==""){alert("请填写电话！");return false;}
	if(!check_email(email)&&email!=""){alert("E-mail填写错误！");return false;}
	  case 2:
	if(contact==""){alert("Please fill in the name ！");return false;}
	if(phone==""){alert("Please fill in the telephone！");return false;}
	if(!check_email(email)&&email!=""){alert("E-mail filling in mistake！");return false;}
  }
  return true;
	}
function check_form_reg(language){
	var user=$("user").value;
	var password=$("password").value;
	var check_password=$("check_password").value;
	var email=$("email").value;
	switch(language){
		case 1:
	if(user==""){alert("必须填写用户名！");return false;}
	if(!(user.length>=6&&user.length<=20)){alert("用户名长度必须为6到20个字符！");return false;}
	if(password==""){alert("必须填写密码！");return false;}
	if(!(password.length>=6&&password.length<=20)){alert("密码长度必须为6到20个字符！");return false;}
	if(password!=check_password){alert("两次输入的密码不正确！");return false;}
	if(!check_email(email)&&email!=""){alert("E-mail填写错误！");return false;}
	  case 2:
	if(user==""){alert("Must fill in user! ");return false;}
	if(!(user.length>=6&&user.length<=20)){alert("The user famous length must be 6 to 20 characters! ");return false;}
	if(password==""){alert("Must fill in the password! ");return false;}
  if(!(password.length>=6&&password.length<=20)){alert("The password length must be 6 to 20 characters! ");return false;}
	if(password!=check_password){alert("Two times inputs the password is not correct! ");return false;}
	if(!check_email(email)&&email!=""){alert("E-mail filling in mistake！");return false;}
  }
  return true;
	}
function check_form_mat_save(language){
	var email=$("email").value;
	switch(language){
		case 1:

	if(!check_email(email)&&email!=""){alert("E-mail填写错误！");return false;}
	  case 2:
	if(!check_email(email)&&email!=""){alert("E-mail filling in mistake！");return false;}
  }
  return true;
	}
function check_form_password_save(language){
		 var old_password=$("old_password").value;
  var password=$("password").value;
	var check_password=$("check_password").value;
	switch(language){
		case 1:
  if(old_password==""){alert("必须填写旧密码！");return false;}
  if(!(old_password.length>=6&&old_password.length<=20)){alert("旧密码长度必须为6到20个字符！");return false;}
  if(password==""){alert("必须填写新密码！");return false;}
  if(!(password.length>=6&&password.length<=20)){alert("新密码长度必须为6到20个字符！");return false;}
  if(password!=check_password){alert("两次输入的密码不正确！");return false;}
	  case 2:
	  if(old_password==""){alert("Must fill in the old password! ");return false;}
  if(!(old_password.length>=6&&old_password.length<=20)){alert("The old password length must be 6 to 20 characters! ");return false;}
  if(password==""){alert("Must fill in the new password!");return false;}
  if(!(password.length>=6&&password.length<=20)){alert("The new password length must be 6 to 20 characters! ");return false;}
  if(password!=check_password){alert("Two times inputs the password is not correct!");return false;}
  }
  return true;

	}
function check_email(s)
{
	if ((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(s))==false)
	{
	return false;
	}
	else
	{
	return true;
	}
}

