// **** Table #1 3X2 TOP 125x125 pics images****

//  declare 3 dimensional array
var NumberOfSets = 2;
var ProductsPerSet = 6;    
var Sets = new Array(NumberOfSets);
for(var i = 0; i < NumberOfSets; i++)
    Sets[i] = new Array(ProductsPerSet);

//  populate sets
//  Format: Html File, Alt Tag, Image File, Link Text
var SetNumber = -1;
var ProductNumber = -1;

//  Set #1
SetNumber++;
ProductNumber = 0;
Sets[SetNumber][ProductNumber] = ['electric-office-stapler.html', 'Electronic staplers', 'electric-staplers/electric-stapler-5050-sm.jpg', '<br>Electronic Staplers<br><br>'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['industrial-tackers.html', 'Fasco Staple Guns', 'air-staple-gun/air-staple-gun-f1b-std-s.jpg', 'Fasco Staple Guns<br><br>'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['bindery-stapler.html', 'Salco Long reach stapler', 'new-homepage/long-stapler-booklet.jpg', 'Salco HD-23L<br><br>'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['bindery-stapler.html', 'Rapid HD210 Heavy Duty stapler', 'heavy-duty-staplers/HD210-desktop-stapler-s.jpg', '<font color=#ff3366>* New *</font> Rapid HD210'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['hog-ring-sealers.html', 'Bostitch Hog Ring Staplers', 'bostitch-staplers/bostitch-hog-ring-stapler.jpg', 'Bostitch Hog Ring Staplers'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['electric-tacker-1.html', 'Maestri electric staplers', 'electric-tackers/ME-3G-electric-tacker-s.jpg', '<FONT color=#ff3366>Special Price</FONT><BR>Maestri Electric tackers'];
ProductNumber++;

//  Set #2
SetNumber++;
ProductNumber = 0;
Sets[SetNumber][ProductNumber] = ['upholstery-staplers.html', 'Upholstery Staplers', 'new-homepage/upholstery-stapler.jpg', 'Upholstery Staplers'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['frame-brad-nailer-f18.html', 'Picture Framing', 'new-homepage/back-framing.jpg', 'Picture Framing'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['electric-tacker-2.html', 'Maestri electric staplers', 'new-homepage/electric-staple-gun.jpg', 'Maestri Electric tacker'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['steel-strapping-tool.html', 'Steel Strapping Tool', 'new-homepage/strapping-tool.jpg', 'Steel Strapping Tool'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['hog-ring-pliers-2.html', 'Hog Ring Pliers', 'new-homepage/hog-ring-plier.jpg', 'Hog Ring Pliers'];
ProductNumber++;
Sets[SetNumber][ProductNumber] = ['electric-office-stapler.html', 'Electronic staplers', 'new-homepage/electric-stapler-5080.jpg', 'Electronic Staplers'];
ProductNumber++;



function SetupTable1() {
    
    //  output a random set
    var Set = Math.floor(Math.random() * NumberOfSets);
    for (var i = 0; i < ProductsPerSet; i++) {
        document.write('<TD width=33%><A href=http://www.stapleheadquarters.com/' + Sets[Set][i][0] + '><IMG alt=' + Sets[Set][i][1] + ' src=http://www.stapleheadquarters.com/' + Sets[Set][i][2] + ' border=0><BR>' + Sets[Set][i][3] + '</TD>');
        if (i == 2)
            document.write('</TR><TR class=text2ac vAlign=bottom align=middle>');
    }
    
}


// **** Table #2 100x100 pix images****

var ProductsPerRow = 7;
var TotalNumberOfProducts = 28;
var Rows = new Array(TotalNumberOfProducts);

//  Format: Html File, Alt Tag, Image File

var ProductNum = 0;


//  Row #1


Rows[ProductNum] = ['electric-stapler-105-g.html', 'Salco R105 gangster', 'stapling-applications/105-envelop.jpg'];
ProductNum++;
Rows[ProductNum] = ['industrial-tackers.html', 'Hammer tackers', 'stapling-applications/hammer-tacker.jpg'];
ProductNum++;
Rows[ProductNum] = ['rapid-electric-staplers-1.html', 'Rapid 5080 electric office stapler', 'stapling-applications/5080-stapling.jpg'];
ProductNum++;
Rows[ProductNum] = ['carton-staplers.html', 'Top carton staplers', 'stapling-applications/top-carton-stapler.jpg'];
ProductNum++;
Rows[ProductNum] = ['hog-ring-pliers-2.html', 'Bostitch HFP9 hog ring tool', 'stapling-applications/bostitch-hfp9-ss.jpg'];
ProductNum++;
Rows[ProductNum] = ['carton-staplers-2.html', 'sealing partial overlap carton', 'stapling-applications/stapler-p50cr.jpg'];
ProductNum++;
Rows[ProductNum] = ['carton-staplers-2.html', 'Bottom carton staplers', 'stapling-applications/bottomer.jpg'];
ProductNum++;

//  Row #2

Rows[ProductNum] = ['hog-ring-pliers-1.html', 'Bostitch P7 for labeling', 'stapling-applications/bostitch-p7-lab-ss.jpg'];
ProductNum++;
Rows[ProductNum] = ['hog-ring-pliers-1.html', 'Bostitch P7', 'stapling-applications/bostitch-p7-sm.jpg'];
ProductNum++;
Rows[ProductNum] = ['hog-ring-pliers-1.html', 'Bostitch P7', 'stapling-applications/bostitch-p7-bag.jpg'];
ProductNum++;
Rows[ProductNum] = ['bostitch-bag-sealer-3.html', 'Bostitch SC743 for insulation', 'stapling-applications/insulation-SC743-s.jpg'];
ProductNum++;
Rows[ProductNum] = ['hog-ring-sealers.html', 'Bostitch SC7C pneumatic bag sealer', 'stapling-applications/bostitch-sc7c-ss.jpg'];
ProductNum++;
Rows[ProductNum] = ['carton-staplers-2.html', 'Pliers for stapling box ends', 'stapling-applications/end-box-pliers.jpg'];
ProductNum++;
Rows[ProductNum] = ['specialty-staplers.html', 'Rapid hog ring tool to secure branches', 'stapling-applications/secure-branches.jpg'];
ProductNum++;


//  Row #3

Rows[ProductNum] = ['manual-plier-stapler.html', 'Heavy duty pliers', 'stapling-applications/plier-anvil-carton.jpg'];
ProductNum++;
Rows[ProductNum] = ['electric-staple-guns.html', 'electric staple guns', 'stapling-applications/et155-to-wood.jpg'];
ProductNum++;
Rows[ProductNum] = ['electric-office-stapler.html', 'Salco R106 electric stapler', 'stapling-applications/106-booklet.jpg'];
ProductNum++;
Rows[ProductNum] = ['industrial-tackers.html', 'pneumatic staple guns', 'stapling-applications/bostitch-wood.jpg'];
ProductNum++;
Rows[ProductNum] = ['decorative-nail-gun.html', 'Decorative nail gun', 'upholstery-tacks/deco-appl2-s.jpg'];
ProductNum++;
Rows[ProductNum] = ['industrial-stapler.html', 'Industrial staplers', 'stapling-applications/industrial-stapler-p50.jpg'];
ProductNum++;
Rows[ProductNum] = ['hog-ring-sealers.html', 'Bostitch SC-7 pneumatic bag sealer', 'stapling-applications/bostitch-sc7-ss.jpg'];
ProductNum++;

//  Row #4

Rows[ProductNum] = ['arrow-staple-gun-4.html', 'Arrow ET155 for carpeting', 'stapling-applications/et155-carpet.jpg'];
ProductNum++;
Rows[ProductNum] = ['electric-stapler-105.html', 'Salco R105 for fabric stapling', 'stapling-applications/fabric-stapling.jpg'];
ProductNum++;
Rows[ProductNum] = ['bostitch-bag-sealer-5.html', 'Bostitch SC7C for bait bag', 'stapling-applications/bait-bag-SC7C.jpg'];
ProductNum++;
Rows[ProductNum] = ['upholstery-staplers.html', 'upholstery applications', 'stapling-applications/ETF50bn-uphlst.jpg'];
ProductNum++;
Rows[ProductNum] = ['long-reach-stapler.html', 'Salco HD-23L long reach stapler', 'stapling-applications/long-reach-stapler.jpg'];
ProductNum++;
Rows[ProductNum] = ['electric-staple-gun.html', 'Arrow electric staplers for picture framing', 'stapling-applications/ETFX50-Picture-Frame-s.jpg'];
ProductNum++;
Rows[ProductNum] = ['specialty-staplers.html', 'RO-MA F18 for picture frame backing', 'stapling-applications/f18-frame-nailer.jpg'];
ProductNum++;



function Previous() {
    Start = Start - ProductsPerRow;
    if (Start < 0) Start = TotalNumberOfProducts - ProductsPerRow;
    SetupTable2();
}

function Next() {
    Start = Start + ProductsPerRow;
    if (Start >= TotalNumberOfProducts) Start = 0;
    SetupTable2();
}

function SetupTable2() {
    for (var i = 0; i < ProductsPerRow; i++) {
        var aTag = document.getElementById("a" + i);
        aTag.href = 'http://www.stapleheadquarters.com/' + Rows[Start + i][0];
        var imgTag = document.getElementById("img" + i);
        imgTag.alt = Rows[Start + i][1]; 
        imgTag.src = 'http://www.stapleheadquarters.com/' + Rows[Start + i][2];            
    }
}