String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

function SetSelected(PgID)
{
	selected = PgID;
}

function UnSelectFamilia()
{
	with(document.Form1)
	{
		if(FSelected != "")
		{
			eval("FImg" + FSelected + ".className = 'menu';");
			FSelected = "";
		}
	}
}

function MouseOver(FID, FName)
{
	try
	{
		with(document.Form1)
		{
			
			if(FSelected != FID)
			{
				
				eval("FImg" + FID + ".className = 'menuhover';");
				
			}
		}
	}
	catch(e){}
	
}

function MouseOut(FID, FName)
{
	try
	{
		with(document.Form1)
		{
			if(FID != FSelected)
			{
				eval("FImg" + FID + ".className = 'menu';");
				
			}
		}
	}
	catch(e){}
}

function MouseClick(FID, FName, FPag)
{
	try
	{
		with(document.Form1)
		{
			
			if(FSelected != FID)
			{
				if(FSelected != "") UnSelectFamilia();
				
				eval("FImg" + FID + ".className =  'menuhover';");
				
				FSelected = FID;
				SetSelected(0);
				
				if (FPag != "")
				{
					document.all("myframe").src = FPag;
				}	
				
				
				//if (FPag != "")
				//{
				//	if (FPag == 4)
				//	{
				//		window.location.href = 'default.asp?tipopag=4';
				//	}
				//	else
				//	{	
				//		document.all("myframe").src = FPag;
				//	}	
				//}	
			}
		}
	}
	catch(e){}
}