                                                    
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};


BrowserDetect.init();

//check the browser to External Interface compatibility
function detect(){
if ((BrowserDetect.browser=="Firefox") && ( parseInt(BrowserDetect.version)>=2) || (BrowserDetect.browser=="Netscape") && ( parseInt(BrowserDetect.version)>=8) || (BrowserDetect.browser=="Safari") && ( parseInt(BrowserDetect.version)>=312) || (BrowserDetect.browser=="Explorer") && ( parseInt(BrowserDetect.version)>=6) || (BrowserDetect.browser=="Mozilla") && ( parseInt(BrowserDetect.version)>=1))
	{
//alert("hello compatible");//do nothing
	}
else
	{
alert("Your browser needs to be upgraded.  This site works in all the major browsers including Internet Explorer 6.0+, Firefox 1.0+, Mozilla 1.7.5+, Netscape 8+, and Safari 1.3+.  Please upgrade for the full functionality of this site.");

//alert("Who are you?" + parseInt(BrowserDetect.version));
	}
//alert(BrowserDetect.browser + ' ' + BrowserDetect.version);
}
////////////////////////
var menu;
//hide/show menu tab
function toggleMenu(objID) {
if (!document.getElementById) return;

//close menu on glossary jump
if (!objID){
var menuArray = ['menu1', 'menu2', 'menu3', 'menu4', 'menu5', 'menu6'];
		for (var x=0; x < 6; x++){
		var obtemp = parent.document.getElementById(menuArray[x]).style;
		obtemp.display = 'none';
		}
}//select and close menus from chapter links named 1-7 (corresponds to menu #s)
/*else if (objID <= 7){
var menuArray = ['menu1', 'menu2', 'menu3', 'menu4', 'menu5', 'menu6'];
var obswap = objID - 1;
var obtemp = parent.document.getElementById(menuArray[obswap]).style;
	obtemp.display = 'block';
	
	//hide other drop down
for (var i = 1; i < 7; i++){
if (objID != i)
	{
	var notOb = 'menu' + i;
	var off = parent.document.getElementById(notOb).style;
	off.display = 'none';
	}
}
	
}*/
//pass menu number to menu variable
//added parent to jump to top level
menu = objID.charAt(4);// + objID.charAt(5)	
var ob = parent.document.getElementById(objID).style;
var once = 0; 
if (once == "0"){
	ob.display = 'block';
	once = 1;
	
}

else if (ob.display == 'none') {
	ob.display = 'block';
}

else {
	ob.display = 'none';	
}
//hide other drop down
for (var i = 1; i < 7; i++){
if (menu != i)
	{
	var notOb = 'menu' + i;
	var off = parent.document.getElementById(notOb).style;
	off.display = 'none';
	}
}
}
//LOAD first page of Menu on Click
function loadPage(first){
	loadIframe("DivText", first);
}

var holder=0;
//activates left nav highlight state, added parent to jump from within iframe
function selected(num){
parent.document.getElementById(num).className="highlight";
if (holder != 0)
		{
		parent.document.getElementById(holder).className="side-a";
		}
		holder = num;
}

function gotoChapter(subject, chapter){
	toggleMenu(subject);
	selected(chapter);
}


//old code
/*function selected(num){
document.getElementById(num).className="highlight";
var i= 1;
do{
		if (i == num)
		{
			i+=1;
		}
		else
		{
			document.getElementById(i).className="side-a";
			i+=1;
		}
	} while (i < 31)
}*/

function goHome() {
	document.write('http://cyberbridge.mcb.harvard.edu');
}
//set fluid height of iframe
function goSetHeight() {
	 tooltip.init ();//start rollover title effect
  if (parent == window) return;
  // arg: id of iframe element this doc is to be loaded into
  else parent.setIframeHeight('DivText');
 
}
//iframe fluid height for index.html
function getDocHeight(doc) {
  var docHt = 0, sh, oh;
  if (doc.height) docHt = doc.height;
  else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}

function setIframeHeight(iframeName) {
  var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if ( iframeEl && iframeWin ) {
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
  }
}

function loadIframe(iframeName, url) {
  if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;   
    return false;
  }
  else return true;
  
}
//end iframe fluid height fix


