// JavaScript Document
function check_mbox(){
        if($("#yourname").val() == ''){
			 alert('请填写您的名字');
			 return false;
		}
		else if ($("#yourtelephone").val() == '' && $("#yourmobile").val()==''){
			 alert('手机号码和固定电话至少要填写一个');
			 return false;
		}
		else if ($("#youremail").val() == ''){
			 alert('请填写您的电子邮件');
			 return false;
		}
		else if ($("#title").val() == ''){
			 alert('请填写留言标题');
			 return false;
		}
		else if ($("#content").val() == ''){
			 alert('请填写留言内容');
			 return false;
		}
		else if ($("#code").val() == ''){
			 alert('请填写验证码');
			 return false;
		}			
}
function To_jumpMenu($link_url){
   window.open($link_url);
}
 function check_form($type_id,$id){
		    if ($type_id != 3){
			  $j  =  1;	
			  $(".opt_"+$id).each(function(){
			     if ($(this).attr("checked") == true){
				    $j = $j*0;
				 }else{
				    $j = $j*1;
				 }
			  })
			  if ($j == 1){
			      alert('请选择投票项!');
				  return false;
			  }
			}
			else{
				if ($("#content_"+$id).val() == ''){
			      alert('请先输入内容,然后方可提交');
				  return false;
				}
				
			}
}
function show_content_method($id){
	$method   =  $("#method_"+$id);
	$method_array = Array("凑合下","电话","传真","其他");
	if ($method.attr("checked") == true){
	    $("#content_method").html($("#content_method").html() + "<div id='tel_"+$id+"'>"+$method_array[$id]+": <input type=text  id='content_method_"+$id+"' name='content_method_"+$id+"'></div>");
	}else{
	    $("div").remove("#tel_"+$id);
	}
}
function check_sale(){
   if ($("#resideprovince").val() == ''){
	   alert('请选择城市');
	   return false;
   }else if ($("#company_name").val() == ''){
	   alert('请填写您单位名称');
	   return false;
   }
	$yt = 0;
   $("input[type='checkbox']").each(function($i){
												 if ($(this).attr('checked') == true){
													  $yt = $yt+1;
												 }
											 })
   
	if ($yt == 0){
		alert("请选择要提供的联系方式");
		return false;
	}
   var $k = 1;	
   $("input[type='checkbox']").each(function($i){
											   
											   $j = $i+1;
											    if ($("#content_method_"+$j).val() == ''){
													$k = $k*0;
												}
											 })
 	if ($k == 0){
		alert("请将联系方式填写完整了");
		return false;
	}  
   if ($("#email").val() == ''){
	   alert('请填写邮箱地址');
	   return false;
   }	
   if ($("#project_name").val() == ''){
	   alert('请填写项目名称');
	   return false;
   }
}