/*
  Hong Song
  2004-06-01
  
  <script src="JavaScript/ers.js" type="text/javascript" ></script>
*/

function refresh(refreshUrl)
{
  // alert(refreshUrl);
  window.location = refreshUrl;
} // refresh()


function jsShowHelp(helpUrl)
{
  if (helpUrl == "")
  {
    return false;
  }
// alert(helpUrl);
  
  winTop    = 100;
  winLeft   = 100;
  winWidth  = 500;
  winHeight = 500;

  winParam  = 'toolbar=yes, menubar=no, location=no, directories=no, '
            + 'status=no, width='+winWidth + ', height='+winHeight
            + ', top='+winTop + ', left='+winLeft
            + ', resizable=yes, scrollbars=yes';

  wndTarget = window.open(helpUrl, 'rs_help', winParam);
 // wndTarget.location = helpUrl;
 // wndTarget.focus();
} // jsShowHelp()


function setLabelText(ID, Text)
{
   document.getElementById(ID).innerHTML = Text;
} // setLabelText()

function jsShowIdenficationPage(pageUrl)
{
  if (pageUrl == "")
  {
    return false;
  }
  winTop    = 100;
  winLeft   = 100;
  winWidth  = 500;
  winHeight = 500;

  winParam  = 'toolbar=yes, menubar=no, location=no, directories=no, '
            + 'status=no, width='+winWidth + ', height='+winHeight
            + ', top='+winTop + ', left='+winLeft
            + ', resizable=yes, scrollbars=yes';

  wndTarget = window.open('', 'identication', winParam);
  wndTarget.location = pageUrl;
  wndTarget.focus();
} // jsShowIdenficationPage()

function GetWindowWidth() 
{
  var winWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    winWidth = window.innerWidth;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
  {
    //IE 6+ in 'standards compliant mode'
    winWidth = document.documentElement.clientWidth;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
  {
    //IE 4 compatible
    winWidth = document.body.clientWidth;
  }
  return winWidth;
}

function jsShowTaxon(refreshUrl)
{
  winTop    = 10;
  winLeft   = 10;
  winWidth  = 500;
  winHeight = 600;

  winParam  = 'toolbar=yes, menubar=no, location=no, directories=no, '
            + 'status=no, width='+winWidth + ', height='+winHeight
            + ', top='+winTop + ', left='+winLeft
            + ', resizable=yes, scrollbars=yes';

  // wndTarget = window.open('', 'rs_help', winParam);
  wndTarget = window.open('', '', winParam);
  wndTarget.location = refreshUrl;
  wndTarget.focus();
} // jsShowTaxon()

function isIEVersion4()
{
  szAppVer = navigator.appVersion;
  ichMSIE  = szAppVer.indexOf('MSIE');
  if (szAppVer.substring(ichMSIE + 5, ichMSIE + 6) == 4)
    return(true);

  return(false);
} // isIEVersion4()
