﻿// JavaScript Document
		function setTab(m,n){ 
	var tli=document.getElementById("menu"+m).getElementsByTagName("li"); 
	var mli=document.getElementById("con"+m).getElementsByTagName("dir"); 
	for(i=0;i<tli.length;i++){ 
		tli[i].className=i==n?"hover":""; 
		mli[i].style.display=i==n?"block":"none"; 
	} 
} 
<!--//--><![CDATA[//><!--
function menuFix() {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
  sfEls[i].onmouseover=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseDown=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseUp=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onmouseout=function() {
  this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
  }
}
}
window.onload=menuFix;
//--><!]]>
//站内搜索跳转JS
function goSearch(theForm){
	if (Trim(theForm.q.value).length == 0){
		alert("关键词不能为空!");
		theForm.q.focus();
		return false;
	}
	
	theForm.method	= "get";
	theForm.action	= theForm.targetFile.value;
	return true;
}

//验证登录框
function checkLoginData(theForm){
	if (Trim(theForm.login_account.value).length == 0){
		alert("用户名不能为空!");
		theForm.login_account.focus();
		return false;
	}
	if (Trim(theForm.login_accountPwd.value).length == 0){
		alert("密码不能为空!");
		theForm.login_accountPwd.focus();
		return false;
	}
	if (Trim(theForm.i_verifyCode.value).length == 0){
		alert("验证码不能为空!");
		theForm.i_verifyCode.focus();
		return false;
	}

	
	return true;
}

//会员注册表单验证
function checkRegData(theForm){
	if (Trim(theForm.i_account.value).length == 0){
		alert("用户名不能为空!");
		theForm.i_account.focus();
		return false;
	}
	if (false == checkUserName(Trim(theForm.i_account.value))){
		alert("用户名只能由汉字、字母、下划线和数字组成!");
		theForm.i_account.focus();
		return false;
	}
	if (Trim(theForm.i_accountPwd.value).length == 0){
		alert("密码不能为空!");
		theForm.i_accountPwd.focus();
		return false;
	}
	if (false == checkPassword(theForm.i_accountPwd.value)){
		alert("密码不能有空白字符!");
		theForm.i_accountPwd.focus();
		return false;
	}
	if (theForm.c_accountPwd.value.length == 0){
		alert("密码确认不能为空!");
		theForm.c_accountPwd.focus();
		return false;
	}
	if (false == checkPassword(theForm.c_accountPwd.value)){
		alert("密码确认不能有空白字符!");
		theForm.c_accountPwd.focus();
		return false;
	}
	if (theForm.c_accountPwd.value != theForm.i_accountPwd.value){
		alert("两次输入密码必须相同!");
		theForm.i_accountPwd.focus();
		return false;
	}
	if (Trim(theForm.i_name.value).length == 0){
		alert("姓名不能为空!");
		theForm.i_name.focus();
		return false;
	}
	if (Trim(theForm.i_company.value).length == 0){
		alert("公司不能为空!");
		theForm.i_company.focus();
		return false;
	}
	if (Trim(theForm.i_email.value).length == 0){
		alert("邮箱不能为空!");
		theForm.i_email.focus();
		return false;
	}
	if (false == checkEmail(Trim(theForm.i_email.value))){
		alert("邮箱不是正确的Email地址!");
		theForm.i_email.focus();
		return false;
	}
	if (Trim(theForm.i_telephone.value).length == 0){
		alert("电话不能为空!");
		theForm.i_telephone.focus();
		return false;
	}

	return true;
}

