if (document.images) {
}
/* Funcao de mostrar mensagem na barra de status. */

function bs(msgStr) {
    window.status = msgStr;
    document.ReturnValue = true;
}

/* Funcao de mouse over */

function img(id, newSrc) {
    var theImage = FindImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}
/* Funcao que localiza e troca o botao (imagem) pelo nome. */

function FindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

// stop hiding -->
//--&gt;

	
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_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;
}

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_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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts. This may be used freely as long as this msg is intact!
I will also appriciate any links you could give me.
********************************************************************************/
//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
/*********************************************************************************
These are the variables you have to set:
*********************************************************************************/


//The speed of the timeout between each scroll.
timSpeed=1

//The height of the container (change this when it scrolls to much or to little)
contHeight=50

/*********************************************************************************
This is the object constructor function, which applies 
methods and properties to the Cross-browser layer object
*********************************************************************************/
function makeScrollObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'										
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;		
	this.height=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.top=b_gettop										
	return this
}
//Getting the top for the top method
function b_gettop(){
	var gleft=(bw.ns4 || bw.ns5) ? eval(this.css.top):eval(this.css.pixelTop);
	return gleft;
}
//Variables
var scrollTim;
var active=0;
/*********************************************************************************
The scroll function. Checks what way to scroll and checks if the
layer is not already on top or bottom.
*********************************************************************************/
function scroll(speed){
	clearTimeout(scrollTim)
	way=speed>0?1:0
	if((!way && oScroll[active].top()>-oScroll[active].height+contHeight) || (oScroll[active].top()<0 && way)){
		oScroll[active].css.top=oScroll[active].top()+speed
		scrollTim=setTimeout("scroll("+speed+")",timSpeed)
	}
}
//Clears the timeout so the scroll stops, this is called onmouseout.
function noScroll(){
	clearTimeout(scrollTim)
}
/*********************************************************************************
Changes the active layer. Hides the one that's visible and
shows the "new" one. Also set's the new layers top to
0 so it starts at top.
*********************************************************************************/
function changeActive(num){
	oScroll[active].css.visibility='hidden'
	active=num
	oScroll[active].css.top=0
	oScroll[active].css.visibility='visible'
}
/*********************************************************************************
Initilizes the page, makes a oScroll Array and calls the object constructor.
Here you can add as many scrollObjects as you want
*********************************************************************************/
function scrollInit(){
	oScroll=new Array()
	oScroll[0]=new	makeScrollObj('divScroll1','divCont')
	oScroll[0].css.visibility='visible'
	oControl=new makeScrollObj('divControl')
	oControl.css.visibility='visible'
}
/*********************************************************************************
Executes the scrollInit function on pageload.
*********************************************************************************
onload=scrollInit;*/


// inicio script menu
var head="display:''"

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

