$(document).ready( function(){
	$.extend( {
		CcHoverImage: function(){
			$('img,:image').each( function(){
				if( this.src.match( /_off\./ ) ){
					$(this).mouseover( function(){
						this.src = this.src.replace('_off.', '_on.');
						$(this).addClass( 'hover-image-hover' );
					} );
					$(this).mouseout( function(){
						this.src = this.src.replace('_on.', '_off.');
						$(this).removeClass( 'hover-image-hover' );
					} );
				}
			} );
			
			$('a').each( function(){
				var img = $(this).children('img');
				if(img.length!=0){
					if( img.attr('src').match(/_off\./) ){
						img.mouseover(function(){
							$(this).attr('src',$(this).attr('src').replace('_off.','_on.'));
							$(this).addClass( 'hover-image-hover' );
						});
						img.mouseout(function(){
							$(this).attr('src',$(this).attr('src').replace('_on.','_off.'));
							$(this).removeClass( 'hover-image-hover' );
						});
					}
				}
				else{
					if( $(this).css( 'background-image' ).match( /_off\./ ) ){
						$(this).mouseover( function(){
							$(this).css( 'background-image', $(this).css( 'background-image' ).replace('_off.', '_on.') );
							$(this).addClass( 'hover-image-hover' );
						} );
						$(this).mouseout( function(){
							$(this).css( 'background-image', $(this).css( 'background-image' ).replace('_on.', '_off.') );
							$(this).removeClass( 'hover-image-hover' );
						} );
					}
				}
			} );
			$('.form-button').each( function(){
				if( $(this).css( 'background-image' ).match( /_off\./ ) ){
					$(this).mouseover( function(){
						$(this).css( 'background-image', $(this).css( 'background-image' ).replace('_off.', '_on.') );
						$(this).addClass( 'hover-image-hover' );
					} );
					$(this).mouseout( function(){
						$(this).css( 'background-image', $(this).css( 'background-image' ).replace('_on.', '_off.') );
						$(this).removeClass( 'hover-image-hover' );
					} );
				}
			} );
		}
	} );
} );
