﻿function event_validate()
{
	var nrtrue=false;
	if (document.getElementById("radio_fkfs_01").checked == true)
	{
		nrtrue=true;
	}
	if (document.getElementById("radio_fkfs_02").checked == true)
	{
		nrtrue=true; 
	}
	//if (document.getElementById("radio_fkfs_03").checked == true)
	//{
	//	nrtrue=1; 
	//}
	if(!nrtrue)
	{
		alert("请选择付款方式");
		return false; 
	}
}

function qandaAnswer_validate()
{
	if (document.qandaAnswer.content.value== "")
	{
		alert("请输入要填写的询问\回答");
		document.qandaAnswer.content.focus();
		return false;
	}
	}

function qandapingj_validate()
{
	if (document.qandapingj.contentpingj.value== "")
	{
		alert("请输入要填写的评价");
		document.qandapingj.contentpingj.focus();
		return false;
	}
	}

function search_validate()
{
	if (document.s_search.Keywords.value== "")
	{
		alert("请输入您要搜索的内容");
		document.s_search.Keywords.focus();
		return false;
	}

}
function addreport_validate()
{
	if (document.addreport.content.value== "")
	{
		alert("请输入您要发表的评论");
		document.addreport.content.focus();
		return false;
	}
}

function tuijzt_validate()
{
	if (document.tuijzt.title.value== "")
	{
		alert("请输入推荐主题");
		document.tuijzt.title.focus();
		return false;
	}
	if (document.tuijzt.content.value== "")
	{
		alert("请输入推荐描述");
		document.tuijzt.content.focus();
		return false;
	}
}
function share_validate()
{
	if (document.share.uploadfile.value== "")
	{
		alert("请上传分享报告文件");
		document.share.uploadfile.focus();
		return false;
	}
	if (document.share.title.value== "")
	{
		alert("请输入分享报告名称");
		document.share.title.focus();
		return false;
	}
	if (document.share.content.value== "")
	{
		alert("请输入分享描述");
		document.share.content.focus();
		return false;
	}
}

function cpinquestion_validate()
{
	if (document.addcpinquestion.title.value== "")
	{
		alert("请填写提问问题的标题");
		document.addcpinquestion.title.focus();
		return false;
	}
	if (document.addcpinquestion.content.value== "")
	{
		alert("请具体详细描述您的问题");
		document.addcpinquestion.content.focus();
		return false;
	}
	if(document.addcpinquestion.th_list.selectedIndex>-1)
	{
		}
	else
	{
		alert("请选择问题的分类");
		return false;
		}
}
function cpinanswer_validate()
{
	if (document.addcpinanswer.h_content.value== "")
	{
		alert("请填写回答问题的内容");
		document.addcpinanswer.h_content.focus();
		return false;
	}

}
function cpinfriend_validate()
{
	if (document.addcpinfriend.friend_content.value== "")
	{
		alert("请填写邀请函的内容");
		document.addcpinfriend.friend_content.focus();
		return false;
	}
}
function cpinques_validate()
{
//	if (document.addcpinques.tw_title.value== "")
//	{
//		alert("请填写询问问题的主题");
//		document.addcpinques.tw_title.focus();
//		return false;
//	}
	if (document.addcpinques.tw_content.value== "")
	{
		alert("请填写询问问题的内容");
		document.addcpinques.tw_content.focus();
		return false;
	}
}

function write_validate()
{
	if (document.addwrite.username_list.value== "")
	{
		alert("请选择收件人");
		document.addwrite.username_list.focus();
		return false;
	}
	if (document.addwrite.title.value== "")
	{
		alert("请填写撰写邮件的主题");
		document.addwrite.title.focus();
		return false;
	}
	if (document.addwrite.content.value== "")
	{
		alert("请填写撰写邮件的内容");
		document.addwrite.content.focus();
		return false;
	}
}

function hfwrite_validate()
{
	if (document.hfwrite.title.value== "")
	{
		alert("请填写撰写邮件的主题");
		document.hfwrite.title.focus();
		return false;
	}
	if (document.hfwrite.content.value== "")
	{
		alert("请填写撰写邮件的内容");
		document.hfwrite.content.focus();
		return false;
	}
}

function addqanda_validate()
{
	if (document.addqanda.title.value== "")
	{
		alert("请填写在线问答的问题");
		document.addqanda.title.focus();
		return false;
	}
	if (document.addqanda.content.value== "")
	{
		alert("请具体详细描述您的问题");
		document.addqanda.content.focus();
		return false;
	}
	if(document.addqanda.Qanda_type.selectedIndex>-1)
	{
		}
	else
	{
		alert("请选择问题的分类");
		return false;
		}
}


