/*
'---- 通用窗口处理程序，支持800*600与1024*768下的大小及位置自动调整 ----
'---- C/U-Date: 2006-11-02 ----
*/

/*-- 在新窗口中打开Url --*/
function open_edit_win(cmdtype,objid,extp1,extp2,extp3,extp4,extp5,extp6)
{
	/*-- 屏幕宽度和高度，以确定显示分辨率是 800*600 或 1024*768 --*/
	var avlScreenWidth = window.screen.availWidth;
	var avlScreenHeight = window.screen.availHeight;

	var winwidth = 0, wspace = 0, winheight = 0, hspace = 0;
	var starwin = '', saspfile = '', resize = '', winprop = '';

	/*-- cmdtype=9/10: FileUpload --*/
	if(cmdtype == 9||cmdtype == 10)
	{
		winwidth = 670;
		winheight = 400;
		wspace = (avlScreenWidth-670)/2;
		hspace = (avlScreenHeight-400)/2-15;
		resize = 'yes';
	}
	else
	{
		/*-- 确定新窗口的大小以及位置 --*/
		if(avlScreenWidth == 1024||avlScreenWidth == 1280||avlScreenWidth == 1600)
		{
			winwidth = 515;
			winheight = 480;
			wspace = (avlScreenWidth-515)/2;
			hspace = (avlScreenHeight-480)/2-15;
		}
		else
		{
			winwidth = 515;
			winheight = 440;
			wspace = 150;
			hspace = 10;
		}
		resize = 'no';
	}

	/*-- 窗口属性 --*/
	winprop = 'scrollbars=yes,toolbar=no,location=no,status=yes,menubar=yes,resizable=' + resize + ',width=' + winwidth + ',height=' + winheight + ',left=' + wspace + ',top=' + hspace;

	/*-- 判断窗口类型 --*/
	switch(cmdtype)
	{
	case 1: //显示论坛注意事项
		starwin = 'forum_ann' + objid;
		saspfile = 'forum_announce.htm';
		break;
	case 9: //
		starwin = 'we_ulm' + objid;
		saspfile = 'ulf.asp?t=' + objid + '&sigid=' + extp1;
		break;
	case 315: //CMD_POST_MANAGE
		starwin = 'we_postmanage' + objid;
		saspfile = 'bm.asp?a=' + cmdtype + '&bid=' + extp1 + '&tid=' + extp2 + '&rid=' + extp3 + '&loc=' + extp4 + '&bcp=' + extp5;
		break;
	case 2: //显示投票用户信息
		starwin = 'ws_mvl' + objid;
		saspfile = 'gvlog.asp?v=' + objid;
		break;
	case 3: //显示短消息统计信息
		starwin = 'ws_msi' + objid;
		saspfile = 'msi.asp?a=' + objid;
		break;
	default : //无匹配项
		alert('参数传递错误，请联系管理员！');
		return;
		break;
	}

	/*-- 在新窗口中打开相关连接 --*/
	window.open(saspfile,starwin,winprop);
}
