
isPT = false;

isPT = GetSiteLanguage();
function GetSiteLanguage()
{
	pathArray = window.location.pathname.split( '/' );	
	isPT = false;
			
	if(pathArray.length >0)
	{
			if(pathArray.length>1)
				if(pathArray[1]=="PT")
				{
					pathArray[1] = "EN";
					isPT = false;
				}
				else if(pathArray[1]=="EN")
				{
					pathArray[1] = "PT";
					isPT = true;
				}
				else 
				 	isPT = null;
	}
	return isPT;
}


function GetNavigationsFlags()
{
	pathArray = window.location.pathname.split( '/' );	
	isPT = false;
			
	if(pathArray.length >0)
	{
			if(pathArray.length>1)
				if(pathArray[1]=="PT")
				{
					pathArray[1] = "EN";
					isPT = false;
				}
				else if(pathArray[1]=="EN")
				{
					pathArray[1] = "PT";
					isPT = true;
				}
				else 
				 	isPT = null;
					
			newPathName ="";		
			for ( i = 0; i < pathArray.length && i < 2; i++ )
			{
				if(pathArray[i] !="")		
					newPathName += "/"+pathArray[i];
			}
			
			if(isPT != null)	
				navUrl = window.location.protocol + "//" + window.location.host + newPathName;
			else
				navUrl = window.location.protocol + "//" + window.location.host ;
		
		//para ja inibir o site em inglês - fica apenas link para PT
		/*
		if(isPT == null)
			return ("<div class='bandeiraPT'><a href='" + navUrl + "'><img src='/images/IDTSITE/img/pt_sel.gif' width='22' height='13' border='0' alt='PT' /></a></div><div class='bandeiraEN'><a href='#'><img src='/images/IDTSITE/img/en.gif' width='22' height='13' border='0'/></a></div>");
		else if(isPT)
			return ("<div class='bandeiraPT'><a href='" + navUrl + "'><img src='/images/IDTSITE/img/pt_sel.gif' width='22' height='13' border='0' alt='PT' /></a></div><div class='bandeiraEN'><a href='#'><img src='/images/IDTSITE/img/en.gif' width='22' height='13' border='0'/></a></div>");
		else
			return ("<div class='bandeiraPT'><a href='#'><img src='/images/IDTSITE/img/pt.gif' width='22' height='13' border='0' alt='PT' /></a></div><div class='bandeiraEN'><a href='" + navUrl + "'><img src='/images/IDTSITE/img/en_sel.gif' width='22' height='13' border='0' alt='EN' /></a></div>");
			*/
			
			return ("<div class='bandeiraPT'><a href='" + window.location.protocol + "//" + window.location.host + "/PT'><img src='/images/IDTSITE/img/pt_sel.gif' width='22' height='13' border='0' alt='PT' /></a></div><div class='bandeiraEN'><img src='/images/IDTSITE/img/en.gif' width='22' height='13' border='0'/></div>");
	}	
}

function GoToHomePage()
{  
    path_array = window.location.pathname.split( '/' );	
	var lang = null;
	
	if(path_array.length>1)
		lang = path_array[1]; 
		
	var protocol = window.location.protocol;
	var host = window.location.host;

    window.location = protocol + "//" + host + "/" + lang ;
     
}

function CriaArray (n) {
	this.length = n 
}

