
/* Scripts for benefit sections                                                              */


/* Parameters:                                                                               */
/* opURL: URL to be opened e.g https://www.leponlinewills.co.uk/main.cgi?process=login_https */
/* elm: Optional window name                                                                 */

function opWin(opURL,elm)
 {
  /* Window height and Position */
  var avLeft=parseInt(window.screen.availLeft); if (!avLeft) {avLeft=0;}
  var avTop=parseInt(window.screen.availTop); if (!avTop) {avTop=0;}
  var avHeight=parseInt(window.screen.availHeight); if (!avHeight) {avHeight=screen.height;}
  var avWidth=parseInt(window.screen.availWidth); if (!avWidth) {avWidth=screen.width;}
  var sLeft=0; var sTop=0; var sWidth=0; var sHeight=0;
  if ((avHeight)&&(avWidth))
   {
    if (avHeight>694)
     {
      sTop=parseInt(1.0*(avTop+((avHeight-694)*0.5)));
      sHeight=694;
     }
     else {sTop=avTop; sHeight=avHeight;}
    if (avWidth>830)
     {
      sLeft=parseInt(1.0*(avLeft+((avWidth-830)*0.5)));
      sWidth=830;
     }
    else {sLeft=avLeft; sWidth=avWidth;}
   }
  else {sWidth=830; sHeight=694;}

  /* Open Window */
  eval ("pOpenWin = window.open('"+opURL+"','op_win"+elm+"','top="+sTop+",left="+sLeft+",height="+sHeight+",width="+sWidth+",scrollbars,resizable');");
 }

function opWinSmall(opURL,elm)
 {
  /* Window height and position */
  
  var sLeft=150; var sTop=150; var sWidth=550; var sHeight=225;
 
  /* Open Window */
  eval ("pOpenWin = window.open('"+opURL+"','op_win"+elm+"','top="+sTop+",left="+sLeft+",height="+sHeight+",width="+sWidth+",scrollbars,resizable');"); 
 }
 

