function Slides()
{
    this.width = 112;
    this.steps = 10
    this.timeout = false
    this.position=0;
    this.maxposition=0;
    this.showfotos=4;
    this.slidespeed=20;

    this.ClickThumb = function(n) {
        if (this.position==0 && n ==-1) return;
        if (this.position==this.maxposition && n ==1) return;
        //alert(this.position +" "+ n);
        this.position = this.position+n;

        this.From = $('thumbcontainer').scrollLeft
        this.To = this.width*this.position + 9
        this.DoStep(0)

    }

    this.setNumberFotos = function(number){
        this.maxposition=number-this.showfotos;
    }

    this.DoStep = function(step) {
        step ++
        //alert(this.To +" "+ this.From+" "+ step+" "+ $('thumbcontainer').scrollTop +"\n"+
        // this.Factor(step / this.steps) +" "+ (this.To - this.From) + "\n"+this.Factor(step / this.steps) * (this.To - this.From))
        $('thumbcontainer').scrollLeft = this.Factor(step / this.steps) * (this.To - this.From) + this.From
        if (this.timeout) clearTimeout(this.timeout)
        if (step < this.steps) this.timeout = setTimeout('Slider.DoStep(' + step + ')', this.slidespeed)
    }

    this.Factor = function(f) {
        return .5 - Math.cos(f * Math.PI) * .5
    }
}
