/**********************************
	powerd by kkk 2007 09 01
	ENKEI swap images Module ver1.08 (RegExp type)

	http://ultraworks.jp/

**********************************/


function swap(c_name , str){
	swap.prototype.define(c_name , str);
}

swap.prototype.define = function(c_name , str){
	var objs = classCheck(c_name);
	for(var i = 0 ; i < objs.length ; i++){
		var pa = objs[i];
		pa._up = pa.src;
		pa._over = pa.src.replace(/^(.*)(.jpg|.png|.gif)$/i ,"$1" + str + "$2");
		var img = new Image();
		img.src = pa._over;
		pa.onmouseover = function(){this.src = this._over};
		pa.onmouseout = function(){this.src = this._up};
	}
}

function classCheck(ClassName){
	var result = new Array();
	var elements = document.images;
	for(var i = 0 ; i < elements.length ; i++){
		if(elements[i].className.indexOf(ClassName)>=0)	result[result.length]=elements[i];
	}
	return result;
}

function init(){
	new swap('swap' , '_f2');
}

window.onload = init;