/*********************************************************/
//  Created:	02/06/2004
//  Author:     Demeter, Albert
//  Purpose:	functions in this file are used to load pages in the frame structure of the project
//  Parameters:	none
//  Notes:		none
/*********************************************************/

var error_var = 0

function setEditMode(newEditState)
{
	try
	{
		top.MenuLogo.editOn = newEditState;
	}
	catch(e)
	{
		if(error_var==0)
		{
			error_var = 1;
			window.setTimeout("setEditMode(true)",500); 
		}
	}
}

function confirmmoveright(url)
{
	if (!top.MenuLogo.editOn) moveright(url);
	else if (confirm("You did not save the data.\nAre you sure you want to leave the screen without saving?"))
	{
		moveright(url)
		top.MenuLogo.editOn = false;
	}
}
function moveright(url)
{
	try 
	{
		top.FrameData.MainFrame.location = url; 												
	}
	catch(e)
	{
		if(error_var==0)
		{
			error_var = 1;
			window.setTimeout("moveright(" + url + ")",500); 
		}
	}
}	

function confirmmove(url,urlMain)
{
	if (!top.MenuLogo.editOn) move(url,urlMain);
	else if (confirm("You did not save the data.\nAre you sure you want to leave the screen without saving?"))
	{
		move(url,urlMain)
		top.MenuLogo.editOn = false;
	}
}

function move(url,urlMain)
{
	try 
	{
		top.FrameData.LeftMenu.location = url; 												
		top.FrameData.MainFrame.location = urlMain;
	}
	catch(e)
	{
		if(error_var==0)
		{
			error_var = 1;
			window.setTimeout("move("+url+","+urlMain+")",500); 
		}
	}
}	

function confirmmoveComp(url,urlMain,compID)
{
	if (confirm("You did not save the data.\nAre you sure you want to leave the screen without saving?"))
	{
		move(url + "&changeSession=" + compID,urlMain);
	}
	else
	{
		moveLeft(url);
	}
}
function moveLeft(url)
{
	try 
	{
			top.FrameData.LeftMenu.location = url;
	}
	catch(e)
	{
		if(error_var==0)
		{
			error_var = 1;
			window.setTimeout("moveLeft("+url+")",500); 
		}
	}
}

function confirmlogout(url)
{
	if (!top.MenuLogo.editOn) movelogout(url);
	else if (confirm("You did not save the data.\nAre you sure you want to leave the screen without saving?"))
	{
		movelogout(url);
		top.MenuLogo.editOn = false;
	}
}
function movelogout(url)
{
	try 
	{
		if (confirm("Are you sure you want to logout?")) top.location = url; 												
	}
	catch(e)
	{
		if(error_var==0)
		{
			error_var = 1;
			window.setTimeout("movelogout("+url+")",500); 
		}
	}
}	
