// JavaScript Document
var marcouop=0;
var alterouop=0;

function destacarPrincipal(id, topic){
	
	if(confirm("Deseja destacar esta noticia?"))
			document.location.href='index.php?progoption=turnews&do=destacaprincipal&pageid='+id+'&topicid='+topic;
	
}

function retiraPrincipal(id, topic){
	
	if(confirm("Deseja retirar esta notícia de destaque principal?"))
			document.location.href='index.php?progoption=turnews&do=retiraprincipal&pageid='+id+'&topicid='+topic;
	
}

function apagaTurNoticia(id, topico, titulo){
	
	if(confirm(txt34+':\n'+titulo+'?'))
		document.location.href="index.php?progoption=turnews&do=apaganoticia&pageid="+id+"&topicid="+topico;
	
}

function apagaGaleria(id, nome){
	
	if(confirm('Tem a certeza que deseja apagar a galeria:\n'+nome+'?'))
		document.location.href="index.php?progoption=photoexp&do=deletegallery&galleryid="+id;
	
	}


function apagaNewsletter(titulo, id){
	
	if(confirm('Apagar a newsletter:\n'+titulo+'?'))
		document.location.href="index.php?progoption=newsletter&do=apaga&nlid="+id;
	
}

function apagaNoticia(id, topico, titulo){
	
	if(confirm(txt34+':\n'+titulo+'?'))
		document.location.href="index.php?progoption=news&do=apaganoticia&pageid="+id+"&topicid="+topico;
	
}

function apagaSeccao(id, nome){
	
	if(confirm(txt1+'\n'+nome+'?'))
		document.location.href="index.php?progoption=seccao&do=apagaseccao&secid="+id;
	
	}

function remFoto(i){
	
	document.getElementById('img'+i).src='noimage.gif';
	document.getElementById('img'+i+'val').value='noimage.gif';
	
	}

function enlargePhoto(i){
	
	if(document.getElementById('img'+i+'val').value!='noimage.gif')
		ddrivetip('<img src="'+document.getElementById('img'+i+'val').value+'"/>')
	
	}

function cancelar(lnk){
	
	if(confirm(txt2))document.location.href=lnk;
	
	}

function goLink(lnk){
	
	document.location.href=lnk;
	
	}

//valida imagens

function getImgSize()
{
var newImg = new Image();
imgSrc="file://"+document.getElementById('img1');
newImg.src =imgSrc;
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);
}
//funcoes multimedia

function apagaMMFile(nome, id, cat){

	if(confirm (txt3+" "+nome+"?")){

location.href="index.php?progoption=multimedia&do=delmmfile&mmcatid="+cat+"&mmfileid="+id;
	}

}

function apagaMMCat(nome, id){

	if(confirm (txt4+" "+nome+"?\n"+txt5)){

location.href="index.php?progoption=multimedia&do=delmmcat&mmcatid="+id;
	}

}

//fim de funcoes multimedia

function mailOp(){


         if(marcouop==0){
	          document.getElementById("oppmail").style.height = 'auto';
              marcouop=1;
			  document.location.href='#optit';
	
            }
            else if(marcouop==1){
              document.getElementById("oppmail").style.height = '1px';
              marcouop=0;
	
            }

	}



var marcou=0;
function marcavisitaimob(){


         if(marcou==0){
	          document.getElementById("marcarvisita").style.height = 'auto';
              marcou=1;
	
            }
            else{
              document.getElementById("marcarvisita").style.height = '1px';
              marcou=0;
	
            }

	}
	
function marcavisitaimob2(obj){


         if(obj.checked){
			 $("#marcarvisita").show();
            }

	}
	
	var old1='descricaotab';

function mudaTab(a){
	
	document.getElementById("tabinfo").innerHTML = document.getElementById(a).value;
	document.getElementById(a+'tab').className='desctabssel';
	if(old1!='')document.getElementById(old1).className='desctabs';
	old1=a+'tab';
	
	}
	
function mudaTab2(a){
	
	document.getElementById("tabinfo").innerHTML = document.getElementById(a).innerHTML;
	document.getElementById(a+'tab').className='desctabssel';
	if(old1!='')document.getElementById(old1).className='desctabs';
	old1=a+'tab';
	
	}	
	
	var old2='';