function checkcontained(e){
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
}
else{
foldercontent.style.display="none"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained
// fim script menu

//esta função confere o formulário de contatos
function confere_contatos()
	{
	//esta expressão verifica a validade do e-mail...
	eMail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	
	//esta variável controla se existem erros no formulário...
	ok = true
	
	// este array armazena os erros possíveis do formulário...
	erro = new Array
	
	//esta variável exibe ao final todos os erros encontrados no formulário...
	alerta = "Por favor, para prosseguir com o cadastro, queira por favor\r"
	erro[0] = "preencher ou corrigir os seguintes campos:\r\r" 	
	
	//testa se o usuário preencheu o campo com seu nome...
	nnome = document.dados.nome.value.length
	if ((document.dados.nome.value == "")||(nnome < 3)){
		erro[1] = "- Seu nome\r"
		ok = false
	}	
	
	//verifica se o existe um ddd digitado e se o mesmo é válido...	
	ndddtel = document.dados.dddtel.value.length
	if ((dados.dddtel.value.length == 0)||(ndddtel < 2)){
		erro[2] = "- Seu DDD\r"
		ok = false		
	}

	//verifica se o existe um telefone digitado e se o mesmo é válido...	
	ntel = document.dados.tel.value.length
	if ((dados.tel.value.length == 0)||(ntel < 6)){
		erro[3] = "- Seu telefone\r"
		ok = false		
	}

	//verifica se o existe um e-mail digitado e se o mesmo é válido...	
	if ((dados.email.value.length == 0)||(!eMail.test(dados.email.value))) {
		erro[4] = "- Seu e-mail\r"
		ok = false		
	}
 
	//verifica se o campo assunto foi preenchido...
	if ((document.dados.assunto.value == "")){
		erro[5] = "- O assunto da sua mensagem\r"
		ok = false
	}
	
	//verifica se o campo texto foi preenchido...
	if (document.dados.texto.value == ""){
		erro[6] = "- Sua mensagem\r"
		ok = false
	}
	
	if (ok == true){ //se o formulário estiver ok ele é submetido...
		document.dados.submit()
		}
		else { //se não é exibida uma mensagem com todos os erros do formulário...
				for	(i=0; i<7; i++){
						if (erro[i] != null){
							alerta = alerta + erro[i];
						}
				}
				alert(alerta)
				if (erro[1] != null){
					document.dados.nome.focus()
				}
				else if (erro[2] != null){
					document.dados.dddtel.focus()
				}
				else if (erro[3] != null){
					document.dados.tel.focus()
				}
				else if (erro[4] != null){
					document.dados.email.focus()
				}
				else if (erro[5] != null){
					document.dados.assunto.focus()
				}
				else {
					document.dados.texto.focus()
				}
		}
}
// -->


//esta função confere o primeiro formulário de curriculos
function confere_curriculos01()
	{
	eMail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	ok = true
	erro = new Array

	alerta = "Por favor, para prosseguir com o cadastro, queira por favor\r"
	erro[0] = "preencher ou corrigir os seguintes campos:\r\r" 	
	
	npnome = document.dados.pnome.value.length
	if ((document.dados.pnome.value == "")||(npnome < 3)){
		erro[1] = "- Seu primeiro nome\r"
		ok = false
	}	

	nunome = document.dados.unome.value.length
	if ((document.dados.unome.value == "")||(nunome < 3)){
		erro[2] = "- Seu ultimo nome\r"
		ok = false
	}	

	nendereco = document.dados.endereco.value.length
	if ((document.dados.endereco.value == "")||(nendereco < 3)){
		erro[3] = "- Seu endereco\r"
		ok = false
	}	


	ncidade = document.dados.cidade.value.length
	if ((dados.cidade.value.length == 0)||(ncidade < 3)){
		erro[4] = "- Sua cidade\r"
		ok = false		
	}

	ncep = document.dados.cep.value.length
	if ((dados.cep.value.length == 0)||(ncep < 8)){
		erro[5] = "- Seu CEP\r"
		ok = false		
	}

	nuf = document.dados.uf.value.length
	if ((dados.uf.value.length == 0)||(nuf < 2)){
		erro[6] = "- Seu estado\r"
		ok = false		
	}

	ntelcom = document.dados.telcom.value.length
	if ((dados.telcom.value.length == 0)||(ntelcom < 7)){
		erro[7] = "- Seu telefone comercial\r"
		ok = false		
	}

	ntelres = document.dados.telres.value.length
	if ((dados.telres.value.length == 0)||(ntelres < 7)){
		erro[8] = "- Seu telefone residencial\r"
		ok = false		
	}

	if ((dados.email.value.length == 0)||(!eMail.test(dados.email.value))) {
		erro[9] = "- Seu e-mail\r"
		ok = false		
	}

	if (ok == true){ //se o formulário estiver ok ele é submetido...
		document.dados.submit()
		}
		else { //se não é exibida uma mensagem com todos os erros do formulário...
				for	(i=0; i<10; i++){
						if (erro[i] != null){
							alerta = alerta + erro[i];
						}
				}
				alert(alerta)
				if (erro[1] != null){
					document.dados.pnome.focus()
				}
				else if (erro[2] != null){
					document.dados.unome.focus()
				}
				else if (erro[3] != null){
					document.dados.endereco.focus()
				}
				else if (erro[4] != null){
					document.dados.cidade.focus()
				}
				else if (erro[5] != null){
					document.dados.cep.focus()
				}
				else if (erro[6] != null){
					document.dados.uf.focus()
				}
				else if (erro[7] != null){
					document.dados.telcom.focus()
				}
				else if (erro[8] != null){
					document.dados.telres.focus()
				}
				else {
					document.dados.email.focus()
				}
		}
}
// -->

