/**
 * Description  : Popup a window given the URL and window size 
**/
function jPopWindow(strURL, iWidth, iHeight, xPos, yPos)
{ 
  window.open(strURL, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + iWidth + ',height=' + iHeight + ',top=' + yPos + ',left=' + xPos);
} 

/**
 * Description  : Popup a window given the URL and window size , (with scrollbar)
**/
function jPopWindow2(strURL, iWidth, iHeight, xPos, yPos)
{ 
  window.open(strURL, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=' + iWidth + ',height=' + iHeight + ',top=' + yPos + ',left=' + xPos);
} 

/**
 * Description  : Popup a window given the URL and window size , (with scrollbar and resizable border)
**/
function jPopWindow3(strURL, iWidth, iHeight, xPos, yPos)
{ 
  window.open(strURL, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight + ',top=' + yPos + ',left=' + xPos);
} 

/**
 * Description  :Check what type of browser is client using 
 * Parameter    : none
 * Return Value : 0 = browser is Netscape
 *                1 = browser is IE
 *               -1 = browser is neither (posible of older version of IE or Netscape or other)
**/
function jBrowserType()
{
  var browser_name    = navigator.appName;
  var browser_version = parseFloat (navigator.appVersion); 

  if (browser_name.indexOf("Netscape")                    > -1) { return 0; }
  if (browser_name.indexOf("Microsoft Internet Explorer") > -1) { return 1; }
  
  retuurn -1;
}

/**
 * Description  : Get client's browser width 
 * Parameter    : none
 * Return Value : width of client browser in positive value
 *                -1 if fail to get browser width
**/
function jBrowserWidth()
{
  var iWidth       = -1;
  var iBrowserType = jBrowserType();    // get browser type

  switch(iBrowserType)
  {
    case 0:  // browser is Netscape
      iWidth = window.innerWidth;         
      break;
    case 1:  // browser is IE  
      iWidth = document.body.clientWidth; 
      break;
  }

  // return value  
  return iWidth;
}

/**
 * Description  : Get client's browser height 
 * Parameter    : none
 * Return Value : height of client browser in positive value
 *                -1 if fail to get browser width
**/
function jBrowserHeight()
{
  var iHeight       = -1;
  var iBrowserType  = jBrowserType();    // get browser type

  switch(iBrowserType)
  {
    case 0:  // browser is Netscape
      iHeight = window.innerHeight;
      break;
    case 1:  // browser is IE  
      iHeight = document.body.clientHeight;
      break;
  }

  // return value  
  return iHeight;
}

