<!doctype html>
<html>
<% 
String bgColor = request.getParameter("bgColor");
String thefont = request.getParameter("thefont");
String testing=request.getParameter("testing");
if (testing==null&&bgColor==null) {
    bgColor = "WHITE"; 
    thefont="serif";
    testing="no";
} else {
    if (bgColor.trim().length()==0) {
        bgColor="WHITE";
    }
}
%>
<head>
<title>Testing Styles</title>
<style>
body {
    background-color: <%= bgColor %>;
    font-style: <%= thefont %>;
}
</style>
<script >
function ResetPage(){
    document.location.href = "http://hoare.cs.umsl.edu/servlet/j-siegel/colorfontjs.jsp";
}
</script>

</head>
<body>
<h1 ALIGN="CENTER">Testing Colors and Font Styles.</h1>
<hr />
<%
if(testing.equals("no")){
%>
             
<form>
   Color:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input TYPE="TEXT" NAME="bgColor" /><br />
   &nbsp;<br />
   Font Style:&nbsp;&nbsp;
   <select TYPE="TEXT" NAME="thefont" >
      <option value="normal">normal</option>
      <option value="italic">italic</option>
   </select>
   <br />
   &nbsp;<br />

   <input TYPE="HIDDEN" NAME="testing" VALUE="yes" /><input TYPE="SUBMIT" VALUE="Try the Color">
</form>
<%
}else{
%>
<h1>Do You like the Background Color  <%= bgColor %> and Font <%= thefont %><br />
<button onclick="ResetPage()">Try Another</button>
<%
} 
%>
</body>
</html>


colorfontjs.jsp