// JavaScript Document

function switchImage(imgName, imgSrc) {
  if (document.images){
	if (imgSrc != "none"){
	  document.images[imgName].src = imgSrc;
	}
  }
}

var i = 1;

function nextPic(imgName, arr) {
	
	if (i >= arr.length) i=0;
	if (document.getElementById) {
//		window.alert("i=" + i);
		document.getElementById(imgName).src = arr[i++];
		return false;
	} else {
		return true;
	}
}

function prevPic(imgName, arr) {

	if (i <= 0) i = arr.length;
	if (document.getElementById) {
		document.getElementById(imgName).src = arr[--i];
		return false;
	} else {
		return true;
	}
}

function arrImagedPreload()
{ 
  var args = arrImagedPreload.arguments;
  document.imageArray = args;
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}
