<!--

function allPrint(layer){
   eval(layer).style.overflow = "visible";
   window.print();
   eval(layer).style.overflow = "auto";
}


// É possivel a entrada apenas de números
function ValidaNumero( valor ) {
  expressao = /[\D]/g;
  return valor.replace( expressao,'' );
}

// Pula para o campo desejado
function PulaCampo( campo1,campo2 ) {
if ( campo1.value.length == campo1.maxLength ) 
		VaiParaCampo( campo2 );
 }

// Seta foco no elemento e limpa seu contéudo
function VaiParaCampo( campo ) 	{
		eval( campo ).focus();
		eval( campo ).value = '';
	}
	
function ValidaAlfaNumerico( valor ) {
  expressao = /[\W\xE0|\xE1|\xE2|\xE3|\xE4|\xE7|\xE9|\xEA|\xED|\xF3|\xF4|\xF5|\xFA|\xC0|\xC1|\xC2|\xC3|\xC4|\xC7|\xC9|\xCA|\xCD|\xD3|\xD4|\xD5|\xDA|\x25|\x20]\s/g;
  return valor.replace( expressao,'' );
}	

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  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();
}
MM_reloadPage(true);

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}	
	

function MM_preloadImages() { //v3.0
  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_swapImgRestore() { //v3.0
  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_swapImage() { //v3.0
  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];}
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

//****************************Menu*************************************//
var layerTimer;
var layerTimer2;
var oldvalue; 
var obj; 
var x=1
var img=21; //tamanho da imagem

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  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();
}
MM_reloadPage(true);


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

//fecha o menu
function fecha() 
{
 var n=9;  //numero de camadas 
      if (x<n) x++;
		else
		{
		  for (i=2;i<=n;i++)
		   {
		    obj2 = MM_findObj("l"+i);
		    eval("obj2.style.top ='"+img+"'");

		   }
		  MM_swapImgRestore();
		  x=0;    
		}

	layerTimer = setTimeout("fecha()",500);
		
}



//abre o menu
function abre(valor) { //v3.0
  x=0;
  
  obj = MM_findObj("l"+valor);
  obj2 = MM_findObj("l"+(valor+1));
  tbl = MM_findObj("t"+valor);
  
  clearTimeout(layerTimer);  
  fecha2();    
  oldvalue = eval("obj2.style.top");
  tblheight = eval("tbl.height");

	
  eval("obj2.style.top ='"+tblheight+"'");
  eval("MM_swapImage('n"+valor+"','','../imagens/botoes_menu/tit"+valor+"_on.jpg',1)")
 
   

}


function fecha2() 
{
 var n=9;  //numero de camadas 
 MM_swapImgRestore();
 for (i=2;i<=n;i++)
   {
		obj3 = MM_findObj("l"+i);
		eval("obj3.style.top ='"+img+"'");
   }

}




function startOver()
	{
	x=0
	clearTimeout(layerTimer);
	}
	
//*********************************Fim Menu******************************//	


//seleciona uma imagem ao carregar o site
function randimages(num)
{

 hoje = new Date()
 numero_b = num
 segundos = hoje.getSeconds()

 numero = segundos % numero_b

 imagem  = "../Imagens/random/image"+numero+".jpg"

 document.write('<img src="'+imagem+'" border=0>');
  
}

//***********************************notícias********************************//
// BrowserCheck Object
// provides browser checking variables
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck()

var contador
function noticias() {
	DynLayerInit()
	windowHeight = SW.h
	contentHeight = (is.ns)? SC.doc.height : SC.event.scrollHeight
	offsetHeight = contentHeight - windowHeight
	abaixo()
}

function rola_acima () {
	if (SC.y < 0) SC.moveBy(0,2)
}

function acima() {
	clearInterval(contador)
	contador=setInterval("rola_acima()",60)
}
  
function rola_abaixo() {
	if (SC.y > -offsetHeight){ 
	SC.moveBy(0,-2)
	if (SC.y <= -offsetHeight){
		SC.y = 0}
		}
}

function abaixo() {
	contador=setInterval("rola_abaixo()",100)
}

function para() {
	clearInterval(contador)
	init()
}

function parada() {
	clearInterval(contador)
}

//**********************************fim notícias**************************//
//**********************************mensagem status**************************//