function WriteDate() 
{
   
	hoje = new Date()
	dia = hoje.getDate()
	dias = hoje.getDay()
	mes = hoje.getMonth()
	ano = hoje.getFullYear()
	
	if (dia < 10)
		dia = 0 + dia
	if (ano < 2000)
		ano = 19 + ano

	NomeDia = new CriaArray(7);
	NomeMes = new CriaArray(12);
	
	if(!isPT)
	{
		NomeDia[0] = "Domingo"
		NomeDia[1] = "Segunda-feira"
		NomeDia[2] = "Ter%E7a-feira"
		NomeDia[3] = "Quarta-feira"
		NomeDia[4] = "Quinta-feira"
		NomeDia[5] = "Sexta-feira"
		NomeDia[6] = "Sábado"
	   
		
		NomeMes[0] = "Janeiro"
		NomeMes[1] = "Fevereiro"
		NomeMes[2] = "Mar%E7o"
		NomeMes[3] = "Abril"
		NomeMes[4] = "Maio"
		NomeMes[5] = "Junho"
		NomeMes[6] = "Julho"
		NomeMes[7] = "Agosto"
		NomeMes[8] = "Setembro"
		NomeMes[9] = "Outubro"
		NomeMes[10] = "Novembro"
		NomeMes[11] = "Dezembro"
	}
	else
	{
		NomeDia[0] = "Sunday"
		NomeDia[1] = "Monday"
		NomeDia[2] = "Tuesday"
		NomeDia[3] = "Wednesday"
		NomeDia[4] = "Thursday"
		NomeDia[5] = "Friday"
		NomeDia[6] = "Saturday"

	
		NomeMes[0] = "January"
		NomeMes[1] = "February"
		NomeMes[2] = "March"
		NomeMes[3] = "April"
		NomeMes[4] = "May"
		NomeMes[5] = "June"
		NomeMes[6] = "July"
		NomeMes[7] = "August"
		NomeMes[8] = "September"
		NomeMes[9] = "October"
		NomeMes[10] = "November"
		NomeMes[11] = "December"
	}
	
	/*var spanDay;
	spanDay= document.getElementById("spanDay");	
	spanDay.innerHTML =  NomeDia[dias] + ",  "+ dia + " " + NomeMes[mes] +" " + ano;
	return ("" + unescape(NomeDia[dias]) + ",  "+ dia + " " + NomeMes[mes] +" " + ano +"");*/
	
	var sdate = null;
	sdate = ("" + unescape(NomeDia[dias]) + ",  "+ dia + " " + NomeMes[mes] +" " + ano +"");

	return sdate;
		
}

function GetLabelLetterSize()
{
	/*var tamanhoFonte;
	tamanhoFonte = document.getElementById('tamanhoFonte');*/
	
	if(!isPT)
		return "Tamanho da letra";
	else
		return "Letter size";
}
 

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=0 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1//Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

var delayb4scrollMissao=0 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeedMissao=1//Specify marquee scroll speed (larger is faster 1-10)
var pauseitMissao=1 //Pause marquee onMousever (0=no. 1=yes)?


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

var copyspeedMissao=marqueespeedMissao
var pausespeedMissao=(pauseitMissao==0)? copyspeedMissao:0
var actualheightMissao=''

function scrollmarquee()
{
    if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+1))
        cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
    else
    	cross_marquee.style.top=parseInt(marqueeheight)+1+"px"
}

function scrollmarqueeMissao()
{
	if (parseInt(cross_marqueeMissao.style.top)>(actualheightMissao*(-1)+1))
        cross_marqueeMissao.style.top=parseInt(cross_marqueeMissao.style.top)-copyspeedMissao+"px"
    else
    	cross_marqueeMissao.style.top=parseInt(vmarqueeMissaoheight)+1+"px"
}


function initializemarquee()
{
  	initializemarqueeDestaques();
  	
  	initializerMarqueeMissao();
}

function initializemarqueeDestaques()
{
	cross_marquee=document.getElementById("vmarquee")
    if( cross_marquee != null)
    {
	    cross_marquee.style.top=0
	    marqueeheight=document.getElementById("marqueecontainer").offsetHeight
	    actualheight=cross_marquee.offsetHeight
	    
	    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1)
	    { //if Opera or Netscape 7x, add scrollbars to scroll and exit
	        cross_marquee.style.height=marqueeheight+"px"
	        cross_marquee.style.overflow="scroll"
	        return
	    }
	    setTimeout('lefttime=setInterval("scrollmarquee()",50)', delayb4scroll)
    }
}

