//弹开查看窗口
function openview(depid){
	var th =  document.form1;
	var window_height = screen.availHeight -200 ;
	var window_width = screen.availWidth -150 ;
	var window_dimensions = "top = 20" + ",left = 50" + ",height=" + window_height + ",width=" + window_width + ",scrollbars=yes" + ",resizable=1,status=yes";
	window.open('','viewaptitude'+depid,window_dimensions);
	th.action = "showaptitude.jsp?depid="+depid;
	th.target = "viewaptitude"+depid;
	th.submit();
}
//弹开修改窗口
function openupdate(aptitudeid){
	var th =  document.form1;
	th.action_flag.value="updateaptitude";
	var window_height = screen.availHeight -200 ;
	var window_width = screen.availWidth -150 ;
	var window_dimensions = "top = 20" + ",left = 50" + ",height=" + window_height + ",width=" + window_width + ",scrollbars=yes" + ",resizable=1,status=yes";
	window.open('','update',window_dimensions);
	th.action = "updateaptitude.jsp?aptitudeid="+aptitudeid;
	th.target = "update";
	th.submit();
}
//弹开添加窗口
function openadd(){
	var th =  document.form1;
	th.action_flag.value="addaptitude";
	var window_height = screen.availHeight -200;
	var window_width = screen.availWidth -150 ;
	var window_dimensions = "top = 20" + ",left = 50" + ",height=" + window_height + ",width=" + window_width + ",scrollbars=yes" + ",resizable=1,status=yes";
	window.open('','addaptitude',window_dimensions);
	th.target = "addaptitude";
	th.action = "addaptitude.jsp";
	th.submit();
}

//添加提交
function addsubmit(){
	var th =  document.form1;
	if(trim(th.dep_name.value)==""){
		alert("请输入企业名称！");
		return;
	}
	th.action_flag.value = "add";
	th.action = "addaptitude.jsp";
	th.target = "_self";
	th.submit();
}

//修改提交
function updatesubmit(){
	var th =  document.form1;
	if(trim(th.dep_name.value)==""){
		alert("请输入企业名称！");
		return;
	}
	th.action_flag.value = "update";
	th.action = "updateaptitude.jsp";
	th.target = "_self";
	th.submit();
}

//删除提交
function dodelete(aptitudeid){
	if (!confirm("确定删除本条信息么?")){
		return ;
	}
	var th = document.form1;
	th.action_flag.value="delete";
	th.action = "aptitudemanager.jsp?hid_CurrPage=&aptitudeid="+aptitudeid;
	th.target = "_self";
	th.submit();
}

//回刷
function doreload(){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "aptitudemanager.jsp";
	th.target = "_self";
	th.submit();
}

//manager界面用
function loadtypeperson(type){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "personmanager.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}
function loadtypedep(type){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "aptitudemanager.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

//list界面用
function loadlistperson(type){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "personlist.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}
//list界面用
function loadlistdep(type){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "aptitudelist.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

//主页界面用
function loadmainperson(type){
	var th = parent.document.form1;
	parent.document.form1.action = "jsp/webpage/aptitude/personlist.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

//主页界面用
function loadmaindep(type){
	var th = parent.document.form1;
	parent.document.form1.action = "jsp/webpage/aptitude/aptitudelist.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

function openserach(actionurl){
	var th =  document.form1;
	th.action_flag.value = "opensearch";
	th.action = actionurl;	
	th.target = "_self";
	th.submit();
}

function searchsubmit(){
	var th =  document.form1;
	th.action_flag.value = "searchsubmit";
	th.action = "aptitudesearch.jsp";	
	th.target = "_self";
	th.submit();
}

//搜索页面重置查询条件
function doreset(){
	var th = document.form1;
	th.dep_name.value="";
	th.aptitude_level.value="";
	th.aptitude_num.value="";
	th.law_man.value="";
	return;
}
