//popup position Toni Ivanisevic
//'where' ist beide anfangsbuchstaben von PosX und PosY - Bsp. MR =MiddleRight
//bei weglassen von where is default = Zentriert

//Aufruf TopLeft (TL):  popup('xxx.html','whatever','TL','500','500','resizable=yes,scrollbars=yes');
var win = null;
function pop_up(mypage,myname,where,w,h,extras){
  switch (where){
    case "TL" :
      LeftPos = 0;
      TopPos = 0;
      break;
    case "TM" :
      LeftPos = (screen.width) ? (screen.width-w)/2 : 0;
      TopPos = 0;
      break;
    case "TR" :
      LeftPos = (screen.width) ? (screen.width-w) : 0;
      TopPos = 0;
      break;
    case "ML" :
      LeftPos = 0;
      TopPos = (screen.height) ? (screen.height-h)/2 : 0;
      break;
    case "MR" :
      LeftPos = (screen.width) ? (screen.width-w) : 0;
      TopPos = (screen.height) ? (screen.height-h)/2 : 0;
      break;
    case "BL" :
      LeftPos = 0;
      TopPos = (screen.height) ? (screen.height-h) : 0;
      break;
    case "BM" :
      LeftPos = (screen.width) ? (screen.width-w)/2 : 0;
      TopPos = (screen.height) ? (screen.height-h) : 0;
      break;
    case "BR" :
      LeftPos = (screen.width) ? (screen.width-w) : 0;
      TopPos = (screen.height) ? (screen.height-h) : 0;
      break;
    default :
      LeftPos = (screen.width) ? (screen.width-w)/2 : 0;
      TopPos = (screen.height) ? (screen.height-h)/2 : 0;
      break;
  }
  TopPos-=25; //wegen Taskleiste
  settings ='height='+h+',width='+w+',top='+TopPos+',left='+LeftPos;
  if(extras!="")
    settings +=","+extras;
  win = window.open(mypage,myname,settings);
  if(win.window.focus){win.window.focus();}
}