//FUNÇÕES DA GALERIA/IMGCENTRAL DAS PÁGINAS INTERNAS


var count = 0;


//FUNCAO THUMBNAILS
function tonails(){
	var nails = document.getElementById('galeria').getElementsByTagName('a');
	for(k=0;k<nails.length;k++){ nails[k].className = 'none';}
	nails[count].className = 'select';
	document.getElementById('loadimg').style.display='block'; 
	}
	
//FUNCAO MOSTRAR IMG
function showpic(n){
	document.getElementById('imgcentral').src = mypic[n][0];
	document.getElementById('legcentral').innerHTML = mypic[n][1];
	count=n;
	tonails();
	//scrollTo(0,0);
	return false
	}

//NEXT
function next(){
	count++;
	if (count == mypic.length) {count = 0;};
	document.getElementById('imgcentral').src = mypic[count][0];
	document.getElementById('legcentral').innerHTML = mypic[count][1];
	//scrollTo(0,0);
	tonails();
	}
	
function prev(){
	count--;
	if (count<0) {count = mypic.length-1;};
	document.getElementById('imgcentral').src = mypic[count][0];
	document.getElementById('legcentral').innerHTML = mypic[count][1];
	//scrollTo(0,0);
	tonails();
	}
		
	
//ALTURA DOS ELEMENTOS DA AREA SENSIVEL
function nextheight(){
	var hvalue = document.getElementById('imgcentral');
	if( mypic.length > 1) {
		document.getElementById('container').innerHTML = '<div id="loadimg"></div><a href="#" id="imgprev" onclick="prev(); return false;" >prev</a><a href="#" id="imgnext" onclick="next(); return false;">next</a>';
		document.getElementById('loadimg').style.height = document.getElementById('imgcentral').offsetHeight + 'px';
		document.getElementById('imgnext').style.height = document.getElementById('imgcentral').offsetHeight + 'px';
		document.getElementById('imgprev').style.height = document.getElementById('imgcentral').offsetHeight + 'px';
		setTimeout("loading()",0005); 
		}
		else{document.getElementById('container').style.display="none";}
	}

//PRIMEIRA IMG
 function  fstimg(){ nextheight(); }
	
	
function loading() { document.getElementById('loadimg').style.display='none'}

function lighthome() {
	var hlogo = document.getElementById('logo');
	var hhomeop = document.getElementById('homeop');
		hlogo.className=='select' ? hlogo.className='none' : hlogo.className='select'  ;
		hhomeop.className=='select' ? hhomeop.className='none' : hhomeop.className='select'  ;
	}	


function nomeimproprio(){
      if (GBrowserIsCompatible()) {
    // var map = document.getElementById("map");
	//	map.addControl(new GSmallMapControl());
	//	map.addControl(new GMapTypeControl());
	//	map.addControl(new GOverviewMapControl());
		//localização inicial
	//	var novomapa = new GLatLng(-19.91100, -44.028277);
        //map.setCenter(novomapa, 11); //zoom
		document.getElementById("map").setCenter(new GLatLng(42.366662,-71.106262), 11)
		
//		map.setMapType(G_SATELLITE_TYPE); // Vue satelite
//		map.removeMapType(G_SATELLITE_TYPE); // Vue satelite
//		map.setMapType(G_HYBRID_TYPE); // Vue mixte
//		map.setMapType(G_MAP_TYPE); // Vue carte
//		map.enableScrollWheelZoom();
}
      } 
	  
	  

var intershow;

function slideShow(){

	if(intershow == undefined){
		intershow = setInterval(next,7500);
		}
	}
	

function slideShowOff(){
	clearInterval(intershow);
	intershow=null;
	//var intershow;
	}
	