var win = null;

function NewWindow(mypage,myname,w,h,scroll){
if(! window.focus) return;

if(win){
	try{
		win.close();
	}catch(ex){}
}

var href;
if (typeof(mypage) == 'string')
   href=mypage;
else
   href=mypage.href;

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes'

try{
	win = window.open(href,myname,settings);
}catch(Ex){}

if(win){
	try{
		win.focus();
	}catch(ex){}
}
}