//会员修改 资料验证表单
function checkData(theForm){
	if (Trim(theForm.i_account.value).length == 0){
		alert("用户名不能为空!");
		theForm.i_account.focus();
		return false;
	}
	if (false == checkUserName(Trim(theForm.i_account.value))){
		alert("用户名只能由汉字、字母、下划线和数字组成!");
		theForm.i_account.focus();
		return false;
	}
	if (theForm.e_accountPwd.checked == true){
		if (Trim(theForm.i_accountPwd.value).length == 0){
			alert("密码不能为空!");
			theForm.i_accountPwd.focus();
			return false;
		}
		if (false == checkPassword(theForm.i_accountPwd.value)){
			alert("密码不能有空白字符!");
			theForm.i_accountPwd.focus();
			return false;
		}
		if (theForm.c_accountPwd.value.length == 0){
			alert("密码确认不能为空!");
			theForm.c_accountPwd.focus();
			return false;
		}
		if (false == checkPassword(theForm.c_accountPwd.value)){
			alert("密码确认不能有空白字符!");
			theForm.c_accountPwd.focus();
			return false;
		}
		if (theForm.c_accountPwd.value != theForm.i_accountPwd.value){
			alert("两次输入密码必须相同!");
			theForm.i_accountPwd.focus();
			return false;
		}
	}
	if (Trim(theForm.i_name.value).length == 0){
		alert("姓名不能为空!");
		theForm.i_name.focus();
		return false;
	}
	if (Trim(theForm.i_company.value).length == 0){
		alert("公司不能为空!");
		theForm.i_company.focus();
		return false;
	}
	if (Trim(theForm.i_email.value).length == 0){
		alert("邮箱不能为空!");
		theForm.i_email.focus();
		return false;
	}
	if (false == checkEmail(Trim(theForm.i_email.value))){
		alert("邮箱不是正确的Email地址!");
		theForm.i_email.focus();
		return false;
	}
	if (Trim(theForm.i_telephone.value).length == 0){
		alert("电话不能为空!");
		theForm.i_telephone.focus();
		return false;
	}
	
	return true;
}

//在线留言 表单验证
function checkGuestData(theForm){
	if (theForm.i_pId1.value == 0){
		alert("你必须选择沟通分区！");
		return false;
	}
	if (Trim(theForm.i_name1.value).length == 0){
		alert("姓名不能为空!");
		theForm.i_name1.focus();
		return false;
	}
	if (Trim(theForm.i_telephone.value).length == 0){
		alert("电话不能为空!");
		theForm.i_telephone.focus();
		return false;
	}
	if (Trim(theForm.i_email.value).length == 0){
		alert("邮箱不能为空!");
		theForm.i_email.focus();
		return false;
	}
	if (false == checkEmail(Trim(theForm.i_email.value))){
		alert("邮箱不是正确的Email地址!");
		theForm.i_email.focus();
		return false;
	}
	if (Trim(theForm.i_name.value).length == 0){
		alert("标题不能为空!");
		theForm.i_name.focus();
		return false;
	}
	if (Trim(theForm.i_content.value).length == 0){
		alert("留言不能为空!");
		theForm.i_content.focus();
		return false;
	}
	if (Trim(theForm.i_addDate.value).length == 0){
		alert("留言日期不能为空!");
		theForm.i_addDate.focus();
		return false;
	}
	
	return true;
}

//预约开户 表单验证
function checkBookingData(theForm){
	if (theForm.i_pId1.value == 0){
		alert("你必须选择账号类型！");
		return false;
	}
	if (theForm.i_isOpen.checked == true){
		if (Trim(theForm.i_account.value).length == 0){
			alert("集成利期货账户不能为空!");
			theForm.i_account.focus();
			return false;
		}
	}
	if (Trim(theForm.i_name.value).length == 0){
		alert("姓名不能为空!");
		theForm.i_name.focus();
		return false;
	}
	if (Trim(theForm.i_idCard.value).length == 0){
		alert("身份证号码不能为空!");
		theForm.i_idCard.focus();
		return false;
	}
	if (Trim(theForm.i_telephone.value).length == 0){
		alert("电话不能为空!");
		theForm.i_telephone.focus();
		return false;
	}
	if (Trim(theForm.i_mobile.value).length == 0){
		alert("手机不能为空!");
		theForm.i_mobile.focus();
		return false;
	}
	if (Trim(theForm.i_address.value).length == 0){
		alert("地址不能为空!");
		theForm.i_address.focus();
		return false;
	}
	if (Trim(theForm.i_postalcode.value).length == 0){
		alert("邮编不能为空!");
		theForm.i_postalcode.focus();
		return false;
	}

	return true;
}