function mudaTab21(a){
	//if(a=='opinioes'&&alterouop==1)document.getElementById("tabinfo2").style.height="45px";
	//else document.getElementById("tabinfo2").style.height="auto";
	//document.getElementById("tabinfo2").innerHTML = document.getElementById(a).innerHTML;
	if(a=='opinioes'&&alterouop==1)document.getElementById("tabinfo").style.height="45px";
	else document.getElementById("tabinfo").style.height="auto";
	document.getElementById("tabinfo").innerHTML = document.getElementById(a).innerHTML;
	document.getElementById(a+'tab').className='desctabssel';
	if(old2!='')document.getElementById(old2).className='desctabs';
	old2=a+'tab';
	if(a=='opinioes'&&alterouop==1)actualOp();
	
	}	
	
function mudaTab211(a){
	if(a=='opinioes'&&alterouop==1)document.getElementById("tabinfo2").style.height="45px";
	else document.getElementById("tabinfo2").style.height="auto";
	document.getElementById("tabinfo2").innerHTML = document.getElementById(a).innerHTML;
	document.getElementById(a+'tab').className='desctabssel';
	if(old2!='')document.getElementById(old2).className='desctabs';
	old2=a+'tab';
	if(a=='opinioes'&&alterouop==1)actualOp();
	
	$("a.iframe#iframeboo:visible").fancybox({
'width' : 540,
'height' : '100%',
'autoScale' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'type' : 'iframe',
'centerOnScroll' : true
}); 

	$("div#cenas form#b_availFrm2 input[type=submit]:visible").click(function () { 
	$("a.iframe#iframeboo:visible").attr("href", $("#b_availFrm2").attr("action")+"?"+$("#b_availFrm2").serialize()+"&lang="+$("#langset").html());
	//alert($("#b_availFrm2").attr("action")+"?"+$("#b_availFrm2").serialize());
      $("a.iframe#iframeboo:visible").click();
	  
        return false;
    });
	
	$("div#cenas form#b_availFrm2 input[type=submit]:visible").live("click", function() {
 $("a.iframe#iframeboo:visible").attr("href", $("#b_availFrm2").attr("action")+"?"+$("#b_availFrm2").serialize()+"&lang="+$("#langset").html());
	//alert($("#b_availFrm2").attr("action")+"?"+$("#b_availFrm2").serialize());
      $("a.iframe#iframeboo:visible").click();
	
        return false;
    });
	
	}	

//ampliar mapa
var mapa="";

function ampliaMapa(a){
	
	document.location.href="#topo";
	mapa=a;
	document.getElementById('sobrelayer').style.filter = "alpha(opacity=00)";
	document.getElementById('sobrelayer').style.opacity = .0;
	document.getElementById('sobrelayer').style.MozOpacity = .0;
	document.getElementById('sobrelayer').style.height=pageHeight() + 'px';
	//alert(document.getElementById('sobrelayer').style.height);
	document.getElementById('sobrelayer').style.width=pageWidth() + 'px';
	//alert(document.getElementById('sobrelayer').style.width);	
	document.getElementById('sobrelayer').style.visibility='visible';
	document.getElementById('unidade').style.visibility='hidden';
	document.getElementById('conc').style.visibility='hidden';
	document.getElementById('sobrelayer').xOpacity = .1;
	document.getElementById('sobrelayerconteudo').style.height=pageHeight() + 'px';
	document.getElementById('sobrelayerconteudo').style.width=pageWidth() + 'px';
	
	nop=10;
	fazFade12();
	
	
	}
	
	function fazFade12(){

	//document.write('nop: '+nop);
	document.getElementById('sobrelayer').style.filter = "alpha(opacity=" + nop + ")";
	document.getElementById('sobrelayer').style.opacity = nop/100;
	document.getElementById('sobrelayer').style.MozOpacity = nop/100;
	nop+=10;
	if(nop<90){
	//alert('nop '+nop);
	setTimeout(fazFade12,10);
	}
	else {
		nop=10;
	colocaMapa();
	}
	}
	
function colocaMapa(){

		
		document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a></div><img src="'+mapa+'" class="fotogrande">';
		
		
			document.getElementById('sobrelayerconteudo').style.visibility='visible';
	
	}

//funcoes
function apagarconcelho(zona,id){

if(confirm (txt6+" "+zona+"?\n"+txt7)){

location.href="index.php?progoption=alojamentos&do=delzona&zonaid="+id;
	}
}

function apagarunidade(tipo,id){

if(confirm (txt8+" "+tipo+"?\n"+txt9)){

location.href="index.php?progoption=alojamentos&do=delunidade&unidadeid="+id;
	}
}


function apagartipo(tipo,id){

if(confirm (txt10+" "+tipo+"?\n"+txt11)){

location.href="index.php?progoption=alojamentos&do=deltipo&tipoid="+id;
	}
}

