	// carrega a pagina enviada em argumento
	function loadPage(url){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		if (window.XMLHttpRequest) 
			xmlhttp=new XMLHttpRequest();
		// code for IE6, IE5
		else
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		// parte que faz o html request
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById("content").innerHTML=xmlhttp.responseText;
				window.scroll(0,150);
			}
		}
		xmlhttp.open('GET',url,true);
		xmlhttp.send();
	}

	// carrega a pagina enviada em argumento
	function loadNewsletter(url,op){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		if (window.XMLHttpRequest) 
			xmlhttp=new XMLHttpRequest();
		// code for IE6, IE5
		else
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		// parte que faz o html request
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById("newsletterRow").innerHTML=xmlhttp.responseText;
				window.scroll(0,1000);
			}
		}

		url= url + '?nome=' + document.getElementById('nome').value + '&email=' + document.getElementById('email').value + '&op=' + op;
		xmlhttp.open('GET',url,true);
		xmlhttp.send();
	}

	// carrega os artigos do ano, mes
	function loadArtigos(url,ano,mes){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		if (window.XMLHttpRequest) 
			xmlhttp=new XMLHttpRequest();
		// code for IE6, IE5
		else
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		// parte que faz o html request
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById("artigos").innerHTML=xmlhttp.responseText;
				window.scroll(0,500);
			}
		}

		url= url + '?ano=' + ano;
		if (mes!='-1')
			url= url + '&mes=' + mes;

		xmlhttp.open('GET',url,true);
		xmlhttp.send();
	}
	
	function setPastaSelected(id,galeria,url1,ano,url2){
		document.getElementById(id).className='selectedText';
		document.getElementById('pastaGaleria').value= galeria;
		nrPastas = parseInt(document.getElementById('numPastas').value);
		for (i=1;i<=nrPastas;++i){
			if (i!=parseInt(id)){
				sId= i + "";
				document.getElementById(sId).className='textRed_BiggerR';
			}
		}
		url1 = url1 + "?galeria=" + galeria;
		url2 = url2 + "?galeria=" + galeria;
		if (ano=='0000'){
			loadFotos(url2,id);
		}
		else{
			listSubfolder(url1,id);
		}
	}

	// carrega a pagina enviada em argumento
	function listSubfolder(url,id){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		if (window.XMLHttpRequest) 
			xmlhttp=new XMLHttpRequest();
		// code for IE6, IE5
		else
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		// parte que faz o html request
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById("subpastas").innerHTML=xmlhttp.responseText;
				document.getElementById("selectedFolder").value= id;
				document.getElementById("selectedGaleria").value= "";
				window.scroll(0,500);
			}
		}

		xmlhttp.open('GET',url,true);
		xmlhttp.send();
	}
	
	// carrega a pagina enviada em argumento
	function loadFotos(url,id){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		if (window.XMLHttpRequest) 
			xmlhttp=new XMLHttpRequest();
		// code for IE6, IE5
		else
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		// parte que faz o html request
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById("contentSlideshow").innerHTML=xmlhttp.responseText;
				//document.getElementById("subpastas").innerHTML="&nbsp;";
				window.scroll(0,500);
			}
		}

		xmlhttp.open('GET',url,true);
		xmlhttp.send();
	}

	function loadPagina(id,galeria,url){	
		folder= document.getElementById('selectedFolder').value;
		url = url + '?selectedGaleria=' + id + '&selectedFolder=' + folder  + '&galeria=' + galeria;
		
		//window.navigate(url);
		window.location.href=url;
	}

	// carrega a pagina enviada em argumento
	function loadPageWithScroll(url,scrollY){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		if (window.XMLHttpRequest) 
			xmlhttp=new XMLHttpRequest();
		// code for IE6, IE5
		else
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		// parte que faz o html request
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById("content").innerHTML=xmlhttp.responseText;
				window.scroll(0,parseInt(scrollY));
			}
		}
		xmlhttp.open('GET',url,true);
		xmlhttp.send();
	}

	function changeImagemMenu(imagem){
		document.getElementById('show').innerHTML='<img width=\'666\' height=\'371\' src=\'' + imagem + '\' style=\'position:relative;top:-371px;left:169px;\'/>';	
	}

	// carrega a pagina enviada em argumento
	function loadContentActividades(url,scrollY){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		if (window.XMLHttpRequest) 
			xmlhttp=new XMLHttpRequest();
		// code for IE6, IE5
		else
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		
		// parte que faz o html request
		xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById("actividades").innerHTML=xmlhttp.responseText;
				window.scroll(0,parseInt(scrollY));
			}
		}
		xmlhttp.open('GET',url,true);
		xmlhttp.send();
	}
	
	String.prototype.trim = function () {
		return this.replace(/^\s*/, "").replace(/\s*$/, "");
	}
		
	// popup Window
	function centeredPopup(url,fotos,winName,w,h,scroll){
		var popupWindow = null;
		
		LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';

		if (fotos!=''){
			hiddenIndice = document.getElementById('indexFoto');
			iHiddenIndice = parseInt(hiddenIndice.value);
			var foto = getPhotoByIndex(iHiddenIndice,fotos);
			if (foto!=''){
				url = url + foto;
				//popupWindow = window.open(url,winName,settings);
				PopupPic(url);
			}		
		}
		else
			//popupWindow = window.open(url,winName,settings);
			PopupPic(url);
	}
	
	// resize popup to fit image size
	function PopupPic(sPicURL) {
     window.open( "popup.htm?"+sPicURL, "",  
     "resizable=1,HEIGHT=200,WIDTH=200");
   }  

	function basicPopup(url) {
		popupWindow = window.open(url,'popUpWindow','height=600,width=800,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no, status=no');
    }

	function PopupFotoDetalhes(id,imageTitle){
		imageURL = document.getElementById(id).value;
		
		AutoSizePopUp(imageURL,imageTitle)
	}

	function AutoSizePopUp(imageURL,imageTitle){
		// Set the horizontal and vertical position for the popup
		PositionX = 150;
		PositionY = 200;

		// Set these value approximately 20 pixels greater than the
		// size of the largest image to be used (needed for Netscape)
		defaultWidth  = 500;
		defaultHeight = 500;

		// Set autoclose true to have the window close automatically
		// Set autoclose false to allow multiple popup windows
		var AutoClose = true;

		// Do not edit below this line...
		// ================================
		if (parseInt(navigator.appVersion.charAt(0))>=4){
			
			if (navigator.appName=="Netscape")
				isNN=1;
			else
				isNN=0;
			if (navigator.appName.indexOf("Microsoft")!=-1)
				isIE=1;
			else
				isIE=0;
						
			var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
			var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
		
			if (isNN){
				imgWin=window.open('about:blank','',optNN);
			}
			if (isIE){
				imgWin=window.open('about:blank','',optIE);
			}
			with (imgWin.document){
				writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
				writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
				writeln('if (navigator.appName=="Netscape") isNN=1; else isNN=0;');writeln('if (navigator.appName.indexOf("Microsoft")!=-1) isIE=1; else isIE=0;}');
				writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
				writeln('width=300-(document.body.clientWidth-document.images[0].width);');
				writeln('height=300-(document.body.clientHeight-document.images[0].height);');
				writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
				//writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
				writeln('window.innerWidth=document.images[0].width;');writeln('window.innerHeight=document.images[0].height;}}');
				writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
				if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
				else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
				writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
				close();		
			}
		}
	}

	// destacar/não destacar colunas de uma tabela
	function highlightCols(bHighlight,Col1,Col2,Col3,Col4){
		if (bHighlight==true){
			document.getElementById(Col1).className= document.getElementById(Col1).className.replace('_Highlight','') + '_Highlight';
			document.getElementById(Col2).className= document.getElementById(Col2).className.replace('_Highlight','') + '_Highlight';
			document.getElementById(Col3).className= document.getElementById(Col3).className.replace('_Highlight','') + '_Highlight';
			document.getElementById(Col4).className= document.getElementById(Col4).className.replace('_Highlight','') + '_Highlight';	
		}
		else{
			document.getElementById(Col1).className= document.getElementById(Col1).className.replace('_Highlight','');
			document.getElementById(Col2).className= document.getElementById(Col2).className.replace('_Highlight','');
			document.getElementById(Col3).className= document.getElementById(Col3).className.replace('_Highlight','');
			document.getElementById(Col4).className= document.getElementById(Col4).className.replace('_Highlight','');
		}
	}

	// CSS functions ---------------------
	function changeStyleClass(nomeClasse,obj){
		if (obj.className!='selectedText')
			obj.className=nomeClasse;
	}

	function setMenuSelected(id){
		document.getElementById(id).className='selectedText';
		if (id=='yoga'){
			document.getElementById('meditacao').className='textRed_BiggerR';
			document.getElementById('satsanga').className='textRed_BiggerR';
			document.getElementById('taichi').className='textRed_BiggerR';
			document.getElementById('massagem').className='textRed_BiggerR';
			document.getElementById('terapia').className='textRed_BiggerR';
			document.getElementById('yogamassage').className='textRed_BiggerR';
                        document.getElementById('actividades_personalizadas').className='textRed_BiggerR';
		}
		else if (id=='meditacao'){;
			document.getElementById('yoga').className='textRed_BiggerR';
			document.getElementById('satsanga').className='textRed_BiggerR';
			document.getElementById('taichi').className='textRed_BiggerR';
			document.getElementById('massagem').className='textRed_BiggerR';
			document.getElementById('terapia').className='textRed_BiggerR';
			document.getElementById('yogamassage').className='textRed_BiggerR';
                        document.getElementById('actividades_personalizadas').className='textRed_BiggerR';
		}
		else if (id=='satsanga'){
			document.getElementById('meditacao').className='textRed_BiggerR';
			document.getElementById('yoga').className='textRed_BiggerR';
			document.getElementById('taichi').className='textRed_BiggerR';
			document.getElementById('massagem').className='textRed_BiggerR';
			document.getElementById('terapia').className='textRed_BiggerR';
			document.getElementById('yogamassage').className='textRed_BiggerR';
                        document.getElementById('actividades_personalizadas').className='textRed_BiggerR';
		}
		else if (id=='taichi'){
			document.getElementById('meditacao').className='textRed_BiggerR';
			document.getElementById('satsanga').className='textRed_BiggerR';
			document.getElementById('yoga').className='textRed_BiggerR';
			document.getElementById('massagem').className='textRed_BiggerR';
			document.getElementById('terapia').className='textRed_BiggerR';
			document.getElementById('yogamassage').className='textRed_BiggerR';
                        document.getElementById('actividades_personalizadas').className='textRed_BiggerR';
		}
		else if (id=='massagem'){
			document.getElementById('meditacao').className='textRed_BiggerR';
			document.getElementById('satsanga').className='textRed_BiggerR';
			document.getElementById('yoga').className='textRed_BiggerR';
			document.getElementById('taichi').className='textRed_BiggerR';
			document.getElementById('terapia').className='textRed_BiggerR';
			document.getElementById('yogamassage').className='textRed_BiggerR';
                        document.getElementById('actividades_personalizadas').className='textRed_BiggerR';
		}
		else if (id=='terapia'){
			document.getElementById('meditacao').className='textRed_BiggerR';
			document.getElementById('satsanga').className='textRed_BiggerR';
			document.getElementById('yoga').className='textRed_BiggerR';
			document.getElementById('taichi').className='textRed_BiggerR';
			document.getElementById('massagem').className='textRed_BiggerR';
			document.getElementById('yogamassage').className='textRed_BiggerR';
                        document.getElementById('actividades_personalizadas').className='textRed_BiggerR';
		}
		else if (id=='yogamassage'){
			document.getElementById('meditacao').className='textRed_BiggerR';
			document.getElementById('satsanga').className='textRed_BiggerR';
			document.getElementById('yoga').className='textRed_BiggerR';
			document.getElementById('taichi').className='textRed_BiggerR';
			document.getElementById('massagem').className='textRed_BiggerR';
			document.getElementById('terapia').className='textRed_BiggerR';
                        document.getElementById('actividades_personalizadas').className='textRed_BiggerR';
		}
                else if (id=='actividades_personalizadas'){
                        document.getElementById('meditacao').className='textRed_BiggerR';
			document.getElementById('satsanga').className='textRed_BiggerR';
			document.getElementById('yoga').className='textRed_BiggerR';
			document.getElementById('taichi').className='textRed_BiggerR';
			document.getElementById('massagem').className='textRed_BiggerR';
			document.getElementById('terapia').className='textRed_BiggerR';
                        document.getElementById('yogamassage').className='textRed_BiggerR';
                }
	}

	function setCursor(obj,sCursor){
		obj.style.cursor=sCursor;
	}

	// -----------------------------------
	// By Stoyan Stefanov - http://www.phpied.com/
	function sleep(milliseconds) {
	  var start = new Date().getTime();
	  for (var i = 0; i < 1e7; i++) {
		if ((new Date().getTime() - start) > milliseconds){
		  break;
		}
	  }
	}

	// funcao para realizar scroll para determinada parte da pagina
	function scrollTo(x,y){
		posX= parseInt(x);
		posY= parseInt(y);
		window.scroll(posX,posY);
	}
