function rightAlign(div,offset){
  if(typeof div=='string'){div=document.getElementById(div)}
  if(isNaN(offset)){offset=0}
  div.style.left=document.body.clientWidth-parseInt(div.offsetWidth)+offset;
}
function stretchRight(div,offset){
  if(typeof div=='string'){div=document.getElementById(div)}
  if(isNaN(offset)){offset=0}
  if(document.body.clientWidth-parseInt(div.offsetLeft)+offset>=0){
    div.style.width=document.body.clientWidth-parseInt(div.offsetLeft)+offset;
  }
}
function stretchBottom(div,offset){
  if(typeof div=='string'){div=document.getElementById(div)}
  if(isNaN(offset)){offset=0}
  if(document.body.clientHeight-parseInt(div.offsetTop)+offset>=0){
    div.style.height=document.body.clientHeight-parseInt(div.offsetTop)+offset;
  }
}
var running = false;
var the_timeout;

function mostrafoto(Foto){
 document.getElementById("foto").src =Foto; 
 dh=document.getElementById('iframeDiv');
 dh.style.visibility='visible';
// L'amaguem d'aqui 10 segons
if (running) {
	//Si ja teniem el timer activat, l'anulem
	clearTimeout(the_timeout);
	//Tornem a assignar timeout
	the_timeout = setTimeout("dh.style.visibility='hidden'; running = false;", 10000);
} else {
	//Assignem timeout d'aqui 10 segons per a que s'amagui
	the_timeout = setTimeout("dh.style.visibility='hidden'; running = false;", 10000);
	//Indiquem que està visible
	running = true;
}
}
