var popit = null;

var chasm = (screen.availWidth - 13);
var mount = (screen.availHeight - 107);

var url = "";
var sizeByPercent = "";

var w = 0;
var h = 0;
var winwidth = 0;	
var winheight = 0;

function openWindowCentered(w,h,sizeByPercent,url,windowname,options){

// openWindowCentered(#,#,'yes|no','url','_name','list of window features')
// window options to include/exclude: 
// "scrollbars,resizable,toolbar,location=yes|no,status=yes|no,menubar"


if (sizeByPercent == 'yes'){
	winwidth = ((w/100) * chasm);
	winheight = ((h/100) * mount);
}
else {
	winwidth = w;
	winheight = h;
}


 popit = window.open(url,windowname,'width=' + winwidth + ',height=' + winheight + ',left=' + ((chasm - winwidth) * .5) + ',top=' + ((mount - winheight) * .5) + ',' + options);
}