﻿//显示DIV曾，多媒体部分函数
function popup(msg,bb)
{
document.all("description").style.display="";
document.all("aa").innerHTML=msg;
if(bb=="bb"){
document.all("bb").style.backgroundColor='#FFFFFF';
document.all("cc").style.backgroundColor='#D0D0D0';
document.all("dd").style.backgroundColor='#D0D0D0';
document.all("ee").style.backgroundColor='#D0D0D0';
document.all("ff").style.backgroundColor='#D0D0D0';
};
if(bb=="cc"){
document.all("bb").style.backgroundColor='#D0D0D0';
document.all("cc").style.backgroundColor='#FFFFFF';
document.all("dd").style.backgroundColor='#D0D0D0';
document.all("ee").style.backgroundColor='#D0D0D0';
document.all("ff").style.backgroundColor='#D0D0D0';
};
if(bb=="dd"){
document.all("bb").style.backgroundColor='#D0D0D0';
document.all("cc").style.backgroundColor='#D0D0D0';
document.all("dd").style.backgroundColor='#FFFFFF';
document.all("ee").style.backgroundColor='#D0D0D0';
document.all("ff").style.backgroundColor='#D0D0D0';
};
if(bb=="ee"){
document.all("bb").style.backgroundColor='#D0D0D0';
document.all("cc").style.backgroundColor='#D0D0D0';
document.all("dd").style.backgroundColor='#D0D0D0';
document.all("ee").style.backgroundColor='#FFFFFF';
document.all("ff").style.backgroundColor='#D0D0D0';
};
if(bb=="ff"){
document.all("bb").style.backgroundColor='#D0D0D0';
document.all("cc").style.backgroundColor='#D0D0D0';
document.all("dd").style.backgroundColor='#D0D0D0';
document.all("ee").style.backgroundColor='#D0D0D0';
document.all("ff").style.backgroundColor='#FFFFFF';
};
}
//隐藏DIV曾函数
function pohide()
{
		if(screen.width<=800) {
		document.all.floater.style.display="none";
	 document.all.wel.style.display="none";
		}
	 }
function popuphide()
{
document.all("description").style.display="none";
document.all("aa").innerHTML="";
}
//检查是否INPUR输入为英文
function CheckIfEnglish( String )
{ 
    var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-";
     var i;
     var c;
      if(String.charAt( 0 )=='-')
	return false;
      if( String.charAt( String.length - 1 ) == '-' )
          return false;
     for( i = 0; i < String.length; i ++ )
     {
          c = String.charAt( i );
	  if (Letters.indexOf( c ) < 0)
	     return false;
     }
     return true;
}
//邮箱登陆密码验证部分
function encode(datastr, bassnum) {
	var tempstr;
	var tchar;
	var newdata = "";

	for (var i = 0; i < datastr.length; i++)
	{
		tchar = 65535 + bassnum - datastr.charCodeAt(i);
		tchar = tchar.toString();

		while(tchar.length < 5)
		{
			tchar = "0" + tchar;
		}

		newdata = newdata + tchar;
	}

	return newdata;
}
//邮箱登陆部分
function AddDomain() {			
if (document.f1.yxym.value=="") {
			  alert("邮箱域名不能为空！");						
			  document.f1.yxym.focus();											
			  return false;
			}
	if (document.f1.userid.value=="") {
			  alert("邮箱用户名不能空！");						
			  document.f1.username.focus();											
			  return false;
			}
	if (document.f1.passwd.value=="") {
			  alert("邮箱密码不能空！");						
			  document.f1.passwd.focus();											
			  return false;
			}
	 document.f1.passwd.value = encode(document.f1.passwd.value, parseInt(document.f1.picnum.value));
	 if(document.f1.userid.value.indexOf("@") == -1){
     document.f1.userid.value = document.f1.userid.value +"@"+ document.f1.user.value;}
	 else{
		 document.f1.userid.value = document.f1.userid.value + document.f1.user.value;
		 }
		document.f1.action="http://mail."+ document.f1.yxym.value+"/index.asp";
		return true;
}
//域名1搜索验证
function submitchecken() {
if (document.CheckIfEnglish.domain.value == ""){
		alert ("提示：\n\n如果您要进行域名的查询，请输入您要查询的域名前缀！");
		document.form_domain.domain.focus();
		return false;
	}
if (document.CheckIfEnglish.Domain.value == "") {
		alert("请输入您要查询的英文域名。");
		document.CheckIfEnglish.Domain.focus();
		return false;
	}

if (!CheckIfEnglish(document.CheckIfEnglish.Domain.value )) {
		alert("\t注意：在查询英文域名时应输入英文不能输入中文及非法字符！\n域名由不分大小写的英文字母和数字组成，除了开头和结尾以外，中间也可以含有“-”（即连字符或称减号）最大长度为26个字符；");
		document.CheckIfEnglish.Domain.focus();
		return false;
	}
return true;
}
//域名2搜索验证
function submitcheck() {
	if (document.checkdomain.nameInfo.value == "") {
		alert("请输入您要查询的通用域名。");
		document.checkdomain.nameInfo.focus();
		return false;
	}
	return true;
	}
//用户登陆验证
function BGLogin_Submit_Add(form) {						

			if (form.name.value=="") {
			  alert("用户名不能空！");						
			  document.form.name.focus();											
			  return false;
			}
			if (form.pass.value =="") {
				alert("密码不能空！");
				document.form.pass.focus();		
				return false;
			}
          form.action = "../guestbook/login.asp";		  	   
		   return true;
	   }
	   //客户定单验证
function dingdan() {			
if (document.f2.t_gsmc.value=="") {
			  alert("公司名称不能为空！");						
			  document.f2.t_gsmc.focus();											
			  return false;
			}
	if (document.f2.t_fzr.value=="") {
			  alert("负责人不能为空！");						
			  document.f2.t_fzr.focus();											
			  return false;
			}
	if (document.f2.t_lxdz.value=="") {
			  alert("联系地址不能为空！");						
			  document.f2.t_lxdz.focus();											
			  return false;
			}
	if (document.f2.t_lxdh.value=="") {
			  alert("联系电话不能为空！");						
			  document.f2.t_lxdh.focus();											
			  return false;
			}
    if (document.f2.email.value=="" | document.f2.email.value.indexOf("@") == -1 | document.f2.email.value.indexOf(".") == -1) {
			  alert("电子邮件格式错误！");						
			  document.f2.email.focus();											
			  return false;
			}
	var msg=window.confirm ("为了方便我们与您联系,\n您确定提交以上内容吗?");
    if(msg==true){
              return true;
          }else{
			  return false;}
}