var nextID
var priorID
var state = new Array(0,0,0,0,0,0,0,0,0,0,0)

function Display(pID) 
{
var Dta
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

if (pID == 1)
{    
  if (state[pID] == 1)
   {
   state[pID] = 0
   RemoveDesc1(pID)
  // document.arrow1.src  = "../../../Global/Image/Arrows/tridown.gif"
    return false;
   }
 
 else if (state[pID] == 0)
 {
  	state[pID] = 1
	Dta =  "<BR><TABLE BORDER='0' bordercolor='#d7d7d7' cellpadding='8' cellspacing='0' BGCOLOR='black'><TR><TD>"
	Dta =  Dta + "<PRE><FONT color='white'>"
	Dta =  Dta + "<FONT color='yellow'>"
	Dta =  Dta + "C:/Apache Group/Apache2/bin&gt; openssl req -config openssl.cnf -new<BR>"
	Dta =  Dta + " -out my-server.csr</FONT><BR>"
	Dta =  Dta + "Loading 'screen' into random state - done<BR>"

	Dta =  Dta + "Generating a 1024 bit RSA private key<BR>"
	Dta =  Dta + "...............................++++++<BR>"
	Dta =  Dta + ".............++++++<BR>"
	Dta =  Dta + "writing new private key to 'privkey.pem' <br>"
	Dta =  Dta + "Enter PEM pass phrase:<FONT color='yellow'>____</font><BR>"
	Dta =  Dta + "Verifying - Enter PEM pass phrase:<FONT color='yellow'>____</font><BR>"
	Dta =  Dta + "-----<br>"
	Dta =  Dta + "You are about to be asked to enter information that will be incorporated<BR>"
	Dta =  Dta + "into your certificate request.<BR>"
	Dta =  Dta + "What you are about to enter is what is called a Distinguished Name or a DN.<BR>"
	Dta =  Dta + "There are quite a few fields but you can leave some blank <BR>"
	Dta =  Dta + "For some fields there will be a default value,<BR>"
	Dta =  Dta + "If you enter '.', the field will be left blank. <BR>"
	Dta =  Dta + "----- <BR>"
	Dta =  Dta + "Country Name (2 letter code) []:<FONT color='yellow'><u>us</u></FONT> <BR>"
	Dta =  Dta + "State or Province Name (full name) []:<FONT color='yellow'><u>tx</u></FONT> <BR>"
	Dta =  Dta + "Locality Name (eg, city) []:<FONT color='yellow'><u>dallas</u></FONT> <BR>"
	Dta =  Dta + "Organization Name (eg, company) []:<FONT color='yellow'><u>jm solutions</u></FONT> <BR>"
	Dta =  Dta + "Organizational Unit Name (eg, section) []:<FONT color='yellow'><u>development</u></FONT> <BR>"
	Dta =  Dta + "Common Name (eg, your websites domain name) []:<FONT color='yellow'><u>www.my-server.com</u></FONT> <BR>"
	Dta =  Dta + "Email Address []:<FONT color='yellow'><u>my@email.com</u></FONT> <BR><BR>"
	Dta =  Dta + "Please enter the following 'extra' attributes <BR>"
	Dta =  Dta + "to be sent with your certificate request <BR>"
	Dta =  Dta + "A challenge password []:<FONT color='yellow'><u>myPassword</u></FONT> <BR>"
	Dta =  Dta + "</FONT>"
	Dta =  Dta + "</TD></TR></TABLE>"
  }
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (pID == 2)
{    

  if (state[pID] == 1)
   {
   state[pID] = 0
   RemoveDesc1(pID)
  // document.arrow1.src  = "../../../Global/Image/Arrows/tridown.gif"
    return false;
   }
 
 else if (state[pID] == 0)
 {
  	state[pID] = 1
	Dta =  "<BR><TABLE BORDER='0' bordercolor='#d7d7d7' cellpadding='8' cellspacing='0' BGCOLOR='black'><TR><TD>"
	Dta =  Dta + "<PRE><FONT color='white'>"
	Dta =  Dta + "<FONT color='yellow'>"
	Dta =  Dta + "C:/Apache Group/Apache2/bin&gt; openssl rsa -in privkey.pem -out my-server.key <BR>"
	Dta =  Dta + "</FONT>"
	Dta =  Dta + "Enter pass phrase for privkey.pem:<FONT color='yellow'>____</font> <BR>"
	Dta =  Dta + "writing RSA key <BR>"
	Dta =  Dta + "</FONT>"
	Dta =  Dta + "</TD></TR></TABLE>"
  }
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (pID == 3)
{    
  if (state[pID] == 1)
   {
   state[pID] = 0
   RemoveDesc1(pID)
  // document.arrow1.src  = "../../../Global/Image/Arrows/tridown.gif"
    return false;
   }
 
 else if (state[pID] == 0)
 {
  	state[pID] = 1
	Dta =  "<BR><TABLE BORDER='1' bordercolor='#d7d7d7' cellpadding='8' cellspacing='0' BGCOLOR='black'><TR><TD>"
	Dta =  Dta + "<PRE><FONT color='white'>"
	Dta =  Dta + "<FONT color='yellow'>"
	Dta =  Dta + "C:/Server Manager/Apache Group/Apache2/bin&gt; openssl x509 -in my-server.csr<BR>"
	Dta =  Dta + " -out my-server.cert -req -signkey my-server.key -days 365<BR>"
	Dta =  Dta + "</FONT>"
	Dta =  Dta + "Loading 'screen' into random state - done<BR>"
	Dta =  Dta + "Signature ok<BR>"
	Dta =  Dta + "subject=/C=us/ST=tx/L=dallas/O=jm solutions/OU=development/CN=www.my-server<BR>"
	Dta =  Dta + ".com/emailAddress=my@email.com<BR>"
	Dta =  Dta + "Getting Private key<BR>"
	Dta =  Dta + "</FONT>"
	Dta =  Dta + "</TD></TR></TABLE>"
   }
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 //http://www.dhtmlnirvana.com/alchemy/writto.htm
 p1 = "Q" + pID
 if (document.layers) 
 {
 document.layers[p1].document.write(Dta)
 document.layers[p1].document.close()
 } 
 else if (document.all) 
 {
 eval("document.all."+p1+".innerHTML=Dta")
 } 
 else {document.getElementById(p1).innerHTML = Dta;}
 
//eval(pID).innerHTML = Dta;
//---- eval(P1).innerHTML = Dta;
 //eval(P2).innerHTML = "-->";
  
 return false;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function RemoveDesc1(pID) 
{
 var Dta;
 p1 = "Q" + pID
 Dta = " "
 if (document.layers) 
 {
 document.layers[p1].document.write(Dta)
 document.layers[p1].document.close()
 } 
 else if (document.all) 
 {
 eval("document.all."+p1+".innerHTML=Dta")
 } 
 else {document.getElementById(p1).innerHTML = Dta;}
 
 //{document.getElementById(p1).innerHTML = Dta;}
 //--eval("P" + pID).innerHTML = Dta;
 return false;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function RemoveDesc(pID) 
{
 var Dta;
 Dta = " "
 //eval(pID).innerHTML = Dta;
 eval(pID).innerHTML = Dta;
 return false;
}
