//variables
var framesetUrl = "Default.htm";
var leftNavFrameName = "fMenu";
var unAuthUrl = "LeftNav_Unauth.htm";
var authUrl = "LeftNav_Auth.htm";
var rootLocation = "/MyHome/";
//mainAuth
function mainAuth(Authorized)
{
	if (verifyFrameset() == true)
	{
		SetLeftNavigation(Authorized);
		//verifyLeftNavAuth();
	}
}

//verifyFrameset FUNCTION
function verifyFrameset()
{
	//make sure page is within the frameset
	//alert(window.parent.frames.length);
	if (window.parent.frames.length == 0)
	{
		window.location.href = rootLocation + framesetUrl;
		return false;
	}
	return true;
}

//verifyLeftNavAuth FUNCTION
function SetLeftNavigation(Authorization)
{
	//make sure left nav is loaded with navigation page
	//var leftNavFrame = this.parent.document.getElementById(leftNavFrameName);
	var leftNavFrame = window.parent.frames[leftNavFrameName];
	if (Authorization==true) {
		if (leftNavFrame){
			leftNavFrame.location.href = rootLocation + authUrl; //rootLocation + 
		}
	} else {
		if (leftNavFrame){
			leftNavFrame.location.href = rootLocation + unAuthUrl; //rootLocation + 
		}
	}
}

//verifyLeftNavUnAuth FUNCTION
function verifyLeftNavUnAuth()
{
	//make sure left nav is loaded with navigation page
	//var leftNavFrame = window.parent.frames(leftNavFrameName);
	//var leftNavFrame = this.parent.document.getElementById(leftNavFrameName);
	//if (leftNavFrame){
	//	if (leftNavFrame.src != unAuthUrl)
	//	{
	//		leftNavFrame.location.href = rootLocation + unAuthUrl; //rootLocation + 
	//	}
	//}
}

