/* Returns the current page's file name */
function getCurrentPage() {
	var path = window.location.pathname;
    var page = path.substring(path.lastIndexOf('/') + 1);
    return page;
}

/* Returns the directory this file is in */
function getDirectory() {
	var current = window.location.href;
	var parent  = current.split("/");
	delete parent[(parent.length - 1)];
	var location = parent.join("/");
	return location;
}

/* Handles recirections */
function handleRedirect(url, ms) {
	self.setTimeout("window.location.href = '" + url + "';", ms);
}

/* Redirects to the specified page */
function navigateToURL(url) {
   if(getCurrentPage() != url) {
        window.location.href = url;
    } else {
        return;
    }
}

