// -----------------------------------------------------------------------------------
//	PIB
//	http://www.webdourados.com.br
//	01/01/2009
// -----------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
// Função para Abrir Janelas em Camadas

function abrirDiv(janela)
	{
		if (janela=="1")
		{
			document.getElementById("visao").style.visibility="visible";
			document.getElementById("missao").style.visibility="hidden";
			document.getElementById("razao").style.visibility="hidden";
			document.getElementById("visao").style.height = document.body.scrollHeight;
			document.getElementById("visao").style.width = document.body.scrollWidth;
		}
		else if (janela=="2")
		{
			document.getElementById("visao").style.visibility="hidden";
			document.getElementById("missao").style.visibility="visible";
			document.getElementById("razao").style.visibility="hidden";
			document.getElementById("missao").style.height = document.body.scrollHeight;
			document.getElementById("missao").style.width = document.body.scrollWidth;
		}
		else if (janela=="3")
		{
	
			document.getElementById("visao").style.visibility="hidden";
			document.getElementById("missao").style.visibility="hidden";
			document.getElementById("razao").style.visibility="visible";
			document.getElementById("razao").style.height = document.body.scrollHeight;
			document.getElementById("razao").style.width = document.body.scrollWidth;
		}
	}
	
	function fecharDiv()
	{
		document.getElementById("visao").style.visibility="hidden";
		document.getElementById("missao").style.visibility="hidden";
		document.getElementById("razao").style.visibility="hidden";
	}
// -----------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
// Função Campo Busca
function limpaclass(campo) {
if (campo.value = "Pesquisar") {
campo.value = "";
} 
else
{
campo.value = "Pesquisar";
}
}

function limpaclass2(campo) {
if (campo.value < 1) {
campo.value = "Pesquisar";
} 
}
// -----------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
// Função Erro nos Campos de Formulários
function limpaerro(campo) {
campo.className = "formulario";
}
// -----------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
// Função para Exibir Data
function dataloga(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new 
Array("Domingo","Segunda-Feira","Ter&ccedil;a-Feira","Quarta-Feira","Quinta-Feira","Sexta-Feira","S&aacute;bado")
var montharray=new 
Array("Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro")
document.write(""+dayarray[day]+", "+daym+" de "+montharray[month]+" de "+year+"")
}
// -----------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
// Função Sombra
var gradientshadow={}
gradientshadow.depth=6 //Depth of shadow in pixels
gradientshadow.containers=[]

gradientshadow.create=function(){
var a = document.all ? document.all : document.getElementsByTagName('*')
for (var i = 0;i < a.length;i++) {
	if (a[i].className == "shadow") {
		for (var x=0; x<gradientshadow.depth; x++){
			var newSd = document.createElement("DIV")
			newSd.className = "shadow_inner"
			newSd.id="shadow"+gradientshadow.containers.length+"_"+x //Each shadow DIV has an id of "shadowL_X" (L=index of target element, X=index of shadow (depth) 
			if (a[i].getAttribute("rel"))
				newSd.style.background = a[i].getAttribute("rel")
			else
				newSd.style.background = "black" //default shadow color if none specified
			document.body.appendChild(newSd)
		}
	gradientshadow.containers[gradientshadow.containers.length]=a[i]
	}
}
gradientshadow.position()
window.onresize=function(){
	gradientshadow.position()
}
}

gradientshadow.position=function(){
if (gradientshadow.containers.length>0){
	for (var i=0; i<gradientshadow.containers.length; i++){
		for (var x=0; x<gradientshadow.depth; x++){
  		var shadowdiv=document.getElementById("shadow"+i+"_"+x)
			shadowdiv.style.width = gradientshadow.containers[i].offsetWidth + "px"
			shadowdiv.style.height = gradientshadow.containers[i].offsetHeight + "px"
			shadowdiv.style.left = gradientshadow.containers[i].offsetLeft + x + "px"
			shadowdiv.style.top = gradientshadow.containers[i].offsetTop + x + "px"
		}
	}
}
}

if (window.addEventListener)
window.addEventListener("load", gradientshadow.create, false)
else if (window.attachEvent)
window.attachEvent("onload", gradientshadow.create)
else if (document.getElementById)
window.onload=gradientshadow.create
// -----------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------
// Função para Exibir Topo do Site
function toposite(){
	var largura = document.body.scrollWidth; 
	if (largura > 800) {
		var topowidth = 1002; 
		var topoheight = 150; 
		var toposwf = "topo_pib1002x150.swf";
		}
	else
	{
		var topowidth = 772; 
		var topoheight = 116; 
		var toposwf = "topo_pib772x116.swf";
	}
	
	document.getElementById("corposite").style.width = topowidth;
		
	var s1 = new SWFObject("imagens/"+ toposwf,"topo",topowidth,topoheight,"8", "#FFFFFF");
	s1.addParam("wmode","transparent");
	s1.write("flashcontent");
}
// -----------------------------------------------------------------------------------

