// (C) 2002 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header.

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 10000;

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

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

Picture[1]  = '/images/common/headers/header_2.jpg';
Picture[2]  = '/images/common/headers/header_1.jpg';
Picture[3]  = '/images/common/headers/header_3.jpg';
Picture[4]  = '/images/common/headers/header_4.jpg';
Picture[5]  = '/images/common/headers/header_5.jpg';

var tss;
var iss;
var jss = Math.floor(Math.random()*(Picture.length-1)) + 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 runSlideShow() {
	if (document.all) {
		document.images.PictureBox.style.filter="blendTrans(duration=2)";
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}
	
	document.images.PictureBox.src = preLoad[jss].src;

	if (document.all) {
		document.images.PictureBox.filters.blendTrans.Play();
	}

	jss = jss + 1;
	if (jss > (pss)) {
		jss=1;
	}
	
	tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

var newwindow;
var wheight = 0, wwidth = 0;

function popupPic(url, title, iwidth, iheight, colour) {
var pwidth, pheight;

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+90;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
newwindow.document.writeln('<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" STYLE=\"border-width:1px; border-color:black; border-style:solid;\"><TR><TD><img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" ></TD></TR></TABLE>');
newwindow.document.writeln('<\/center> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}

// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag

function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}
