function popup_alt(url,name,params) {
 var sizeX = 0;
 var sizeY = 0;
 var winX = screen.availWidth;
 var winY = screen.availHeight;
 var tmpArray = params.split(',');
 for (var i = 0; i < tmpArray.length; i++) {
  if (tmpArray[i].indexOf('width') != -1) {
   var tmpArray2 = tmpArray[i].split('=');
   sizeX = tmpArray2[1];
  }
  if (tmpArray[i].indexOf('height') != -1) {
   var tmpArray2 = tmpArray[i].split('=');
   sizeY = tmpArray2[1];
  }
 }
 var centerX = Math.round(winX / 2 - sizeX / 2);
 var centerY = Math.round(winY / 2 - sizeY / 2);
 params += ',left=' + centerX + ',top=' + centerY;
 var pWindow = open(url,name,params).focus();
}

function popup(height,width,cat)
{
h=height;
w=width;
mypage = "popup.php?cat="+cat;
myscroll="no";
myname = "notes";
myresize = "no";
mytitle = "no";
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+',titlebar='+mytitle+',resizable,s crollbars='+myscroll ;
noteswin = window.open(mypage,myname,settings)
noteswin.focus();
}