$(document).ready(function(){
  var hereItIs = whereIsIt();
  if (hereItIs > -1) {
    var okkkSpan = $($('span.Z3988')[hereItIs]);
    var match = /&rft_val_fmt=(.*)&rfr_id=(.*)&rft.btitle=(.*)&rft.au=(.*)&rft.id=(.*)$/.exec(okkkSpan.attr('title'));
    var forwardURL = "/JspToolkitIntegration/MainApplication/refresh?" + "rft_val_fmt="+escape(match[1])+"&rfr_id="+escape(match[2])+"&rft_btitle="+escape(match[3])+"&rft_au="+escape(match[4])+"&rft_id="+escape(match[5]);
    //okkkSpan.before("<a href='" + forwardURL + "'><img border='0' src='./images/book_go.png' width='16' height='16'></a>");
    okkkSpan.before("<img border='0' src='./images/book_go.png' width='16' height='16' onclick='return submitData();'>");
  }
});

function whereIsIt() {
  var hereItIs = -1;
  $('span.okkk').each(function(index){
    if (-1 < jQuery.inArray($('span.okkk')[index], $('span.Z3988'))) {
      hereItIs = index;
    }
  });
  return hereItIs;
}
