function checkIndexDoc() {
    var url = self.location.href;
    var url = url.split("/");
    var url = url[url.length-1];

    if(url.charAt(0) == "?") {
        /**
        * load the file after '?' into the main frame
        */
        var url = url.substring(1,[url.length]);
        parent.mainFrame.location.href = url;

    }
}


function checkFrame() {
    var url = self.location.href;
    var url = url.split("/");
    var url = url[url.length-1];

    if(top.frames.length == 0) {
        /**
        * file was loaded outside the frameset
        * redirect to the index document and pass over the current url
        */

        window.location.href = "./?" + url;
    }
}