function apagarsubtipo(subtipo,id){

if(confirm (txt12+" "+subtipo+"?\n"+txt13)){

location.href="index.php?progoption=alojamentos&do=delsubtipo&subtipoid="+id;
	}
}

function apagarpubseccao(seccao,id){

if(confirm (txt14+" "+seccao+"?\n"+txt15)){

location.href="index.php?progoption=publicidades&do=delpubsec&pubsec="+id;
	}
}

function apagarbanner(seccao,id,ban){

if(confirm (txt16+" "+seccao+"?\n"+txt17)){

location.href="index.php?progoption=publicidades&do=delbanner&banid="+id+"&ban="+ban;
	}
}

function limitText(limitField, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} 
}

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 validateGallery(){
	
	var acolocar, i, erros='', args=validateGallery.arguments;
	acolocar=MM_findObj('galleryname');
	acolocar=acolocar.value;
	for(i=0; i<args.length; i++){
		
			if(args[i].toString()==acolocar.toString())
				erros=txt18+'\n';
		}
		
		if (erros) alert(txt19+':\n\n'+erros);
  		document.returnval = (erros == '');
	
}


function validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+txt20+' '+nm+' '+txt21+'\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+txt20+' '+nm+' '+txt22+'\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+txt20+' '+nm+' '+txt23+' '+min+' - '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+txt20+' '+nm+' '+txt24+'\n'; }
  } if (errors) alert(txt19+'\n\n'+errors);
  document.vf_returnval = (errors == '');
}



function doPause()  {
	if(pause) {
		pause = false;
		document.getElementById("pauseBtn").value = txt25;
	} else {
		pause = true;
		document.getElementById("pauseBtn").value = txt26;
	}
}


//window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so_init);

var d=document, imgs = new Array(), textos = new Array(), zInterval = null, current=0, pause=false;

textos[0]="texto1";
textos[1]="texto2";
textos[2]="texto3";
textos[3]="texto4";
textos[4]="texto5";
textos[5]="texto6";

function so_init() {
	if(!d.getElementById || !d.createElement)return;
	
	css = d.createElement("link");
	css.setAttribute("href","xfade2.css");
	css.setAttribute("rel","stylesheet");
	css.setAttribute("type","text/css");
	d.getElementsByTagName("head")[0].appendChild(css);
	
	imgs = d.getElementById("imageContainer").getElementsByTagName("img");
	//txts= d.getElementById("texto");
	for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
	imgs[0].style.display = "block";
	imgs[0].xOpacity = .99;
	//txts.innerHTML=textos[current];
	
	setTimeout(so_xfade,5000);
}

function so_xfade() {
	if(pause)setTimeout(so_xfade,35);
	else{
	//txts.innerHTML=textos[(current+1)<=5?(current+1):0];
	cOpacity = imgs[current].xOpacity;
	nIndex = imgs[current+1]?current+1:0;
	nOpacity = imgs[nIndex].xOpacity;
	
	cOpacity-=.05; 
	nOpacity+=.05;
	
	imgs[nIndex].style.display = "block";
	imgs[current].xOpacity = cOpacity;
	imgs[nIndex].xOpacity = nOpacity;
	
	setOpacity(imgs[current]); 
	setOpacity(imgs[nIndex]);
	
	if(cOpacity<=0) {
		imgs[current].style.display = "none";
		current = nIndex;

		setTimeout(so_xfade,5000);
				
	} else {
		setTimeout(so_xfade,35);
	}
	}
}
	
	function setOpacity(obj) {
		if(obj.xOpacity>.99) {
			obj.xOpacity = .99;
			return;
		}
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
	}
	


function changeFoto(it)  {
	pause=true;
	imgs[it].style.display = "block";
	imgs[it].xOpacity = .99;
	setOpacity(imgs[it]);
	for(i=0;i<imgs.length;i++) {
		if(i!=it)imgs[i].xOpacity = 0;
		if(i!=it)imgs[i].style.display = "none";
		if(i!=it)setOpacity(imgs[i]);
	}
	imgs[it].style.display = "block";
	imgs[it].xOpacity = .99;
	setOpacity(imgs[it]);
	
	current=it;
	
	document.getElementById("pauseBtn").value = txt26;
	pause=true;
}

function apagarUser(login,id,nome)
{
if(confirm("Apagar utilizador com o login: "+login+" \ne o nome: "+nome+"?\n\nEsta operação não pode ser anulada!"))
{
	
	location.href="index.php?progoption=users&do=del&id="+id;
	
	}
}

