var isDOM = (document.getElementById ? true : false);
var isIE  = (document.all ? true: false);
var isNS4 = (navigator.appName=='Netscape' && !isDOM ? true : false);
var isIE4 = ((isIE && !isDOM) ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

function getRef(id, par)
{
 par = (!par ? document : (par.navigator ? par.document : par));
 return (isIE ? par.all[id] :
  (isDOM ? (par.getElementById?par:par.ownerDocument).getElementById(id) :
  par.layers[id]));
}

function LayerObj(id, par)
{
 this.ref = getRef(id, par);

 this.write = function(txt) {
  if (isNS4) with (this.ref.document) { write(txt); close() }
  else this.ref.innerHTML = txt }

 return this;
}
function getLyr(id, par) { return new LayerObj(id, par) }








function txcCycle() { with (this)
{
 if (!div) div = getLyr(myName + 'Layer');
 
 // Increment the counter by 1, trim by array length.
 count = ((count - step) % colours.length);

 var str = '<span class="' + myName + '">';
 
 for (var i = 0; i < text.length; i++)
 {

  var pos = (count + i) % colours.length;
  if (pos < 0) pos += colours.length;
  str += '<font color="' + colours[pos] + '">' + text.substring(i, i + 1) + '</font>';
 }


 div.write(str + '</span>');


 setTimeout(myName + '.cycle()', interval);
}}

function TextCycler(myName)
{
 this.myName = myName;
 this.div = null;


 this.colours = null;


 this.interval = 100;

 this.count = 0;


 this.step = 1;


 this.text = '';


 this.cycle = txcCycle;
}








// *** START EDITING HERE ***

// Create a new cycler, pass it its own name. Its name is also used as a stylesheet
// class, and the ID of its container layer below.
var waveText = new TextCycler('waveText');
with (waveText)
{
 // Set an array of colours through which it cycles.
 colours = new Array('#999999', '#aaaaaa', '#bbbbbb', '#ccccccc', '#dddddd', '#eeeeee',
  '#ffffff', '#eeeeee', '#dddddd', '#cccccc', '#bbbbbb', '#aaaaaa', '#999999');

 // Some text...
 text = "Türkiye'nin Her Yerine Ücretsiz Teslimat";

 // Optionally set speed and direction.
 //interval = 200;
 //step = -1;
}

// Call it onload. Remember to add any other functions you're calling onload in here, and
// don't have a BODY ONLOAD section below.
window.onload = new Function('waveText.cycle()');