// images.js
// This file contains functions that are used to manipulate images.
// Author: Dovie Gelerinter
// Date: December 5, 2000


// This checks to see if the jslib object exists yet and creates it if needed.

if(!jslib){
	var jslib = library();
	}
// This creates a new image object within the JS Library object if needed.

if(!jslib.images){		
	jslib.images = new imageObject();
	}

// This creates a new JS library.

function library(){
	// Further functionality can be added to the library here.
	// this.property = value;
	return this;
	}

// This creates an image object with all our functions set within it.

function imageObject(){
	this.preload = preloadimages;
	this.toggle = imagetoggler;
	return this;
	}

// This function toggles the src of a named image

function imagetoggler(imagename, imagesrc){
	document[imagename].src = imagesrc;
	}
	
// This function preloads the passed images (unlimited number of images)

function preloadimages(){
	for(i=0; i < arguments.length; i++){
    	var newimage = new Image();
        newimage.src = arguments[i];
        }
	}
	
	