/**
 * Get the filename
 */
function getFileName() 
{
	//this gets the full url
	var url = document.location.href;
	//this removes the anchor at the end, if there is one
	url = url.substring(0, (url.indexOf("#") == -1) ? url.length : url.indexOf("#"));
	//this removes the query after the file name, if there is one
	url = url.substring(0, (url.indexOf("?") == -1) ? url.length : url.indexOf("?"));
	//this removes everything before the last slash in the path
	url = url.substring(url.lastIndexOf("/") + 1, url.length);
	//return
	return url;
}



/**
 * Get the location
 */
function getLocation()
{
	var filename = "/" + getFileName();
	var url = document.location.href;
	return url.substring(0, (url.indexOf(filename) == -1) ? url.length : url.indexOf(filename));
}