function sucessoEditUser()
{
alert("Dados alterados com sucesso");

	
	location.href="index.php?progoption=users&do=list";
	
}

//ricardo nobre 23-02-2007 23h33

function colocaImgOpcao(op){
	
	if(op){
	if(document.getElementById("try").value == 'Stop')
	document.getElementById("imgopcoes").innerHTML = txt25;
	else
	document.getElementById("imgopcoes").innerHTML = txt26;
	}else
	document.getElementById("imgopcoes").innerHTML = '';
	}
	
function colocaImgOpcao2(op){
	
	
	document.getElementById("imgopcoes").innerHTML = op;
	}	
		
var nop=10;
var b;
function fazFade1(){

	//document.write('nop: '+nop);
	document.getElementById('sobrelayer').style.filter = "alpha(opacity=" + nop + ")";
	document.getElementById('sobrelayer').style.opacity = nop/100;
	document.getElementById('sobrelayer').style.MozOpacity = nop/100;
	nop+=10;
	if(nop<90){
	//alert('nop '+nop);
	setTimeout(fazFade1,10);
	}
	else {
		nop=10;
	colocaFotos(b, current);
	}
	}

function ampliaFoto(a){
	document.location.href="#topo";
	b=a;
	document.getElementById('sobrelayer').style.filter = "alpha(opacity=00)";
	document.getElementById('sobrelayer').style.opacity = .0;
	document.getElementById('sobrelayer').style.MozOpacity = .0;
	document.getElementById('sobrelayer').style.height=pageHeight() + 'px';
	//alert(document.getElementById('sobrelayer').style.height);
	document.getElementById('sobrelayer').style.width=pageWidth() + 'px';
	//alert(document.getElementById('sobrelayer').style.width);	
	document.getElementById('sobrelayer').style.visibility='visible';
	document.getElementById('unidade').style.visibility='hidden';
	document.getElementById('conc').style.visibility='hidden';
	document.getElementById('sobrelayer').xOpacity = .1;
	document.getElementById('sobrelayerconteudo').style.height=pageHeight() + 'px';
	document.getElementById('sobrelayerconteudo').style.width=pageWidth() + 'px';
	
	nop=10;
	fazFade1();
	
	
	}	

function fecharFoto(){
	
	
	document.getElementById('sobrelayer').style.height='0px';
	document.getElementById('sobrelayer').style.width='0px';
	document.getElementById('sobrelayer').style.hidden='hidden';
	document.getElementById('unidade').style.visibility='visible';
	document.getElementById('conc').style.visibility='visible';
	document.getElementById('sobrelayerconteudo').style.height='0px';
	document.getElementById('sobrelayerconteudo').style.width='0px';
	document.getElementById('sobrelayerconteudo').style.visibility='hidden';
	
	
	}
	
function mudaSlideImg(){

	if(document.getElementById("try").value == 'Stop'){
		document.getElementById("try").value = 'Play';
		document.getElementById("pauseBtn").src = 'ngest/images/play.jpg';		
	}else{
		document.getElementById("try").value = 'Stop';
		document.getElementById("pauseBtn").src = 'ngest/images/stop.jpg';
		}
	}	

function mudaSlideImg2(op){

	if(op == 'Play'){
		document.getElementById("try").value = 'Play';
		document.getElementById("pauseBtn").src = 'ngest/images/play.jpg';		
	}
	if(op == 'Stop'){
		document.getElementById("try").value = 'Stop';
		document.getElementById("pauseBtn").src = 'ngest/images/stop.jpg';
		}
	}	
	
function pageHeight()
{
var docHeight;
if (typeof document.height != 'undefined') {
docHeight = document.height;
}
else if (document.compatMode && document.compatMode != 'BackCompat') {
docHeight = document.documentElement.scrollHeight;
}
else if (document.body && typeof document.body.scrollHeight !=
'undefined') {
docHeight = document.body.scrollHeight;
}
return docHeight;
}

function pageWidth()
{
var docWidth;
if (typeof document.width != 'undefined') {
docWidth = document.width;
}
else if (document.compatMode && document.compatMode != 'BackCompat') {
docWidth = document.documentElement.scrollWidth;
}
else if (document.body && typeof document.body.scrollWidth !=
'undefined') {
docWidth = document.body.scrollWidth;
}
return docWidth;
}

function preloader(ar)
{

AllImages=ar;

for(loadall=0; loadall<AllImages.length; loadall++)
{

var LoadedImage=new Image();
LoadedImage.src=AllImages[loadall];
}

}