function initializerMarqueeMissao()
{
	cross_marqueeMissao=document.getElementById("vmarqueeMissao")
    if( cross_marqueeMissao != null)
    {
	    cross_marqueeMissao.style.top=0
	    vmarqueeMissaoheight=document.getElementById("marqueecontainerMissao").offsetHeight
	    actualheightMissao=cross_marqueeMissao.offsetHeight
	    
	    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1)
	    { //if Opera or Netscape 7x, add scrollbars to scroll and exit
	        cross_marqueeMissao.style.height=vmarqueeMissaoheight+"px"
	        cross_marqueeMissao.style.overflow="scroll"
	        return
	    }
	    setTimeout('lefttime=setInterval("scrollmarqueeMissao()",50)', delayb4scrollMissao)
    }
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee

/*******************************************
	CODIGO PARA MOSTRAR E ESCONDER O MAPA
*******************************************/

	
	function showMapa(objAbrir,objFechar)
	{
		objAbrir.style.display = '';
		objFechar.style.display = 'none';
	}
	
/* ******************************************
*********************************************
****************************************** */

/*FUNÇÂO PARA AUMENTAR/ DIMUNUIR TAMANHO DO TEXTO*/
var obj = {

  max:1.2,
  min:1,
  normal:1,
  
  inicializa:function()
  {

  document.body.style.fontSize = this.normal;
    
  var cook=GetCookie("pc_cookie_tamanho");

	if(cook!=null)
	{
	this.setvalores(cook);
	}
	else
	{
	this.setvalores(this.normal);
	}
	
  },
 
  mudaFonte: function(val) {
//	DelCookie("pc_cookie_tamanho");
	var tamanho = parseFloat(document.body.style.fontSize) ;
	
	tamanho += val;

    if ( tamanho > this.max ) 
    {
      tamanho = this.max;
    }
   
    if(tamanho < this.min )
    {
    tamanho=this.min;
    }
    
   
	this.setvalores(tamanho);
	

  },
  
  setvalores:function(tam)
  {
   
    document.body.style.fontSize = tam + "em";
   
    this.completa(document);
    if (navigator.appVersion.indexOf("MSIE ")!=-1)
    {
    
		if(document.frames.length>0)
		{
		document.all[0].document.body.style.fontSize = tam + "em";
		this.completa(document.all[0].document);
		var frame=document.getElementById('ifrm_list');
		if(frame!=null)
		    {
			frame.src=frame.src;
			}
		}
	}
	else
	{
	
		var frame=document.getElementById('ifrm_list');
		if(frame!=null)
		{
		frame.contentDocument.body.style.fontSize=tam + "em";
		this.completa(frame.contentDocument);
		}
		
	
	}
	
	
	//document.body.style.fontSize = tam + "em";
	
  
	
	SetCookie("pc_cookie_tamanho", tam,1);
	
 
  },
  
  completa:function(objecto)
  {
  if (objecto.getElementsByTagName) 
	 { 
      tags = new Array ('table'); 

      for (j = 0; j < tags.length; j ++) 
      { 
     
         var tagElements = objecto.body.getElementsByTagName(tags[j]); 
         for (i = 0; i < tagElements.length; i ++) 
         { 
            currentElement = tagElements[i]; 
            currentElement.style.fontSize = objecto.body.style.fontSize; 
         } 
      }
      }
  }
  
}

function mudaFonte(size)
{
obj.mudaFonte(size);

}


function SetCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	var ck = name+"="+value+expires+"; path=/";
	document.cookie = ck;
}

function GetCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function DelCookie(name)
{
	SetCookie(name,"",-1);
}


//VALIDAÇAO DE EMAIL NEWSLETTER
function VerificaEmail(ClientID)
{

	var browser=navigator.appName;	
	var email = document.getElementById(ClientID + '_txtEmail');
	var email_txt = email.value;
    var msg_error = document.getElementById(ClientID + '_lblMessage');

	if(email_txt.length == 0)
	{
		msg_error.style.visibility = "visible";
		
		if(browser=="Netscape")
			{msg_error.textContent = "introduza um email";}
		else if(browser == "Microsoft Internet Explorer")
			{msg_error.innerText= "introduza um email";}
			
	    return false;
	}
	else
	{
		var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
		
		if( !emailPattern.test(email_txt))
		{        	
	        msg_error.style.visibility = "visible";
	        
	        if(browser=="Netscape")
				{msg_error.textContent = "email incorrecto";}
			else if(browser == "Microsoft Internet Explorer")
				{msg_error.innerText= "email incorrecto";}
	        
	        return false;
	    }        
	    else
	    {
	        msg_error.style.visibility = "hidden";
	        
	        if(browser=="Netscape")
				{msg_error.textContent = "";}
			else if(browser == "Microsoft Internet Explorer")
				{msg_error.innerText= "";}
	        
	        return true;
	    }
	}             

}



