// Fernando N. Cunha Lima - C1114696 - 11/09/2003 [FUNÇÃO rClick]
// Fernando N. Cunha Lima - C1114696 - 21/08/2003 [FUNÇÃO SelectBox]
// Fernando N. Cunha Lima - C1114696 - 26/06/2003 [FUNÇÃO PopUpWindow]
// Fernando N. Cunha Lima - C1114696 - 25/06/2003 [NOVAS FUNÇÕES]
// Fernando N. Cunha Lima - C1114696 - 27/05/2003 [FUNÇÃO menuInclusao]
// Fernando N. Cunha Lima - C1114696 - 26/05/2003 [FUNÇÃO TituloTela]
// Fernando N. Cunha Lima - C1114696 - 08/05/2003 [INICIO DO DOCUMENTO]

function rClick() {
	if (document.all) {
		return false;
	}
}
document.oncontextmenu=rClick;

function SelectBox(campo,n) { //Usar em: OnChange
	// campo = document.NomeDoFormulario.NomeDoCampo
	// n = Numero de opcoes sem contar com o vazio
	// Ex.:  onChange="SelectBox(document.form.inMes,12)"
	var i = campo.selectedIndex
	if (i != 0) {
		for (i; i<=n; i++) {
			var End = campo.options[i].value;
			window.open(End,"_self");
			return false;
		}
	}
}
function PopUpWindow(End,Name,w,h,Scroll,Resize) {
	window.open(End,Name,"width="+w+",height="+h+",scrollbars="+Scroll+",resizable="+Resize+"");
}
function Datar() {

  var data = new Date();
  var ano = data.getYear();
  var meses = new Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro");
  var mes = data.getMonth();
  var dia = data.getDate();

	if (dia < 10) {
		dia = "0"+data.getDate();
	} else {
		dia = data.getDate();
	}
	  
  document.write("Brasília, "+dia+" de "+meses[mes]+" de "+ano);
}
function ImagemAleatoria(EndImg1,EndImg2,EndImg3,EndImg4) {
	var n1 = Math.random();
		n1 = n1 * 100;
	
	if (n1 <= 25) {
		document.write("<!--a href='"+EndImg1+".html'-->");
		document.write("<img src='imagens/"+EndImg1+".gif' border='0'><!--/a-->");
	}
	if ((n1 <= 50)&&(n1 > 25)) {
		document.write("<!--a href='"+EndImg2+".html'-->");
		document.write("<img src='imagens/"+EndImg2+".gif' border='0'><!--/a-->");
	}
	if ((n1 <= 75)&&(n1 > 50)) {
		document.write("<!--a href='"+EndImg3+".html'-->");
		document.write("<img src='imagens/"+EndImg3+".gif' border='0'><!--/a-->");
	}
	if ((n1 <= 100)&&(n1 > 75)) {
		document.write("<!--a href='"+EndImg4+".html'-->");
		document.write("<img src='imagens/"+EndImg4+".gif' border='0'><!--/a-->");
	}
}
/* Codificação para menu */
//var ContextPath = "http://localhost:8080/nPortal";
//var ContextPath = "http://bsbwkst6755:8080/nPortal";
var ContextPath = "http://intranetceti/portal";

NS4 = (document.layers);
IE4 = (document.all);
ver4 = (NS4 || IE4);
IE5 = (IE4 && navigator.appVersion.indexOf("5.")!=-1);
isMac = (navigator.appVersion.indexOf("Mac") != -1);
isMenu = (NS4 || (IE4 && !isMac) || (IE5 && isMac));

function popUp(){return};
function popDown(){return};
if (!ver4) event=null;