//if menu selected, select appropriate quiz
function toggleQuiz(){
var url;

	if (menu == 6)
	{url = "mitosis_quiz.html";
	}
	else if (menu == 5)
	{url = "evolution_quiz.html";
	}
	else if (menu == 4)
	{url = "genetics_quiz.html";
	}
	else if (menu == 3)
	{url = "dna_quiz.html";
	}
	else if (menu == 2)
	{url = "bonding_quiz.html";
	}
	else if (menu == 1)
	{url = "math_quiz.html";
	}
	else
	{url = "content.html";
	}
	
return (url);
}
//if menu selected, select appropriate tutorial
function toggleTutorial(){
var url;
	if (menu == 6)
	{url = "mitosis_1.html";
	}
	else if (menu == 5)
	{url = "evolution_1.html";
	}
	else if (menu == 4)
	{url = "genetics_1.html";
	}
	else if (menu == 3)
	{url = "dna_1.html";
	}
	else if (menu == 2)
	{url = "bonding_1.html";
	}
	else if (menu == 1)
	{url = "math_1.html";
	}
	else{ url = "content.html";
	}

return (url);
}

var totalQues = 0;//was -1
//is New Question (for question tally)
var isNewQues = false;

function checkQuesTally(){
	//If radio button clicked Once record question in tally
	if (isNewQues == false){
	totalQues++;
	isNewQues= true;
	}
}

//Sets visibility of each quiz question
var currentLayer = 'page1'; 
var currentTop = 'Q1';
//setup default as first question
function showLayer(lyr,top) {
   hideLayer(currentLayer); 
   deleteTally(currentTop);
   deleteResponse(currentLayer);
  	//deleteButton(where);
	//lyr = page1, page1a, page2, etc.
	//try to retrieve layer height div.page#page1 and push it to DivText
	// new code to try and resize quiz questions
   document.getElementById(lyr).style.visibility = 'visible'; 
   currentLayer = lyr;
   currentTop = top;
   insertScript(lyr,top);
   //setQuizHeight(lyr);
}
//Hides Layer/Question
function hideLayer(lyr) {
   document.getElementById(lyr).style.visibility = 'hidden';
}

//Fluid height Quiz
function height(div){
var divHeight = document.getElementById(div);
var tellme = divHeight.offsetHeight;
alert(tellme);
var num = divHeight.offsetHeight + 340; //was 250 nancy long winded, was 320 ernie even more long winded - oi!
//alert(num);
parent.document.getElementById("DivText").style.height = 
num + "px";                        
}

//Fluid height Quiz  RESULTS ONLY
function heightResults(div){
var divHeight = document.getElementById(div);
var num = divHeight.offsetHeight + 650; //was 250 nancy long winded, was 580 ernie even more...
//alert(num);
parent.document.getElementById("DivText").style.height = 
num + "px";                        
}

function createTally(question){
//Creates the Points Tally at top of page
var myselect = document.getElementById(question);
var theBox = document.createElement('div');
theBox.setAttribute('id', 'quizCount');
theBox.innerHTML = "Quiz Tally.";
myselect.appendChild(theBox);
}

function deleteTally(question) {
//Removes the Points Tally at top of page
var myselect = document.getElementById(question);
var theBox = document.getElementById('quizCount');
//remove
myselect.removeChild(theBox);
}

function createResponse(question){
//Create Quiz response box
var myselect = document.getElementById(question);
var theBox = document.createElement('div');
theBox.setAttribute('id', 'quizPoints');
theBox.innerHTML = "Test your knowledge.";
myselect.appendChild(theBox);
//Reset Question Tally boolean
isNewQues = false;
}

function deleteResponse(question) {
//Use the IDs set in the create to locate elements
var myselect = document.getElementById(question);
var theBox = document.getElementById('quizPoints');
//remove
myselect.removeChild(theBox);

}


function insertScript(current, current2){
//onload create the response box
createTally(current2);
createResponse(current);

var totalQuestion = 10;
var currentQuestion = current.charAt(4) + current.charAt(5);
var theBox = document.getElementById('quizCount');
//alert(totalQues);
//alert(totalPoints)
theBox.innerHTML = "You are on question number " + currentQuestion + " of " + totalQuestion + " total questions.";
var theBox2 = document.getElementById('quizPoints');
theBox2.innerHTML = currentAns;
//totalQues++;
var finalGrade = (totalPoints/totalQues) *100;

if (current == "results"){
	
	if (totalQues > 0){
	finalGrade = Math.round(finalGrade);
	theBox2.innerHTML = "You have " + totalPoints + " points out of " + totalQues + " possible total points." + "<div></div>" + "Your Score is " + finalGrade + "%"; 
	//add the evaluation to the div
	makeForm();
	
	}
	else{
		theBox2.innerHTML = "You have " + totalPoints + " points out of " + totalQues + " possible total points." + "<div></div>" + "You need to answer questions to receive a score."; 
		
	}
}
tries = 0;
	if (current == "results"){
	heightResults(current);
	}
	else{
	height(current);
	}
}


