function chk_img(obj) {
  var img = $(obj)[0].src;
  if ( img.match(/.*jpg$/) ) {
    $(obj)[0].src = $(obj)[0].src.replace('.jpg', '.gif');
  }
}