if 	(isMenu) {
	menuVersion = 3;
	menuWidth = 120;
	childOverlap = 0;
	childOffset = 0;
	perCentOver = null;
	secondsVisible = 0.5;
	fntCol = "#000000";//cor da fonte
	fntSiz = "9";//tamanho da fonte  
	fntBold = true;//negrito
	fntItal = false;//italico
	fntFam = "Arial,sans-serif";//tipo da fonte
	backCol = "#FFC300";//cor de fundo sem mouse
	overCol = "#FFF666";//cor de fundo com mouse
	overFnt = "#000000";//cor da fonte com mouse 
	borWid = 0;//tamanho da borda
	borCol = "#000000";//cor da borda
	borSty = "solid";//estilo da borda
	itemPad = 3;
	imgSrc = ContextPath + "/imagens/img_submenu.gif"; //imagem da seta
	imgSiz = 9;//tamanho da imagem
	separator = 1;//espaço da separação das linhas
	separatorCol = "#FFF999";//cor da borda de separação
	isFrames = false;
	keepHilite = true; 
	clickStart = false;
	clickKill = false;
}
function menuInclusao() {
	document.write("<table background='../imagens/img_Cabecalho.gif' width='100%' height='70' cellpadding='3' cellspacing='3' border='0'>");
	document.write("	<tr>");
	document.write("		<td height='50%' width='10'>&nbsp;</td>");
	document.write("		<td height='50%'>&nbsp;</td>");
	document.write("		<td height='50%'>&nbsp;</td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td height='50%' width='10'>&nbsp;</td>");	
	document.write("		<td height='50%' valign='bottom'>");	
	document.write("		<a href='#' onClick='void(0);' onMouseOver='popUp(\"elMenu1\",event,25,70);' onMouseOut='popDown(\"elMenu1\");'>Tecnologia CETI</a> | ");
	document.write("		<a href='#' onClick='void(0);' onMouseOver='popUp(\"elMenu2\",event,131,70);' onMouseOut='popDown(\"elMenu2\");'>Espaço dos Colaboradores</a> | ");
	document.write("		<a href='#' onClick='void(0);' onMouseOver='popUp(\"elMenu3\",event,298,70);' onMouseOut='popDown(\"elMenu3\");'>Links</a>");
	document.write("		</td>");	
	document.write("		<td height='50%' align='right' valign='bottom' class='Data'><script language='JavaScript'>Datar();</script></td>");
	document.write("	</tr>");	
	document.write("</table>");	
}
function Cont(contadorTemp) { // O contador funciona com esse algoritimo.
	var hiddenV = contadorTemp;
	/* *************************************************
	Verifica o número de caracteres do INPUT HIDDEN e
	completa o resto dos dígitos com ZERO.
	************************************************* */
	if (hiddenV.length == 1) hiddenV = "0000" + hiddenV;
	if (hiddenV.length == 2) hiddenV = "000" + hiddenV;
	if (hiddenV.length == 3) hiddenV = "00" + hiddenV;
	if (hiddenV.length == 4) hiddenV = "0" + hiddenV;
	if (hiddenV.length == 5) hiddenV = hiddenV;

	/* *************************************************
	Atribui cada valor a sua respectiva imagem no
	contador.
	************************************************* */
	if (hiddenV.charAt(0) >= 1) {
		if (hiddenV.charAt(0) == 1) { document.write("<img src=\"imagens/ct_1.jpg\" border=\"0\" alt=\": Contador CETI :\">"); }
		if ((hiddenV.charAt(0) > 1)&&(hiddenV.charAt(0) <= 2)) document.write("<img src=\"imagens/ct_2.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(0) > 2)&&(hiddenV.charAt(0) <= 3)) document.write("<img src=\"imagens/ct_3.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(0) > 3)&&(hiddenV.charAt(0) <= 4)) document.write("<img src=\"imagens/ct_4.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(0) > 4)&&(hiddenV.charAt(0) <= 5)) document.write("<img src=\"imagens/ct_5.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(0) > 5)&&(hiddenV.charAt(0) <= 6)) document.write("<img src=\"imagens/ct_6.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(0) > 6)&&(hiddenV.charAt(0) <= 7)) document.write("<img src=\"imagens/ct_7.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(0) > 7)&&(hiddenV.charAt(0) <= 8)) document.write("<img src=\"imagens/ct_8.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(0) > 8)&&(hiddenV.charAt(0) <= 9)) document.write("<img src=\"imagens/ct_9.jpg\" border=\"0\" alt=\": Contador CETI :\">");
	} else {
		// Atribui ZERO a qualquer dígito alfabetico e zero.
		document.write("<img src=\"imagens/ct_0.jpg\" border=\"0\" alt=\": Contador CETI :\">");	
	}
	if (hiddenV.charAt(1) >= 1) {
		if (hiddenV.charAt(1) == 1) { document.write("<img src=\"imagens/ct_1.jpg\" border=\"0\" alt=\": Contador CETI :\">"); }
		if ((hiddenV.charAt(1) > 1)&&(hiddenV.charAt(1) <= 2)) document.write("<img src=\"imagens/ct_2.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(1) > 2)&&(hiddenV.charAt(1) <= 3)) document.write("<img src=\"imagens/ct_3.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(1) > 3)&&(hiddenV.charAt(1) <= 4)) document.write("<img src=\"imagens/ct_4.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(1) > 4)&&(hiddenV.charAt(1) <= 5)) document.write("<img src=\"imagens/ct_5.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(1) > 5)&&(hiddenV.charAt(1) <= 6)) document.write("<img src=\"imagens/ct_6.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(1) > 6)&&(hiddenV.charAt(1) <= 7)) document.write("<img src=\"imagens/ct_7.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(1) > 7)&&(hiddenV.charAt(1) <= 8)) document.write("<img src=\"imagens/ct_8.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(1) > 8)&&(hiddenV.charAt(1) <= 9)) document.write("<img src=\"imagens/ct_9.jpg\" border=\"0\" alt=\": Contador CETI :\">");
	} else {
		document.write("<img src=\"imagens/ct_0.jpg\" border=\"0\" alt=\": Contador CETI :\">");	
	}
	if (hiddenV.charAt(2) >= 1) {
		if (hiddenV.charAt(2) == 1) { document.write("<img src=\"imagens/ct_1.jpg\" border=\"0\" alt=\": Contador CETI :\">"); }
		if ((hiddenV.charAt(2) > 1)&&(hiddenV.charAt(2) <= 2)) document.write("<img src=\"imagens/ct_2.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(2) > 2)&&(hiddenV.charAt(2) <= 3)) document.write("<img src=\"imagens/ct_3.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(2) > 3)&&(hiddenV.charAt(2) <= 4)) document.write("<img src=\"imagens/ct_4.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(2) > 4)&&(hiddenV.charAt(2) <= 5)) document.write("<img src=\"imagens/ct_5.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(2) > 5)&&(hiddenV.charAt(2) <= 6)) document.write("<img src=\"imagens/ct_6.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(2) > 6)&&(hiddenV.charAt(2) <= 7)) document.write("<img src=\"imagens/ct_7.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(2) > 7)&&(hiddenV.charAt(2) <= 8)) document.write("<img src=\"imagens/ct_8.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(2) > 8)&&(hiddenV.charAt(2) <= 9)) document.write("<img src=\"imagens/ct_9.jpg\" border=\"0\" alt=\": Contador CETI :\">");
	} else {
		document.write("<img src=\"imagens/ct_0.jpg\" border=\"0\" alt=\": Contador CETI :\">");	
	}
	if (hiddenV.charAt(3) >= 1) {
		if (hiddenV.charAt(3) == 1) { document.write("<img src=\"imagens/ct_1.jpg\" border=\"0\" alt=\": Contador CETI :\">"); }
		if ((hiddenV.charAt(3) > 1)&&(hiddenV.charAt(3) <= 2)) document.write("<img src=\"imagens/ct_2.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(3) > 2)&&(hiddenV.charAt(3) <= 3)) document.write("<img src=\"imagens/ct_3.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(3) > 3)&&(hiddenV.charAt(3) <= 4)) document.write("<img src=\"imagens/ct_4.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(3) > 4)&&(hiddenV.charAt(3) <= 5)) document.write("<img src=\"imagens/ct_5.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(3) > 5)&&(hiddenV.charAt(3) <= 6)) document.write("<img src=\"imagens/ct_6.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(3) > 6)&&(hiddenV.charAt(3) <= 7)) document.write("<img src=\"imagens/ct_7.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(3) > 7)&&(hiddenV.charAt(3) <= 8)) document.write("<img src=\"imagens/ct_8.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(3) > 8)&&(hiddenV.charAt(3) <= 9)) document.write("<img src=\"imagens/ct_9.jpg\" border=\"0\" alt=\": Contador CETI :\">");
	} else {
		document.write("<img src=\"imagens/ct_0.jpg\" border=\"0\" alt=\": Contador CETI :\">");	
	}
	if (hiddenV.charAt(4) >= 1) {
		if (hiddenV.charAt(4) == 1) { document.write("<img src=\"imagens/ct_1.jpg\" border=\"0\" alt=\": Contador CETI :\">"); }
		if ((hiddenV.charAt(4) > 1)&&(hiddenV.charAt(4) <= 2)) document.write("<img src=\"imagens/ct_2.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(4) > 2)&&(hiddenV.charAt(4) <= 3)) document.write("<img src=\"imagens/ct_3.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(4) > 3)&&(hiddenV.charAt(4) <= 4)) document.write("<img src=\"imagens/ct_4.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(4) > 4)&&(hiddenV.charAt(4) <= 5)) document.write("<img src=\"imagens/ct_5.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(4) > 5)&&(hiddenV.charAt(4) <= 6)) document.write("<img src=\"imagens/ct_6.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(4) > 6)&&(hiddenV.charAt(4) <= 7)) document.write("<img src=\"imagens/ct_7.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(4) > 7)&&(hiddenV.charAt(4) <= 8)) document.write("<img src=\"imagens/ct_8.jpg\" border=\"0\" alt=\": Contador CETI :\">");
		if ((hiddenV.charAt(4) > 8)&&(hiddenV.charAt(4) <= 9)) document.write("<img src=\"imagens/ct_9.jpg\" border=\"0\" alt=\": Contador CETI :\">");
	} else {
		document.write("<img src=\"imagens/ct_0.jpg\" border=\"0\" alt=\": Contador CETI :\">");	
	}
}


/* Toda e qualquer função adicionado
 * pelo editor de HTML deve ser adicionada
 * abaixo destas linhas de comentário */
 
function MM_preloadImages() { //v3.0 [Dreamweaver MX]
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized [Dreamweaver MX]
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function MM_swapImgRestore() { //v3.0 [Dreamweaver MX]
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01 [Dreamweaver MX]
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0 [Dreamweaver MX]
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}