var totalPoints=0;
var currentAns="Test Your Knowledge."

//creates answer responses and shows score
function msg(choice, score){
var finalAnswer = " ";
totalPoints = score;checkQuesTally();
var answer1 = "Congratulations! You have " + totalPoints + " points out of " + totalQues + " possible total points. Next question";
var answer2 = "Nice job. You have " + totalPoints + " points out of " + totalQues + " possible total points. Next question.";
var answer3 = " Try again.";
var answer4 = " Incorrect, please review the tutorial.";

	if (choice == "one"){
		finalAnswer = answer1;
		
	}
	else if (choice == "two"){
		finalAnswer = answer2;
		
	}
	else if (choice == "three"){
		finalAnswer = answer3;
		
	}
	else if (choice =="four") {
		finalAnswer = answer4;
		
	}
	else {	
	return;
	}
		
document.getElementById('quizPoints').innerHTML = finalAnswer;
//alert(totalPoints);
	currentAns = "You have " + totalPoints + " points out of " + totalQues + " possible total points.";
	
}

var points = 0; 
var tries = 0;  //two tries to answer correctly

//pass user's radio button selection and return value
function question(form,name) {
// Question One	
var radioGrp = document['forms']['quiz'][name];
//normally form.one[i].value
for (var i = 0;i < radioGrp.length; i++) {
	if (radioGrp[i].checked) {	
	break	
	}	
} 
var radioValue = radioGrp[i].value;
var isCorrect = radioValue.substring(0,8);//concatenate value to Correct! 
//alert(radioValue);  answer
//alert(radioGrp[i].name);  one, two
//alert(i);  0,1,2,3 index
if (tries == 0 && isCorrect == "Correct!"){
	points += 1; 
	msg("one", points);
	tries++;
	createButton(currentLayer,radioGrp);
}
	
else if (tries == 1 && isCorrect == "Correct!"){
	points += .5; 
	msg("two", points);
	tries++;
	createButton(currentLayer,radioGrp);
}
 
else if (tries < 1) { 
	msg("three", points);
	tries++;
	
}
	
else if (tries < 2){
	msg("four", points);
	tries++;
	createButton(currentLayer,radioGrp);
}
msg("done", points);
//alert(tries);
radioGrp[i].checked = true;
//next question is reveal answers
var answer = radioGrp[i].name;
var reveal = answer + [i+1];
document.getElementById(reveal).innerHTML = radioValue;
}

function createButton(fpo,group){
	//alert(fpo.charAt(5));//page1a
	
var placeme = document.getElementById(fpo);
var revealbutton = document.createElement("BUTTON");
revealbutton.setAttribute("type", "none");
if (fpo.charAt(5) == "a" || fpo.charAt(6) =="a"){
	revealbutton.setAttribute("id", "reveal_btn2");
}
else{
revealbutton.setAttribute("id", "reveal_btn");
}
//revealbutton.style.height =20;
///revealbutton.style.width=65;
placeme.appendChild(revealbutton);
//assign the value of the button
theText=document.createTextNode("Reveal Answers");
revealbutton.appendChild(theText);

//reveal all answers on click
revealbutton.onclick = function revealAns(){
//loop through radio buttons and reveal answers
	for (var i = 0;i <= group.length + 1; i++) {
	var answer = group[i].name;
	//alert(answer);
	var reveal = answer + [i+1];
	document.getElementById(reveal).innerHTML = group[i].value; 
	group[i].checked = false;
		}
	}
}

function deleteButton(question) {
//Removes the Points Tally at top of page
var myselect = document.getElementById(question);
var theButton = document.getElementById('reveal_btn');
//remove
	myselect.removeChild(theButton);
	}

