// popup with chkenv Ver.1.0
// 2002.09.12

function popupwin(tgturl, winname, winwidth, winheight, winscroll, winresize, xpos, ypos,vscr,hscr) {
	if (xpos == 'center') {
		xpos = (screen.width - winwidth) / 2;
	}
	if (ypos == 'center') {
		ypos = (screen.height - winheight) / 2;
	}
	
	if(winscroll == 'yes') {
		if(vscr == 'yes') {
			if(is_mac && ua_NS4) {
				winwidth = eval(winwidth) + 15;
			}
			if(is_mac && ua_IE) {
				winwidth = eval(winwidth) - 1;
			}
			if(is_win && ua_NS4) {
				winwidth = eval(winwidth) + 16;
			}
			if(is_mac && ua_NS6x) {
				winwidth = eval(winwidth) + 15;
			}
			if(is_win && ua_NS6x) {
				winwidth = eval(winwidth) + 14;
			}
		}
		if(hscr == 'yes') {
			if(is_mac && ua_NS4) {
				winheight = eval(winheight) + 15;
			}
			if(is_mac && ua_IE) {
				winheight = eval(winheight) - 1;
			}
			if(is_win && ua_NS4) {
				winheight = eval(winheight) + 16;
			}
			if(is_mac && ua_NS6x) {
				winheight = eval(winheight) + 15;
			}
			if(is_win && ua_NS6x) {
				winheight = eval(winheight) + 14;
			}
		} else {
			if(is_win && ua_NS4) {
				winheight = eval(winheight) + 2;
			}
			if(is_mac && ua_NS4) {
				winheight = eval(winheight) + 2;
			}
		}
		if(is_win && ua_IE) {
			winwidth  = eval(winwidth) + 16;
			winheight = eval(winheight) + 16;
		}
	}
	winoption = "left="+xpos+",top="+ypos+",width="+winwidth+",height="+winheight+",scrollbars="+winscroll+",resizable="+winresize;
	subwin = window.open(tgturl, winname, winoption);
	subwin.focus();
}
