function $(id){
	return document.getElementById(id);
}
function checksearch(){
	var yet = true;
	if(document.getElementById('keyword').value == ''){
		alert('关键字不能为空！');
		document.getElementById('keyword').focus();
		yet = false;
		return yet;
	}
	return yet;
}
function checkjob(){
		var yet = true;
		if($('_position').value == ''){
			alert('求职意向不能为空！');
			$('_position').focus();
			yet = false;
			return yet;
		}
		if($('_truename').value == ''){
			alert('姓名不能为空！');
			$('_truename').focus();
			yet = false;
			return yet;
		}
		/*if($('_city').value == ''){
			alert('城市不能为空！');
			$('_city').focus();
			yet = false;
			return yet;
		}
		if($('_education').value == ''){
			alert('学历不能为空！');
			$('_education').focus();
			yet = false;
			return yet;
		}
		if($('_subject').value == ''){
			alert('专业不能为空！');
			$('_subject').focus();
			yet = false;
			return yet;
		}
		if($('_worktimes').value == ''){
			alert('工作年限不能空！');
			$('_worktimes').focus();
			yet = false;
			return yet;
		}
		if($('_deal').value == ''){
			alert('期望待遇不能为空！');
			$('_deal').focus();
			yet = false;
			return yet;
		}*/
		if($('_email').value == ''){
			alert('电子邮件不能为空！');
			$('_email').focus();
			yet = false;
			return yet;
		}else{
			var myemail = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
			if(!myemail.test($('_email').value)){
				alert('电子邮件格式错误！');
				$('_email').focus();
				yet = false;
				return yet;
			}
		}
		if($('_phone').value == ''){
			alert('电话不能为空！');
			$('_phone').focus();
			yet = false;
			return yet;
		}
		if($('_resume').value == ''){
			alert('个人简历不能为空！');
			$('_resume').focus();
			yet = false;
			return yet;
		}
		return yet;
	}
function dosubmit(){	
	if(checkjob()){
		document.getElementById('jobsform').submit();
	}
}
function guestsubmit(){ 	
	if(checkguest()){
		document.getElementById('guestform').submit();
	}
}

function checkguest(){
		var yet = true;
		var myemail = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;		
		if($('_name').value == ''){
			alert('姓名不能为空！');
			$('_name').focus();
			yet = false;
			return yet;
		}
		if($('_phone').value == ''){
			alert('电话不能为空！');
			$('_phone').focus();
			yet = false;
			return yet;
		}
		if($('_email').value == ''){
			alert('E-mail不能为空！');
			$('_email').focus();
			yet = false;
			return yet;
		}else{ 
			if(!myemail.test($('_email').value)){
				alert('E-mail格式错误！');
				$('_email').focus();
				yet = false;
				return yet;
			}
		}
		/*if($('_product').value == ''){
			alert('产品不能为空！');
			$('_product').focus();
			yet = false;
			return yet;
		}*/
		if($('_content').value == ''){
			alert('留言不能为空！');
			$('_content').focus();
			yet = false;
			return yet;
		}
		return yet;
	}
 function tip(){
	var str = '新一代光伏电池组件智能连接控制系统领导者';
	var obj = document.getElementById("tip");
	var text = obj.innerHTML;
	var len = text.length;
	var length = str.length;
	if(len < length){
		len++;
		obj.innerHTML = str.substr(0,len);
		window.setTimeout("tip()",100);
	}
}
