var pausa=3000

// ------------------------------------
if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontentS{display:none;}\n')
document.write('</style>\n')
}

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontentA{display:none;}\n')
document.write('</style>\n')
}

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontentB{display:none;}\n')
document.write('</style>\n')
}

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontentD{display:none;}\n')
document.write('</style>\n')
}

// --------------------------------------

var selezionatoS=0
var totalDivsS=0
function contraiS(){
  var incS=0
  while (document.getElementById("dropmsgS"+incS)){
  document.getElementById("dropmsgS"+incS).style.display="none"
  incS++
  }
}

var selezionatoA=0
var totalDivsA=0
function contraiA(){
  var incA=0
  while (document.getElementById("dropmsgA"+incA)){
  document.getElementById("dropmsgA"+incA).style.display="none"
  incA++
  }
}

var selezionatoB=0
var totalDivsB=0
function contraiB(){
  var incB=0
  while (document.getElementById("dropmsgB"+incB)){
  document.getElementById("dropmsgB"+incB).style.display="none"
  incB++
  }
}

var selezionatoD=0
var totalDivsD=0
function contraiD(){
  var incD=0
  while (document.getElementById("dropmsgD"+incD)){
  document.getElementById("dropmsgD"+incD).style.display="none"
  incD++
  }
}

// -------------------------------------------

function espandiunoS(){
var selezionatoObj=document.getElementById("dropmsgS"+selezionatoS)
contraiS()
//document.getElementById("dropcontentsubject").innerHTML=selezionatoObj.getAttribute("subject")
selezionatoObj.style.display="block"
selezionatoS=(selezionatoS<totalDivsS-1)? selezionatoS+1 : 0
setTimeout("espandiunoS()",pausa)
}

function espandiunoA(){
var selezionatoObj=document.getElementById("dropmsgA"+selezionatoA)
contraiA()
//document.getElementById("dropcontentsubject").innerHTML=selezionatoObj.getAttribute("subject")
selezionatoObj.style.display="block"
selezionatoA=(selezionatoA<totalDivsA-1)? selezionatoA+1 : 0
setTimeout("espandiunoA()",pausa)
}

function espandiunoB(){
var selezionatoObj=document.getElementById("dropmsgB"+selezionatoB)
contraiB()
//document.getElementById("dropcontentsubject").innerHTML=selezionatoObj.getAttribute("subject")
selezionatoObj.style.display="block"
selezionatoB=(selezionatoB<totalDivsB-1)? selezionatoB+1 : 0
setTimeout("espandiunoB()",pausa)
}

function espandiunoD(){
var selezionatoObj=document.getElementById("dropmsgD"+selezionatoD)
contraiD()
//document.getElementById("dropcontentsubject").innerHTML=selezionatoObj.getAttribute("subject")
selezionatoObj.style.display="block"
selezionatoD=(selezionatoD<totalDivsD-1)? selezionatoD+1 : 0
setTimeout("espandiunoD()",pausa)
}

// -------------------------------------------
function iniziascrollS(){
while (document.getElementById("dropmsgS"+totalDivsS)!=null)
totalDivsS++
espandiunoS()
if (!enablesubject)
document.getElementById("dropcontentSsubject").style.display="none"
}

function iniziascrollA(){
while (document.getElementById("dropmsgA"+totalDivsA)!=null)
totalDivsA++
espandiunoA()
if (!enablesubject)
document.getElementById("dropcontentAsubject").style.display="none"
}

function iniziascrollB(){
while (document.getElementById("dropmsgB"+totalDivsB)!=null)
totalDivsB++
espandiunoB()
if (!enablesubject)
document.getElementById("dropcontentBsubject").style.display="none"
}

function iniziascrollD(){
while (document.getElementById("dropmsgD"+totalDivsD)!=null)
totalDivsD++
espandiunoD()
if (!enablesubject)
document.getElementById("dropcontentDsubject").style.display="none"
}

// -------------------------------------------

if (window.addEventListener)
window.addEventListener("load", iniziascrollS, false)
else if (window.attachEvent)
window.attachEvent("onload", iniziascrollS)
else if (document.getElementById)
window.onload=iniziascrollS

if (window.addEventListener)
window.addEventListener("load", iniziascrollA, false)
else if (window.attachEvent)
window.attachEvent("onload", iniziascrollA)
else if (document.getElementById)
window.onload=iniziascrollA

if (window.addEventListener)
window.addEventListener("load", iniziascrollB, false)
else if (window.attachEvent)
window.attachEvent("onload", iniziascrollB)
else if (document.getElementById)
window.onload=iniziascrollB

if (window.addEventListener)
window.addEventListener("load", iniziascrollD, false)
else if (window.attachEvent)
window.attachEvent("onload", iniziascrollD)
else if (document.getElementById)
window.onload=iniziascrollD
