function navigate(sender)
{
	window.open(sender.options[sender.selectedIndex].value);
}

function openPopup(document, windowName, wWidth, wHeight, fullScreen)
{
	var top = (screen.availHeight - wHeight) / 2;
	var left = (screen.availWidth - wWidth) / 2;
	var params = 'width=' + wWidth + ', height=' + wHeight + ', top=' + top + ', left=' + left + ', resizable=no, toolbar=no, scrollbars=no';

	if (fullScreen == true) {
	    params = 'fullscreen, scrollbars';
	}
	
	window.open(document, windowName, params);
}

function openPopup2(document, windowName, wWidth, wHeight)
{
	var top = (screen.availHeight - wHeight) / 2;
	var left = (screen.availWidth - wWidth) / 2;
	
	window.open(document, windowName, 'width=' + wWidth + ', height=' + wHeight + ', top=' + top + ', left=' + left + ', resizable=no, toolbar=no, scrollbars=yes');
}

function toggleLayer(divid)
{
	aResults = document.getElementsByTagName("div");
			
	for(var i = 0; i < aResults.length; i++)
	{
	
		if (aResults[i].id == divid)
		{
	
			if (document.getElementById(divid).style.display == 'none')
			{
				document.getElementById(divid).style.display = 'block';
			}
				
			else
			{
				document.getElementById(divid).style.display = 'none';
			}
			
		}
			
	}

}

function toggleField(whichField)
{
	if (whichField.disabled == true)
	{
		whichField.disabled = false;
	}
	else
	{
		whichField.disabled = true;
	}
}

function showDiv(whatDiv)
{
    document.getElementById(whatDiv).style.display = 'block';
}

function hideDiv(whatDiv)
{
    document.getElementById(whatDiv).style.display = 'none';
}

function disableFields()
{

	var chkExpSem = document.getElementById("chkExpSem");
	
	var items = new Array();
	items[0] = document.getElementById("radBancaSim");
	items[1] = document.getElementById("radBancaNao");
	items[2] = document.getElementById("ddlSectorAct1");
	items[3] = document.getElementById("txtEntidade1");
	items[4] = document.getElementById("txtFuncoes1");
	items[5] = document.getElementById("txtCatProf1");
	items[6] = document.getElementById("txtDataInicioAct1");
	items[7] = document.getElementById("txtDataFimAct1");
	items[8] = document.getElementById("txtInfoAdicional1");
	items[9] = document.getElementById("txtEntidade2");
	items[10] = document.getElementById("txtFuncoes2");
	items[11] = document.getElementById("txtCatProf2");
	items[12] = document.getElementById("txtDataInicioAct2");
	items[13] = document.getElementById("txtDataFimAct2");
	items[14] = document.getElementById("txtInfoAdicional2");
	items[15] = document.getElementById("txtEntidade3");
	items[16] = document.getElementById("txtFuncoes3");
	items[17] = document.getElementById("txtCatProf2");
	items[18] = document.getElementById("txtDataInicioAct3");
	items[19] = document.getElementById("txtDataFimAct3");
	items[20] = document.getElementById("txtInfoAdicional3");
	
	for(i = 0; i <= items.length - 1; i++)
	{
		items[i].disabled = chkExpSem.checked;
		alert[i];
	}

}

function seguros(divName)
{
	hideDiv('divSegurosBase');
	hideDiv('divSegurosBaseVidros');
	hideDiv('divSegurosPlus');
	hideDiv('divSegurosTotal');
	
	showDiv(divName);
}

function seguros2(content)
{
	openPopup2('seguros/default.aspx?c=' + content, 'seguros', 790, 550);	
}
