function viewOrg(orgid){
	var th =  document.form1;
	var window_height = screen.availHeight -70 ;
	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('','vieworg'+orgid,window_dimensions);
	th.action = "showorgan.jsp?orgid="+orgid;
	th.target = "vieworg"+orgid;
	th.submit();
}

function openupdate(orgid){
	var th =  document.form1;
	th.action_flag.value="updateorg";
	var window_height = screen.availHeight -70 ;
	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 = "updateorgan.jsp?orgid="+orgid;
	th.target = "update";
	th.submit();
}

//manager页面用的删除
function dodelete(orgid){
	if (!confirm("确定删除本条信息么?")){
		return ;
	}
	var th = document.form1;
	th.action_flag.value="delete";
	th.action = "organmanager.jsp?hid_CurrPage=&orgid="+orgid;
	th.target = "_self";
	th.submit();
}

function openadd(){
	var th =  document.form1;
	th.action_flag.value="addorg";
	var window_height = screen.availHeight -70 ;
	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('','addorg',window_dimensions);
	th.target = "addorg";
	th.action = "addorgan.jsp";
	th.submit();
}

function loadorgantype(type){
	var th =  document.form1;
	th.action_flag.value="load";
	th.action = "organmanager.jsp?orgtype="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

function addsubmit(){
	var th =  document.form1;
	if(trim(th.organname.value)==""){
		alert("请输入机构名称!");
		return;
	}
	th.action_flag.value = "add";
	th.action = "addorgan.jsp";
	th.target = "_self";
	th.submit();
}

function updatesubmit(){
	var th =  document.form1;
	if (trim(th.organname.value)==""){
		 alert("请输入机构名称!");
		 return;
		}
	th.action_flag.value = "update";
	th.action = "updateorgan.jsp";
	th.target = "_self";
	th.submit();
}

function doreload(){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "organmanager.jsp";
	th.target = "_self";
	th.submit();
}

function vieworgtype(type){
	var th =  document.form1;
	th.action = "organlist.jsp?orgtype="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}


//转到search界面
function opensearch(){
	var th = document.form1;
	th.action_flag.value="opensearch";
	th.action = "organsearch.jsp";
	th.target = "_self";
	th.submit();
}

//search提交
function searchsubmit(){
	var th = document.form1;
	th.action_flag.value="searchsubmit";
	th.action = "organsearch.jsp";
	th.target = "_self";
	th.submit();
}

//搜索页面重置查询条件
function doreset(){
	var th = document.form1;
	th.organname.value="";
	th.organ_type.value="";
	return;
}