var aImages 	= new Array();
var ROLLOVER_PREFIX	= 'ro';
validSuffix = new Array();
var idx = 0;
validSuffix[idx++] = new Array("_off","_on");
validSuffix[idx++] = new Array("_on","_on");

function roObject(imgName) {
	this.out = new Image();
	this.out.src = document.images[imgName].src;
	this.over = new Image();
	this.over.src == this.out.src;
	for (var i=0;i<validSuffix.length;i++) {
        var re = new RegExp (validSuffix[i][0] +"(.(gif|jpg|jpeg))");
		if (this.out.src.match(re) != null) {
			this.over.src = this.out.src.replace (re, "" + validSuffix[i][1] + "$1");
			break;
		}
	}
}

function roOut(imgName) {
	if (document.images && aImages[imgName] != null)
		document.images[imgName].src = aImages[imgName].out.src;
}

function roOver(imgName) {
	if (document.images && aImages[imgName] != null){
		document.images[imgName].src = aImages[imgName].over.src;
	}
}

function roLoad(imgName) {
	if (document.images) {
		if (document.images[imgName] != null)
    			aImages[imgName] = new roObject(imgName);
	}
}

	

function roInit() {
	if (document.images) {
  		for (var i=0; i < document.images.length; i++) {
			if (document.images[i].name.substr(0, ROLLOVER_PREFIX.length) == ROLLOVER_PREFIX) {
				roLoad(document.images[i].name);
			}
  		}
	}
}

function roAutoLoad() {
	if (document.all) {
		if (document.readyState == "complete")  
			roInit();
		else  
			setTimeout("roAutoLoad()",50);
	}
	else {
		roInit();
	}
} 
