function msgticker(divname,tickername,httppage,happyhour) 
{
    this.mtouinterval = 60*5;
    this.mtdivname = divname;
    this.mtpage = httppage;
    this.mtintervalid = 0;
    this.happyhour = 1;
    this.tickername = tickername;
    this.mtintervalid = 0;
    if(happyhour != 1){
	    this.happyhour = 0;
    }

    this.mtticker = null;

    this.LimitSize = function(val) 
    {
        if (!this.mtticker) {
            this.mtticker = new ajaxticker(this.tickername,this.happyhour);
        }
        this.mtticker.LimitSize(val);
    }

    this.DynamicResize = function(val)
    {
        if (!this.mtticker) {
            this.mtticker = new ajaxticker(this.tickername,this.happyhour);
        }
        this.mtticker.DynamicResize(val);
    }

    this.SetSpeed = function(val)
    {
        if (!this.mtticker) {
            this.mtticker = new ajaxticker(this.tickername,this.happyhour);
        }
        this.mtticker.SetSpeed(val);
    }

    this.TickTime = function(val)
    {
        if (!this.mtticker) {
            this.mtticker = new ajaxticker(this.tickername,this.happyhour);
        }
        this.mtticker.TickTime(val);
    }

    this.Interval = function(val)
    {
        this.mtouinterval = val;
    }

    this.update = function(temp) {
        new Ajax.Request(temp.mtpage, {
            method: 'get',
            onSuccess: function(response) { $(temp.mtdivname).update(response.responseText); temp.mtticker.updateContent(); }
        });

        return true;
   }

   this.start = function(firstupdate) {
       if (!this.mtticker) {
            this.mtticker = new ajaxticker(this.tickername,this.happyhour);
       }
       if (firstupdate != 0) {
            this.update(this);
       } else {
            this.mtticker.updateContent();
       }
       var temp = this;
       if (this.mtintervalid) {
            clearInterval(this.mtintervalid);
             this.mtintervalid = 0;
       }
       this.mtintervalid = setInterval(function() { temp.update(temp); },this.mtouinterval * 1000);
    }

    this.Pause = function() {
        if (this.mtticker) {
            this.mtticker.Pause();
        }
    }

    this.Resume= function(e) {
        if (this.mtticker) {
            this.mtticker.Resume(e);
        }
    }

    this.stop = function() {
        //this.mtticker.stop();
        if (this.mtintervalid) {
            clearInterval(this.mtintervalid);
            this.mtintervalid = 0;
        }
    }
}

