
/* - matteipic.js - */
// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 5000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 500;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var Link = new Array();

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'http://www.matteicos.com/images/sea09cap.jpg';
Picture[2]  = 'http://www.matteicos.com/images/ag09cap.jpg';
Picture[3]  = 'http://www.matteicos.com/images/forest09cap.jpg';
Picture[4]  = 'http://www.matteicos.com/images/movingstorage09cap.jpg';
Picture[5]  = 'http://www.matteicos.com/images/waste09cap.jpg';
Picture[6]  = 'http://www.matteicos.com/images/wd09cap.jpg';
Picture[7]  = 'http://www.matteicos.com/images/ak09cap.jpg';


Link[1]  = 'http://www.matteicos.com';
Link[2]  = 'http://www.matteicos.com/agribusiness';
Link[3]  = 'http://www.matteicos.com/forest_wood';
Link[4]  = 'http://www.matteicos.com/moving-storage';
Link[5]  = 'http://www.matteicos.com/waste-industry';
Link[6]  = 'http://www.matteicos.com/wholesale-distributors';
Link[7]  = 'http://www.matteicos.com/alaska-commerical-insurance';



// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "Mattei Insurance Services";
Caption[2]  = "Agribusiness";
Caption[3]  = "Forest Products";
Caption[4]  = "Moving & Storage";
Caption[5]  = "Waste Industry";
Caption[6]  = "Wholesale Distributors";
Caption[7]  = "Alaska Commercial";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function DoJump()
{
     var ix = jss - 1;
     

     if (ix < 1)
     {
        //just get out - nothing to jump to
        return;
     }
     window.location = Link[ix];
     
}
function runSlideShow(){

if (location.href != "http://www.matteicos.com/")
{
    if (location.href.indexOf("forest_wood") > 0) {
         document.images.PictureBox.src = preLoad[3].src;
    } else if (location.href.indexOf("agribusiness") > 0) {
          document.images.PictureBox.src = preLoad[2].src;
    } else if (location.href.indexOf("moving") > 0) {
          document.images.PictureBox.src = preLoad[4].src;
    } else if (location.href.indexOf("waste") > 0) { 
          document.images.PictureBox.src = preLoad[5].src;
    } else if (location.href.indexOf("wholesale") > 0) {
          document.images.PictureBox.src = preLoad[6].src;
    } else if (location.href.indexOf("alaska") > 0) {
          document.images.PictureBox.src = preLoad[7].src;
    } else {
          document.images.PictureBox.src = preLoad[1].src;
    }
    return;
}
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=4)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
//if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];

if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;

tss = setTimeout(runSlideShow, SlideShowSpeed);

}

registerPloneFunction(runSlideShow);

