// Javascript function to post data to a page
function __POST(action,p)
{
    // Create a temporary form on the page, fill it with data, submit it then remove it.
    var tempForm = document.createElement("form");
    tempForm.method="post";
    tempForm.action = action;
    
    // For every key value pair on the post items array, create an input
    for (var k in p)
    {
        var tempInput = document.createElement("input") ;
        tempInput.setAttribute("name", k);
        tempInput.setAttribute("value", p[k]);
        tempForm.appendChild(tempInput) ;
    }
    
    document.body.appendChild(tempForm);
    tempForm.submit();
    document.body.removeChild(tempForm);
}