var currenttitle=1;
var nexttitle;

function setOpacity(id,value)
{
 var obj = document.getElementById(id);
 if (value==0) obj.style.display = 'none';
  else if (obj.style.display=='none' || obj.style.top!=0) { obj.style.display = 'block'; obj.style.top = '0'; }
 if (typeof document.body.style.opacity == 'string')
  obj.style.opacity = value/10;
 else if (typeof document.body.style.MozOpacity == 'string')
  obj.style.MozOpacity = value/10;
 else if (typeof document.body.style.KhtmlOpacity == 'string')
  obj.style.KhtmlOpacity = value/10;
 else if (document.body.filters && navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5)
 { 
  if(value==10) obj.style.filter='';
  else obj.style.filter = 'alpha(opacity=' + value*10 + ')';
 }
}


function fadeBlock(id,max)
{
 var i;
 var j=0;
 for (i=max;i>=0;i--)
 {
  setTimeout("setOpacity('"+id+"',"+i+")",50*j);
  j++;
 }
}


function showBlock(id,max)
{
 var i;
 for (i=0;i<=max;i++) setTimeout("setOpacity('"+id+"',"+i+")",50*i);
}


function changeTitle()
{
 nexttitle=currenttitle+1;
 if(nexttitle>2) nexttitle=1;
 fadeBlock('title'+currenttitle,10);
 showBlock('title'+nexttitle,10);
 currenttitle=nexttitle;
}