detectFrames();

// Redirects the visitor to the frameset if they directly access the page.
function detectFrames() {
    if (getParentPath() != "/" && getParentPath().toLowerCase() != "/default.aspx") {
        location.href = "http://" + parent.location.host + "/default.aspx?load=" + encode(getParentPath());
    }
}

function getParentPath() {
    if (parent) { return parent.location.pathname; }
    return "";
}

function encode(str) {
    str = escape(str);
    str = str.replace("+", "%2B");
    str = str.replace("/", "%2F");
    
    return str;
}