Why not just save yourself some time and use a javascript or similar that means you don't have to re-invent the wheel?
PHP Code:
function initBanner() {
if ( !document.getElementById ) return;
// arguments: id, delay (amount of time in milliseconds you linger on each item)
// set up pause onmouseover and resume onmouseout? (boolean)
var ban1 = new dw_Banner('bannerDiv', 4500, true);
// add as many items as you like
ban1.addItem('‘Do what you love and love what your’re doing and you’ll never work another day in your life’ Unknown source');
ban1.addItem('‘If you are not using your smile, your’e like a man with a million dollars in the bank account and no checkbook’ Les Giblin');
ban1.addItem('‘The time is always right to do what is right’ Martin Luther King Jr');
ban1.addItem('‘What lies behind us and what lies before us are tiny matters compared to what lies within us’ Ralph Waldo Emerson');
ban1.addItem('‘Integrity is not a 90 percent thing, not a 95 percent thing, either you have it or you don’t’ Peter Scotese');
ban1.addItem('‘Never, never, never give up’ Winston Churchill');
ban1.addItem('‘You must be the change you wish to see in the world’ Ghandi');
ban1.rotate(); // Begin the rotation
}
Then add this to the body tag!
PHP Code:
<body onLoad="initBanner()" >
Add your div wherever!
PHP Code:
<div id="bannerDiv" >
‘Never, never, never give up’
<br>
Winston Churchill
</div>
Now look I did not create this so credit goes to:
www.dyn-web.com/bus/terms.html
Check their terms and stuff but I am sure it's ok
Have fun