// JavaScript Document

/*
This code is from Dynamic Web Coding 
at http://www.dyn-web.com/
Copyright 2001-2 by Sharon Paine 
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Permission granted to use this code 
as long as this entire notice is included.
*/

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// preload images to be included in banners
var imgAr = new Array(
	"images/home_superior.jpg",
	"images/home_webster.jpg",
	"images/home_columbia.jpg",
	"images/home_vapor.jpg",
	"images/home_thermal.jpg"
);

if (document.images) {
	var imgs = new Array();
	for (var i=0; i<imgAr.length; i++) {
  	imgs[i] = new Image(); 
		imgs[i].src = imgAr[i];
  }
}

function bannerObj(id,w,h,x,y,d,cls) {
	this.bobj=writeObj;
	this.bobj(id,w,h,x,y);
	this.delay=d; this.cls=cls; 
	this.items = new Array(); 
	this.w=w;
	this.obj=id+"bannerObj"; eval(this.obj+"=this"); 
}

function rotate() {
	var cntnt;
	if (document.layers) cntnt = '<table width="'+this.w+'"><tr><td class="' + this.cls + '">' + this.items[this.ctr] + '</td></tr></table>';
	else cntnt = '<div class="' + this.cls + '">' + this.items[this.ctr] + '</div>';
	this.writeLyr(cntnt);
	if (this.ctr < this.items.length-1) this.ctr++;
  else this.ctr = 0;
	setTimeout(this.obj+".rotate()",this.delay);
}

function addBannerItem(txt) {
	this.items[this.items.length] = txt
}

bannerObj.prototype=new writeObj;
bannerObj.prototype.ctr = 0;
bannerObj.prototype.addItem = addBannerItem;
bannerObj.prototype.rotate = rotate;

var banners = new Array();
function initBanner() {
	// args: id, width, height, left, top, delay, class
	// delay is amount of time in milliseconds you linger on each item
	// set up a class for formatting your banner (last argument here)
	banners[0] = new bannerObj('homerotate',211,271,0,0,3000,'none');
	// add as many items as you like
	banners[0].addItem('<img src="images/home_superior.jpg" width="211" height="271" alt="" border="0">');
	banners[0].addItem('<img src="images/home_thermal.jpg"  width="211" height="271" alt="" border="0">');
	banners[0].addItem('<img src="images/home_columbia.jpg"  width="211" height="271" alt="" border="0">');
	banners[0].addItem('<img src="images/home_vapor.jpg"  width="211" height="271" alt="" border="0">');
	banners[0].addItem('<img src="images/home_webster.jpg"  width="211" height="271" alt="" border="0">');
	//banners[0].addItem('Add as many as you like.');
	banners[0].rotate(); 
	
	banners[1] = new bannerObj('new',00000,00000,0,0,3500);
	banners[1].addItem('<img src="../images/xxx.gif" width="x" height="x" alt="" border="0">');
	banners[1].addItem('<img src="../images/xxx.gif" width="x" height="x" alt="" border="0">');
	banners[1].addItem('<img src="../images/xxx.gif" width="x" height="x" alt="" border="0">');
	banners[1].addItem('<img src="../images/xxx.gif" width="x" height="x" alt="" border="0">');
	banners[1].addItem('<img src="../images/xxx.gif" width="x" height="x" alt="" border="0">');
	//banners[1].addItem('<div class="b1">You can mix text and images in a banner.</div>');
	banners[1].rotate();
	
}
window.onload=initBanner;