function opwin_full(win_url)
{
	var win = window.open(win_url,"",'directories=no,menubar=no,location=no,toolbar=no,status=no');
	try{win.focus();}catch(e){}
}
function opwin(win_url, win_attr)
{
	if(win_attr==null || win_attr==""){
		var w = window.screen.availWidth;
		var h = window.screen.availHeight;
		
		win_attr = "width=" + w + ",height=" + h;
	}
	
	var bFull=false
	if(window.navigator.userAgent.indexOf("MSIE")>0){
		var nS = window.navigator.userAgent.indexOf("MSIE") + 5;
		var nE = window.navigator.userAgent.indexOf(";", nS);
		var ver = eval(window.navigator.userAgent.substring(nS,nE));
		if(ver>=7.0) bFull = true;
	}
	var win;
	if(bFull) win =  window.open(win_url,"", "scrollbars=yes,scrolling=yes,resizable=yes");
	else win = window.open(win_url,"",win_attr + ',left=0,top=0,scrollbars=yes,scrolling=yes,menubar=no,resizable=yes');
	try{win.focus();}catch(e){}
}

function opwin_position(win_url, win_attr, x, y)
{
	var win = window.open(win_url,"",win_attr + ', scrollbars=yes,scrolling=yes,menubar=no,resizable=yes');
	try{
		win.moveTo(x,y);
		win.focus();
	}catch(e){}
}

function opwin_pos(win_url, win_attr, x, y)
{
	var win = window.open(win_url,"",win_attr + ', scrollbars=yes,scrolling=yes,menubar=no,resizable=yes');
	try{
		win.moveTo(x,y);
		win.focus();
	}catch(e){}
}

function opwin_noresize(win_url, win_attr)
{
	var win = window.open(win_url,"",win_attr + ', scrollbars=yes,scrolling=yes,menubar=no,resizable=no');
	try{win.focus();}catch(e){}
}

function opwin_fixed(win_url, win_attr)
{
	var win = window.open(win_url,"",win_attr + ', scrollbars=no,scrolling=no,menubar=no,resizable=1');
	try{win.focus();}catch(e){}
}

function opwin_noscroll(win_url, win_attr)
{
	var win = window.open(win_url,"",win_attr + ', scrollbars=no,scrolling=no,menubar=no,resizable=yes');
	try{win.focus();}catch(e){}
}

function opwin_board(win_url, win_attr)
{
	var win = window.open(win_url,"",win_attr + ',top=10,left=0,height=' + (window.screen.height-80) + ', scrollbars=yes,scrolling=yes,menubar=no,resizable=yes');
	try{win.focus();}catch(e){}
}


function opwin_board_pos(win_url, win_attr, x, y)
{
	var win = window.open(win_url,"",win_attr + ',top=10,left=0,height=' + (window.screen.height-80) + ', scrollbars=yes,scrolling=yes,menubar=no,resizable=yes');
	try{
		win.moveTo(x,y);
		win.focus();
	}catch(e){}
}

function selectUrlWin(form) {
	if(form.url.selectedIndex != 0) {
		var win_url = form.url.options[form.url.selectedIndex].value;
		var win = window.open(win_url, "", "width=800,height=600,scrollbars=yes,resizable=yes,screenX=20px,screenY=20px,left=20px,top=20px,toolbar=yes,directories=yes,status=yes,menubar=yes,location=yes");
		try{win.focus();}catch(e){}
	}
}

function getScreenWidth()
{
	var nScreenWidth = 1024;
	//	alert( "w=" + window.screen.width );
	if ( window.screen.width != null )	nScreenWidth = window.screen.width;
	return nScreenWidth;
}

function getScreenHeight()
{
	var nScreenHeight = 768;
	//	alert( "h=" + window.screen.height );
	if ( window.screen.height != null )	nScreenHeight = window.screen.height;
	return nScreenHeight;
}

function getCenterX(wd)
{
	var posX = (getScreenWidth() - wd)/2;
	if (posX < 0)	posX = 0;
	return posX;
}

function getCenterY(ht)
{
	var posY = (getScreenHeight() - ht)/2;
	posY = posY-30; // for task bar 
	if (posY < 0)	posY = 0;
	return posY;
}