//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 createHiddenElement(elementName, elementValue){
 var newElement = document.createElement("input");
 newElement.name=elementName;
 newElement.type='hidden';
 newElement.value = elementValue;
 return newElement;
}

//function that creates the form, adds some elements
//and then submits it
function forwardWithSourceTagSubmit(postUrl, sourceUrlValue){
 var submitForm = getNewSubmitForm();
 var hiddenElement = createHiddenElement("sourceUrl", sourceUrlValue);
 submitForm.appendChild(hiddenElement);
 submitForm.action= postUrl;
 submitForm.submit();
}