function openBrWindow(theURL,winName,features) {
    var flength = features.length;
    var wlocate = features.indexOf('width=');
    var hlocate = features.indexOf(',height=');
    
    var w = features.substring(wlocate+6, hlocate);
    var h = features.substring(hlocate+8, flength);
    
   //confirm("width="+w+",height="+h);
    
    var winl = (screen.width - w)/2;
    var wint = (screen.height - h)/2;
    
    //confirm("top="+wint+",left="+winl);
    
    features += ",top="+wint;
    features += ",left="+winl;
    
    window.open(theURL,winName,features);

}