function match(s,r)
{
    var _r = new RegExp(r);
    var _o = _r.exec(s);
    return (s==_o);
}

function isNumeric(s)
{
    return match(s,"\\d+");
}

//general popup window
function popup_win(sURL, sName, sSize) {
	var iWidth, iHeight;
	
	switch (sSize) {
		case "standard":
			iWidth = 480;
			iHeight = 400;
			break;
		case "short":
			iWidth = 480;
			iHeight = 300;
			break;
		case "tall":
			iWidth = 480;
			iHeight = 500;
			break;
		case "wide":
			iWidth = 800;
			iHeight = 500;
			break;
		case "large":
			iWidth = 800;
			iHeight = 600;
			break;
		default:
			iWidth = 480;
			iHeight = 400;
			break;
		}
		
	// determine location to centre pop-up
	var stop, sleft;
	stop = Math.floor((screen.height-iHeight)/2);
	sleft = Math.floor((screen.width-iWidth)/2);

	window.open(sURL,sName,'height='+iHeight+',width='+iWidth+',menubar=no,scrollbars=yes,status=yes,toolbar=no,screenX='+sleft+',screenY='+stop+',left='+sleft+',top='+stop+',resizable=yes');
}
