function OnClickHandler(aLink,isPU,aTg)
{
//alert("aLink=" + aLink + ", isPU=" + isPU + ", aTg=" + aTg);
	if(!IsNill(aLink))
	{
		if(!IsNill(isPU) && isPU)
		{
			open(aLink);
		}
		else 
		{
			if ( !IsNill(aTg) && aTg!= "main" && !IsNill(frames[aTg]) )
				frames[aTg].location.href = aLink;
			else 
				location.href = aLink;
		}
	}
}

/* Fun‡”es para colapsar e expandir conteudos - tipo FAQ */
function toggleAllBlocks(bExpand)
{	
	var o, n;	
	
	n = 1;

	while (true)
	{
		o = document.getElementById("bloco" + n + "_detail");
		if (o == null) break;
		o.style.display = bExpand ? "" : "none";
		n+=1;
	}

	n = 1;
	while (true)
	{
		o = document.getElementById("bloco" + n + "_img");
		if (o == null) break;
		o.src = "http://www.logo.pt/SE7E/appImages/seta_" + (bExpand ? "bott" : "dta") + ".gif";
		n+=1;
	}
	
	document.getElementById("collapseAll").style.display = bExpand ? "" : "none";
	document.getElementById("expandAll").style.display = bExpand ? "none" : "";		
}


function toggleBlock(id)
{
	//alert('toggleBlock ' + id);
	var oBlockDetail = document.getElementById(id + "_detail");
	var oBlockImg = document.getElementById(id + "_img");	
	
	if (oBlockDetail.style.display == "none")
	{
		oBlockDetail.style.display = "";
		oBlockImg.src = "http://www.logo.pt/SE7E/appImages/seta_bott.gif";		
	}
	else
	{
		oBlockDetail.style.display = "none";
		oBlockImg.src = "http://www.logo.pt/SE7E/appImages/seta_dta.gif";			
	}	
}

function HideShowMenu(id,size) {
	var o, n;	
	
	n = 0;

	while (true)
	{
		o = document.getElementById(n + "_divItem");
		
		if (o == null) break;
		o.style.display = "none";
		n+=1;
	}

	if(size > 0)
		document.getElementById(id).style.display = "block";	
}

function HideShowGarage(id) {
	var o, n;	
	
	n = 0;

	while (true)
	{
		o = document.getElementById("divDetalhe" + n);
		
		if (o == null) break;
		o.style.display = "none";
		n+=1;
	}

	document.getElementById(id).style.display = "block";	
}

function HideShowMenuItem(id,size) {
	var o, n;	
	
	n = 0;

	while (true)
	{
		o = document.getElementById(n + "_divSubItem");
		
		if (o == null) break;
		o.style.display = "none";
		n+=1;
	}

	if(size > 0)
		document.getElementById(id).style.display = "block";	
}
