var numsec = new Array("01","02","03","04","05","06","07","08","09","10");
var visible = -1;        // guarda numero de fot visible actualvar 
var foto  = 'fot01gran '; 
function secuencia(arr,val)   //Ocurrencia en un array
{ for (var g=0;g<arr.length;g++) {if (val==arr[g]) {return g;}} return 0;
}
function sobrefoto(nombre)    
{ if (visible >= 0)
  {Presentar('fot'+numsec[visible]+'gran ',160,-500,80,30,0,0);}
   visible=secuencia(numsec,nombre);  
   Presentar('fot'+numsec[visible]+'gran ',100,+10,80,30,0,0); 
   foto = 'fot'+numsec[visible]+'gran ';
}
function fuerafoto()   
{  //foto.onfocus=this.blur(); }
}
function buscaObjeto(n, d) 
{ 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=buscaObjeto(n,d.layers[i].document);
         if(!x && d.getElementById)  x=d.getElementById(n); 
  return x;
}
function Presentar(el, x, y, a, b, c, s) 
{ //Presenta fija en pantalla la fot sobre la que se posa el raton 
  var g,elo=el,f="",m=false,d="";x=parseInt(x);y=parseInt(y);
  var t = 'g.p7Magic = setTimeout("Presentar(\''+elo+'\','; 
  if ((g=buscaObjeto(el))!=null) 
  { d=(document.layers)?g:g.style; }
  else { return;                   }
  if (parseInt(s)>0)
  { eval(t+x+','+y+','+a+','+b+','+c+',0)",' + s+')');  return;   }
  var xx=(parseInt(d.left))?parseInt(d.left):0;
  var yy=(parseInt(d.top))?parseInt(d.top):0;
  if (parseInt(c)==1)  
  { x+=xx;y+=yy;m=true;c=0;        }
  else if (c==2) 
       { m=false;clearTimeout(g.p7Magic); }
       else { var i=parseInt(a);
              if (eval(g.moved)) { clearTimeout(g.p7Magic);           }
              if (xx<x)          { xx+=i; m=true;  if(xx>x) { xx=x; } }
              if (xx>x)          { xx-=i; m=true;  if(xx<x) { xx=x; } }
              if (yy<y)          { yy+=i; m=true;  if(yy>y) { yy=y; } }
              if (yy>y)          { yy-=i; m=true;  if(yy<y) { yy=y; } }
       }
       if (m) 
       { if((parseInt(navigator.appVersion)>4       ||
                      navigator.userAgent.indexOf("MSIE")>-1)&&
                      navigator.userAgent.indexOf("Opera")==-1)
         { xx+="px";  yy+="px"; }
         d.left=xx;
         d.top=yy; 
         g.moved=true;
         eval (t+x+','+y+','+a+','+b+','+c+',0)",'+b+')'); }
         else   { g.moved=false;                                      }      
}