function huiyinf_validate()
{
	if (document.huiyinf.user_name.value== "")
	{
		alert("请填写姓名");
		document.huiyinf.user_name.focus();
		return false;
	}
	if (document.huiyinf.Birth.value== "")
	{
		alert("请填写生日");
		document.huiyinf.Birth.focus();
		return false;
	}
	if (document.huiyinf.CurrentCompany.value== "")
	{
		alert("请填写任职公司");
		document.huiyinf.CurrentCompany.focus();
		return false;
	}
	if (document.huiyinf.CurrentPosition.value== "")
	{
		alert("请填写职位");
		document.huiyinf.CurrentPosition.focus();
		return false;
	}
	if (document.huiyinf.Mobile.value== "")
	{
		alert("请填写手机");
		document.huiyinf.Mobile.focus();
		return false;
	}
	if (document.huiyinf.Company_mail.value=="")
	{
		alert("请填写公司邮箱");
		document.huiyinf.Company_mail.focus();
		return false;
	}
}
function huiy_account()
{

	if (document.huiy_account.oldSiteAccount.value=="")
	{
		alert("请填写原帐户");
		document.huiy_account.oldSiteAccount.focus();
		return false;
	}
	if (document.huiy_account.newSiteAccount.value=="")
	{
		alert("请填写新帐户");
		document.huiy_account.newSiteAccount.focus();
		return false;
	}

}
function huiy_pj_validate()
{
	if (document.huiy_pj.huiypj_title.value=="")
	{
		alert("请填写评价");
		document.huiy_pj.huiypj_title.focus();
		return false;
	}
}

function search_name_validate()
{
	if (document.search_name.s_name.value== "")
	{
		alert("请填写要搜索姓名");
		document.search_name.s_name.focus();
		return false;
	}
}

function indexmain_validate()
{
	if(document.indexmain.event_jiany.value=="")
	{
		alert("请填写您感兴趣的话题");
		document.indexmain.event_jiany.focus();
		return false;
	}
}

function indexdiaoc_validate(sum_number,Survey_Fill)
{
	var bool_true=false;
	for(var i=1; i<=sum_number;i++)
	{
		if(document.getElementById("diaoc_"+i).checked==true)
		{
			bool_true=true;
		}
	}
	if(!bool_true)
	{
		if(Survey_Fill=="True")
		{
			if(document.getElementById("diaoc_1_1").value!="")
			{
				bool_true=true;
			}
		}
	}
	if(!bool_true)
	{
		alert("请选择调查问卷选项");
		//document.indexdiaoc.diaoc_input.focus();
		return false;			
	}
}


var checkflag = "false";
function checkall(field)
{
	if (checkflag == "false")
	{
		for (i = 0; i < field.length; i++)
		{
			field[i].checked = true;
		}
		checkflag = "true";
	}
	else
	{
		for (i = 0; i < field.length; i++)
		{
			field[i].checked = false;
		}
		checkflag = "false";
	}
}
function yjh_c()
{
	yjh_c_i=confirm('您确定要删除吗?');
	if(yjh_c_i==false)  
	{
		return false;
	}
	return true; 
}

function yjh_updatefriend_c()
{
	yjh_c_i=confirm('您确定要添加对方为您的好友吗?');
	if(yjh_c_i==false)  
	{
		return false;
	}
	return true; 
}
  
function andornot(name,num)
{
	var str,str1,str2;
	str=document.getElementById(name).value;
	str1=jsright(document.getElementById(name).value,2);
	str2=jsright(document.getElementById(name).value,1);
	if (str.indexOf("++")>0 || str.indexOf("--")>0 || str.indexOf("!")>0 )
	{
		alert('对不起，您只能使用一个模糊查询。');
		return false;
	}
	if (str2=="!")
	{
		alert('对不起，您只能使用一个模糊查询。');
		return false;
	}
	if (num==1)
	{
		
		if (document.getElementById(name).value!="" && str1!="++"&& str1!="--"&& str2!="!")
		{
			document.getElementById(name).value=document.getElementById(name).value+"++"
		}
	}
	if (num==2)
	{
		if (document.getElementById(name).value!="" && str1!="++"&& str1!="--"&& str2!="!")
		{
			document.getElementById(name).value=document.getElementById(name).value+"--"
		}
	}
	if (num==3)
	{
		if (document.getElementById(name).value!="" && str1!="++"&& str1!="--"&& str2!="!")
		{
			document.getElementById(name).value=document.getElementById(name).value+"!"
		}
	}
}
function jsright(rights,rightn) 
{ 

var sr=rights; 

sr = sr.substring(sr.length-rightn,sr.length); 

return sr; 
}
function showcalendar(name)
{
	var obj,dv;
	obj=document.getElementById(name);
	dv=window.showModalDialog("include/calendar.htm","44","center:1;help:no;status:no;dialogHeight:263px;dialogWidth:256px;scroll:no");
	if (dv)
	{
		if(dv=="null")
		{
			obj.value='';
		}
		else
			obj.value=dv;
	}
	else{
			obj.value='';
	}
}
