function getXforCenterWindow(w)
{
   return((screen.width - w)/2);
}

function getYforCenterWindow(h)
{
   return((screen.height - h)/2);
}

function openRightLowerWindow(windowfile,w,h,wt,ht,options)
{
   var posx;
   var posy;
   
   posx = getXforCenterWindow(wt);
   posy = getYforCenterWindow(ht);
   posx = posx + (wt - w) + 10; 
   posy = posy + (ht - h); 

   window.open(windowfile,'_blank','width='+w+',height='+h+',left='+posx+',top='+posy+'options');
}

function openRightUpperWindow(windowfile,w,h,wt,wh,options)
{
   var posx;
   var posy;
   
   posx = getXforCenterWindow(wt);
   posy = getYforCenterWindow(wh);
   posx = posx + (wt - w) + 10; 
   
   window.open(windowfile,'_blank','width='+w+',height='+h+',left='+posx+',top='+posy+'options');
}

function openCenterWindow(windowfile,w,h,options)
{
   var posx;
   var posy;
   
   posx = getXforCenterWindow(w);
   posy = getYforCenterWindow(h);
   
   window.open(windowfile,'_blank','width='+w+',height='+h+',left='+posx+',top='+posy+'options');
}

function positionAsCenterWindow(w,h)
{
   var posx;
   var posy;
   
   posx = (screen.width - w)/2;
   posy = (screen.height - h)/2;
   
   window.moveTo(posx,posy);
}

function openBottomWidthWindow(windowfile,w,h,options)
{
   var posx;
   var posy;

   posx = 0;
   posy = screen.height - h;
   
   // window.open(windowfile,'_blank',"width="+width,"height="+height,options);
   window.open(windowfile,'_blank','width='+screen.width+',height='+h+',left='+posx+',top='+posy+'options');
}


