//reloads the window if Nav4 resized
function MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//rollover script for dropdown menus
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible";
}
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden"
}

//section rollover on homepage
function showtext(id)
{
    var idWipeThis	=	"image_" + id;
    var wipeThis	=	document.getElementById(idWipeThis);
	wipeThis.className	=	"noShow";

    var idDrawThis	=	"text_" + id;
	var drawThis	=	document.getElementById(idDrawThis);
	drawThis.className	=	"show";	
}

function showimage(id)
{
    var idWipeThis	=	"text_" + id;
    var wipeThis	=	document.getElementById(idWipeThis);
	wipeThis.className	=	"noShow";

    var idDrawThis	=	"image_" + id;
	var drawThis	=	document.getElementById(idDrawThis);
	drawThis.className	=	"show";	
}

//change background colour
function changecolor(idnew, colour)
{
	var ShowCanvas	=	document.getElementById(idnew);
	//ShowCanvas.className = "noshow";
    ShowCanvas.style.backgroundColor = colour;
}

//jump menus
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MultipleImagesAnimator(imageElement, imagePaths, frameInterval, linkElement, linkPaths){	
	this.imageElement = imageElement;
	this.imagePaths = imagePaths;
	this.frameInterval = frameInterval;
	this.linkElement = linkElement;
	this.linkPaths = linkPaths;
 	this.currentFrameIndex = 0;
 	this.interval = null;
}

MultipleImagesAnimator.prototype.start = function(){
	if(this.interval == null) {
		var self = this;
 		this.interval = setInterval(function() {self.nextFrame();},this.frameInterval);
	}
}

MultipleImagesAnimator.prototype.stop = function(){
	if(this.interval != null) {
		clearInterval(this.interval);
 		this.interval = null;
	}
}

MultipleImagesAnimator.prototype.nextFrame = function(){
	this.imageElement.src = this.imagePaths[this.currentFrameIndex];
	this.linkElement.href = this.linkPaths[this.currentFrameIndex];
 	this.currentFrameIndex = (this.currentFrameIndex + 1) % this.imagePaths.length;
}