function colocaLoader(){
	
		document.getElementById("preloadimg").innerHTML = '<img src="images/loading.gif" width="20" height="20" hspace="5">&nbsp;'+txt33;
	
	}
	
function removeLoader(){
	
		document.getElementById("preloadimg").innerHTML = '';
			document.getElementById("preloadimg").style.visibility = 'hidden';
	}
	
function colocaFotos(a, i){

		//if(i>0&&i<imgs.length)
		document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a href="javascript:fotoAnterior('+i+');" class="fecharcss2"><< '+txt27+'</a><a class="fecharcss">'+txt28+': '+(parseInt(i)+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a><a href="javascript:fotoSeguinte('+i+');" class="fecharcss2">'+txt30+' >></a></div><img src="'+b[i]+'" class="fotogrande">';
		
		//if(i==imgs.length-1)document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a href="javascript:fotoAnterior('+i+');" class="fecharcss2"><< '+txt27+'</a><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a></div><img src="'+b[i]+'" class="fotogrande">';
		//if(i==0)document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a><a href="javascript:fotoSeguinte('+i+');" class="fecharcss2">'+txt30+' >></a></div><img src="'+b[i]+'" class="fotogrande">';
		
			document.getElementById('sobrelayerconteudo').style.visibility='visible';
	
	}	
	
	function fotoAnterior(j){
		i=j;
		if(i>0) i=j-1;
		else i=imgs.length-1;
		//if(i>0&&i<imgs.length)
		document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a href="javascript:fotoAnterior('+i+');" class="fecharcss2"><< '+txt27+'</a><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a><a href="javascript:fotoSeguinte('+i+');" class="fecharcss2">'+txt30+' >></a></div><img src="'+b[i]+'" class="fotogrande">';
		
		//if(i==imgs.length-1)document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a href="javascript:fotoAnterior('+i+');" class="fecharcss2"><< '+txt27+'</a><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a></div><img src="'+b[i]+'" class="fotogrande">';
		//if(i==0)document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a><a href="javascript:fotoSeguinte('+i+');" class="fecharcss2">'+txt30+' >></a></div><img src="'+b[i]+'" class="fotogrande">';
		}
	
	function fotoSeguinte(j){
		i=j;
		if(i<imgs.length) i=j+1;
		if(i>=imgs.length) i=0;
		
		//if(i>0&&i<imgs.length)
		document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a href="javascript:fotoAnterior('+i+');" class="fecharcss2"><< '+txt27+'</a><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a><a href="javascript:fotoSeguinte('+i+');" class="fecharcss2">'+txt30+' >></a></div><img src="'+b[i]+'" class="fotogrande">';
		
		//if(i==imgs.length-1)document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a href="javascript:fotoAnterior('+i+');" class="fecharcss2"><< '+txt27+'</a><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a></div><img src="'+b[i]+'" class="fotogrande">';
		//if(i==0)document.getElementById("sobrelayerconteudo").innerHTML = '<div style="width:100%;text-align:center;padding-top:10px;height:30px;"><a class="fecharcss">'+txt28+': '+(i+1)+'/'+imgs.length+'</a><a href="javascript:fecharFoto();" class="fecharcss">'+txt29+'</a><a href="javascript:fotoSeguinte('+i+');" class="fecharcss2">'+txt30+' >></a></div><img src="'+b[i]+'" class="fotogrande">';
		
		}
		
		
function expandeDetalhe(qual){
	
	if(document.getElementById(qual+'aux').value=='max'){
		document.getElementById(qual).style.height='20px';
		document.getElementById(qual+'img').src='ngest/images/mais1.jpg';
		document.getElementById(qual+'aux').value='min';
		document.getElementById(qual+'what').innerHTML=txt31;
		//alert(document.getElementById(qual+'aux').value);
	}
	else if(document.getElementById(qual+'aux').value=='min'){
		document.getElementById(qual).style.height='auto';
		document.getElementById(qual+'img').src='ngest/images/menos1.jpg';
		document.getElementById(qual+'aux').value='max';
		document.getElementById(qual+'what').innerHTML=txt32;
		//alert(document.getElementById(qual+'aux').value);
	}
	
	
	}		
	
function expandeTexto(qual,text)	{
	if(text!=''){
	if(document.getElementById(qual+'aux').value=='max')document.getElementById(qual+'what').innerHTML=txt32;
	else if(document.getElementById(qual+'aux').value=='min')document.getElementById(qual+'what').innerHTML=txt31;
	}else document.getElementById(qual+'what').innerHTML='';
	}