//FUNÇÃO ABRE/FECHA
function Mostra(which) 
{
  if ( document.getElementById(which).style.display == "block" )
  {
  	document.getElementById(which).style.display="none";
  }else
  {
  	document.getElementById(which).style.display="block";
  }
}




/****************************************************************
*
* FUNÇÔES PARA A LISTA DE NOTICIAS
*
*****************************************************************/


/*******************************************
DESDOBRAMENTO NOTICIAS -  PRIMEIRO NIVEL
*******************************************/
var NoticiaSeleccionada = null;

function tdClickNoticias(table_cell)
{
	if (NoticiaSeleccionada == null)
	{
		//nunca executou esta função
		table_cell.className = 'menuNoticiasSel';
		NoticiaSeleccionada = table_cell;
	}
	else
	{
		if (NoticiaSeleccionada == table_cell)
		{
			//repor a cor original
			NoticiaSeleccionada.className = 'menuNoticias';
			NoticiaSeleccionada = null;
		}
		else
		{
			NoticiaSeleccionada.className = 'menuNoticias';
			table_cell.className = 'menuNoticiasSel';
			NoticiaSeleccionada = table_cell;
		}
		//já executou esta função
		
	}
}

function divNoticiasOver(table_cell) {
	if (table_cell != NoticiaSeleccionada)
	{table_cell.className = 'menuNoticiasOver';}
}
function divNoticiasOut(table_cell) {
	if (table_cell != NoticiaSeleccionada)
	{
		table_cell.className = 'menuNoticias';
	}
}


var objLastMenuShownNoticias = null;

function showNoticias(objMenu)
{
	if (objMenu == null) return;

	if (objLastMenuShownNoticias != null)
	{
		ShowDetalheNoticias(objLastMenuShownNoticias, false);
	}
	if (objLastMenuShownNoticias != objMenu)
	{
		ShowDetalheNoticias(objMenu, true);
		objLastMenuShownNoticias = objMenu;
	}
	else
	{
	objLastMenuShownNoticias = null;
	}
}

function ShowDetalheNoticias(objMenu, blnShow)
{
	if (objMenu == null || objMenu == 'noSub' || blnShow == null) return false;

	if (blnShow){
		objMenu.style.display = '';
	}
	else
	{
		objMenu.style.display = 'none';
	}
	return true;
}


/*******************************************
DESDOBRAMENTO NOTICIAS -  SEGUNDO NIVEL
*******************************************/
var NoticiaSeleccionada2 = null;

function tdClickNoticias2(table_cell)
{
	if (NoticiaSeleccionada2 == null)
	{
		//nunca executou esta função
		table_cell.className = 'menuNoticiasSel2';
		NoticiaSeleccionada2 = table_cell;
	}
	else
	{
		if (NoticiaSeleccionada2 == table_cell)
		{
			//repor a cor original
			NoticiaSeleccionada2.className = 'menuNoticias2';
			NoticiaSeleccionada2 = null;
		}
		else
		{
			NoticiaSeleccionada2.className = 'menuNoticias2';
			table_cell.className = 'menuNoticiasSel2';
			NoticiaSeleccionada2 = table_cell;
		}
		//já executou esta função
		
	}
}

function divNoticiasOver2(table_cell) {
	if (table_cell != NoticiaSeleccionada2)
	{table_cell.className = 'menuNoticiasOver2';}
}
function divNoticiasOut2(table_cell) {
	if (table_cell != NoticiaSeleccionada2)
	{
		table_cell.className = 'menuNoticias2';
	}
}


