var myTop = '0px';
var mySetTop = '0px';
var mySetLeft = '0px';
var myLeft = mySetTop;
var mySetRight = '450px';
var myRight = mySetRight;
var mySetWidth = '550px';
var myWidth = mySetWidth;
var marginTopStep=25;
var fadeSteps = 50;
var fadeDelay = 30;
var iTotMsg = 22; 
var nextSetDelay = 5000;
var loopPrepend = true;
var iPause = false;
var arMessage = new Array(
"&nbsp;&nbsp;which spawns new media;",
"&nbsp;&nbsp;which hatches new neural pathways to connect/engage;",
"&nbsp;&nbsp;which amasses virtual traffic into an information jet stream;",
"&nbsp;&nbsp;which charges the resource clouds;",
"&nbsp;&nbsp;which discharge to storage cells of education in and out of institutions;",
"&nbsp;&nbsp;which illuminates individuals with new critical mass empowerment;",
"&nbsp;&nbsp;which explodes into new levels of commerce;",
"&nbsp;&nbsp;which mandate new organizational structures;",
"&nbsp;&nbsp;which erupt into new centers of influence.",
"&nbsp;&nbsp;",
"&nbsp;&nbsp;",
"&nbsp;&nbsp;which spawns new media;",
"&nbsp;&nbsp;which hatches new neural pathways to connect/engage;",
"&nbsp;&nbsp;which amasses virtual traffic into an information jet stream;",
"&nbsp;&nbsp;which charges the resource clouds;",
"&nbsp;&nbsp;which discharge to storage cells of education in and out of institutions;",
"&nbsp;&nbsp;which illuminates individuals with new critical mass empowerment;",
"&nbsp;&nbsp;which explodes into new levels of commerce;",
"&nbsp;&nbsp;which mandate new organizational structures;",
"&nbsp;&nbsp;which erupt into new centers of influence.",
"&nbsp;&nbsp;",
"&nbsp;&nbsp;");
var elIdx = 0, msgIdx = 0, fadeStep = 0;
var iPause=false;
var fadeElem;
var msgLen = arMessage.length;
function fadeMsg(){
    if(elIdx == iTotMsg || (!loopPrepend && (msgIdx == msgLen))){
        if(elIdx != iTotMsg)msgIdx = 0;
        elIdx = 0;
        if (iPause)return;
        setTimeout('fadeMsg()', nextSetDelay);
    }else{
        if(elIdx == 0) {
	  myTop = mySetTop;
	  myLeft = mySetLeft;
	  myRight = mySetRight;
	  myWidth = mySetWidth;
        }
        fadeStep = 20;
        if(elIdx == (iTotMsg/2)) {
          myTop = mySetTop;
          myTop = parseInt(myTop.substr(0,myTop.indexOf('px')))-1+'px';
          myLeft = parseInt(myLeft.substr(0,myLeft.indexOf('px')))-1+'px';
          //alert("myLeft="+myLeft+" myTop="+myTop);
        }
        document.getElementById('fadeElem'+elIdx).style.marginLeft=myLeft;
        document.getElementById('fadeElem'+elIdx).style.marginTop=myTop;
        document.getElementById('fadeElem'+elIdx).style.width=myWidth;
        document.getElementById('fadeElem'+elIdx).style.marginRight=myRight;
        myTop=parseInt(myTop.substr(0,myTop.indexOf('px')))+marginTopStep+'px';
        if(msgIdx == msgLen)msgIdx = 0;
        if(elIdx == 0){
            for(var i=0;i<iTotMsg;i++){setOpacity(document.getElementById('fadeElem'+i), 0);}
        }
        fadeElem = document.getElementById('fadeElem' + elIdx);
        fadeElem.innerHTML = arMessage[msgIdx];
        //alert("arMessage\[msgIdx\]="+arMessage[msgIdx]);
        fadeStep = 0;
        elIdx++;
        msgIdx++;
        fadeIn();
    }

}
function fadeIn() {
    if(fadeStep > fadeSteps){
        fadeMsg();
        return;
    }
    setOpacity(fadeElem, (fadeStep/fadeSteps));
    fadeStep++;
    window.setTimeout("fadeIn()", fadeDelay);
}
function setOpacity( el, opacity){
    if(el.style.opacity != undefined){
        el.style.opacity = opacity;
    }else if( el.style.MozOpacity != undefined){
        el.style.MozOpacity = opacity;
    }else if ( el.style.filter != undefined){
        el.style.filter="alpha(opacity=" + Math.round(opacity * 100) + ")";
    }
}

