function popWin(url,width,height,options) {
	options = new String(options);

	var width = width + 20;
	var height = height + 20;
	
	var fromleft = (screen.width / 2) - (width / 2);
	var fromtop = (screen.height / 2) - (height / 2);
	
	var winstr = "";
	
	winstr += (options.indexOf('toolbar')		== -1) ? ('toolbar=0,')		: ('toolbar=1,')
	winstr += (options.indexOf('location')		== -1) ? ('location=0,')	: ('location=1,')
	winstr += (options.indexOf('directories')	== -1) ? ('directories=0,')	: ('directories=1,')
	winstr += (options.indexOf('status')		== -1) ? ('status=0,')		: ('status=1,')
	winstr += (options.indexOf('menubar')		== -1) ? ('menubar=0,')		: ('menubar=1,')
	winstr += (options.indexOf('scrollbars')	== -1) ? ('scrollbars=0,')	: ('scrollbars=1,')
	winstr += (options.indexOf('resizable')		== -1) ? ('resizable=0,')	: ('resizable=1,')
	
	winstr += 'width='   + width    + ',';
	winstr += 'height='	 + height   + ',';
	winstr += 'screenY=' + fromtop  + ',';
	winstr += 'screenX=' + fromleft + ',';
	winstr += 'top='	 + fromtop  + ',';
	winstr += 'left='	 + fromleft;
	
	var newwin = window.open(url,'popWin',winstr);
	
	if (window.focus) {
		newwin.focus();
	}
}
