//弹开查看窗口
function viewmedia(magazineid){
	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('','viewmagazine'+magazineid,window_dimensions);
	th.action = "filelist.jsp?magazineid="+magazineid;
	th.target = "viewmagazine"+magazineid;
	th.submit();
}
//弹开修改窗口
function openupdate(magazineid){
	var th =  document.form1;
	th.action_flag.value="updatemagazine";
	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 = "updatemagazine.jsp?magazineid="+magazineid;
	th.target = "update";
	th.submit();
}
//弹开添加窗口
function openadd(){
	var th =  document.form1;
	th.action_flag.value="addmagazine";
	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('','addmagazine',window_dimensions);
	th.target = "addmagazine";
	th.action = "addmagazine.jsp";
	th.submit();
}

//弹开添加文章的窗口
function openaddfile(magazineid){
	var th =  document.form1;
	th.action_flag.value="openaddfile";
	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('','openaddfile',window_dimensions);
	th.action = "filemanager.jsp?magazineid="+magazineid;
	th.target = "openaddfile";
	th.submit();
}

//添加提交
function addsubmit(){
	var th =  document.form1;
	if (trim(th.magazine_year.value)==""){
		 alert("请输入年份");
		 return;
	}
	if (trim(th.expect_num.value)==""){
	 alert("请输入期刊号码");
	 return;
	}
	th.action_flag.value = "add";
	th.action = "addmagazine.jsp";
	th.target = "_self";
	th.submit();
}

//修改提交
function updatesubmit(){
	var th =  document.form1;
	if (trim(th.magazine_year.value)==""){
		alert("请输入年份");
		return;
	}
	if (trim(th.expect_num.value)==""){
		alert("请输入期刊号码");
		return;
	}
	th.action_flag.value = "update";
	th.action = "updatemagazine.jsp";
	th.target = "_self";
	th.submit();
}

//删除提交
function dodelete(magazineid){
	if (!confirm("确定删除本条信息么?")){
		return ;
	}
	var th = document.form1;
	th.action_flag.value="delete";
	th.action = "magazinemanager.jsp?hid_CurrPage=&magazineid="+magazineid;
	th.target = "_self";
	th.submit();
}

//回刷
function doreload(){
	var th =  document.form1;
	th.action_flag.value="reload";
	th.action = "magazinemanager.jsp";
	th.target = "_self";
	th.submit();
}

//查询杂志的期刊信息
function loadmeginze(mediaid){
	var th =  document.form1;
	th.action = "magazinemanager.jsp?mediaid="+mediaid;
	th.target = "_self";
	th.submit();
}

//查询杂志的期刊信息 list页面使用
function loadmagalist(mediaid){
	var th =  document.form1;
	th.action = "magazinelist.jsp?mediaid="+mediaid;
	th.target = "_self";
	th.submit();
}

//主页界面用
function loadmainlist(mediaid){
	var th = parent.document.form1;
	parent.document.form1.action = "jsp/webpage/media/magazinelist.jsp?mediaid="+mediaid;
	th.target = "_self";
	th.submit();
}
