/* ppxtra.js 
 *
 * Copyright (c) 1999-2006 by plainpix.com
 * Author (c)1999-2006 Gerd Kühn 
 * gk 11.12.1999-04.02.2006
 *
 */
 
 function popupImage(url, width, height) {
 var x, y, scrbar, zs, scrX, scrY;
 x = (screen.width-10);
 y = (screen.height-10);
 zs = 50;
 scrX = 150;
 scrY = 150;
 
 if( (scrX + width) > screen.width ) {
  scrX = (screen.width - width) >= 0 ? (screen.width - width) : 0;
 }
 
 if( (scrY + height) > screen.height ) {
  scrY = (screen.height - height) >= 0 ? (screen.height - height) : 0;
 }
 
 if(width > x || height > y) {
  scrbar = 1;  
  if(width > x) {
   width = (x - zs);
   if(height > y){
    height = (y - zs);
   }
  } else {
   height = (y - zs);
  }
 } else {
  scrbar = 0;
 }
 popupImgWin = npp_nwin.open(url,"popupImage",width,height,150,100,0,scrbar);
}

function popupPrint(url) {
  popupPrintWin = npp_nwin.open(url,"popupPrint",750,500,150,150,1,1);
}

function popupNotifi(url,width,height) {
  popupNotifWin = npp_nwin.open(url,"popupNotifi",width,height,150,150,0,0);
}

function popupXTpic(url,width,height) {
  popupXTpicWin = npp_nwin.open(url,"popupXTpic",width,height,150,150,0,0);
}

function pp_nwin() {
 this.open    = pp_open_win;
 this.focus   = pp_focus_win;
 this.close   = pp_close_win;
 this.put     = pp_put_win;
}

function pp_open_win(url,name,width,height,left,top,resizable,scrollbars){
 win=window.open("",name,"width="+width+",height="+height+
                    ",left="+left+",top="+top+
                    ",resizable="+resizable+",scrollbars="+scrollbars); 
 
 if (window.win.opener == null){
  window.win.opener = self;
 }

 this.focus(win);

 if (url != ""){
  this.put(win,url);
 }
 return win;
} 

function pp_focus_win(win) {
 window.win.focus();
}

function pp_close_win(win) {
 window.win.close();
}

function pp_put_win(win,url) {
 window.win.location.href = url;
}

npp_nwin = new pp_nwin();


