var picSwitcher = Class.create();
picSwitcher.prototype = {

	initialize : function (elems)
	{
		this.options = elems;
		this.writeEvents();
	},

	writeEvents : function ()
	{
		for( i=0; i<this.options.length; i++ )
		{
			for( k=0; k<this.options[i].length; k++ )
			{
				this.options[i][k].observe('mouseover', this.over);
				this.options[i][k].observe('mouseout', this.out);
			}
		}
	},

	over : function ()
	{
		this.imgSrc = this.getElementsByTagName('img')[0].src;
		this.seperatedSrc = this.imgSrc.split('.');
		fileExtension =  this.seperatedSrc.length - 1;
		fileName = this.seperatedSrc.length - 2;
		this.seperatedSrc[fileName] = this.seperatedSrc[fileName] + '_active';
		this.joinedSrc = this.seperatedSrc.join(".");
		this.getElementsByTagName('img')[0].src = this.joinedSrc;
	},
	
	out : function ()
	{
		this.imgSrc = this.getElementsByTagName('img')[0].src;
		this.seperatedSrc = this.imgSrc.split('.');
		fileExtension =  this.seperatedSrc.length - 1;
		fileName = this.seperatedSrc.length - 2;
		this.seperatedSrc[fileName] = this.seperatedSrc[fileName].replace(new RegExp("_active\\b"), "")
		this.joinedSrc = this.seperatedSrc.join(".");
		this.getElementsByTagName('img')[0].src = this.joinedSrc;
	}
}