var dd=1;
var nw=0;
bgb=new Image();
bgb.src="img/moreb.gif";
bgg=new Image();
bgg.src="img/moreg.gif";

function mostra(ri)
{
 var mst=eval("document.getElementById('ri"+ri+"')");
 var piu=eval("document.getElementById('p"+ri+"')");
 if(dd)
 {
  mst.style.display='block';
  piu.innerText="-";
  dd=0;
 }
 else
 {
  mst.style.display='none';
  piu.innerHTML="+";
  dd=1;
 }
}

function abre(foto, wd, ht)
{
 if(nw) nw.close();
 if(document.location.href.indexOf("600")+1) mq="600";
 else mq="900";
 nw=window.open("foto"+mq+".html?ft="+foto+"&w="+wd+"&h="+ht, "foto", "height="+(ht+100)+", width="+(wd+100));
 nw.moveTo(20,20);
 nw.focus();
}

function abrep(pag,width)
{
 if(width==0) {width=screen.AvailWidth; x=0;} 
 else x=70;
 nwa=window.open(pag, "cartec", "height="+(screen.AvailHeight-50)+", width="+width+", scrollbars=yes");
 nwa.moveTo(x,10);
 nwa.focus();
}

function abreng(foto, wd, ht)
{
 if(nw) nw.close();
 nw=window.open("foto900.html?ft="+foto+"&w="+wd+"&h="+ht, "foto", "height="+(ht+100)+", width="+(wd+100));
 nw.moveTo(20,20);
 nw.focus();
}


timeoutflow = null;
timeoutwrap = null;
timeoutcont = null;
function show(que,cto,dto)
{
 eval ("clearTimeout(timeout"+que+")");
 document.getElementById(que).style.display= "block";
 document.getElementById(que).style.right=cto-240;
 document.getElementById(que).style.top=dto;
}

function unshow(que)
{
 eval("timeout"+que+"=setTimeout('unshow1(\""+que+"\")', 500)");
}

function unshow1(que)
{
  document.getElementById(que).style.display= "none";
}
