function makeNewForm() {
	var newForm = document.createElement("form");
	newForm.setAttribute("action", frame_path);
	newForm.setAttribute("method", "POST");
	document.body.appendChild(newForm);	
	return newForm;
}

function addInput(inputForm, inputName, inputValue) {
	var newInput = document.createElement("input");
	newInput.setAttribute("name", inputName);
	newInput.setAttribute("type", "hidden");
	newInput.setAttribute("value", inputValue);
	inputForm.appendChild(newInput);
	return newInput;
}

function redirect() {
	var redirectForm = makeNewForm();
	addInput(redirectForm, "inner", this_path);
	redirectForm.submit();
}

var this_path = window.location.href;
if (this_path.match("ism3")) {
	var frame_path = "http://ism3.infinityprosports.com/ismdata/2008051400/std-sitebuilder/sites/200901/www/en/"
} else {
	var frame_path = "http://www.valleysportsxtra.com/"
}
window.onload = function() {
	if ((this_path != frame_path) && (this_path != "http://ism3.infinityprosports.com/ismdata/2008051400/std-sitebuilder/sites/200901/www/en/") && !this_path.match("/ISM3/")) {
		redirect();
	}
}
