function doNetscape() {
  javaReady = false;
  for (i = 0; i < navigator.plugins.length; i++) {
    for (j = 0; j < navigator.plugins[i].length; j++) {
      strPluginType = navigator.plugins[i][j].type;
      if (strPluginType.indexOf("application/x-java-applet") != -1) {
	    javaReady = true;
      }
    }
  }
  if (javaReady == true) {
	return navigator.javaEnabled();
  }
  return false;
}

function doMicrosoft() {
  var applet = document.myApplet;
  if (applet == null) {
    return false;
  }
  else {
    return window.navigator.javaEnabled();
  }
}

function doOpera() {
  javaReady = false;
  for (i = 0; i < navigator.plugins.length; i++) {
    for (j = 0; j < navigator.plugins[i].length; j++) {
      strPluginType = navigator.plugins[i][j].type;
      if (strPluginType.indexOf("application/x-java-applet") != -1) {
	    javaReady = true;
      }
    }
  }
  if (javaReady == true) {
	return navigator.javaEnabled();
  }
  return false;
}

function checkJavaPlugin() {
  browsername = navigator.appName;
  testJava = false;

  if (browsername.indexOf("Netscape") != -1) {
    testJava = doNetscape();
  }
  else if (browsername.indexOf("Microsoft") != -1) {
    testJava = doMicrosoft();
  }
  else if (browsername.indexOf("Opera") != -1) {
    testJava = doOpera();
  }
  return testJava;
}

