var doc_root = '/Portals/98465/';
var img_root = doc_root + 'images/';
var prod_root = img_root + 'products/';

var $hoverto;

function hover_init(){
 $hoverables = $('table#hoverable tr');
 if($hoverables.length == 0) return;

 $hoverto = $('img#hoverto');
 $hoverables.each(function(index){
  var row = $(this);

  var id = $.trim( $('td:first', row).text() );

  if(id == parseInt(id)){
   var src = prod_root + id + '.jpg';
   $('<img/>')[0].src = src;
   row.mouseover( function(){
    doswap(src); 
    $(this).addClass('over');
   });// mouseover
   row.mouseout( function(){
    $(this).removeClass('over');
   }); //mouseout
  } // if
 });
}

$('document').ready(function(){
  hover_init();
});

function doswap(img){
 $hoverto[0].src = img;
}


