
function AlternadorImagens(){this.id_img='';this.prefixo='img/';this.nomearq='img';this.sufixo='.png'
this.num_img=2;this.tempo_ms=1000;this.indice_imagem=0;this.imagens=new Array();this.cfgParametros=cfgParametros;this.trocaImg=trocaImg;function cfgParametros(id,pre,arq,suf,num,tempo){this.id_img=id;this.prefixo=pre;this.nomearq=arq;this.sufixo=suf;this.num_img=num;this.tempo_ms=tempo;this.imagens[0]=new Image();this.imagens[0].src=this.prefixo+this.nomearq+1+this.sufixo;if(this.tempo_ms<5000){for(var i=1;i<this.num_img;i++){this.imagens[i]=new Image();this.imagens[i].src=this.prefixo+this.nomearq+(i+1)+this.sufixo;}}
return;}
function trocaImg(){var proxima=(this.indice_imagem+1)%this.num_img;if(this.imagens[proxima]==undefined){this.imagens[proxima]=new Image();this.imagens[proxima].src=this.prefixo+this.nomearq+(proxima+1)+this.sufixo;}
document.getElementById(this.id_img).src=this.imagens[this.indice_imagem].src;this.indice_imagem=proxima;}}
function imgcache(imagens){var i;var j=0;var imgobj=new Array();for(i in imagens){imgobj[j]=new Image();imgobj[j].src=imagens[i];j++;}}
function TemasEsqueleto(){this.propriedade=new Array();this.propriedade["img:Laterais"]=Array("html","backgroundImage");this.propriedade["cor:ReferenciaNavegacao:link_normal"]=Array("p#referencia_navegacao a","color");this.propriedade["cor:Menu:fundo_normal"]=Array("ul#navegacao li a","backgroundColor");this.propriedade["cor:Menu:borda_normal"]=Array("ul#navegacao li a","borderLeftColor");this.propriedade["cor:Menu:link_normal"]=Array("ul#navegacao li a","color");this.propriedade["cor:Menu:fundo_foco"]=Array("ul#navegacao li a:hover","backgroundColor");this.propriedade["cor:Menu:borda_foco"]=Array("ul#navegacao li a:hover","borderLeftColor");this.propriedade["cor:Menu:link_foco"]=Array("ul#navegacao li a:hover","color");this.propriedade["cor:SubMenu:fundo_normal"]=Array("ul#navegacao ul li a","backgroundColor");this.propriedade["cor:SubMenu:borda_normal"]=Array("ul#navegacao ul li a","borderLeftColor");this.propriedade["cor:SubMenu:link_normal"]=Array("ul#navegacao ul li a","color");this.propriedade["cor:SubMenu:fundo_foco"]=Array("ul#navegacao ul li a:hover","backgroundColor");this.propriedade["cor:SubMenu:borda_foco"]=Array("ul#navegacao ul li a:hover","borderLeftColor");this.propriedade["cor:SubMenu:link_foco"]=Array("ul#navegacao ul li a:hover","color");this.propriedade["cor:Conteudo:link_normal"]=Array("div#conteudo a","color");this.propriedade["cor:Conteudo:titulos"]=Array("h2, h3, h4","color");this.propriedade["cor:Conteudo:texto_forte"]=Array("div#conteudo strong","color");}
function TemasValores(){this.valor=new Array();this.valor["img:Laterais"]="";this.valor["cor:Container"]="#EEE";this.valor["cor:ReferenciaNavegacao:link_normal"]="#333";this.valor["cor:Menu:fundo_normal"]="#333";this.valor["cor:Menu:borda_normal"]="#808080";this.valor["cor:Menu:link_normal"]="#FFF";this.valor["cor:Menu:fundo_foco"]="#CCC";this.valor["cor:Menu:borda_foco"]="#222";this.valor["cor:Menu:link_foco"]="#222";this.valor["cor:SubMenu:fundo_normal"]="#FFF";this.valor["cor:SubMenu:borda_normal"]="#008";this.valor["cor:SubMenu:link_normal"]="#003";this.valor["cor:SubMenu:fundo_foco"]="#D3E2FF";this.valor["cor:SubMenu:borda_foco"]="#008";this.valor["cor:SubMenu:link_foco"]="#FFFF00";this.valor["cor:Conteudo:link_normal"]="#333"
this.valor["cor:Conteudo:titulos"]="#444";this.valor["cor:Conteudo:texto_forte"]="#444";}
function TemasPrincipal(cssarq){this.css=cssarq;this.erro=false;this.esqueleto=new TemasEsqueleto();this.tema=new TemasValores();this.temaAzul=new TemasValores();this.temaVerde=new TemasValores();this.temaVinho=new TemasValores();this.temaPreto=new TemasValores();this.regras=new Array();this.definirTemas=definirTemas;this.escolherTema=escolherTema;this.aplicarTema=aplicarTema;var x;if(document.styleSheets){for(x=0;x<document.styleSheets.length;x++){if(document.styleSheets[x].href.search(this.css)!='-1'){if(document.styleSheets[x].cssRules)
this.regras=document.styleSheets[x].cssRules;else if(document.styleSheets[x].rules)
this.regras=document.styleSheets[x].rules
break;}}}
if(!document.styleSheets||(document.styleSheets[x].href.search(this.css)=='-1'))
this.erro=true;function definirTemas(){this.temaPreto.valor["img:Laterais"]="url(img/tema_preto_bg.jpg)"
this.temaPreto.valor["cor:Container"]="#EEE"
this.temaPreto.valor["cor:ReferenciaNavegacao:link_normal"]="#333"
this.temaPreto.valor["cor:Menu:fundo_normal"]="#333"
this.temaPreto.valor["cor:Menu:borda_normal"]="#808080"
this.temaPreto.valor["cor:Menu:link_normal"]="#FFF"
this.temaPreto.valor["cor:Menu:fundo_foco"]="#CCC"
this.temaPreto.valor["cor:Menu:borda_foco"]="#222"
this.temaPreto.valor["cor:Menu:link_foco"]="#222"
this.temaPreto.valor["cor:SubMenu:fundo_normal"]="#FFF";this.temaPreto.valor["cor:SubMenu:borda_normal"]="#000";this.temaPreto.valor["cor:SubMenu:link_normal"]="#000";this.temaPreto.valor["cor:SubMenu:fundo_foco"]="#CCC";this.temaPreto.valor["cor:SubMenu:borda_foco"]="#888";this.temaPreto.valor["cor:SubMenu:link_foco"]="#000";this.temaPreto.valor["cor:Conteudo:link_normal"]="#333"
this.temaPreto.valor["cor:Conteudo:titulos"]="#444";this.temaPreto.valor["cor:Conteudo:texto_forte"]="#444";this.temaAzul.valor["img:Laterais"]="url(img/tema_azul_bg.jpg)";this.temaAzul.valor["cor:Container"]="#f0f0ff";this.temaAzul.valor["cor:ReferenciaNavegacao:link_normal"]="#003";this.temaAzul.valor["cor:Menu:fundo_normal"]="#003";this.temaAzul.valor["cor:Menu:borda_normal"]="#000080";this.temaAzul.valor["cor:Menu:link_normal"]="#FFF";this.temaAzul.valor["cor:Menu:fundo_foco"]="#0843a1";this.temaAzul.valor["cor:Menu:borda_foco"]="#1588ab";this.temaAzul.valor["cor:Menu:link_foco"]="#ffff00";this.temaAzul.valor["cor:SubMenu:fundo_normal"]="#FFF";this.temaAzul.valor["cor:SubMenu:borda_normal"]="#008";this.temaAzul.valor["cor:SubMenu:link_normal"]="#003";this.temaAzul.valor["cor:SubMenu:fundo_foco"]="#D3E2FF";this.temaAzul.valor["cor:SubMenu:borda_foco"]="#008";this.temaAzul.valor["cor:SubMenu:link_foco"]="#008";this.temaAzul.valor["cor:Conteudo:link_normal"]="#003";this.temaAzul.valor["cor:Conteudo:titulos"]="#003";this.temaAzul.valor["cor:Conteudo:texto_forte"]="#003";this.temaVerde.valor["img:Laterais"]="url(img/tema_verde_bg.jpg)";this.temaVerde.valor["cor:Container"]="#f0fff0";this.temaVerde.valor["cor:ReferenciaNavegacao:link_normal"]="#030";this.temaVerde.valor["cor:Menu:fundo_normal"]="#326342";this.temaVerde.valor["cor:Menu:borda_normal"]="#040";this.temaVerde.valor["cor:Menu:link_normal"]="#fff";this.temaVerde.valor["cor:Menu:fundo_foco"]="#030";this.temaVerde.valor["cor:Menu:borda_foco"]="#0C0";this.temaVerde.valor["cor:Menu:link_foco"]="#ffa500";this.temaVerde.valor["cor:SubMenu:fundo_normal"]="#FFF";this.temaVerde.valor["cor:SubMenu:borda_normal"]="#080";this.temaVerde.valor["cor:SubMenu:link_normal"]="#030";this.temaVerde.valor["cor:SubMenu:fundo_foco"]="#E3FAC8";this.temaVerde.valor["cor:SubMenu:borda_foco"]="#080";this.temaVerde.valor["cor:SubMenu:link_foco"]="#080";this.temaVerde.valor["cor:Conteudo:link_normal"]="#030";this.temaVerde.valor["cor:Conteudo:titulos"]="#050";this.temaVerde.valor["cor:Conteudo:texto_forte"]="#050";this.temaVinho.valor["img:Laterais"]="url(img/tema_vinho_bg.jpg)"
this.temaVinho.valor["cor:Container"]="#fff0f0"
this.temaVinho.valor["cor:ReferenciaNavegacao:link_normal"]="#300"
this.temaVinho.valor["cor:Menu:fundo_normal"]="#500"
this.temaVinho.valor["cor:Menu:borda_normal"]="#800"
this.temaVinho.valor["cor:Menu:link_normal"]="#fff"
this.temaVinho.valor["cor:Menu:fundo_foco"]="#a60000"
this.temaVinho.valor["cor:Menu:borda_foco"]="#bb696f"
this.temaVinho.valor["cor:Menu:link_foco"]="#fff"
this.temaVinho.valor["cor:SubMenu:fundo_normal"]="#FFF";this.temaVinho.valor["cor:SubMenu:borda_normal"]="#800";this.temaVinho.valor["cor:SubMenu:link_normal"]="#300";this.temaVinho.valor["cor:SubMenu:fundo_foco"]="#E8C2BF";this.temaVinho.valor["cor:SubMenu:borda_foco"]="#800";this.temaVinho.valor["cor:SubMenu:link_foco"]="#800";this.temaVinho.valor["cor:Conteudo:link_normal"]="#300"
this.temaVinho.valor["cor:Conteudo:titulos"]="#500";this.temaVinho.valor["cor:Conteudo:texto_forte"]="#500";}
function escolherTema(num){switch(num){default:case 0:this.tema=this.temaPreto;break;case 1:this.tema=this.temaAzul;break;case 2:this.tema=this.temaVinho;break;case 3:this.tema=this.temaVerde;break;}}
function aplicarTema(tema){var x,i;var regra;if(this.erro)
alert("Não é possível usar este recurso na configuração atual.");else
for(x in this.esqueleto.propriedade)
for(i=0;i<this.regras.length;i++)
if(this.regras[i].selectorText!=undefined)
if(this.regras[i].selectorText.toLowerCase()==this.esqueleto.propriedade[x][0])
if(this.regras[i].style[this.esqueleto.propriedade[x][1]]!=undefined)
this.regras[i].style[this.esqueleto.propriedade[x][1]]=tema.valor[x];}}