// Title: Tigra Scroller PRO
// URL: http://www.softcomplex.com/products/tigra_scroller_pro/
// Version: 2.0
// Date: 06-17-2004 (mm-dd-yyyy)
// Technical Support: support@softcomplex.com (specify product title and order ID)
// Notes: Registration needed to use this script legally.
//	Visit official site for details.
// ----------------------------------------
// set correct path to Tigra Scroller files
var TScroll_path_to_files = 'tsp_files/';


// please, don't change anything below this line
// ----------------------------------------------
var TScroll = [];
document.write('<scr' + 'ipt language="JavaScript" src="' + TScroll_path_to_files + 'scroll.'
                   + (document.layers ? 'nn4' : 'dom') + '.js"></scr' + 'ipt>');

function TScroll_init(tspp, tspq, tsp2)
    {
    this.id = TScroll.length;
    TScroll[this.id] = this;
    this.step = tspq.speed != 0 ? tspq.speed : 1;
    this.interval = tspq.interval ? tspq.interval : 50;
    this.tspr = this.tsps = 0;
    this.tspt = this.step < 0 ? [1, 0] : [0, 1];
    this.tspu = Math.abs(this.step);
    this.zindex = tspq.zindex ? tspq.zindex : 0;
    var i, tspv = function()
        {
        }, tsp1 = { "up": tspp.up && typeof (tspp.up) == "object" ? tspp.up : tspe.up,
                    "dn": tspp.dn && typeof (tspp.dn) == "object" ? tspp.dn : tspe.dn,
                    "pa": tspp.pa && typeof (tspp.pa) == "object" ? tspp.pa : tspe.pa,
                    "re": tspp.re && typeof (tspp.re) == "object" ? tspp.re : tspe.re,
                    "nx": tspp.nx && typeof (tspp.nx) == "object" ? tspp.nx : tspe.nx,
                    "pr": tspp.pr && typeof (tspp.pr) == "object" ? tspp.pr : tspe.pr,
                    "s_i": tspp.s_i,
                    "s_b": tspp.s_b,
                    "s_m": tspp.s_m }, vertical = tspq.vertical, w = tspp.size[0]
            ? tspp.size[0] : tspe.size[0], h = tspp.size[1] ? tspp.size[1] : tspe.size[1];

    this.height = vertical ? h : w;
    this.distance = typeof (tspp.distance) == 'number' ? tspp.distance : this.height;

    if (!vertical)
        this.tsp5 = tspp.item_w != null ? tspp.item_w : w;

    this.tspZ = 0;
    this.tspO = [];
    this.auto = tspq.auto;
    this.hide_buttons = tspq.hide_buttons;
    this.tspw = tsp0;
    this.tspn = tspx;
    this.tsp1 = [];
    this.img = [];
    this.tsp1.img = [];
    var c = this.tsp1.img;

    if (this.auto)
        {
        c[0] = new Image(tsp1.pa[2], tsp1.pa[3]);
        c[1] = new Image(tsp1.pa[2], tsp1.pa[3]);
        c[2] = new Image(tsp1.re[2], tsp1.re[3]);
        c[3] = new Image(tsp1.re[2], tsp1.re[3]);
        c[4] = new Image(tsp1.nx[2], tsp1.nx[3]);
        c[5] = new Image(tsp1.nx[2], tsp1.nx[3]);
        c[6] = new Image(tsp1.pr[2], tsp1.pr[3]);
        c[7] = new Image(tsp1.pr[2], tsp1.pr[3]);
        c[0].src = tsp1.pa[4] ? tsp1.pa[4] : tspe.pa[4];
        c[2].src = tsp1.re[4] ? tsp1.re[4] : tspe.re[4];
        c[4].src = tsp1.nx[4] ? tsp1.nx[4] : tspe.nx[4];
        c[6].src = tsp1.pr[4] ? tsp1.pr[4] : tspe.pr[4];
        c[1].src = tsp1.pa[5] ? tsp1.pa[5] : c[0].src;
        c[3].src = tsp1.re[5] ? tsp1.re[5] : c[2].src;
        c[5].src = tsp1.nx[5] ? tsp1.nx[5] : c[4].src;
        c[7].src = tsp1.pr[5] ? tsp1.pr[5] : c[6].src;
        this.tsp1.img = c
        }

    else
        {
        c[0] = new Image(tsp1.up[2], tsp1.up[3]);
        c[1] = new Image(tsp1.up[2], tsp1.up[3]);
        c[2] = new Image(tsp1.dn[2], tsp1.dn[3]);
        c[3] = new Image(tsp1.dn[2], tsp1.dn[3]);
        c[0].src = tsp1.up[4] ? tsp1.up[4] : tspe.up[4];
        c[2].src = tsp1.dn[4] ? tsp1.dn[4] : tspe.dn[4];
        c[1].src = tsp1.up[5] ? tsp1.up[5] : c[0].src;
        c[3].src = tsp1.dn[5] ? tsp1.dn[5] : c[2].src;
        this.tsp1.img = c
        }

    this.move = function(p)
        {
        if (this.tsps <= p && this.tspr == 0)
            {
            this.tsps = 0;
            this.tspr = setTimeout('TScroll[' + this.id + '].tsp02(' + p + ')', this.interval)
            }
        };

    this.stop = function(p)
        {
        if (this.tsps < p)
            this.tsps = p;

        if (this.tspy)
            {
            clearTimeout(this.tspy);
            this.tspy = 0
            }

        if (this.tspr != 0)
            {
            clearInterval(this.tspr);
            this.tspr = 0
            }
        };

    this.sleep = function(tspz)
        {
        this.stop(0);
        this.tspy = setTimeout('TScroll[' + this.id + '].tsp00()', tspz * 1000)
        };

    this.tsp00 = function()
        {
        this.tspW();
        this.tspZ -= this.step;
        this.move(0)
        };

    this.jump_to = function(tsp01)
        {
        if (!this.tspO[tsp01])
            return;

        this.tspZ = -this.img[tsp01];
        this.tspW()
        };

    this.tsp02 = function(p)
        {
        var i, j, t;

        for (i in this.tspO)
            for (j in this.tspt)
                if (Math.abs(this.tspZ + this.tspO[i].tsp03[this.tspt[j]]) < this.tspu)
                    {
                    var tsp04 = this.tspO.length - 1;

                    if (document.body && this.tsp9)
                        {
                        x = this.tspZ + this.tspO[i].tsp03[this.tspt[1 - j]];
                        this.t = ((x > 0) ^ (this.step > 0) || (x == 0)) ? (this.step > 0
                                                                               ? (i == tsp04 ? [this.img[0], 0] : [this.img[i * 1 + 1], i * 1 + 1])
                                                                               : (i == 0
                                                                                     ? [this.tspO[tsp04].tsp03[1], tsp04]
                                                                                     : [this.tspO[i - 1].tsp03[1], i - 1])) : 0
                        }

                    if (this.tspO[i].tsp05[this.tspt[j]] > 0)
                        {
                        this.tspZ = -this.tspO[i].tsp03[this.tspt[j]];
                        this.tspW(1);
                        return this.sleep(this.tspO[i].tsp05[this.tspt[j]])
                        }
                    }

        if (this.step > 0 && this.tspZ + this.tsp06 < this.tspu)
            this.tspZ = this.step;

        else if (this.step < 0 && -this.tspZ < this.tspu)
            this.tspZ = -this.tsp06;

        this.tspZ -= this.step;
        this.tspW();
        this.tspr = 0;
        this.move(p)
        };

    if (this.auto)
        this.tsp07 = this.tsp08 = this.tsp09 = this.tsp0A = this.click_pass = tspv;

    else
        {
        if (this.hide_buttons)
            this.tsp08 = this.tsp07 = tspv;

        this.tsp0B = this.tsp0C = this.tsp0D = this.tsp0E = tspv
        }

    this.tspw(w, h, vertical, tsp1, tsp2)
    }

