$(document).ready(function() {

    // if we get a "ticket" request parameter handed back to us, write it into the browser and reload
    var ticket = Gitana.getCurrentQueryStringParameter("ticket");
    if (ticket)
    {
        // write the gitana ticket down into a cookie (be sure to URL encode)
        Gitana.writeCookie("GITANA_TICKET", encodeURIComponent(ticket));
        
        // redirect to documents.html
        window.location = "/documents.html";
    }
    
});
