<!--
$(document).ready(function()
{
//-----------------------begin
//主导航
	$(".jf_title").mouseover(function(){$(this).css("position","relative");$(this).find(".jf_intro").show();})
	$(".jf_title").mouseleave(function(event){$(this).css("position","static");$(this).find(".jf_intro").hide();event.stopPropagation();})   //积分途径
	
	$(".zhekou>ul>li").mouseover(function(){$(this).css("position","relative");$(this).find(".img_title").show();})
	$(".zhekou>ul>li").mouseleave(function(event){$(this).css("position","static");$(this).find(".img_title").hide();event.stopPropagation();})
	
	$(".zhekou_big>ul>li").mouseover(function(){$(this).css("position","relative");$(this).find(".img_title_big").show();})
	$(".zhekou_big>ul>li").mouseleave(function(event){$(this).css("position","static");$(this).find(".img_title_big").hide();event.stopPropagation();})
  
//检测首页留言表单
	$('#form_reg').submit(function ()
	{
				
		if($('#username').val()=="" || $('#username').val().length<6)
		{			
			alert("用户名不能为空！并且不能小于6位。");
			$('#username').focus();
			return false;
		}		
		if($('#password').val()=="" || $('#password').val().length<6)
		{			
			alert("密码不能为空,并且不能小于6位。");
			$('#password').focus();
			return false;
		}
		
		if($('#password2').val()=="" || $('#password').val()!=$('#password2').val())
		{			
			alert("确认密码不能为空,同时两次输入的密码要相等");
			$('#password2').focus();
			return false;
		}
		
		if($('#mail').val()=="" || !isEmail($('#mail').val())){			
			alert("邮箱地址不能为空,或邮箱格式不正确。");
			$('#mail').focus();
			return false;
		}
		if($('#vdcode').val()=="")
		{			
			alert("验证码不能为空");
			$('#vdcode').focus();
			return false;
		}
		
		
	})
//检测咨询师
$('#form_expert').submit(function ()
	{
				
		if($('#username').val()=="" || $('#username').val().length<6)
		{			
			alert("用户名不能为空！并且不能小于6位。");
			$('#username').focus();
			return false;
		}		
		if($('#password').val()=="" || $('#password').val().length<6)
		{			
			alert("密码不能为空,并且不能小于6位。");
			$('#password').focus();
			return false;
		}
		
		if($('#password2').val()=="" || $('#password').val()!=$('#password2').val())
		{			
			alert("确认密码不能为空,同时两次输入的密码要相等");
			$('#password2').focus();
			return false;
		}
		
		if($('#realname').val()==""){			
			alert("真实姓名不能为空。");
			$('#realname').focus();
			return false;
		}
		
		if($('#mail').val()=="" || !isEmail($('#mail').val())){			
			alert("邮箱地址不能为空,或邮箱格式不正确。");
			$('#mail').focus();
			return false;
		}
		if($('#mobile').val()==""){			
			alert("手机不能为空。");
			$('#mobile').focus();
			return false;
		}		
		if($('#qq').val()==""){			
			alert("QQ不能为空。");
			$('#qq').focus();
			return false;
		}
		
		if($('#idcard').val()==""){			
			alert("身份证号码不能为空。");
			$('#idcard').focus();
			return false;
		}
		
		if($('#levelcode').val()==""){			
			alert("证书或毕业证号码不能为空。");
			$('#levelcode').focus();
			return false;
		}
		
		if($('#vdcode').val()=="")
		{			
			alert("验证码不能为空");
			$('#vdcode').focus();
			return false;
		}
		
		
	})
//检测重新密码
	$('#form_repwd').submit(function ()
	{
		
		
		if($('#oldpwd').val()=="")
		{			
			alert("旧密码不能为空！");
			$('#oldpwd').focus();
			return false;
		}		
		if($('#newpwd').val()=="")
		{			
			alert("新密码不能为空。");
			$('#newpwd').focus();
			return false;
		}
		
		
		if($('#newpwd').val()!=$('#newpwd2').val())
		{			
			alert("新密码两次输入要相等。");
			$('#newpwd2').focus();
			return false;
		}
		
		return true;
		
	})

//检测评论
	$('#form_commend').submit(function ()
	{
		if($('#u_id').val()=="")
		{			
			alert("请登录，如果您还不是会员，请您注册。");
			$('#note').focus();
			return false;
		}
		
		if($('#title').val()=="")
		{			
			alert("标题不能为空！");
			$('#title').focus();
			return false;
		}		
		if($('#note').val()=="")
		{			
			alert("内容不能为空。");
			$('#note').focus();
			return false;
		}
		
		if($('#code').val()=="")
		{			
			//alert("验证码不能为空");
			//$('#code').focus();
			//return false;
		}
		
	})
	
//检测咨询表单
	$('#ep_msg').submit(function ()
	{
		if($('#title').val()=="")
		{			
			alert("标题不能为空");
			$('#title').focus();
			return false;
		}
		
		if($('#title').val()=="")
		{			
			alert("标题不能为空！");
			$('#title').focus();
			return false;
		}		
		if($('#note').val()=="")
		{			
			alert("内容不能为空。");
			$('#note').focus();
			return false;
		}
		
		if($('#code').val()=="")
		{			
			//alert("验证码不能为空");
			//$('#code').focus();
			//return false;
		}
		
	})	
 
 //动画
  $('#fW_Content').cycle({ 
	 fx:'fade',
	 timeout:3000,
     pager:'#fW_Controls'
 }); 

//-----------------------end
});
//检测邮件格式
function isEmail(strEmail) {
if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
return false;
}

function show_box(t,n,a,b)
{
   for(i=1;i<=t;i++)
   {
	  if(n==i){
	    document.getElementById(a+"_"+n).className='press';
		document.getElementById(b+"_"+n).style.display='';
	  }else{
		document.getElementById(a+"_"+i).className='';  
		document.getElementById(b+"_"+i).style.display='none';
	  }
   }
}

-->
