//Rotating image links on a timer. Each image link will be changed after every 2 seconds. 

var interval = 3; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes
var number_of_image = 4;
var image_index = 0;
interval *= 1000;

image_list = new Array();
// Copy and paste one of the following line to add a new Ad into the rotator. You need to specific your graphic name and the link for your Ad. 
image_list[image_index++] = new imageItem("http://www.perimeter.ca/images/ad-rotator/chicken-delight.gif", "http://www.perimeter.ca/palcms/files/File/Departments/NEWS/Chicken-Delight2.jpg");
image_list[image_index++] = new imageItem("http://www.perimeter.ca/images/ad-rotator/CARGO-TRACKING.jpg", "http://www.perimeter.ca/cargo/tracking_cargo.html");
image_list[image_index++] = new imageItem("http://www.perimeter.ca/images/ad-rotator/PAL.KAL.Intra.ad.passpoint.gif", "http://www.perimeter.ca/Travel/Passport_Point_App.html");
image_list[image_index++] = new imageItem("http://www.perimeter.ca/images/ad-rotator/PAL.KAL.Intra.ad.kal.gif", "http://www.keewatinair.ca");


function imageItem(image_location, link) {

this.image_item = new Image();
this.image_item.src = image_location;
this.image_item.link = link; 

}

function getNextImage() {

if (random_display) { //random image rotation
image_index = Math.floor(Math.random() * image_list.length);
}
else { //sequential image rotation 
image_index = (image_index+1) % number_of_image;
}

var new_image = image_list[image_index];
return(new_image);

}


function rotateImage(rImage, link) {

var new_image = getNextImage();
document.getElementById('rImage').src = new_image.image_item.src;
document.getElementById('rLink').href = new_image.image_item.link; 

setTimeout("rotateImage()", interval);

}


function topad(id){
		//document.getElementById(id).style.display="none";
        Effect.BlindUp(id); return false;
	}

function topadshow(id) {


    Effect.BlindDown(id); return false;

   }




window.onload=function()
{//??
//document.getElementById('winpop').style.height='0px';
//setTimeout("tips_pop()",800);//3????tips_pop()????

// Slide down top AD
//topadshow('adtop'); 
}
