
// 	Function		: swapAB
//	Version			: 1.0
// 	Author 			: Gary Rowswell (17-03-2004)
// 	Notes			: Using the naming convention 'image-a.ext' and 'image-b.ext'
//					: This function provides an easy and code efficient method 
//					: to swap between 2 images i.e. for rollover effects
// 	Application 	: The image tag will need to have a default .src set and a unique .id
// 					: onMouseOver="swapAB(this.src,this.id);" onMouseOut="swapAB(this.src,this.id);"

function swapAB(src,id)
{
	src1 = src.substring(0,src.length-5)
	src2 = src.substring(src.length-5,src.length-4)
	src3 = src.substring(src.length-4,src.length)

	if (src2 == 'a') {
		document.getElementById(id).src = src1 + 'b' + src3
	}
	
	if (src2 == 'b') {
		document.getElementById(id).src = src1 + 'a' + src3
	}				
}