//上传球洞图片
function CourseHoleImagesrc(pointid)
{
	var CourseHole=showModalDialog('/windowopen/action=courseholeimagesrcaddframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:400px;help:0;status:0;resizeable:1;scrolling:1;');
}
//上传球洞图片


//上传球洞图片表单检测
function CheckCourseHoleImagesrcFormValue(theform)
{
	if (document.getElementById("myfile").value=='')
	{
		alert("请选择图片！");
		document.getElementById("myfile").focus();
		return false;
	}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE图片！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
	if (document.getElementById("mydescriptions").value=='')
	{
		alert("请输入描述！");
		document.getElementById("mydescriptions").focus();
		return false;
	}
	if (document.getElementById("mydescriptions").value.length>300)
	{
		alert("描述不能超过300个字符！");
		document.getElementById("mydescriptions").focus();
		return false;
	}
	
}
//上传球洞图片表单检测


//添加球场特惠 
function CoursePreferential(pointid,pointid1,pointarea)
{
	if (pointid1!='A')
	{
		var CP=showModalDialog('/windowopen/action=coursepreferentialeditframe&pointid='+pointid+'&pointid1='+pointid1,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var CP=showModalDialog('/windowopen/action=coursepreferentialaddframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	
	if (CP!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'CoursePreferentialListTable','CoursePreferentialForm');
		}
	    if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreCoursePreferentialListTable','MoreCoursePreferentialForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'CoursePreferentialListByTagTable','CoursePreferentialListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
		
}
//添加球场特惠 



//检测添加球场特惠表单
 function CheckCoursePreferentialFormValue(theform)
 {
	  var	today =	new	Date();
	  var	dateNow	 = today.getDate();
	  var	monthNow = today.getMonth()+ 1;
	  var	yearNow	 = today.getYear();
	  if (monthNow<10)
	  {	
		 var monthNow = '0'+monthNow
	  }
	  if (dateNow<10)
	  {
		  var dateNow = '0'+dateNow
	  }
	  var  nowdate = yearNow+'-'+monthNow+'-'+dateNow;
	 if (trim(document.getElementById("mytitle").value)=='')
	 {
		 alert("请输入特惠名称！");
		 document.getElementById("mytitle").focus();
		 return false;
	 }
	 if (document.getElementById("mytitle").value.length>50)
	 {
		 alert("特惠名称字数不能超过50个字符！");
		 document.getElementById("mytitle").focus();
		 return false;
	 }
	 if (trim(document.getElementById("myabs").value)=='')
	 {
		 alert("请输入特惠摘要！");
		 document.getElementById("myabs").focus();
		 return false;
	 }
	 if (document.getElementById("myabs").value.length>200)
	 {
		 alert("特惠名称字数不能超过200个字符！");
		 document.getElementById("myabs").focus();
		 return false;
	 }
	 //if (document.getElementById("desc").value=='')
	 //{
	//	 alert("请输入特惠描述！");
		 
	//	 return false;
	 //}
	 if (document.getElementById("mystartdate").value=='')
	 {
		 alert("请选择开始日期！");
		 document.getElementById("mystartdate").focus();
		 return false;
	 }
	 if (document.getElementById("myenddate").value=='')
	 {
		 alert("请选择结束日期！");
		 document.getElementById("myenddate").focus();
		 return false;
	 }
	 if (nowdate>document.getElementById("mystartdate").value)
	 {
		  alert("开始日期不能小于当前日期！");
		  document.getElementById("mystartdate").focus();
		  return false;
	 }
	 if (nowdate>document.getElementById("myenddate").value)
	 {
		  alert("结束日期不能小于当前日期！");
		  document.getElementById("myenddate").focus();
		  return false;
	 }
	 if (document.getElementById("myenddate").value<document.getElementById("mystartdate").value)
	 {
		  alert("结束日期不能小于开始日期！");
		  document.getElementById("myenddate").focus();
		  return false;
	 }
	if(document.getElementById("pivd").value=='ns'){
		if(document.getElementById("usercourseid").value==''){
			alert("请您选择球场！");
		  document.getElementById("resultname").focus();
		  return false;}
	}

 }
//检测添加球场特惠表单


//删除球场特惠
function CoursePreferentialDel(pointid,pointname,pointarea)
{
	var CP = '' ;
	var truthBeTold = window.confirm("单击“确定”删除球场特惠“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{
		if (pointarea=='MainList')
		{
			ajaxfordel('CoursePreferentialListTable','/submit/action=coursepreferentialdel_ex&pointid='+pointid,'删除成功','CoursePreferentialForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreCoursePreferentialListTable','/submit/action=coursepreferentialdel_ex&pointid='+pointid,'删除成功','MoreCoursePreferentialForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxfordel('CoursePreferentialListByTagTable','/submit/action=coursepreferentialdel_ex&pointid='+pointid,'删除成功','CoursePreferentialListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	
	}
}
//删除球场特惠



//发布招聘
function InvitesCourse(pointid,pointid1,pointarea)
{
	if (pointid1!='A')
	{
		var IC=showModalDialog('/windowopen/action=invitescourseeditframe&pointid='+pointid+'&pointid1='+pointid1,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var IC=showModalDialog('/windowopen/action=invitescourseaddframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (IC!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'InvitesCourseListTable','InvitesCourseListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreInvitesCourseListTable','MoreInvitesCourseListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'InvitesCourseListByTagTable','InvitesCourseListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//发布招聘


//删除招聘
function InvitesCourseDel(pointid,pointname,pointarea)
{
	var IC = '' ;
	var truthBeTold = window.confirm("单击“确定”删除招聘“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{
		if (pointarea=='MainList')
		{
			ajaxfordel('InvitesCourseListTable','/submit/action=invitescoursedel_ex&pointid='+pointid,'删除成功','InvitesCourseListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreInvitesCourseListTable','/submit/action=invitescoursedel_ex&pointid='+pointid,'删除成功','MoreInvitesCourseListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxfordel('InvitesCourseListByTagTable','/submit/action=invitescoursedel_ex&pointid='+pointid,'删除成功','InvitesCourseListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	
	}
}
//删除招聘


//检测发布招聘表单
function CheckInvitesCourseFormValue(theform)
{
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入招聘名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>50)
	{
		alert("招聘名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("myabs").value)=='')
	{
		alert("请输入招聘摘要！");
		document.getElementById("myabs").focus();
		return false;
	}
	if (document.getElementById("myabs").value.length>200)
	{
		alert("招聘摘要字数不能超过200个字符！");
		document.getElementById("myabs").focus();
		return false;
	}

	if (trim(document.getElementById("mytag").value)=='')
	{
		alert("请输入职位标签！");
		document.getElementById("mytag").focus();
		return false;
	}
	//if (trim(document.getElementById("desc").value)=='')
	//{
	//	alert("请输入招聘信息！");
		//document.getElementById("desc").focus();
	//	return false;
	//}
	if(document.getElementById("pivd").value=='ns'){
		if(document.getElementById("usercourseid").value==''){
			alert("请您选择球场！");
		  document.getElementById("resultname").focus();
		  return false;}
	}

}
//检测发布招聘表单



//添加球场新闻
function CourseNews(pointid,pointid1,pointarea)
{
	if (pointid1!='A')
	{
		var CN=showModalDialog('/windowopen/action=coursenewseditframe&pointid='+pointid+'&pointid1='+pointid1,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var CN=showModalDialog('/windowopen/action=coursenewsaddframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (CN!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'CourseNewsListTable','CourseNewsListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreCourseNewsListTable','MoreCourseNewsListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'CourseNewsListByTagTable','CourseNewsListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//添加球场新闻


//检测添加球场新闻表单
function CheckCourseNewsFormValue(theform)
{
	if (trim(document.getElementById("mytitle").value)=='')
	{
		 alert("请输入新闻标题！");
		 document.getElementById("mytitle").focus();
		 return false;
	}
	if (document.getElementById("mytitle").value.length>150)
	{
		 alert("新闻标题字数不能超过150个字符！");
		 document.getElementById("mytitle").focus();
		 return false;
	}
	//if (trim(document.getElementById("desc").value)=='')
	//{
	//	 alert("请输入新闻内容！");
		// document.getElementById("mycontents").focus();
	//	 return false;
	//}
	if (document.getElementById("mydate").value=='')
	{
		alert("请选择日期！");
		document.getElementById("mydate").focus();
		return false;
	}
	if(document.getElementById("pivd").value=='ns'){
		if(document.getElementById("usercourseid").value==''){
			alert("请您选择球场！");
		  document.getElementById("resultname").focus();
		  return false;}
	}
}
//检测添加球场新闻表单


//删除球场新闻
function CourseNewsDel(pointid,pointname,pointarea)
{
	var CN = '' ;
	var truthBeTold = window.confirm("单击“确定”删除球场新闻“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		
		if (pointarea=='MainList')
		{
			ajaxfordel('CourseNewsListTable','/submit/action=coursenewsdel_ex&pointid='+pointid,'删除成功','CourseNewsListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreCourseNewsListTable','/submit/action=coursenewsdel_ex&pointid='+pointid,'删除成功','MoreCourseNewsListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxfordel('CourseNewsListByTagTable','/submit/action=coursenewsdel_ex&pointid='+pointid,'删除成功','CourseNewsListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
		
}
//删除球场新闻

//添加新比赛
function Compete(pointid,pointid1,pointarea)
{
	if (pointid1!='A')
	{
		var C=showModalDialog('/windowopen/action=competeeditframe&pointid='+pointid+'&pointid1='+pointid1,window,'dialogWidth:700px; dialogHeight:700px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var C=showModalDialog('/windowopen/action=competeaddframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (C!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'CompeteListTable','CompeteListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreCompeteListTable','MoreCompeteListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'CompeteListByTagTable','CompeteListByTagTableForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//添加新比赛


//检测添加比赛表单
function CheckCompeteaddFormValue(theform)
{
	var	today =	new	Date();
	var	dateNow	 = today.getDate();
	var	monthNow = today.getMonth()+ 1;
	var	yearNow	 = today.getYear();
	if (monthNow<10)
	{	
		var monthNow = '0'+monthNow
	}
	if (dateNow<10)
	{
		var dateNow = '0'+dateNow
	}
	var  nowdate = yearNow+'-'+monthNow+'-'+dateNow;
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入比赛名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>50)
	{
		alert("比赛名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("myabs").value)=='')
	{
		alert("请输入比赛摘要！");
		document.getElementById("myabs").focus();
		return false;
	}
	if (document.getElementById("myabs").value.length>200)
	{
		alert("比赛摘要字数不能超过200个字符！");
		document.getElementById("myabs").focus();
		return false;
	}
	if (document.getElementById("mysigndate").value=='')
	{
		alert("请选择报名开始日期！");
		document.getElementById("mysigndate").focus();
		return false;
	}
	if (document.getElementById("mysigndate").value<nowdate)
	{
		alert("报名开始日期不能小于当前日期！");
		document.getElementById("mysigndate").focus();
		return false;
	}
	if (document.getElementById("mysignenddate").value=='')
	{
		alert("请选择报名结束日期！");
		document.getElementById("mysignenddate").focus();
		return false;
	}
	if (document.getElementById("mysignenddate").value<document.getElementById("mysigndate").value)
	{
		alert("报名结束日期不能小于报名开始日期！");
		document.getElementById("mysignenddate").focus();
		return false;
	}
	if (document.getElementById("mycompetedate").value=='')
	{
		alert("请选择赛事开始日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}
	if (document.getElementById("mycompetedate").value<document.getElementById("mysignenddate").value)
	{
		alert("赛事开始日期不能小于报名结束日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}
	if (document.getElementById("mycompeteenddate").value=='')
	{
		alert("请选择赛事结束日期！");
		document.getElementById("mycompeteenddate").focus();
		return false;
	}
	if (document.getElementById("mycompetedate").value>document.getElementById("mycompeteenddate").value)
	{
		alert("赛事结束日期不能小于开始日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}
	if (trim(document.getElementById("mycompeteprice").value)=='')
	{
		alert("请输入比赛费用！");
		document.getElementById("mycompeteprice").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("mycompeteprice").value))||trim(document.getElementById("mycompeteprice").value)<0)
	{
		alert("请输入一个有效的正整数作为比赛费用！");
		document.getElementById("mycompeteprice").focus();
		return false;
	}
	if (trim(document.getElementById("mypersonnumber").value)=='')
	{
		alert("请输入参赛的上限人数！");
		document.getElementById("mypersonnumber").focus();
		return false;
	}
	if (isNaN(parseInt(trim(document.getElementById("mypersonnumber").value)))||trim(document.getElementById("mypersonnumber").value)<=0)
	{
		alert("请输入一个有效的正整数作为参赛的上限人数！");
		document.getElementById("mypersonnumber").focus();
		return false;
	}
	if (trim(document.getElementById("desc").value)=='')
	{
		alert("请输入比赛描述！");
		return false;
	}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为比赛宣传图！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
}
//检测添加比赛表单


//删除比赛
function CompeteDel(pointid,pointname,pointarea)
{
	var C = '' ;
	var truthBeTold = window.confirm("单击“确定”删除比赛“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		if (pointarea=='MainList')
		{
			ajaxfordel('CompeteListTable','/submit/action=competedel_ex&pointid='+pointid,'删除成功','CompeteListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreCompeteListTable','/submit/action=competedel_ex&pointid='+pointid,'删除成功','MoreCompeteListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxfordel('CompeteListByTagTable','/submit/action=competedel_ex&pointid='+pointid,'删除成功','CompeteListByTagTableForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//删除比赛


//发起新活动
function Activity(pointid,pointid1,pointarea)
{
	if (pointid1!='A')
	{
		var A=showModalDialog('/windowopen/action=activityeditframe&pointid='+pointid+'&pointid1='+pointid1,window,'dialogWidth:700px; dialogHeight:700px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var A=showModalDialog('/windowopen/action=activityaddframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (A!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'ActivityListTable','ActivityListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreActivityListTable','MoreActivityListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'ActivityListByTagTable','ActivityListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
		
	}
}
//发起新活动


//检测活动表单
function CheckActivityaddFormValue(theform)
{
	var	today =	new	Date();
	var	dateNow	 = today.getDate();
	var	monthNow = today.getMonth()+ 1;
	var	yearNow	 = today.getYear();
	if (monthNow<10)
	{	
		var monthNow = '0'+monthNow
	}
	if (dateNow<10)
	{
		var dateNow = '0'+dateNow
	}
	var  nowdate = yearNow+'-'+monthNow+'-'+dateNow;
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入活动名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>50)
	{
		alert("活动名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mystartdate").value=='')
	{
		alert("请活动开始日期！");
		document.getElementById("mystartdate").focus();
		return false;
	}
	if (document.getElementById("mystartdate").value<nowdate)
	{
		alert("活动开始日期不能小于当前日期！");
		document.getElementById("mystartdate").focus();
		return false;
	}
	if (document.getElementById("myendstart").value=='')
	{
		alert("请选择活动结束日期！");
		document.getElementById("myendstart").focus();
		return false;
	}
	if (document.getElementById("myendstart").value<document.getElementById("mystartdate").value)
	{
		alert("活动结束日期不能小于活动开始日期！");
		document.getElementById("myendstart").focus();
		return false;
	}
	if (trim(document.getElementById("mydescrition").value)=='')
	{
		alert("请输入活动描述！");
		document.getElementById("mydescrition").focus();
		return false;
	}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为活动宣传图！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
}
//检测活动表单


//删除活动
function ActivityDel(pointid,pointname,pointarea)
{
	var C = '' ;
	var truthBeTold = window.confirm("单击“确定”删除活动“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		if (pointarea=='MainList')
		{
			ajaxfordel('ActivityListTable','/submit/action=activitydel_ex&pointid='+pointid,'删除成功','ActivityListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreActivityListTable','/submit/action=activitydel_ex&pointid='+pointid,'删除成功','MoreActivityListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxfordel('ActivityListByTagTable','/submit/action=activitydel_ex&pointid='+pointid,'删除成功','ActivityListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//删除活动



//添加培训
function Train(pointid,pointid1,pointarea)
{
	if (pointid1!='A')
	{
		var T=showModalDialog('/windowopen/action=traineditframe&pointid='+pointid+'&pointid1='+pointid1,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var T=showModalDialog('/windowopen/action=trainaddframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (T!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'TrainListTable','TrainListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreTrainListTable','MoreTrainListForm');
		}
	}
}
//添加培训


//检测培训表单
function CheckTrainaddFormValue(theform)
{
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入培训名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>50)
	{
		alert("培训名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("myabs").value)=='')
	{
		alert("请输入培训摘要！");
		document.getElementById("myabs").focus();
		return false;
	}
	if (document.getElementById("myabs").value.length>200)
	{
		alert("培训摘要字数不能超过200个字符！");
		document.getElementById("myabs").focus();
		return false;
	}

	if (trim(document.getElementById("myexpenses").value)=='')
	{
		alert("请输入培训费用！");
		document.getElementById("myexpenses").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("myexpenses").value))||trim(document.getElementById("myexpenses").value)<=0)
	{
		alert("请输入一个有效的正整数作为培训费用！");
		document.getElementById("myexpenses").focus();
		return false;
	}
	if (trim(document.getElementById("mylessonhour").value)=='')
	{
		alert("请输入培训课时！");
		document.getElementById("mylessonhour").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("mylessonhour").value))||trim(document.getElementById("mylessonhour").value)<=0)
	{
		alert("请输入一个有效的正整数作为培训课时！");
		document.getElementById("mylessonhour").focus();
		return false;
	}
	//if (trim(document.getElementById("desc").value)=='')
	//{
	//	alert("请输入培训描述！");
		//document.getElementById("desc").focus();
	//	return false;
	//}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为宣传图片！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
	if(document.getElementById("pivd").value=='ns'){
		if(document.getElementById("usercourseid").value==''){
			alert("请您选择球场！");
		  document.getElementById("resultname").focus();
		  return false;}
	}

}
//检测培训表单


//删除培训
function TrainDel(pointid,pointname,pointarea)
{
	var T = '' ;
	var truthBeTold = window.confirm("单击“确定”删除培训“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		
		if (pointarea=='MainList')
		{
			ajaxfordel('TrainListTable','/submit/action=traindel_ex&pointid='+pointid,'删除成功','TrainListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreTrainListTable','/submit/action=traindel_ex&pointid='+pointid,'删除成功','MoreTrainListForm');
		}
	}
}
//删除培训




//删除提交AJAX
function ajaxfordel(div,geturl,theclew,theform) {
	var ajax=new AJAXRequest;
	ajax.get(
		geturl+'&a=Math.Random()',
		function(obj) {
		if (obj.responseText==1)
		{
			alert(theclew);
			ajaxchangecontentbypost(this,div,theform);
		}
		}
	);
}
//删除提交AJAX


//图片格式检测
function CheckExt(objUpload)
{
  var AllowExt=".jpg|.jpeg|";
  ImgSrc = objUpload.value;
  FileExt=ImgSrc.substr(ImgSrc.lastIndexOf(".")).toLowerCase();
  if(AllowExt.indexOf(FileExt+"|")==-1)
  {
	 return false;
  }
  return true;
}
//图片格式检测

//教练生涯
function CoachCareer()
{
	var CC=showModalDialog('/windowopen/action=coachcareerframe',window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
}
//教练生涯


//教练发培训
function TrainCoach(pointid,pointarea)
{
	if (pointid!='A')
	{
		var TC=showModalDialog('/windowopen/action=traincoacheditframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var TC=showModalDialog('/windowopen/action=traincoachaddframe',window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (TC!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'TrainCoachListTable','TrainCoachListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreTrainCoachListTable','MoreTrainCoachListForm');
		}
	}
}
//教练发培训


//教练发知识
function EpistemeCoach(pointid,pointarea)
{
	if (pointid!='A')
	{
		var EC=showModalDialog('/windowopen/action=epistemecoacheditframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var EC=showModalDialog('/windowopen/action=epistemecoachaddframe',window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (EC!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'EpistemeCoachListTable','EpistemeCoachListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreEpistemeCoachListTable','MoreEpistemeCoachListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'EpistemeCoachListByTagTable','EpistemeCoachListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//教练发知识

//检测教练培训表单
function CheckTrainCoachAddFormValue(theform)
{
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入培训名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>50)
	{
		alert("培训名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("myexpenses").value)=='')
	{
		alert("请输入培训费用！");
		document.getElementById("myexpenses").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("myexpenses").value))||trim(document.getElementById("myexpenses").value)<=0)
	{
		alert("请输入一个有效的正整数作为培训费用！");
		document.getElementById("myexpenses").focus();
		return false;
	}
	if (trim(document.getElementById("mylessonhour").value)=='')
	{
		alert("请输入培训课时！");
		document.getElementById("mylessonhour").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("mylessonhour").value))||trim(document.getElementById("mylessonhour").value)<=0)
	{
		alert("请输入一个有效的正整数作为培训课时！");
		document.getElementById("mylessonhour").focus();
		return false;
	}
	if (trim(document.getElementById("mydescriptions").value)=='')
	{
		alert("请输入培训描述！");
		document.getElementById("mydescriptions").focus();
		return false;
	}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为宣传图片！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
}
//检测教练培训表单


//教练删除培训
function TrainCoachDel(pointid,pointname,pointarea)
{
	var T = '' ;
	var truthBeTold = window.confirm("单击“确定”删除培训“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		
		if (pointarea=='MainList')
		{
			ajaxfordel('TrainCoachListTable','/submit/action=traincoachdel_ex&pointid='+pointid,'删除成功','TrainCoachListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreTrainCoachListTable','/submit/action=traincoachdel_ex&pointid='+pointid,'删除成功','MoreTrainCoachListForm');
		}
	}
}
//教练删除培训


//检测教练知识表单
function CheckEpistemeCoachAddFormFormValue(theform)
{
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入知识名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("mytype").value)=='')
	{
		alert("请选择知识类别！");
		document.getElementById("mytype").focus();
		return false;
	}
	if (trim(document.getElementById("mydescriptions").value)=='')
	{
		alert("请输入知识描述！");
		document.getElementById("mydescriptions").focus();
		return false;
	}
}
//检测教练知识表单

//教练删除知识
function EpistemeCoachDel(pointid,pointname,pointarea)
{
	var EC = '' ;
	var truthBeTold = window.confirm("单击“确定”删除培训“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		
		if (pointarea=='MainList')
		{
			ajaxfordel('EpistemeCoachListTable','/submit/action=epistemecoachdel_ex&pointid='+pointid,'删除成功','EpistemeCoachListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreEpistemeCoachListTable','/submit/action=epistemecoachdel_ex&pointid='+pointid,'删除成功','MoreEpistemeCoachListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxfordel('EpistemeCoachListByTagTable','/submit/action=epistemecoachdel_ex&pointid='+pointid,'删除成功','EpistemeCoachListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//教练删除知识

//检测教练生涯表单
function CheckCoachCareEreditFormValue(theform)
{
	if (trim(document.getElementById("myname").value)=='')
	{
		alert("请输入姓名！");
		document.getElementById("myname").focus();
		return false;
	}
	if (document.getElementById("myname").value.length>50)
	{
		alert("姓名字数不能超过50个字符！");
		document.getElementById("myname").focus();
		return false;
	}
	if (trim(document.getElementById("mycountry").value)=='')
	{
		alert("请输入国籍！");
		document.getElementById("mycountry").focus();
		return false;
	}
	if (trim(document.getElementById("myballage").value)=='')
	{
		alert("请输入球龄！");
		document.getElementById("myballage").focus();
		return false;
	}
	if (trim(document.getElementById("City").value)=='')
	{
		alert("请选择教练区域！");
		document.getElementById("City").focus();
		return false;
	}
	if (document.getElementById("mycoachintelligence").value=='')
	{
		alert("请选择教练资质！");
		document.getElementById("mycoachintelligence").focus();
		return false;
	}
	if (trim(document.getElementById("myaddress").value)=='')
	{
		alert("请输入地址！");
		document.getElementById("myaddress").focus();
		return false;
	}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为您的近照！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
}
//检测教练生涯表单

//新闻
function WebNews(pointid,pointarea)
{
	if (pointid!='A')
	{
		var WN=showModalDialog('/windowopen/action=webnewseditframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:700px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var WN=showModalDialog('/windowopen/action=webnewsaddframe',window,'dialogWidth:700px; dialogHeight:700px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (WN!='')
	{		
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'WebNewsListTabel','WebNewsListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'WebNewsListByTagTabel','WebNewsListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//新闻

//检测新闻表单
function CheckWebNewsAddFormValues(theform)
{
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入新闻标题！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>100)
	{
		alert("新闻标题字数不能超过100个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("mydate").value)=='')
	{
		alert("请选择新闻日期！");
		document.getElementById("mydate").focus();
		return false;
	}
	if (trim(document.getElementById("mysummary").value)=='')
	{
		alert("请输入新闻摘要！");
		document.getElementById("mysummary").focus();
		return false;
	}
	if (document.getElementById("mysummary").value.length>500)
	{
		alert("新闻摘要字数不能超过500个字符！");
		document.getElementById("mysummary").focus();
		return false;
	}
	// if (trim(document.getElementById("desc").value)=='')
	//{
	//	alert("请输入新闻内容！");
	//	document.getElementById("desc").focus();
	//	return false;
	//}
	if (document.getElementById("mytype").value=='')
	{
		alert("请选择新闻类别！");
		document.getElementById("mytype").focus();
		return false;
	}
}
//检测新闻表单

//删除新闻
function WebNewsDel(pointid,pointname,pointarea)
{
	var EC = '' ;
	var truthBeTold = window.confirm("单击“确定”删除新闻“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		if (pointarea=='MainList')
		{
			ajaxfordel('WebNewsListTabel','/submit/action=webnewsdel_ex&pointid='+pointid,'删除成功','WebNewsListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxfordel('WebNewsListByTagTabel','/submit/action=webnewsdel_ex&pointid='+pointid,'删除成功','WebNewsListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
}
//删除新闻

//申请成为教练
function CoachApply()
{
	var CA=showModalDialog('/windowopen/action=coachapplyframe',window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	if (CA!='')
	{
		ajaxchangecontentbypost(this,'UserBasicInfoTable','UserBasicInfoForm');
	}window.location.reload();
}
//申请成为教练


function CheckCoachApplyFormValues()
{
	if (trim(document.getElementById("myapply_desc").value)=='')
	{
		alert("请填写申请理由！");
		document.getElementById("myapply_desc").focus();
		return false;
	}
}


//去左空格
function ltrim(s)
{ 
	return s.replace( /^\s*/, ""); 
}
//去左空格

//去右空格
function rtrim(s)
{ 
	return s.replace( /\s*$/, ""); 
} 
//去右空格
//去空格
function trim(s)
{ 
	return rtrim(ltrim(s)); 
}
//去空格

//添加新比赛
function Compete2(pointid1,pointarea)
{var C='';
	if (pointid1!='A')
	{
		 C=showModalDialog('/windowopen/action=golfcompeteeditframe&pointid1='+pointid1,window,'dialogWidth:700px; dialogHeight:700px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		 C=showModalDialog('/windowopen/action=golfcompeteaddframe',window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (C!='')
	{
		window.location.reload();
		/*if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'CompeteListTable','golfCompeteListForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');*/
	}
}

function  golfallCheckCompeteaddFormValue(theform){
	
 if(!golfCheckCompeteaddFormValue(theform)){
		return false;
	 }
else {
		 return true;
}
	
}

//检测添加比赛表单
function golfCheckCompeteaddFormValue(theform)
{
	var	today =	new	Date();
	var	dateNow	 = today.getDate();
	var	monthNow = today.getMonth()+ 1;
	var	yearNow	 = today.getYear();
	if (monthNow<10)
	{	
		var monthNow = '0'+monthNow
	}
	if (dateNow<10)
	{
		var dateNow = '0'+dateNow
	}
	var  nowdate = yearNow+'-'+monthNow+'-'+dateNow;
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入比赛名称！");
		document.getElementById("mytitle").focus();
		return false;
	}

	if (document.getElementById("mytitle").value.length>50)
	{
		alert("比赛名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("myabs").value)=='')
	{
		alert("请输入比赛摘要！");
		document.getElementById("myabs").focus();
		return false;
	}

	if (document.getElementById("myabs").value.length>200)
	{
		alert("比赛摘要字数不能超过200个字符！");
		document.getElementById("myabs").focus();
		return false;
	}

	if (document.getElementById("mysigndate").value=='')
	{
		alert("请选择报名开始日期！");
		document.getElementById("mysigndate").focus();
		return false;
	}
	/*if (document.getElementById("mysigndate").value<nowdate)
	{
		alert("报名开始日期不能小于当前日期！");
		document.getElementById("mysigndate").focus();
		return false;
	}*/
	if (document.getElementById("mysignenddate").value=='')
	{
		alert("请选择报名结束日期！");
		document.getElementById("mysignenddate").focus();
		return false;
	}
	if (document.getElementById("mysignenddate").value<document.getElementById("mysigndate").value)
	{
		alert("报名结束日期不能小于报名开始日期！");
		document.getElementById("mysignenddate").focus();
		return false;
	}
	if (document.getElementById("mycompetedate").value=='')
	{
		alert("请选择赛事开始日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}
	/*if (document.getElementById("mycompetedate").value<document.getElementById("mysignenddate").value)
	{
		alert("赛事开始日期不能小于报名结束日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}*/
	if (document.getElementById("mycompeteenddate").value=='')
	{
		alert("请选择赛事结束日期！");
		document.getElementById("mycompeteenddate").focus();
		return false;
	}
	if (document.getElementById("mycompetedate").value>document.getElementById("mycompeteenddate").value)
	{
		alert("赛事结束日期不能小于开始日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}
	if (trim(document.getElementById("mycompeteprice").value)=='')
	{
		alert("请输入比赛费用！");
		document.getElementById("mycompeteprice").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("mycompeteprice").value))||trim(document.getElementById("mycompeteprice").value)<0)
	{
		alert("请输入一个有效的正整数作为比赛费用！");
		document.getElementById("mycompeteprice").focus();
		return false;
	}
	if (trim(document.getElementById("mypersonnumber").value)=='')
	{
		alert("请输入参赛的上限人数！");
		document.getElementById("mypersonnumber").focus();
		return false;
	}
	if (isNaN(parseInt(trim(document.getElementById("mypersonnumber").value)))||trim(document.getElementById("mypersonnumber").value)<=0)
	{
		alert("请输入一个有效的正整数作为参赛的上限人数！");
		document.getElementById("mypersonnumber").focus();
		return false;
	}
	//if (trim(document.getElementById("desc").value)=='')
	//{
	//	alert("请输入比赛描述！");
	//	document.getElementById("desc").focus();
	//	return false;
	//}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为比赛宣传图！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
	return true;
}
//检测添加比赛表单

//删除比赛
function CompeteDel2(pointid,pointname)
{
	var C = '' ;
	var truthBeTold = window.confirm("单击“确定”删除比赛“"+ pointname+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		
		//ajaxchangecontentbypost(this,'delcoursecompete','golfCompeteListFormselect');
		document.location='/golfcompetedel_ex/'+pointid;
	}
}

//检测添加比赛表单
function CheckCompeteaddFormValue_new(theform)
{
	var	today =	new	Date();
	var	dateNow	 = today.getDate();
	var	monthNow = today.getMonth()+ 1;
	var	yearNow	 = today.getYear();
	if (monthNow<10)
	{	
		var monthNow = '0'+monthNow
	}
	if (dateNow<10)
	{
		var dateNow = '0'+dateNow
	}
	var  nowdate = yearNow+'-'+monthNow+'-'+dateNow;
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入比赛名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>50)
	{
		alert("比赛名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("myabs").value)=='')
	{
		alert("请输入比赛摘要！");
		document.getElementById("myabs").focus();
		return false;
	}
	if (document.getElementById("myabs").value.length>200)
	{
		alert("比赛摘要字数不能超过200个字符！");
		document.getElementById("myabs").focus();
		return false;
	}
	if (document.getElementById("mysigndate").value=='')
	{
		alert("请选择报名开始日期！");
		document.getElementById("mysigndate").focus();
		return false;
	}
	/*if (document.getElementById("mysigndate").value<nowdate)
	{
		alert("报名开始日期不能小于当前日期！");
		document.getElementById("mysigndate").focus();
		return false;
	}*/
	if (document.getElementById("mysignenddate").value=='')
	{
		alert("请选择报名结束日期！");
		document.getElementById("mysignenddate").focus();
		return false;
	}
	if (document.getElementById("mysignenddate").value<document.getElementById("mysigndate").value)
	{
		alert("报名结束日期不能小于报名开始日期！");
		document.getElementById("mysignenddate").focus();
		return false;
	}
	if (document.getElementById("mycompetedate").value=='')
	{
		alert("请选择赛事开始日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}
	/*if (document.getElementById("mycompetedate").value<document.getElementById("mysignenddate").value)
	{
		alert("赛事开始日期不能小于报名结束日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}*/
	if (document.getElementById("mycompeteenddate").value=='')
	{
		alert("请选择赛事结束日期！");
		document.getElementById("mycompeteenddate").focus();
		return false;
	}
	if (document.getElementById("mycompetedate").value>document.getElementById("mycompeteenddate").value)
	{
		alert("赛事结束日期不能小于开始日期！");
		document.getElementById("mycompetedate").focus();
		return false;
	}
	if (trim(document.getElementById("mycompeteprice").value)=='')
	{
		alert("请输入比赛费用！");
		document.getElementById("mycompeteprice").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("mycompeteprice").value))||trim(document.getElementById("mycompeteprice").value)<0)
	{
		alert("请输入一个有效的正整数作为比赛费用！");
		document.getElementById("mycompeteprice").focus();
		return false;
	}
	if (trim(document.getElementById("mypersonnumber").value)=='')
	{
		alert("请输入参赛的上限人数！");
		document.getElementById("mypersonnumber").focus();
		return false;
	}
	if (isNaN(parseInt(trim(document.getElementById("mypersonnumber").value)))||trim(document.getElementById("mypersonnumber").value)<=0)
	{
		alert("请输入一个有效的正整数作为参赛的上限人数！");
		document.getElementById("mypersonnumber").focus();
		return false;
	}
	//if (trim(document.getElementById("desc").value)=='')
	//{
	//	alert("请输入比赛描述！");
	//	return false;
	//}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为比赛宣传图！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
}


//新闻
//教练组
function Webcoachgroup(pointid,pointarea)
{
	if (pointid!='A')
	{
		var WN=showModalDialog('/windowopen/action=webcoachgroupeditframe',window,'dialogWidth:700px; dialogHeight:700px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{	
		var WN=showModalDialog('/windowopen/action=webcoachgroupaddframe',window,'dialogWidth:700px; dialogHeight:700px;help:0;status:0;resizeable:1;scrolling:1;');

	}	
	
}
//教练组
//教练组添加教练
function Webcoachgroupaddcoach(pointid,pointarea){
	
		var WN=showModalDialog('/windowopen/action=webcoachgroupaddcoachframe',window,'dialogWidth:700px; dialogHeight:160px;help:0;status:0;resizeable:1;scrolling:1;');
		if (WN!='')
		{
			if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'WebCoachGroupListTabel','WebCoachGroupCoachListForm');
		}
		}
			
}
//教练组
//检测新闻表单

//检测添加教练组表单
function CheckCoachGroupAddFormValues(theform)
{
	if (trim(document.getElementById("coachgroupname").value)=='')
	{
		alert("请输入教练团队名称！");
		document.getElementById("coachgroupname").focus();
		return false;
	}	
	if (trim(document.getElementById("CGMname").value)=='')
	{
		alert("请输入组长姓名！");
		document.getElementById("CGMname").focus();
		return false;
	}
	if (trim(document.getElementById("CGMlink").value)=='')
	{
		alert("请输入组长联系方式！");
		document.getElementById("CGMlink").focus();
		return false;
	}
	

	if (trim(document.getElementById("CGMcountry").value)=='')
	{
		alert("请输入组长国籍！");
		document.getElementById("CGMcountry").focus();
		return false;
	}
	if (trim(document.getElementById("CGMcoachintelligence").value)=='')
	{
		alert("请输入组长资质！");
		document.getElementById("CGMcoachintelligence").focus();
		return false;
	}
	if (trim(document.getElementById("CGMballage").value)=='')
	{
		alert("请输入组长球龄！");
		document.getElementById("CGMballage").focus();
		return false;
	}
	if (trim(document.getElementById("coachgrouppostion").value)=='')
	{
		alert("请输入组长地址！");
		document.getElementById("coachgrouppostion").focus();
		return false;
	}
	if (trim(document.getElementById("myfile").value)=='')
	{
		alert("请上传组长照片！");
		document.getElementById("myfile").focus();
		return false;
	}
	if (trim(document.getElementById("coachgroupdescriptions").value)=='')
	{
		alert("请输入教练组简介！");
		document.getElementById("coachgroupdescriptions").focus();
		return false;
	}
	if (trim(document.getElementById("CGMcoachintelligence1").value)=='')
	{
		alert("请输入组长资历！");
		document.getElementById("CGMcoachintelligence1").focus();
		return false;
	}
	
	

}
//检测添加教练组表单
//检测编辑教练组表单
function CheckCoachGroupEditFormValues(theform)
{
	if (trim(document.getElementById("coachgroupname").value)=='')
	{
		alert("请输入教练团队名称！");
		document.getElementById("coachgroupname").focus();
		return false;
	}	
	if (trim(document.getElementById("CGMname").value)=='')
	{
		alert("请输入组长姓名！");
		document.getElementById("CGMname").focus();
		return false;
	}
	if (trim(document.getElementById("CGMlink").value)=='')
	{
		alert("请输入组长联系方式！");
		document.getElementById("CGMlink").focus();
		return false;
	}
	

	if (trim(document.getElementById("CGMcountry").value)=='')
	{
		alert("请输入组长国籍！");
		document.getElementById("CGMcountry").focus();
		return false;
	}
	if (trim(document.getElementById("CGMcoachintelligence").value)=='')
	{
		alert("请输入组长资质！");
		document.getElementById("CGMcoachintelligence").focus();
		return false;
	}
	if (trim(document.getElementById("CGMballage").value)=='')
	{
		alert("请输入组长球龄！");
		document.getElementById("CGMballage").focus();
		return false;
	}
	if (trim(document.getElementById("coachgrouppostion").value)=='')
	{
		alert("请输入组长地址！");
		document.getElementById("coachgrouppostion").focus();
		return false;
	}
	
	if (trim(document.getElementById("coachgroupdescriptions").value)=='')
	{
		alert("请输入教练组简介！");
		document.getElementById("coachgroupdescriptions").focus();
		return false;
	}
	if (trim(document.getElementById("CGMcoachintelligence1").value)=='')
	{
		alert("请输入组长资历！");
		document.getElementById("CGMcoachintelligence1").focus();
		return false;
	}
	
	

}
//检测编辑教练组表单

//检测教练组添加教练表单
function CheckCoachGroupAddCoachFormValues(theform)
{
	if (trim(document.getElementById("coachgroupcoachemail").value)=='')
	{
		alert("请输入教练邮箱！");
		document.getElementById("coachgroupcoachemail").focus();
		return false;
	}	
	
	

}
//检测教练组添加教练表单

//教练组删除教练
function WebCoachGroupDelCoach(pointid,pointname,pointarea)
{
	var EC = '' ;
	var truthBeTold = window.confirm("单击“确定”删除此教练。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		if (pointarea=='MainList')
		{	
			alert(pointid);
			ajaxfordel1('WebCoachGroupListTabel','/submit/action=webcoachgroupcoachdel_ex&pointid='+pointid,'删除成功','WebCoachGroupCoachListForm');
		}
				
	}
}
//教练组删除教练
//教练组发知识
function EpistemeCoachGroup(pointid,pointarea)
{
	if (pointid!='A')
	{
		var EC=showModalDialog('/windowopen/action=epistemecoacheditframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var EC=showModalDialog('/windowopen/action=epistemecoachgroupaddframe',window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (EC!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'EpistemeCoachListTable','EpistemeCoachListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxchangecontentbypost(this,'MoreEpistemeCoachListTable','MoreEpistemeCoachListForm');
		}
		if (pointarea=='ListByTag')
		{
			ajaxchangecontentbypost(this,'EpistemeCoachListByTagTable','EpistemeCoachListByTagForm');
		}
		ajaxchangecontentbypost(this,'LeftTagNavTable','LeftTagNavForm');
	}
	
}
//教练组发知识
//教练组发培训
function TrainCoachGroup(pointid,pointarea)
{
	if (pointid!='A')
	{
		var TC=showModalDialog('/windowopen/action=traincoachgroupeditframe&pointid='+pointid,window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	else
	{
		var TC=showModalDialog('/windowopen/action=traincoachgroupaddframe',window,'dialogWidth:700px; dialogHeight:500px;help:0;status:0;resizeable:1;scrolling:1;');
	}
	if (TC!='')
	{
		if (pointarea=='MainList')
		{
			ajaxchangecontentbypost(this,'TrainCoachGroupListTable','TrainCoachListForm');
		}
		
	}
}
//教练组发培训
//教练组删除培训
function TrainCoachDel(pointid,pointname,pointarea)
{
	var T = '' ;
	var truthBeTold = window.confirm("单击“确定”删除培训“"+ document.getElementById(pointname+pointid).value+"”。单击“取消”停止。");
	if (truthBeTold) 
	{ 
		
		if (pointarea=='MainList')
		{
			ajaxfordel('TrainCoachGroupListTable','/submit/action=traincoachdel_ex&pointid='+pointid,'删除成功','TrainCoachListForm');
		}
		if (pointarea=='MoreList')
		{
			ajaxfordel('MoreTrainCoachListTable','/submit/action=traincoachdel_ex&pointid='+pointid,'删除成功','MoreTrainCoachListForm');
		}
	}
}
//教练组删除培训
//检测教练组培训表单
function CheckTrainCoachgroupAddFormValue(theform)
{
	if (trim(document.getElementById("mytitle").value)=='')
	{
		alert("请输入培训名称！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (document.getElementById("mytitle").value.length>50)
	{
		alert("培训名称字数不能超过50个字符！");
		document.getElementById("mytitle").focus();
		return false;
	}
	if (trim(document.getElementById("myexpenses").value)=='')
	{
		alert("请输入培训费用！");
		document.getElementById("myexpenses").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("myexpenses").value))||trim(document.getElementById("myexpenses").value)<=0)
	{
		alert("请输入一个有效的正整数作为培训费用！");
		document.getElementById("myexpenses").focus();
		return false;
	}
	if (trim(document.getElementById("mylessonhour").value)=='')
	{
		alert("请输入培训课时！");
		document.getElementById("mylessonhour").focus();
		return false;
	}
	if (isNaN(trim(document.getElementById("mylessonhour").value))||trim(document.getElementById("mylessonhour").value)<=0)
	{
		alert("请输入一个有效的正整数作为培训课时！");
		document.getElementById("mylessonhour").focus();
		return false;
	}
	if (trim(document.getElementById("myabstract").value)=='')
	{
		alert("请输入培训摘要！");
		document.getElementById("myabstract").focus();
		return false;
	}
	if (trim(document.getElementById("mydescriptions").value)=='')
	{
		alert("请输入培训描述！");
		document.getElementById("mydescriptions").focus();
		return false;
	}
	if (document.getElementById("myfile").value!='')
	{
		if(!CheckExt(document.getElementById("myfile")))
		{
			alert("请选择JPG或JPGE格式的图片作为宣传图片！");
			document.getElementById("myfile").focus();
			return false;
		}
	}
}
//检测教练组培训表单
     function getViewValue(){
	var re = /<P>/g;
	var a2 = /<\/\P>/g;
	var a3 = /<br>/g;
	var a4 = /\/\br>/g;
	    var nv = document.getElementById('desc').value;
		var rs = nv.replace(re,''); 
		rs = rs.replace(a2,'');
		rs = rs.replace(a3,'');
		rs = rs.replace(a4,'');
		document.getElementById('myabs').value=rs.substring(0,50);
	 }