Event.observe( window, 'load', function() {
     $('r0c0').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r0c1').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r0c2').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r0c3').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r1c0').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r1c1').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r1c2').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r1c3').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r2c0').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r2c1').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r2c2').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
     $('r2c3').observe( 'mouseover', function( e ) {
          Event.stop( e );
          var imgPath = this.getAttribute("src");
          imgPath = imgPath.slice( 0, imgPath.length-6 );
          imgPath = imgPath + ".jpg";
          $('mainImg').setAttribute( "src", imgPath );
     } );
} );