var objLastMenuShownNoticias2 = null;
function showNoticias2(objMenu)
{
	if (objMenu == null) return;

	if (objLastMenuShownNoticias2 != null)
	{
		ShowDetalheNoticias2(objLastMenuShownNoticias2, false);
	}
	if (objLastMenuShownNoticias2 != objMenu)
	{
		ShowDetalheNoticias2(objMenu, true);
		objLastMenuShownNoticias2 = objMenu;
	}
	else
	{
	    objLastMenuShownNoticias2 = null;
	}
}

function ShowDetalheNoticias2(objMenu, blnShow)
{
	if (objMenu == null || objMenu == 'noSub' || blnShow == null) return false;

	if (blnShow){
		objMenu.style.display = '';
	}
	else
	{
		objMenu.style.display = 'none';
	}
	return true;
}


/***************************************************
*
*  SEND TO A FRIEND
*
****************************************************/


function OpenOutlookDoc()
{
try
{

var outlookApp = new ActiveXObject("Outlook.Application");
alert(outlookApp);
var nameSpace = outlookApp.getNameSpace("MAPI");
alert(nameSpace );
mailFolder = nameSpace.getDefaultFolder(6);
alert(mailFolder );
mailItem = mailFolder.Items.add('IPM.Note.FormA');
mailItem.Subject="a subject test";
mailItem.To = "an@email.here";
mailItem.HTMLBody = "<b>bold</b>";
mailItem.display (0); 
}
catch(e)
{
alert(e);
// act on any error that you get
}
}


/**************************************************************
*
*  FUNCTION FOR PRINT FRIENDLY
*
***************************************************************/

function GetPrintLabel()
{
	var stringReturn ;
	
	var lang ;
	
	if(isPT == null)
	{
		lang = "Vers&atilde;o para Impress&atilde;o";
	}
	else if(!isPT )
	{
			lang = "Vers&atilde;o para Impress&atilde;o";
			
	}
	else
	{
		lang = "Print Friendly";

	}
				
	stringReturn = '<a href="javascript:printPages();" class="linkEventosCalendario"><img alt="" src="/images/IDTSITE/img/picto_print.gif" border="0">&nbsp;'+ lang +'</a>';
	
	return stringReturn;
}


function printPages()
{

	var divParent = document.getElementById('divPageContent');
	
   	var header;
   	var footer;
   	var divTop;
   	var newInner;
  
	if(divParent != null)
	{
		var re = new RegExp("<script([^<]*)?</script>", "gim");
		var innerHMTL = divParent.innerHTML;
		newInner= innerHMTL.replace(re,"");	
	
	 	
		var scriptsSources ='';
		scriptsSources += '<link rel="stylesheet" type="text/css" href="/images/IDTSITE/comum/style.css">';
		scriptsSources += '<link rel="stylesheet" type="text/css" href="/images/IDTSITE/comum/Customstyle.css">';
		scriptsSources += '<link rel="stylesheet" type="text/css" href="/images/IDTSITE/comum/IDTcoreStyle.css">';
		scriptsSources += '<script type="text/javascript" src="/images/IDTSITE/comum/swfobject.js"></script>';
		scriptsSources += '<script type="text/javascript" src="/images/IDTSITE/comum/functions.js"></script>';
		scriptsSources += '<script type="text/javascript" src="/images/IDTSITE/comum/menusSubMenus.js"></script>';
		scriptsSources += '<script type="text/javascript" src="/images/IDTSITE/comum/Utils.js"></script> ';
		
		scriptsSources +='<style type="text/css">';
		scriptsSources +='  #containerBarraTopo{display:none;} ';
		scriptsSources +='  #delegacoesColunaOutros{visibility:hidden; display:none;}';
		scriptsSources +='  #divPrintButtons{visibility:hidden; display:none;}';

		scriptsSources +='   </style>';		
		
		header ='<html><head><title>' ;		
		
		var pageTitle = '';
		  
		if(isPT == null)
			header += '</title>' + scriptsSources ;
		else if(!isPT )
				header += unescape('P&aacute;gina para Impress&atilde;o')+'</title>' + scriptsSources;
			else
				header += 'Print Page</title>' + scriptsSources ;
		  
		header += '</head><body onload="window.print();window.close();"><div id="divPageContent" style="margin-left:25px;">';		
		footer = '</div></body></html>';
				
		/*pop = window.open("","mywindow","status=0,toolbar=0,location=0,width=800,outerWidth=800,height=600"); 
		pop.document.write(header + newInner  + footer);
		pop.location.reload(true);
		pop.focus();*/
		
		if(isPT == null)
			pageTitle  = '';
		else if(!isPT )
			pageTitle  = unescape('P&aacute;gina para Impress&atilde;o');
		else
			pageTitle  = 'Print Page';

		 window.open(window.location.protocol + "//" + window.location.host  + "/images/IDTSITE/Paginas/PrintPage.htm", "" ,"resizable=no,scrollbars=no,width=800,outerWidth=800,height=600");
		
	}
 }


