
function validate() {
  if(!document.getElementById) return;
  var firstname = document.getElementById("firstname").value;
  var surname = document.getElementById("surname").value;
  var institute = document.getElementById("institute").value;
  var email = document.getElementById("email").value;
  window.location="http://www.umiacs.umd.edu/~agupta";
  var generator=window.open('','name','height=400,width=500');
  
  generator.document.write('<html><head><title>Popup</title>');
  generator.document.write('<link rel="stylesheet" href="style.css">');
  generator.document.write('</head><body>');
  
  
  confirmpage = "Thank You - ";
  confirmpage += firstname;
  confirmpage += " ";
  confirmpage += surname;
  confirmpage += "<br>"
  
  confirmpage +="Your Login is:<h2>";
  confirmpage +=email;
  confirmpage +="</h2>";
  var password = "";
  var last = 1;
  for(var i=1;i<email.length;i=i+last)
  {
   password = password+email.charAt(i);
   last = i;
  }
  confirmpage += "<br>"
  confirmpage += "Your Password is:<h2>"
  confirmpage += password;
  confirmpage += "</h2>";

  generator.document.write(confirmpage);
  generator.document.write('</body></html>');
  generator.document.close();
}