﻿//helper function to create the form
function getNewSubmitForm(getpost) {
	var submitForm = document.createElement("FORM");
	document.body.appendChild(submitForm);
	submitForm.method = getpost;
	return submitForm;
}

//helper function to add elements to the form
function createNewFormElement(inputForm, elementName, elementValue) {
    var newElement = document.createElement("input");
    newElement.setAttribute("type", "hidden");
    newElement.setAttribute("name", elementName);
    newElement.value = elementValue;
	inputForm.appendChild(newElement);
	newElement.value = elementValue;
	return newElement;
}
