//弹开查看窗口
function openview(afficheid){
	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('','viewaffiche'+afficheid,window_dimensions);
	th.action = "showaffiche.jsp?afficheid="+afficheid;
	th.target = "viewaffiche"+afficheid;
	th.submit();
}
//弹开修改窗口
function openupdate(afficheid){
	var th =  document.form1;
	th.action_flag.value="updateaffiche";
	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 = "updateaffiche.jsp?afficheid="+afficheid;
	th.target = "update";
	th.submit();
}
//弹开添加窗口
function openadd(){
	var th =  document.form1;
	th.action_flag.value="addaffiche";
	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('','addaffiche',window_dimensions);
	th.target = "addaffiche";
	th.action = "addaffiche.jsp";
	th.submit();
}

//添加提交
function addsubmit(){
	var th =  document.form1;
	if(trim(th.title.value)==""){
		alert("请输入标题！");
		return;
	}
	th.action_flag.value = "add";
	th.action = "addaffiche.jsp";
	th.target = "_self";
	th.submit();
}

function addsubmit2(){
	var th =  document.form1;
	if(trim(th.title.value)==""){
		alert("请输入标题！");
		return;
	}
	th.action_flag.value = "add";
	th.action = "addaffiche2.jsp";
	th.target = "_self";
	th.submit();
}

//修改提交
function updatesubmit(){
	var th =  document.form1;
	if(trim(th.title.value)==""){
		alert("请输入标题！");
		return;
	}
	th.action_flag.value = "update";
	th.action = "updateaffiche.jsp";
	th.target = "_self";
	th.submit();
}

//删除提交
function dodelete(afficheid){
	if (!confirm("确定删除本条信息么?")){
		return ;
	}
	var th = document.form1;
	th.action_flag.value="delete";
	th.action = "affichemanager.jsp?hid_CurrPage=&afficheid="+afficheid;
	th.target = "_self";
	th.submit();
}

//回刷
function doreload(){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "affichemanager.jsp?hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

function loadtype(type){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "affichemanager.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

function loadtypelist(type){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "affichelist.jsp?type="+type+"&hid_CurrPage=";
	th.target = "_self";
	th.submit();
}

//主页弹开查看窗口
function openview(afficheid){
	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('','viewaffiche',window_dimensions);
	th.action = "showaffiche.jsp?afficheid="+afficheid;
	th.target = "viewaffiche";
	th.submit();
}

//转到search界面
function opensearch(){
	var th = document.form1;
	th.action_flag.value="opensearch";
	th.action = "affichesearch.jsp";
	th.target = "_self";
	th.submit();
}

//search提交
function searchsubmit(){
	var th = document.form1;
	th.action_flag.value="searchsubmit";
	th.action = "affichesearch.jsp";
	th.target = "_self";
	th.submit();
}

//搜索页面重置查询条件
function doreset(){
	var th = document.form1;
	th.title.value="";
	th.type.value="";
	return;
}

function reshow(afficheid){
	if (!confirm("确定重新激活本条信息么?")){
		return ;
	}
	var th = document.form1;
	th.action_flag.value="reshow";
	th.action = "affichemanager.jsp?afficheid="+afficheid;
	th.target = "_self";
	th.submit();
}

function dohistory(afficheid){
	if (!confirm("确定将本条信息转入历史库么?")){
		return ;
	}
	var th = document.form1;
	th.action_flag.value="dohistory";
	th.action = "affichemanager.jsp?afficheid="+afficheid;
	th.target = "_self";
	th.submit();
}