
function trim(s){
	return s.replace(/(^\s*)|(\s*$)/gi,"");
}

//helper function to create the form
function getNewSubmitForm()
{
    var submitForm = document.createElement("FORM");
    document.body.appendChild(submitForm);
    submitForm.method = "POST";
    return submitForm;
}

//helper function to add elements to the form
function createNewFormElement(inputForm, elementName, elementValue)
{
    var newElement = document.createElement("input");
    newElement.setAttribute("name",elementName);
    newElement.setAttribute("type","hidden");
    newElement.setAttribute("value",elementValue);
    inputForm.appendChild(newElement);
    return newElement;
}