function tspx()
    {
    this.tspK('lmain');
    this.tspb = this.tspV("lmain");

    for (var i in this.tspO)
        {
        this.img[i] = this.tspG(i);
        this.tspO[i].tsp03 = [this.img[i], this.tspG(i * 1 + 1) - this.distance - this.height]
        }

    this.tsp06 = this.img[this.img.length] = this.tspG(this.tspO.length);
    this.tspb.visibility = this.tspE;

    if (this.auto)
        {
        this.tsp1.pau = this.tspV("lpau");
        this.tsp1.res = this.tspV("lres");
        this.tsp1.nxt = this.tspV("lnxt");
        this.tsp1.prv = this.tspV("lprv");
        this.move(0)
        }

    else
        {
        this.tsp1.up = this.tspV("laup");
        this.tsp1.dn = this.tspV("ladn")
        }

    this.tsp0F = function(tsp0G, n)
        {
        var tsp0H = document.images['ib_' + n + '_' + this.id];

        if (tsp0H)
            tsp0H.src = this.tsp1.img[(tsp0G ? n + 1 : n)].src
        };

    if (this.auto)
        {
        this.tsp07 = this.hide_buttons ? function(n)
            {
            this.tsp0F(0, n);
            this.tsp1.nxt.visibility = this.tsp1.prv.visibility = this.tsp1.pau.visibility
                = this.tsp1.res.visibility = this.tspD;
            this.move(1);
            return true
            }: function(n)
            {
            this.tsp0F(0, n);
            this.move(1);
            return true
            };

        this.tsp08 = this.hide_buttons ? function(n)
            {
            this.tsp0F(1, n);
            this.tsp1.nxt.visibility = this.tsp1.prv.visibility = this.tspE;

            if (this.tsps < 2)
                {
                this.tsp1.pau.visibility = this.tspE;
                this.tsp1.res.visibility = this.tspD
                }

            else
                {
                this.tsp1.pau.visibility = this.tspD;
                this.tsp1.res.visibility = this.tspE
                }

            this.stop(1);
            return true
            }: function(n)
            {
            this.tsp0F(1, n);
            this.stop(1);
            return true
            };

        this.tsp09 = function()
            {
            this.tsp1.pau.visibility = this.tspD;
            this.tsp1.res.visibility = this.tspE;
            this.stop(2)
            };

        this.tsp0A = function()
            {
            this.tsp1.pau.visibility = this.tspE;
            this.tsp1.res.visibility = this.tspD;
            this.tsps = 1
            };

        this.click_pass = function(tsp0I)
            {
            if (this.step * tsp0I > 0)
                {
                var i = 0;

                while (i < this.img.length && this.img[i] <= -this.tspZ)
                    i++;

                if (i == this.img.length - 1)
                    i = 0;

                this.tspZ = -this.img[i]
                }

            else
                {
                var i = this.img.length - 1;

                while (i >= 0 && this.img[i] >= -this.tspZ)
                    i--;

                if (i == -1)
                    i = this.tspO.length - 1;

                this.tspZ = -this.img[i]
                }

            this.tspW()
            }
        }

    else
        {
        if (this.hide_buttons)
            {
            this.tsp08 = function(n)
                {
                this.tsp0F(1, n);
                this.tsp1.up.visibility = this.tsp1.dn.visibility = this.tspE
                };

            this.tsp07 = function(n)
                {
                this.tsp0F(0, n);
                this.tsp1.up.visibility = this.tsp1.dn.visibility = this.tspD
                };

            this.tsp0B = this.tsp0C = function(n)
                {
                this.tsp0F(0, n);
                this.tsp07();
                this.stop(1)
                }
            }

        else
            this.tsp0B = this.tsp0C = function(n)
                {
                this.tsp0F(0, n);
                this.stop(1)
                };

        this.tsp0D = function(n)
            {
            this.tsp0F(1, n);

            if (this.hide_buttons)
                this.tsp08();

            this.step = -this.tspu;
            this.tspt = [0, 1];
            this.move(1)
            };

        this.tsp0E = function(n)
            {
            this.tsp0F(1, n);

            if (this.hide_buttons)
                this.tsp08();

            this.step = this.tspu;
            this.tspt = [1, 0];
            this.move(1)
            }
        }
    }

var tspe = { 'size': [150, 100], 'up': [130, 4, 16, 16, TScroll_path_to_files + 'aup.gif'],
                 'dn': [130, 80, 16, 16, TScroll_path_to_files + 'adn.gif'],
                 'pa': [110, 80, 16, 16, TScroll_path_to_files + 'pau.gif'],
                 're': [110, 80, 16, 16, TScroll_path_to_files + 'res.gif'],
                 'nx': [130, 80, 16, 16, TScroll_path_to_files + 'nxt.gif'],
                 'pr': [90, 80, 16, 16, TScroll_path_to_files + 'prv.gif'],
                 'tspf': TScroll_path_to_files + 'pixel.gif' }
