
function popup(pageToLoad, winName, width, height, center, title, menu, toolbar, location, status, resize, scrollbars) {
    //get name of the frame i'm currently in, if any. 
    var frameName = window.name; 
    if(frameName!='') { 
      if(pageToLoad.indexOf('?')!=-1) { 
        pageToLoad+='&pFrame=' + window.name;} 
      else { 
        pageToLoad+='?pFrame=' + window.name;} 
    }
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," + "height=" + height + "," + "location=" + location + "," + "menubar=" + menu + "," + "resizable=" + 

resize + "," + "scrollbars=" + scrollbars + "," + "status=" + status + "," + "titlebar=" + title + "," + "toolbar=" + toolbar + "," + 

"hotkeys=0," + "screenx=" + xposition + "," + "screeny=" + yposition + "," + "left=" + xposition + "," + "top=" + yposition;
    window.open(pageToLoad, winName, args);
}

