<!--

okay= document.images;

if (okay) { // preload the images:
   temp= new Array("off", "home", "atppm", "atpcc");
   nav= new MakeOneArray(temp, "pictext");
}

function MakeOneArray(off, pre) {
  this.length= off.length;
  for (i=0; i<this.length; i++) {
    this[i]= new Image(); var name= "images/"+pre+"_"+off[i];
	  this[i].src= name+".gif";
  }
  return this;
}

function swap(which, i) {
if (okay) { document.images[which].src= nav[i].src; }
}





var	arrOff, arrOn, arrNames;		//arrays for images and image names
var bOkay;

bOkay= document.images;				//images OK?
arrOff = new Array();
arrOn = new Array();
arrNames = new Array();

function preload(){					//Called in the Onload event of the body tag

var iSlashIndex, iLastIndex;		//integers and indices
var strName, strImagePath;			//image name and path
var iCount, i, j;					

if (bOkay)
{
	iCount = document.images.length;
	j = 0;
	
	for (i=0; i<iCount; i++)
	{
		strName = document.images[i].name;
		
		if (strName != "")			//Add any exceptions here. NB need names of multiple rollovers (cannot handle these) 
		{							// 			eg (strName != "" && strName != image1 && ...)
									//Also - .gif rollovers only! (could easily be altered)
			arrOff[j] = new Image();
			arrOn[j] = new Image();
			arrNames[j] = new String();

			arrNames[j] = strName;							//the image name is stored (name=filename)
			strImagePath = document.images[i].src;			
			arrOff[j].src = strImagePath;					//the off image is the image itself
			strImagePath = strImagePath.substring(0, strImagePath.length-4);
			arrOn[j].src = strImagePath + "_on.gif";		//the on image
			j++;
		}
	}	
}
}

function on(strName) 
{
var i;
if (bOkay)
{
	for (i=0; i<arrNames.length; i++)
	{
		if (strName == arrNames[i])
		{
			document.images[strName].src = arrOn[i].src;
		}
	}
}
}

function off(strName)
{
var i;
if (bOkay)
{
	for (i=0; i<arrNames.length; i++)
	{
		if (strName == arrNames[i])
		{
			document.images[strName].src = arrOff[i].src;
		}
	}
}
}


function openWindow(FilePath,ImageID,WinWidth,WinHeight)
 { 
var file = FilePath+"?ImageID="+ImageID
var name = "new_window"
var params = "toolbars=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+WinWidth+",height="+WinHeight+",top=0,left=0"
newwin = window.open(file, name, params);
newwin.focus();
 }

 
function openWindow2(FilePath,ImageLoc,AltText,WinWidth,WinHeight)
{ 
	var file = FilePath+"?ImageLoc="+ImageLoc+"&AltText="+AltText
	var name = "new_window"
	var params = "toolbars=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+WinWidth+",height="+WinHeight+",top=0,left=0"
	newwin = window.open(file, name, params);
	newwin.focus();
}

//-->