function writeimg()
{
  var now = new Date();
  var min = now.getMinutes()*60;
  var i=((min-min%10)/10)%8;
  document.write('<map name ="mcsup"><area shape ="rect" coords ="0,0,10,10" href ="mcsup.php">');

  if (i==0) document.write('<img height=180 width=790 src="images/foto1.jpg" border=0 usemap ="#mcsup">');
  if (i==1) document.write('<img height=180 width=790 src="images/foto2.jpg" border=0 usemap ="#mcsup">');
  if (i==2) document.write('<img height=180 width=790 src="images/foto3.jpg" border=0 usemap ="#mcsup">');
  if (i==3) document.write('<img height=180 width=790 src="images/foto4.jpg" border=0 usemap ="#mcsup">');
  if (i==4) document.write('<img height=180 width=790 src="images/foto5.jpg" border=0 usemap ="#mcsup">');
  if (i==5) document.write('<img height=180 width=790 src="images/foto6.jpg" border=0 usemap ="#mcsup">');
  if (i==6) document.write('<img height=180 width=790 src="images/foto7.jpg" border=0 usemap ="#mcsup">');
  if (i==7) document.write('<img height=180 width=790 src="images/foto8.jpg" border=0 usemap ="#mcsup">');
}

stop = false;

function scroll(s)
{
  var obj = document.getElementById("scroll");
  obj.style.top = (parseInt(obj.style.top)+s);
  if( (parseInt(obj.style.top)>0) ) obj.style.top = 0;
        else if( 114-parseInt(obj.offsetHeight)>parseInt(obj.style.top)) obj.style.top = 114-parseInt(obj.offsetHeight);
  else if( !stop ) setTimeout("scroll("+s+")",40);
}

function StartScroll(s)
{
  stop=false;
  scroll(s);
}

function EndScroll()
{
  stop=true;
}


function ITH(n)
{
  var result = n.toString(16);
  if (result.length==1) result = "0"+result;
  return result;
}


function HTI(hex)
{
  return parseInt(hex, 16);
}


function hidemenu(name,w)
{
  rstr=ITH(((w*HTI("FF")+(8-w)*HTI("77"))-((w*HTI("FF")+(8-w)*HTI("77"))%8))/8);
  gstr=ITH(((w*HTI("FF")+(8-w)*HTI("77"))-((w*HTI("FF")+(8-w)*HTI("77"))%8))/8);
  bstr=ITH(((w*HTI("FF")+(8-w)*HTI("77"))-((w*HTI("FF")+(8-w)*HTI("77"))%8))/8);
  str="#"+rstr+gstr+bstr;
  var obj=document.getElementById(name);
  obj.style.background=str;
  obj=document.getElementById(name+"x");
  obj.style.background=str;
  if( w!=0 ) setTimeout("hidemenu('"+name+"',"+(w-1)+",false)",40);
}

function fade(name,fin)
{
  if( fin ) {
    var obj=document.getElementById(name);
    obj.style.background="#FFFFFF";
    obj=document.getElementById(name+"x");
    obj.style.background="#FFFFFF";
  }
  else setTimeout("hidemenu('"+name+"',8,false)",40);
}