timeID = 5;
stcnt = 11;
msg = "0800 263399 - Senhas para internações ,remoções;  3233-8855 - Informações administrativas, prorrogações.";
wmsg = new Array(33);
wmsg[0] = msg;
blnk = "                                                               ";
for (i = 1; i < 32; i++) {
b = blnk.substring(0, i);
wmsg[i] = "";
for (j = 0; j < msg.length; j++) wmsg[i] = wmsg[i] + msg.charAt(j) + b;
}

function mensagem() {
if (stcnt > -1) str = wmsg[stcnt]; 
else str = wmsg[0];
if (stcnt-- < -40) stcnt = 31;
status = str;
clearTimeout(timeID);
timeID = setTimeout("mensagem()", 150);

}

//**********************************fim mensagem status**************************//


//*****************************mensagem status escrevendo*************************//

var current = 0
var x = 0
var speed = 150 //tempo de preenchimento
var speed2 = 3000 //tempo de espera

function initArray(n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '
}
}

txt = new initArray(3) //quantidade de mensagens
//querendo por mais mensagens, copie a linha e mude o número obedecendo a sequência.
txt[0]="0800 263399  ->  Central de Regulação 24h. Senhas para internações ,remoções"
txt[1]="3233-8855  ->  Informações administrativas, prorrogações"
txt[2]="Tele-Atendimento Caberj. Ligou Resolveu."


function wiper() {
var m = txt[current]
window.status = m.substring(0, x++) + "_" //este é o caracter que aparece preenchendo o texto
if (x == m.length + 1) {
x = 0
current++
if (current > txt.length - 1) {
current = 0
}
setTimeout("wiper()", speed2)
}
else {
setTimeout("wiper()", speed)
}
}

//*****************************fim mensagem status escrevendo*************************//


//****************************relogio***************************
var months=new Array(13);
months[1]="Jan";
months[2]="Fev";
months[3]="Mar";
months[4]="Abr";
months[5]="Mai";
months[6]="Jun";
months[7]="Jul";
months[8]="Ago";
months[9]="Set";
months[10]="Out";
months[11]="Nov";
months[12]="Dez";

var dia=new Array(7);
dia[1]="Dom";
dia[2]="Seg";
dia[3]="Ter";
dia[4]="Qua";
dia[5]="Qui";
dia[6]="Sex";
dia[7]="Sab";


var clockid=new Array()
var clockidoutside=new Array()
var i_clock=-1
var thistime= new Date()
var lmonth=months[thistime.getMonth() + 1];
var ldia=dia[thistime.getDay() + 1];
var date=thistime.getDate();
var year=thistime.getYear();
if (year < 2000)    
year = year + 1900; 
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
var thistime = hours+":"+minutes+":"+seconds
	
function writeclock() {
	i_clock++
	if (document.all || document.getElementById || document.layers) {
		clockid[i_clock]="clock"+i_clock
		document.write("<span id='"+clockid[i_clock]+"' style='position:relative'>" +thistime+"</span>")
	}
}
function writedata(){
document.write("<span id=3 style='position:relative'>"+ldia+", "+date+" de "+lmonth+" de " +year+"</span>")
}

function writedataR(){ //data resumida
document.write("<span id=3 style='position:relative'>Rio,"+date+"."+lmonth+"." +year+"</span>")
}

function clockon() {
	thistime= new Date()
	hours=thistime.getHours()
	minutes=thistime.getMinutes()
	seconds=thistime.getSeconds()
	if (eval(hours) <10) {hours="0"+hours}
	if (eval(minutes) < 10) {minutes="0"+minutes}
	if (seconds < 10) {seconds="0"+seconds}
	thistime = hours+":"+minutes+":"+seconds
		
	if (document.all) {
		for (i=0;i<=clockid.length-1;i++) {
			var thisclock=eval(clockid[i])
			thisclock.innerHTML=thistime
		}
	}
	
	if (document.getElementById) {
		for (i=0;i<=clockid.length-1;i++) {
			document.getElementById(clockid[i]).innerHTML=thistime
		}
	}
	var timer=setTimeout("clockon()",1000)
}
window.onload=clockon

//***********************fim relogio
//**************busca
<!-- Hide from older browsers...

//Preload search icon
var search_icon_off = new Image(); 
search_icon_off.src = "/Imagens/site_search_icon_off.gif";

//Check the form before submitting
function CheckForm () {

	//Check for a word to search
	if (document.frmSiteSearch.search.value==""){
		alert("Por favor, entre com pelo menos uma palavra para a busca");
		document.frmSiteSearch.search.focus();
		return false;
	}
	
	return true
}


//-->	