function showAns(reveal) {
var ob = document.getElementById(reveal).style;
	if (ob.display == 'none') {
		ob.display = 'block';
	}
	else {
		ob.display = 'none';	
	}
}

///////////QTIP RollOver/////////////////////////////

var qTipTag = "a"; //Which tag do you want to qTip-ize? Keep it lowercase!//
var qTipX = -60; //This is qTip's X offset, -30//
var qTipY = 10; //This is qTip's Y offset//



//There's No need to edit anything below this line//
tooltip = {
  name : "qTip",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function () {
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){ var tipContainerID = "qTip";}
	var tipContainer = document.getElementById(tipContainerID);

	if(!tipContainer) {
	  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
	  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}

	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};

	var a, sTitle;
	var anchors = document.getElementsByTagName (qTipTag);

	for (var i = 0; i < anchors.length; i ++) {
		a = anchors[i];
		sTitle = a.getAttribute("title");
		if(sTitle) {
			a.setAttribute("tiptitle", sTitle);
			a.removeAttribute("title");
			a.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			a.onmouseout = function() {tooltip.hide()};
		}
	}
}

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}

tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}

//Pass variables from one iframe to another and jump to anchor
function sendData(aname)
{
  // Initialize packed or we get the word 'undefined'
  var aname;
  //load the glossary page and put the anchor in the url
  window.location = "glossary.html?" + aname;
  toggleMenu();
}

  //CLICK FOR ANSWER in TUTORIALS
  //reload page height and jump to anchor
function sendLink(aname)
{
  // Initialize packed or we get the word 'undefined'
  var aname;
  goSetHeight();
  //load the glossary page and put the anchor in the url
  document.anchors.item(aname).scrollIntoView(true);
  //firefox, netscape, IE 7.0 not in IE 5.2
  location.hash=aname;
}


function iFrameLoaded(){
  var query = window.location.search;
  //alert(query);
  // Skip the leading ?, which should always be there, 
  // but be careful anyway
  if (query.substring(0, 1) == '?') {
	  //grab the anchor name
    query = query.substring(1);
 
 /*   else {
  	query = "#top";
  } took out document.write(query) on glossary.html*/
  //jump to anchor point
  //safari
  document.anchors.item(query).scrollIntoView(true);
  //firefox, netscape, IE 7.0 not in IE 5.2
  location.hash=query; }
  }
  
  //NEXT PAGE
  function Next(){
	  //return url //window.location.href;
 var str = location.pathname;
 //  /genetics_4.html
  //alert(str);
  var mylength = str.length;
  //alert(mylength);
  //retrieve first part of url up thru _
  var firstlength = mylength - 5;
  //alert(firstlength);
  var charchange = firstlength - 1;
  //alert(charchange);
  var newPage = str.charAt(charchange);
  //alert(newPage);
  var newNumber = parseInt(newPage) + 1;
  //alert(newNumber);
  var newStr = newNumber.toString();
   //alert(newStr);
   var lastStr = str.substring(charchange + 1);
   var firstStr = str.substring(0,charchange);
 var finalPage = firstStr.concat(newStr,lastStr);
  //alert(finalPage);
   window.location.replace(finalPage);
 }
 
 function Previous(){
	 history.go(-1);
 }
  

