
var winpopWinGeneric;

// Check if Browser is Microsoft Internet Explorer 3.
var ie3popWinGeneric = false;
var iepopWinGeneric = false;
if (navigator.appName.indexOf("Microsoft") != -1) {
   iepopWinGeneric = true;
   if (parseInt(navigator.appVersion) < 4)
      ie3popWinGeneric = true;
}

  // popup function parameters
  // address = URL to put in popup window
  // p_width = window width, defaults to 420 pixels
  // p_height = window height, defaults to 350 pixels
  // p_scroll = y or n, determines if the scrollbar is present, default is y
  // p_resize = y or n, determines if the window can be resized, default is y
function popWinGeneric(address,p_width,p_height,p_scroll,p_resize)
{
  if (p_width > 0){
         if (iepopWinGeneric) {
           v_width = 1*p_width+36;
         } else {
           v_width = 1*p_width+16;
         }
  } else {
         var v_width = "420";
  };
  if (v_width > 880) v_width = 880;
  if (p_height > 0){
         if (iepopWinGeneric) {
           v_height = 1*p_height+32;
         } else {
           v_height = 1*p_height+16;
         }
  } else {
         var v_height = "350";
  };
  if (v_height > 660) v_height = 660;
  if (p_scroll == "n"){
         var v_scroll = "scrollbars=no";
  } else {
         var v_scroll = "scrollbars";
  };
  if (p_resize == "n"){
         var v_resize = "";
  } else {
         var v_resize = "resizable";
  };

  if (typeof winpopWinGeneric == 'undefined')
    winpopWinGeneric = window.open(address, "", "width="+v_width+",height="+v_height+","+v_scroll+","+v_resize);
  else
    if (ie3popWinGeneric) {
           if (typeof winpopWinGeneric.value != 'undefined')
              winpopWinGeneric = window.open(address, "", "width="+v_width+",height="+v_height+","+v_scroll+","+v_resize);
           else {
              if (winpopWinGeneric.location.href != address)
                 winpopWinGeneric.location.href = address;
              winpopWinGeneric.focus();
           }
        } else {
       if (winpopWinGeneric.closed)
              winpopWinGeneric = window.open(address, "", "width="+v_width+",height="+v_height+",scrollbars,resizable");
           else {
              if (winpopWinGeneric.location.href != address)
                 winpopWinGeneric.location.href = address;
                 if (!iepopWinGeneric) {
                    winpopWinGeneric.resizeTo(v_width,v_height);
                 } else {
                    winpopWinGeneric.close()
                    winpopWinGeneric = window.open(address, "", "width="+v_width+",height="+v_height+",scrollbars,resizable");
                 }
              winpopWinGeneric.focus();
           }
    }
}


