 var texto, foto,total,idTime,ifoto,esq, iVz, rot;
 iVz=1;
 total=3;
 foto=0;
 ifoto=1;
 esq=0;
 topo=200;
 rot=0;
function Abrir(){
  parent.window.location='news.php?noticia='+document.getElementById('c'+foto).value;
}
function BaixarT(){
  topo=topo+5;
  document.getElementById("Text").style.top=topo+'px';
  if (topo>=250) { Mudar(foto); }
  else { clearTimeout(idTime);idTime=window.setTimeout("BaixarT()",100);}
}
function SubirT(){
  topo=topo-5;
  document.getElementById("Text").style.top=topo+'px';
  if (topo<=195) { MudarT(); }
  else { clearTimeout(idTime);idTime=window.setTimeout("SubirT()",100);}
}
function BaixarF(){
 if(iVz){
  esq=esq+20;
  document.getElementById("ift").style.left=esq+'px';
  if (esq>=0) { SubirT(); }
  else { clearTimeout(idTime);idTime=window.setTimeout("BaixarF()",100);}
 }
}
function SubirF(){
 if(iVz){
  esq=esq-20;
  document.getElementById("ift").style.left=esq+'px';
  if (esq<=-320) { SubirT(); }
  else { clearTimeout(idTime);idTime=window.setTimeout("SubirF()",100);}
 }
}
function MudarF(){  
  if (foto<total){ foto++; BaixarT();}
  else{ foto=0; rot++;
	if(rot>1){ window.open('mudanoticias.php','contador');}
	else{ BaixarT(); }
  }
  
}
function MFoto(){
  if(ifoto==1){if(esq<0){BaixarF();}}
  else{if(esq>-1){SubirF();}}
}
function Iniciar2(){clearTimeout(idTime);idTime=window.setTimeout("MudarF()",3000); iVz=1;}
function Iniciar1(cod){
         foto=cod;
         ifoto=1;
         clearTimeout(idTime);
         topo=200;document.getElementById("Text").style.top=topo+'px';
         esq=0;
         document.getElementById("ift").style.left=esq+'px';
         document.getElementById('ftG1').src=document.getElementById('i'+foto).value;
         document.getElementById('rot').innerHTML=''+document.getElementById('t'+foto).value;
         for(i=0;i<4;i++){document.getElementById('l'+i).style.backgroundImage='';}
         document.getElementById('l'+foto).style.backgroundImage='url(imagens/seta_azul.gif)';
         }
function Iniciar(){ 
  valor=7;
  document.getElementById("ift").style.left=esq+'px';
  document.getElementById("Text").style.opacity = valor/10;
  document.getElementById("Text").style.filter = 'alpha(opacity=' + valor*10 + ')';
  document.getElementById('rot').innerHTML=document.getElementById('t0').value;
  clearTimeout(idTime);
  idTime=window.setTimeout("MudarF()",3000); 
}
function MTexto(){
  document.getElementById('rot').innerHTML=''+document.getElementById('t'+foto).value;
  MFoto();
  //SubirT();
  for(i=0;i<4;i++){document.getElementById('l'+i).style.backgroundImage='';}
  document.getElementById('l'+foto).style.backgroundImage='url(imagens/seta_azul.gif)';	 
}
function MudarT(){
  clearTimeout(idTime);
  idTime=window.setTimeout("MudarF()",5000);
  iVz=1;
}
function Mudar(cod){
   foto=cod;
   ifoto++;
   if(ifoto>2){ ifoto=1; }
   document.getElementById('ftG'+ifoto).src= document.getElementById('i'+foto).value;

}
function MostrarLoc(cod){ document.getElementById('Iloc'+cod).style.display=""; }

function show(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById('menu'+i)) {document.getElementById('menu'+i).style.display='none';}
}
}
function CapturarF5(){
  	
	var tecla=window.event.keyCode; 
	var f = window.frames['direita'];
  	if (tecla==116) {
		f.focus();         
		f.document.location.reload();
		window.event.keyCode=0;
		//alert(window.event.keyCode);
		window.event.returnValue=false;
	}
}
function LogOffPart(){
	window.open('logparticularoff.asp','_blank','width=1,height=1');
}
function Foco(){
	window.focus();
}
moz=document.getElementById&&!document.all
mozHeightOffset=20

function resize_iframe(NFrame){
//document.getElementById(NFrame).height=200; 
document.getElementById(NFrame).height=window.frames[NFrame].document.body.scrollHeight; //+(moz?mozHeightOffset:0)
//alert(NFrame+document.getElementById(NFrame).height);

}

function Pagina(visivel){ 
	document.getElementById("geral").style.display=visivel;
	if (visivel.length>0) { 
		window.setTimeout("Pagina('')",500);
		document.getElementById("Aguarde").style.display=''; 
	}
	else { document.getElementById("Aguarde").style.display='none'; }
}
function CloseDiv(){
	document.getElementById('div_seta').style.display='none';
}


function initialize() {
  handleHistory(); // Verificação inicial
  //window.setInterval(handleHistory, 100); // Intervalo para verificação
}
function handleHistory() {
  if(window.location.hash != appHash) { // Verificação de Estado
    appHash = window.location.hash; // Trocamos o estado da aplicação
    $("select").selectedIndex = window.location.hash.substring(1); // Trocamos a opção selecionada
  }
}
function makeHistory(newHash) {
  window.location.hash = "#" + newHash;
  appHash = newHash;
  //handleHistory();
  alert(appHash);
}
function MyEval(obj,atrib, valor){
	return eval('document.getElementById("'+obj+'").'+atrib+'="'+valor+'"');
}
function MoverCaixa(){
	MyEval('DBox','style.top', document.body.scrollTop+'px');
	MyEval('DBox','style.left', document.body.scrollLeft+'px');
	MyEval('iDBox','style.top', document.body.scrollTop+'px');
	MyEval('iDBox','style.left', document.body.scrollLeft+'px');
}
function FecharBox(){
	document.getElementById('DBox').style.display='none';
	document.getElementById('iDBox').style.display='none';
	document.getElementById('map2').src='';
}
function MM_findObj(n, d) { //v4.01
  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_showHideLayers() { //v6.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; }
}
function MostraBox(texto, pag, scroll){
	window.open(pag,'map2');
	document.getElementById('iDBox').style.display='';
	document.getElementById('DBox').style.display='';
	document.getElementById('mapBox').style.display='';
	document.getElementById('notBox').style.display='none'; 
	document.getElementById('fecBox').style.display='none'; 
	document.getElementById('DBoxTit').innerHTML=texto;
	//if (scroll==1){	document.getElementById("map2").scrolling = "yes"; }
	//else{ document.getElementById("map2").scrolling = "no";	}
	
}
