// image manipulation scripts 
// good for rollovers and image swapping

function newImage(arg) {
 if (document.images) {
  rslt = new Image();
  rslt.src = arg;
  return rslt;
 } // if
}

function changeImages() {
  // if there ARE images, go ahead
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      // loop through all the images in the doc and change them if they have the name or id input
     //alert(document[changeImages.arguments[i]].src); 
     document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    } // for
  } // if
}


function selectSplashImage() {
	// load up a back_up image name
	var imgname = "images/colour_rotate_1.jpg";

	// pseudo-randomly generate number between 1 and 12
	var i = Math.round((12 * Math.random()) + 1);

	// paranoia is good! so check that this is a valid int first
	if (parseInt(i) && i < 13 && i > 0) {	
		imgname = "images/colour_rotate_" + i + ".jpg";
	} // if
	
		// change the images
	changeImages('splashofcolour', imgname);
} 
