﻿function preload(imgSrc) {
	img = new Image();
	img.src = imgSrc;
	return img;
}

// swapImg - swaps an image for another that has already been preloaded.
function swapImg(imgName, preloadedImg) {
	if (document[imgName]) {
		document[imgName].src	= preloadedImg.src;
	}
}

// swapDesc - swaps description.
function swapTxt(txtName, preloadedTxt) {
	if(document.getElementById(''+txtName+'')) {
		document.getElementById(''+txtName+'').innerHTML	= preloadedTxt;
	}
}

function changeDivBkg(divId, imgSrc) {
	document.getElementById(divId).backgroundImage = imgSrc;
	alert(document.getElementById(divId).backgroundImage);
}