//EVALUATION FORM
//this script gives IE a hiccup and throws misc. errors

 function makeForm() {
	  // Where the form will be placed into the page
    var  mypara = document.getElementById("evaluation");
    cleanElement(mypara);
		//attach form to paragraph id
        //mypara=document.getElementById("evaluation");
		
		//create form
try {
        var myform = document.createElement("<FORM name='evaluationForm'></FORM>"); } 
catch (e) {
        myform=document.createElement("FORM"); 
        myform.name = "evaluationForm";
}                
		myform.method = "post";
		myform.action = "https://datacollection.fas.harvard.edu/cgi-bin/form2db.cgi";
		myform.id = "evaluationForm";
try {
        var myhidden = document.createElement("<INPUT name='form2db' />");}
catch (e) {
		myhidden = document.createElement("INPUT");
		myhidden.name = "form2db";
}
		myhidden.type = "hidden";
		myhidden.value = "cyberbridge08";
		myform.appendChild(myhidden);
	
		//add return
		myform.appendChild(document.createElement("BR"));
		
		
		//add copy
		myform.appendChild(document.createTextNode("Quiz Evaluation:"));
		myform.appendChild(document.createElement("P"));
		myform.appendChild(document.createElement("P"));
		myform.appendChild(document.createTextNode("Did you find this exercise useful?"));
		myform.appendChild(document.createElement("BR"));
		
		
		 //radio buttons	
try {
        var myradio1 = document.createElement("<INPUT name='IsEvaluationUseful' />");
        var myradio2 = document.createElement("<INPUT name='IsEvaluationUseful' />");
		  var myradio3 = document.createElement("<INPUT name='IsEvaluationUseful' />");
        var myradio4 = document.createElement("<INPUT name='IsEvaluationUseful' />");} 
catch (e) {
		 //Extremely
		myradio1 = document.createElement("INPUT");
		myradio1.name = "IsEvaluationUseful";
		//Mostly
		myradio2 = document.createElement("INPUT");
		myradio2.name = "IsEvaluationUseful";
		//Moderately
		myradio3 = document.createElement("INPUT");
		myradio3.name = "IsEvaluationUseful";
		//Not At All
		myradio4 = document.createElement("INPUT");
		myradio4.name = "IsEvaluationUseful";
}
		 //Extremely
		myradio1.type = "radio";
		myradio1.value = "Extremely";
		myform.appendChild(myradio1);
		myform.appendChild(document.createTextNode("Extremely"));
		myform.appendChild(document.createElement("BR"));
		
		//Mostly
		myradio2.type = "radio";
		myradio2.value = "Mostly";
		myform.appendChild(myradio2);
		myform.appendChild(document.createTextNode("Mostly"));
		myform.appendChild(document.createElement("BR"));
		
		 //Moderately
		myradio3.type = "radio";
		myradio3.value = "Moderately";
		myform.appendChild(myradio3);
		myform.appendChild(document.createTextNode("Moderately"));
		myform.appendChild(document.createElement("BR"));
		
		//Not At All
		myradio4.type = "radio";
		myradio4.value = "Not At All";
		myform.appendChild(myradio4);
		myform.appendChild(document.createTextNode("Not At All"));
		myform.appendChild(document.createElement("BR"));
		myform.appendChild(document.createElement("BR"));
		
		
		//textbox for email copy
		myform.appendChild(document.createTextNode("Your Email (please include with comments):"));
		myform.appendChild(document.createElement("BR"));
	
		 
		//textbox for email
try {
        var mytextarea = document.createElement("<INPUT name='Email' />");} 
catch (e) {
		mytextarea = document.createElement("input");
		mytextarea.name = "Email";
}
		mytextarea.type = "text";
		myform.appendChild(mytextarea);
		myform.appendChild(document.createElement("BR")); 
		myform.appendChild(document.createElement("BR"));
		
		 //textarea  comments box copy
		 myform.appendChild(document.createTextNode("If you have comments or suggestions, please include them below:"));
		myform.appendChild(document.createElement("BR"));
		
		//textarea comments box
try {
        var mytextarea2 = document.createElement("<TEXTAREA name='Comments'></TEXTAREA>"); 
} catch (e) {
		mytextarea2 = document.createElement("textarea");
		mytextarea2.name = "Comments";
}
		mytextarea2.setAttribute("rows", "8");
		mytextarea2.setAttribute("cols", "40");
		theText2=document.createTextNode("Add your comments.");
		mytextarea2.appendChild(theText2);
		//stylize textarea box
		mytextarea2.style.fontWeight="bold";
		mytextarea2.id = "evaluation";
		myform.appendChild(mytextarea2);
		
		myform.appendChild(document.createElement("BR"));
		myform.appendChild(document.createElement("BR"));
		myform.appendChild(document.createElement("BR"));
		myform.appendChild(document.createElement("BR"));
	
		//submit button
try {
        var submitButton = document.createElement("<INPUT name='Submit' />");
		} 
catch (e) {
		submitButton = document.createElement("INPUT");
		submitButton.name = "Submit";
	
	}
		submitButton.type = "Submit";
		submitButton.value = "Submit";
	
		
    	myform.appendChild(submitButton);
		
		 // Place the form into the page
    	mypara.appendChild(myform);
}
 
	var cleanElement = function (el) {
    while (el.firstChild) {
       
        el.removeChild(el.firstChild);
    }
}

function gonext(){
history.forward();
}

		//document.body.appendChild(myform);
		//mypara.appendChild(myform);