/***
 *  [ Function Name Label ]
 *  @use:
 *   var oFunctionName = new FunctionName({	
 *		//objects shared props
 *	});
 *
 *	@functions:
 *	oFunctionName.aaaaaaaaaaa()
 */
var RDSRollovers = function(){ /*  */ };
RDSRollovers.prototype = {
	
	init: function(){
		var htOptions     = this.htOptions     = this.getOptionSet( arguments[0] );
		var aTargetImgs   = this.aTargetImgs   = htOptions.aTargetImgs;
		var sHoverPattern = this.sHoverPattern = htOptions.sHoverPattern;
		var sOutPattern   = this.sOutPattern   = htOptions.sOutPattern;
		
		if( aTargetImgs == null ){ throw new Error(); return false; };
		
		this.attachMouseoverEvent();
	},
	
	attachMouseoverEvent: function(){
		var self = this;
		$( this.aTargetImgs ).bind( 'mouseover', function( e ){ self.setRollovers( e ) } );
		$( this.aTargetImgs ).bind( 'mouseout',  function( e ){ self.setRollouts( e )  } );
	},
	
	setRollovers: function( e ){
		if( e.target.src ){
			var sExtention = e.target.src.match( /.([a-z0-9]+?)$/gi )[0];
			e.target.src = e.target.src.replace( new RegExp( this.sOutPattern + '.([a-z0-9]+?)$', 'gi' ), this.sHoverPattern + sExtention );
		};
	},
	
	setRollouts: function( e ){
		if( e.target.src ){
			var sExtention = e.target.src.match( /.([a-z0-9]+?)$/gi )[0];
			e.target.src = e.target.src.replace( new RegExp( this.sHoverPattern + '.([a-z0-9]+?)$', 'gi' ), this.sOutPattern + sExtention );
		}
	},
	
	getOptionSet: function( htArguments ){
		var __option = {
			aTargetImgs:  null,
			sHoverPattern: '_h',
			sOutPattern:   '_o'
		};
		if( typeof htArguments === undefined ) htArguments = new Object;
		for( var x in htArguments ) __option[x] = htArguments[x];
		return __option;
	}

};