
function imgSwap(oObj) {

	sSrc = oObj.src; 
	nOffset1 = sSrc.lastIndexOf("-");
	nOffset2 = sSrc.lastIndexOf(".");
	sFileExtension = sSrc.substring(nOffset2,  sSrc.length);
	sImgSuffix = sSrc.substring(0, nOffset2);
	sSrcSubstring = sSrc.substring(0, nOffset2);
	if ( sImgSuffix.indexOf("-on") < 0 ){
		oObj.src = sSrcSubstring + "-on" + sFileExtension;
	}
	else {
		sSrc = sSrcSubstring + sFileExtension;
		sSrc = sSrc.replace("-on", "");
		oObj.src = sSrc;
	}

}

// STYLE COLOR SWAP on OBJECTS WITHOUT CLASS ATTRIBUTES

var sColorOrig= null;

function colorSet(oObj, sColor) {
	sColorOrig = oObj.style.color;
	return(oObj.style.color=sColor);
}

function colorReset(oObj) {
	sColor = sColorOrig;
	sColorOrig = null;
	return(oObj.style.color=sColor)
}



function getPos(aArray, element) {

	for(i=0; i < aArray.length; i++) {
		if(aArray[i] == element) {
			return(i);
		}
	}
	return(-1);
}


function updating(sMsg) {

if (self.innerWidth) {

		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	}

	else if (document.documentElement && document.documentElement.clientWidth){

		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)	{

		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	}

	nWidth = parseInt(document.getElementById("updating").style.width);
	nWidthOffset = nWidth/2
	nHeight = parseInt(document.getElementById("updating").style.height);
	nHeightOffset = nHeight/2
	document.getElementById("updating").style.left= (frameWidth/2) - nWidthOffset;
	document.getElementById("updating").style.top= (frameHeight/2) - nHeightOffset + document.body.scrollTop;
	document.getElementById("updating").innerHTML = sMsg;
	document.getElementById("updating").style.visibility = "visible";

}


function clearMsg() {
	document.getElementById("updating").style.visibility = "hidden";
}