// JavaScript Document
function swap_image(){
	elms = $$('img.swap_image');

	for(i = 0; i < elms.length; i++){
//		path = elms[i].src;
		
//		str = path;
//		result = str.replace(/\./g, "_o.");
//
		pattern = /\/\w+.(jpg|gif|png|jpge)/g;
//		result = result.match(pattern);
//			
//		path2 = "images"+result;
		elms[i].onmouseover = function(){ this.src="images"+(this.src.replace(/\./g, "_o.")).match(pattern); }
		elms[i].onmouseout = function(){this.src="images"+(this.src.replace(/_o\./g, ".")).match(pattern);  }
	}
}

function swap_ct(){
	elms = $$('img.swap_ct');
	for(i = 0; i < elms.length; i++){
		elms[i].src = "images"+(elms[i].src.replace(/\./g, "_ct.")).match(pattern);
	}
}

document.observe("dom:loaded", function() {
	swap_image();
	//swap_ct();
}); 

