/**
 * @author Eddie Tippetts
 */

window.onload = checkFrame;

//Replaces the contents of a frame called "Main" with the path specified after any '?'
function checkFrame() {
	var target = getTarget(self.location);
	var frame = document.getElementById("Main");
	frame = frame.contentWindow.document;
	if((target + "").length > 0)
	{
		frame.location.replace(target);
	}
}

//Returns everything to the right of '?', or an empty string if '?' is absent
function getTarget(url)
{
	var delimPos = (url + "").indexOf("?");
	if(delimPos > -1)
	{
		url = (url + "").substring(delimPos + 1);
		return url;
	}
	else
	{
		return "";
	}
}
