// JavaScript toolbox.
var hostName = top.window.location.hostname;
var path = top.window.location.pathname;
// Make sure this just the path to the website and
// not to the page itself.
if (path.lastIndexOf( '/') != (path.length - 1))
{
    path = path.substr( 0, path.lastIndexOf( '/' ) + 1 );
}

var applicationName = hostName + path;

function previous( f, link )
{
    f.action=link;
    f.method="post";
    f.submit();
}

function gotoLink( page )
{
    var link = "http://" + applicationName + page;
    top.window.location.href = link;
}

function gotoSecureLink( page )
{
    var link = "https://" + applicationName + page;
    top.window.location.href = link;
}

function windowPop( url, name, features )
{
    var win_handle;
    win_handle = window.open( url, name, features );
    win_handle.focus();
}
