﻿// JavaScript Document
function left_div_s_over(div){
	div.style.marginTop="2px";
}
function left_div_s_out(div){
div.style.marginTop="1px";
}
//二级导航
function ejdhOver(img){
	  	var kzm=img.src.match(/\.\w+$/ig);
		img.src=img.src.replace(/\.\w+$/ig,"_pass"+kzm);
	  }
	  function ejdhOut(img){
	  	var kzm=img.src.match(/_pass\.\w+$/ig)+"";
		img.src=img.src.replace(/_pass\.\w+$/ig,"."+kzm.split(".")[1]);
	  }

function gotoysxz(id){
if(id==279){
location.href="/education/demoDownloads/index.html";
}else if(id==286){
location.href="/corporate/demoDownloads/index.html";
}
else if(id==293){
location.href="/trainingCenter/demoDownloads/index.html";
}else{
location.href="/demoDownloads/index.htm";
}
}
function gotocgal(id){
if(id==280){
location.href="/education/caseStudy/index.html";
}else if(id==287){
location.href="/corporate/caseStudy/index.html";
}else if(id==306){
location.href="/trainingCenter/cgal/index.html";
}
else{
location.href="/caseStudy/index.htm";
}
}

/*验证表单*/
function checkForm(id){
	var v=new Validate();
	
	var txt_cname=$.trim($("input[name=txt_cname]").val());//公司名称
	//var txt_department=$.trim($("input[name=txt_department]").val());//部门
	var txt_jobTitle=$.trim($("input[name=txt_jobTitle]").val());//职称
	var txt_name=$.trim($("input[name=txt_name]").val());//姓名
	var txt_telNO1=$.trim($("input[name=txt_telNO1]").val());//电话号码 区号
	var txt_telNO2=$.trim($("input[name=txt_telNO2]").val());//电话号码 主号
	var txt_telNO3=$.trim($("input[name=txt_telNO3]").val());//电话号码 分机
	var txt_fax1=$.trim($("input[name=txt_fax1]").val());//传真号码 区号
	var txt_fax2=$.trim($("input[name=txt_fax2]").val());//传真号码 主号
	//var txt_mpNO=$.trim($("input[name=txt_mpNO]").val());//手机号码
	var txt_mail=$.trim($("input[name=txt_mail]").val());//电子邮箱
	//var txt_city=$.trim($("input[name=txt_city]").val());//区/县/市
	//var txt_province=$.trim($("input[name=txt_province]").val());//省/市/自治区/特别行政区
	//var txt_postCode=$.trim($("input[name=txt_postCode]").val());//邮编
	//var cbox_language="";$("input[name=cbox_language]").each(function(){if($(this)[0].checked){cbox_language+=$(this).val()+","}});cbox_language=cbox_language.substring(0,cbox_language.length-1);//语言
	
	if(!v.required(txt_cname)){
		alert("名称必须填写!");
		$("input[name=txt_cname]")[0].focus();
		return false;	
	}
	/*
	if(!v.required(txt_department)){
		alert("部门必须填写!");
		$("input[name=txt_department]")[0].focus();
		return false;	
	}*/
	if(!v.required(txt_jobTitle)){
		alert("职称必须填写!");
		$("input[name=txt_jobTitle]")[0].focus();
		return false;	
	}
	if(!v.required(txt_name)){
		alert("姓名必须填写!");
		$("input[name=txt_name]")[0].focus();
		return false;	
	}
	if(!v.required(txt_telNO1)){
		alert("电话号码 区号必须填写!");
		$("input[name=txt_telNO1]")[0].focus();
		return false;	
	}else{
			if(!v.isInt(txt_telNO1)){
				alert("电话号码 区号必须是整数!");
				$("input[name=txt_telNO1]")[0].focus();
				return false;	
			}
		}
	if(!v.required(txt_telNO2)){
		alert("电话号码 主号必须填写!");
		$("input[name=txt_telNO2]")[0].focus();
		return false;	
	}else{
			if(!v.isInt(txt_telNO2)){
				alert("电话号码 主号必须是整数!");
				$("input[name=txt_telNO2]")[0].focus();
				return false;	
			}
		}
		
	if(v.required(txt_telNO3)){
		if(!v.isInt(txt_telNO3)){
				alert("电话号码 分机必须是整数!");
				$("input[name=txt_telNO3]")[0].focus();
				return false;	
			}
	}	
		
	if(v.required(txt_fax1)){
			if(!v.isInt(txt_fax1)){
				alert("传真号码 区号必须是整数!");
				$("input[name=txt_fax1]")[0].focus();
				return false;	
			}
	}
	if(v.required(txt_fax2)){
			if(!v.isInt(txt_fax2)){
				alert("传真号码 主号必须是整数!");
				$("input[name=txt_fax2]")[0].focus();
				return false;	
			}
	}
	/*
	if(!v.required(txt_mpNO)){
		alert("手机号码必须填写!");
		$("input[name=txt_mpNO]")[0].focus();
		return false;	
	}else{
			if(!v.isInt(txt_mpNO)){
				alert("手机号码必须是整数!");
				$("input[name=txt_mpNO]")[0].focus();
				return false;	
			}
		}
		*/
		
	if(!v.required(txt_mail)){
		alert("电子邮箱必须填写!");
		$("input[name=txt_mail]")[0].focus();
		return false;	
	}else{
			if(!v.mail(txt_mail)){
				alert("电子邮箱格式不符合!");
				$("input[name=txt_mail]")[0].focus();
				return false;	
			}
		}
		/*
	if(!v.required(txt_city)){
		alert("区/县/市必须填写!");
		$("input[name=txt_city]")[0].focus();
		return false;	
	}
	if(!v.required(txt_province)){
		alert("省/市/自治区/特别行政区必须填写!");
		$("input[name=txt_province]")[0].focus();
		return false;	
	}
	if(!v.required(txt_postCode)){
		alert("邮编必须填写!");
		$("input[name=txt_postCode]")[0].focus();
		return false;	
	}else{
			if(!v.isInt(txt_postCode)){
				alert("邮编必须是整数!");
				$("input[name=txt_postCode]")[0].focus();
				return false;	
			}
		}
		*/
		/*
	if(!v.required(cbox_language)){
		alert("必须选择一种语言!");
		$("input[name=cbox_language]")[0].focus();
		return false;	
	}*/


		/*培训 b*//*
	if(id==268){
		var txt_ydsfx=$.trim($("input[name=txt_ydsfx]").val());//有多少分校
		if(!v.required(txt_ydsfx)){
			alert("有多少分校必须填写!");
			$("input[name=txt_ydsfx]")[0].focus();
			return false;	
		}
		var cbox_fxtc="";$("input[name=cbox_fxtc]").each(function(){if($(this)[0].checked){cbox_fxtc+=$(this).val()}});
		var txt_fxtc=$.trim($("input[name=txt_fxtc]").val());//分校同城
		if(cbox_fxtc=="不是"){
			if(!v.required(txt_fxtc)){
				alert("请填写分校所在的城市!");
				$("input[name=txt_fxtc]")[0].focus();
				return false;	
			}
		}
		var txt_xssl_cr=$.trim($("input[name=txt_xssl_cr]").val());//学生人数 成人
		var txt_xssl_sn=$.trim($("input[name=txt_xssl_sn]").val());//学生人数 儿童/青少年
		if(!v.required(txt_xssl_cr)){
			alert("学生人数 成人必须填写!");
			$("input[name=txt_xssl_cr]")[0].focus();
			return false;	
		}		
		if(!v.required(txt_xssl_sn)){
			alert("学生人数 儿童/青少年必须填写!");
			$("input[name=txt_xssl_sn]")[0].focus();
			return false;	
		}
		var txt_wjjsNO=$.trim($("input[name=txt_wjjsNO]").val());//外籍教师人数
		var txt_bgjsNO=$.trim($("input[name=txt_bgjsNO]").val());//本国教师人数
		if(!v.required(txt_wjjsNO)){
			alert("外籍教师人数必须填写!");
			$("input[name=txt_wjjsNO]")[0].focus();
			return false;	
		}		
		if(!v.required(txt_bgjsNO)){
			alert("本国教师人数必须填写!");
			$("input[name=txt_bgjsNO]")[0].focus();
			return false;	
		}
		
		var cbox_els="";$("input[name=cbox_els]").each(function(){if($(this)[0].checked){cbox_els+=$(this).val()}});
		
		var txt_elsys=$.trim($("input[name=txt_elsys]").val());//分校同城
		if(cbox_els=="是"){
			if(!v.required(txt_elsys)){
				alert("请填写目前贵校使用的在线 e-learning 教学系统名称!");
				$("input[name=txt_elsys]")[0].focus();
				return false;	
			}
		}
		
	}
	*/
	
	
	/*培训 e*/
	

	return true;
}