/********************************************************************
*
* FUNTICTION TO SHOW MODAL POP TO SEND TO A FRIEND
*
**********************************************************************/
function ShowPopSendFriend(url)
{
	var w = 400;
	var h = 300;
	var title = "Enviar Amigo";
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open (url, '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}















//-------------

function ClearDetailsTable()
{
	var tr_1 = document.getElementById('onetidinfoblock1'); 
	var tr_2 = document.getElementById('onetidinfoblock2');
	
	//var table_btn = documento.getElementById('onetIDListForm');
	//var btn_1 = document.getElementById('ctl00_PlaceHolderMain_g_4cb72b5d_1609_4db2_845b_37f802577547_ctl00_toolBarTbltop_RightRptControls_ctl01_ctl00_diidIOSaveItem');
	//var btn_2 = document.getElementById('ctl00_PlaceHolderMain_g_4cb72b5d_1609_4db2_845b_37f802577547_ctl00_toolBarTbl_RightRptControls_ctl01_ctl00_diidIOSaveItem');
	
	//if(btn_1 != null)
	{
	    //alert('encontrou botao 1');
	    //btn_1.style.visibility = "hidden";
	}
	//if(btn_2 != null)
	{
	    //alert('encontrou botao 2');
	    //btn_2.style.visibility = "hidden";
	}
	
	tr_1.style.visibility = "hidden";
	tr_2.style.visibility = "hidden";	
	
	//table_btn.style.visibility = "hidden";
	//btn_top.style.visibility = "hidden";
	//btn_bottom.style.visibility = "hidden";
	
		
}

function AllowNumericCharacters()
{
	if(event.keyCode <= 47 || event.keyCode > 57)
		return false;
}

function ClearEmailTextbox(clientID)
{
	var email = document.getElementById(clientID + '_txtEmail');
		
	if(email.value == "    Insira o seu email")
		{email.value = "";}
}

function ClearFields(clientID)
    {         
      var assunto = document.getElementById(clientID + '_txtAssunto');
      var idade = document.getElementById(clientID + '_txtIdade');
      var sexo_0 = document.getElementById(clientID + '_rbtnSexo_0');
      var sexo_1 = document.getElementById(clientID + '_rbtnSexo_1');
      var localidade = document.getElementById(clientID + '_txtLocalidade');
      var email = document.getElementById(clientID + '_txtEmail');
      var msg = document.getElementById(clientID + '_txtMensagem');
       
      if (sexo_0.checked)          
           sexo_0.checked = false;
      
      if (sexo_1.checked)          
           sexo_1.checked = false;
                 
        if(assunto != null)
            assunto.value = "";
        if(idade != null)
            idade.value = "";
        if(localidade != null)
            localidade.value = "";
        if(email != null)
            email.value = "";
        if(msg != null)
            msg.value = "";
            
            return false;
    }
    
    function VerifyFields(clientID)
    {    
          var browser=navigator.appName;
          var assunto = document.getElementById(clientID + '_txtAssunto');
          var idade = document.getElementById(clientID + '_txtIdade');
          var sexo_Masculino = document.getElementById(clientID + '_rbtnSexo_0');
          var sexo_Feminino = document.getElementById(clientID + '_rbtnSexo_1');
          //var localidade = document.getElementById(clientID + '_txtLocalidade');
          var email = document.getElementById(clientID + '_txtEmail');
          var msg = document.getElementById(clientID + '_txtMensagem');
          
          var lbl_assunto = document.getElementById(clientID + '_lblAssunto');
          var lbl_idade = document.getElementById(clientID + '_lblIdade');
          var lbl_sexo = document.getElementById(clientID + '_lblSexo');
          //var lbl_localidade = document.getElementById(clientID + '_lblLocalidade');
          var lbl_email = document.getElementById(clientID + '_lblEmail');
          var lbl_msg = document.getElementById(clientID + '_lblMensagem');
          
          var result = true;
          
          if(assunto.value.length == 0)
          {
                lbl_assunto.style.visibility = "visible";
                if(browser == "Microsoft Internet Explorer")
                    lbl_assunto.innerText = 'Por favor preencha o campo Assunto';
                else if(browser=="Netscape")
                    lbl_assunto.textContent = 'Por favor preencha o campo Assunto';
                result = false;
          }
          else 
          {
                lbl_assunto.value=''; 
                lbl_assunto.style.visibility = "hidden"; 
          }
          if(idade.value.length == 0)
          {
                lbl_idade.style.visibility = "visible";
                if(browser == "Microsoft Internet Explorer")
                    lbl_idade.innerText = 'Por favor preencha o campo Idade';
                else if(browser=="Netscape")
                    lbl_idade.textContent = 'Por favor preencha o campo Idade';
                result = false;
          }
          else 
          {
                lbl_idade.value =''; 
                lbl_idade.style.visibility = "hidden"; 
          }
          if(!sexo_Masculino.checked && !sexo_Feminino.checked)
          {
                lbl_sexo.style.visibility = "visible";
                if(browser == "Microsoft Internet Explorer")
                    lbl_sexo.innerText = 'Por favor preencha o campo Sexo';
                else if(browser=="Netscape")
                    lbl_sexo.textContent = 'Por favor preencha o campo Sexo';
                result = false;
          }
          else 
          {
                lbl_sexo.value =''; 
                lbl_sexo.style.visibility = "hidden"; 
          }
          if(email.value.length == 0)
          {
                lbl_email.style.visibility = "visible";
                if(browser == "Microsoft Internet Explorer")
                    lbl_email.innerText = 'Por favor preencha o campo Email';
                else if(browser=="Netscape")
                    lbl_email.textContent = 'Por favor preencha o campo Email';
                result = false;
          }
          else 
          {
               var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
                               
               if( !emailPattern.test(email.value))
               {   
                    lbl_email.style.visibility = "visible";
                    if(browser == "Microsoft Internet Explorer")
                        lbl_email.innerText = 'Email incorrecto';
                    else if(browser=="Netscape")
                        lbl_email.textContent = 'Email incorrecto';
                    result = false; 
               }
               else
               {
                    lbl_email.value =''; 
                    lbl_email.style.visibility = "hidden"; 
               }                
          }
          if(msg.value.length == 0)
          {
                lbl_msg.style.visibility = "visible";
                if(browser == "Microsoft Internet Explorer")
                        lbl_msg.innerText = 'Por favor preencha o campo Mensagem';
                else if(browser=="Netscape")
                        lbl_msg.textContent = 'Por favor preencha o campo Mensagem';
                result = false;
          }
          else 
          {
                lbl_msg.value =''; 
                lbl_msg.style.visibility = "hidden"; 
          }
          
          
          if(result == false)
            return false;
    
        
    }


//-------------
function setCookie()
{
	var exdate = new Date;
	var expiredays = 1;
	var c_name = 'IDT_Site_Cookie';
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie = 'IDT_Site_Cookie;path=/'
}

function chkCookie() 
{
	var dc = document.cookie;
	if(!dc.match('IDT_Site_Cookie'))
		alert(unescape('O seu browser n%e4o suporta cookies, %e9 necess%e1rio activar o suporte a cookies'));
}


/****************************************************************
*
* FUNÇÔES PARA A LISTA DE NOTICIAS
*
*****************************************************************/


/*******************************************
DESDOBRAMENTO FAQS -  PRIMEIRO NIVEL
*******************************************/
var FAQSeleccionada = null;

function tdClickFAQ(table_cell)
{
	if (FAQSeleccionada == null)
	{
		//nunca executou esta função
		table_cell.className = 'menuFAQSel';
		FAQSeleccionada = table_cell;
	}
	else
	{
		if (FAQSeleccionada == table_cell)
		{
			//repor a cor original
			FAQSeleccionada.className = 'menuFAQ';
			FAQSeleccionada = null;
		}
		else
		{
			FAQSeleccionada.className = 'menuFAQ';
			table_cell.className = 'menuFAQSel';
			FAQSeleccionada = table_cell;
		}
		//já executou esta função
		
	}
}

function divFAQOver(table_cell) {
	if (table_cell != FAQSeleccionada)
	{table_cell.className = 'menuFAQOver';}
}
function divFAQOut(table_cell) {
	if (table_cell != FAQSeleccionada)
	{
		table_cell.className = 'menuFAQ';
	}
}


var objLastMenuShownFAQ = null;

function showFAQ(objMenu)
{
	if (objMenu == null) return;

	if (objLastMenuShownFAQ != null)
	{
		ShowDetalheFAQ(objLastMenuShownFAQ, false);
	}
	if (objLastMenuShownFAQ != objMenu)
	{
		ShowDetalheFAQ(objMenu, true);
		objLastMenuShownFAQ = objMenu;
	}
	else
	{
	objLastMenuShownFAQ = null;
	}
}

function ShowDetalheFAQ(objMenu, blnShow)
{
	if (objMenu == null || objMenu == 'noSub' || blnShow == null) return false;

	if (blnShow){
		objMenu.style.display = '';
	}
	else
	{
		objMenu.style.display = 'none';
	}
	return true;
}


/*******************************************
DESDOBRAMENTO NOTICIAS -  SEGUNDO NIVEL
*******************************************/
var FAQSeleccionada2 = null;

function tdClickFAQ2(table_cell)
{
	if (FAQSeleccionada2 == null)
	{
		//nunca executou esta função
		table_cell.className = 'menuFAQSel2';
		FAQSeleccionada2 = table_cell;
	}
	else
	{
		if (FAQSeleccionada2 == table_cell)
		{
			//repor a cor original
			FAQSeleccionada2.className = 'menuFAQ2';
			FAQSeleccionada2 = null;
		}
		else
		{
			FAQSeleccionada2.className = 'menuFAQ2';
			table_cell.className = 'menuFAQSel2';
			FAQSeleccionada2 = table_cell;
		}
		//já executou esta função
		
	}
}

function divFAQOver2(table_cell) {
	if (table_cell != FAQSeleccionada2)
	{table_cell.className = 'menuFAQOver2';}
}
function divFAQOut2(table_cell) {
	if (table_cell != FAQSeleccionada2)
	{
		table_cell.className = 'menuFAQ2';
	}
}


var objLastMenuShownFAQ2 = null;
function showFAQ2(objMenu)
{
	if (objMenu == null) return;

	if (objLastMenuShownFAQ2 != null)
	{
		ShowDetalheFAQ2(objLastMenuShownFAQ2, false);
	}
	if (objLastMenuShownFAQ2 != objMenu)
	{
		ShowDetalheFAQ2(objMenu, true);
		objLastMenuShownFAQ2 = objMenu;
	}
	else
	{
		objLastMenuShownFAQ2 = null;
	}
}

function ShowDetalheFAQ2(objMenu, blnShow)
{
	if (objMenu == null || objMenu == 'noSub' || blnShow == null) return false;

	if (blnShow){
		objMenu.style.display = '';
	}
	else
	{
		objMenu.style.display = 'none';
	}
	return true;
}


