  function MakeGraph(plotcode) {
  var AppClass = "grapher.grapher.class";
  var AppWidth = "500";
  var AppHeight= "400";
  var ParamTags = new Array(
 	 'LEGEND',true,
  	"C1",column1,"C2",column2,"C1LABEL","Height","C2LABEL","# of Drops");
  if(plotcode == 1) {
  	var AppHeight="300";
  	var addParam = new Array(
 	 	"XLABEL","Height of Drop","YLABEL","Avg. # of Drops","AUTORANGE","true","PLOTON","1");
  	var ParamTags = ParamTags.concat(addParam);
	}
  else if (plotcode == 2) { // Whelk Data with Sliders
  	var ParamTags = ParamTags.concat(new Array(
  		"XLABEL","Height of Drop","YLABEL","Avg. # of Drops","AUTORANGE","false",
		"PLOTON","1","FN1","a+b/(x-c)","NP","3",
		"A","0","AMIN","-2","AMAX","2","B","50","BMIN","0","BMAX","100","C","0","CMIN","0","CMAX","25"));
  	}
  else if (plotcode == 3) { // Linearized Whelk Data with Sliders
  	var ParamTags = ParamTags.concat(new Array(
  		"XLABEL","Height of Drop","YLABEL","(N-1)^-1","AUTORANGE","false",
		"PLOTON","2","FN2",a+"*x+"+b,"FN1","a*x+b","NP","2",
		"C3",column3,"C3LABEL","(N-1)^-1",
		"A","0.05","AMIN","-0.1","AMAX","0.1","B","0.05","BMIN","-0.5","BMAX","0.5"));
  } else if (plotcode == 4) {
  	var AppHeight="300";
  	var ParamTags = ParamTags.concat(new Array(
  		"XLABEL","Height of Drop","YLABEL","Work","FN1","x*(1+59.5/(x-13.8))",
		"C3",column3,"C3LABEL","Work",
		"PLOTON","2"));
  } else if (plotcode == 5) {
   	var ParamTags = ParamTags.concat(new Array(
   		"XLABEL","Height of Drop","YLABEL","Avg. # of Drops",
		"PLOTON","2","FN1","x*(1+a/(x-b))","NP","2",
		"C3",column3,"C3LABEL","Work"));
 };
  var browser = navigator.appName
  var platform= navigator.platform
  var version = parseInt(navigator.appVersion)
  var ParamLen = ParamTags.length
  var Nav4 = (browser=="Netscape" && version >= 4)
  var IE4  = (browser=="Microsoft Internet Explorer" && version >= 4)
  msg = open("", "wkgraph", "resizable=yes,width=550,height=450");
  msg.document.writeln("<HTML><HEAD><Title>Data Grapher<\/Title><\/HEAD><BODY>");

  // Verify that Java is enabled.
  if ((Nav4 || IE4) && !navigator.javaEnabled())
    msg.document.writeln("</CENTER>Java is disabled in your browser.  Please "+
	               "re-enable it in your browser's options.<P><CENTER>");

  // Check for Netscape 4.x on a Mac
  if (Nav4 && (platform=="MacPPC" || platform=="Mac68k") && version < 5)
  {
    // Determine if they have the plugin installed.
    var vmInstalled = navigator.mimeTypes["application/x-java-vm"]
    
    if (vmInstalled)
    {
	    msg.document.writeln("<EMBED " + 
           "TYPE=\"application/x-java-vm\" " + 
           "NAME=\"Java Applet\" " +
           "PLUGINSPAGE=\"../plugin.html\" " +
           "BORDER=\"5\" " +
           "WIDTH=\""+AppWidth+"\" " +
           "HEIGHT=\""+AppHeight+"\" " + 
           "CODEBASE=\"..\" CODE=\""+AppClass+"\" archive=grapher.jar")
         for (var i = 0; i < ParamLen; i += 2) {
         	msg.document.writeln(" "+ParamTags[i]+"='"+ParamTags[i+1]+"'");
         }
         msg.document.writeln(">");
    }
    else
    {
      msg.document.writeln("To correctly display this activity, <BR>you need to install some software.<p>");
      msg.document.writeln("Click <A href=\"../plugin.html\">here</a> to learn how."); 

      if (Version1Dir != "") 
      	msg.document.writeln("Or click <a href=\"../../../interactivate/activities/"+Version1Dir+"\">here</a> "+
                     "to use an older version of the activity.<p>");
    }
  }
  else if (Nav4 || IE4)
  {
    // Navigator 4+ or Internet Explorer 4+, not on a Macintosh.  Assume the
    // virtual machine works (no indication that any others do not work)
    msg.document.writeln("<APPLET CODEBASE=\"..\" CODE='"+AppClass+"' width="+AppWidth+" height="+
	                AppHeight+" archive=\"grapher.jar\">");
	for (var i = 0; i < ParamLen; i += 2) {
		msg.document.writeln("<PARAM NAME="+ParamTags[i]+" VALUE=\'"+ParamTags[i+1]+"\'>");
	}
	msg.document.writeln("</APPLET>");

    // If they are using Internet Explorer 4.x on a Macintosh, remind them
	// that they need to be using MRJ 2.x.
    if (IE4 && version < 5 && (platform=="MacPPC" || platform=="Mac68k"))
	  msg.document.writeln("<P><BLOCKQUOTE><BLOCKQUOTE>If you experience difficulties running "+
	                 "this activity in your browser, please <a href=\"../ie4_mac.html\">"+
					 "click here</a> for helpful advice.</BLOCKQUOTE></BLOCKQUOTE>");
  }
  else
  {
    msg.document.writeln("You need to have Netscape 4.0 or higher or Internet Explorer 4.0 or higher ")
  }

  msg.document.writeln("<\/BODY><\/HTML>");
  msg.document.close();
}
