function createTicker(tickerId, winId, parentId, dataArray, actType, ds, interval, delay)
 {this.id = tickerId;                              //ticker id
  this.win = winId;                                //for window and mouse coordinate

  /* check criterias */
  if (typeof(tickerId)!='string') {alert("ticker id is undefined, check the parameters"); return;}
  if (typeof(winId)!='object') {alert("ticker windows object for mouse coordinate is undefined, check the parameters"); return;}
  if (typeof(parentId)!='string') {alert("ticker parent id is undefined, check the parameters"); return;}
  if (dataArray.length<1) {alert("ticker data sources are undefined, check the parameters"); return;}

  /* define defaults */
  if (isNaN(ds)) ds=-1;
  if (isNaN(interval)) interval=15;
  if (isNaN(delay)) delay=999;
  this.actType = (actType=="y" || actType==1)?1:0; //action type  0 - x direction,  1 - y direction
  this.direction = (ds>=0)?1:-1;                   //shift direction 1 - forward,  -1 - backward

  /* define parent element */
  this.parentId = parentId;                        //parent element id
  this.parentTag = document.getElementById(parentId);
  this.parentTag.style.overflow = "hidden";
  this.parentW = this.parentTag.offsetWidth;       //ticker window width
  this.parentH = this.parentTag.offsetHeight;      //ticker window height
  this.parentTag.style.width  = this.parentW+"px"; //for no wrap
  this.parentTag.style.height = this.parentH+"px"; //for no wrap
  this.parentLen = (this.actType)?this.parentH:this.parentW;

  /* define and deploy cars */
  this.tag = document.createElement("div");
  this.tag.style.position = "relative";
  this.tag.style.textAlign = "left";
  this.parentTag.appendChild(this.tag);
  this.tagLen = 0;
  for (i=0; i<dataArray.length; i++)
      {divTag = document.createElement("div");
       divTag.id = this.id+"Data".concat(i);
       divTag.innerHTML = dataArray[i];
       if (!this.actType) divTag.style.display = "inline";
       this.tag.appendChild(divTag);
       this.tagLen += (this.actType)?divTag.offsetHeight:divTag.offsetWidth;
      }
  if (this.direction==1) {this.tag.insertBefore(this.tag.lastChild, this.tag.firstChild);}
  this.tag.style.width  = ((this.actType)?this.parentW:this.tagLen)+"px";
  this.tag.style.height = ((this.actType)?this.tagLen:this.parentH)+"px";
  this.childLen = (this.actType)?this.tag.firstChild.offsetHeight:this.tag.firstChild.offsetWidth;

  /* define event */
  this.tag.onmouseover = new Function(this.id+".stop()");
  this.tag.onmouseout  = new Function(this.id+".modify()");
  this.win.cancelCalls.push(this.id+".cancel()");

  /* define action */
  this.s         = 0;                              //ticker current pull left
  this.ds        = ds?Math.abs(ds):1;              //ticker shift at each time
  this.mouse     = new vec(0, 0);                  //mouse over start coordinates
  this.switchOn  = 0;                              //switch on and off
  this.interval  = interval ? interval : 50;       //ticker timer interval in milliseconds
  this.delay     = delay ? delay : 0;              //timer starting pause interval in milliseconds
  this.timerId   = null;                           //ticker timer Id

  /* remove extra textnodes that may separate the child nodes of the ticker div */
  var node = this.tag.firstChild;
  while (node)
     {next = node.nextSibling;
      if (node.nodeType == 3) this.tag.removeChild(node);
      node = next;
     }

  /* define methods */
  this.click = function ()
    {if (!this.switchOn)
       {this.switchOn=(1+this.switchOn)%2
        this.timerId = setTimeout(this.id+'.run()', this.delay)
       }
     }

  this.run = function ()
    {this.s += this.ds;

     if (this.childLen-this.s <= 0)
        {this.s = 0;
         if (this.direction==1) {this.tag.insertBefore(this.tag.lastChild, this.tag.firstChild);}
           else {this.tag.appendChild(this.tag.firstChild);}
         this.childLen = (this.actType)?this.tag.firstChild.offsetHeight:this.tag.firstChild.offsetWidth;
        }

     if (this.actType) this.tag.style.top = ((this.direction==1)?this.s-this.childLen:-this.s)+"px";
      else this.tag.style.left = ((this.direction==1)?this.s-this.childLen:-this.s)+"px";
     this.timerId = setTimeout(this.id+'.run()', this.interval);
    }

  this.modify = function ()
    {var oldDirection = this.direction
     if (this.actType==1) this.direction = (this.win.mouse.y-this.mouse.y>0)?1:-1;
       else this.direction = (this.win.mouse.x-this.mouse.x>0)?1:-1;

     if (this.direction != oldDirection) this.s=this.childLen-this.s;

     this.stop();
     this.run();
    }

  this.change = function (newinterval)
    {if (typeof(newinterval) == 'string') newinterval = parseInt('0' + newinterval, 10);
     if (typeof(newinterval) == 'number' && newinterval > 0) this.interval = newinterval;
    
     this.stop();
     this.run();
    }

  this.stop = function ()
    {if (this.timerId) clearTimeout(this.timerId);
     this.timerId = null;
     this.mouse.set(this.win.mouse.x, this.win.mouse.y);
    }

  this.cancel = function ()
    {this.stop();
     this.id = null;
    }
 }