request_url = 'dev.thmbnl.com/snapshots'
oauth_token = '8eW6Z6Jac3NrrdfT';

size = 60;
med_size = 60;
full_size = 320;

client = 1;
no_cache = 1; //Math.random(1000);

Event.observe( window, 'load', function(){
$$('#profile_content p a').each( function( e ){
if( e.href.match(/http/) ){
  e.insert( { after: "<span style='position: relative'><img id='small_" + e.href + "' src='http://" + request_url + "?url=" + encodeURIComponent( e.href ) + "&size=" + size + "&client=" + client + "&oauth_token=" + oauth_token + "&no_cache=" + no_cache + "' onclick=' $(\"large_" + e.href + "\").show();' style='z-index: 1; cursor: pointer; height: 15px; border: 1px #CCC solid; vertical-align: middle; margin-left: 3px;'/><div style='position: absolute; z-index: 99999; top: -40px; left: 3px;'><img id='large_" + e.href + "' src='http://" + request_url + "?url=" + encodeURIComponent( e.href ) + "&size=" + full_size + "&client=" + client + "&oauth_token=" + oauth_token + "&no_cache=" + no_cache + "' style='z-index: 5000; display: none; cursor: pointer; border: 1px gray solid; z-index: 888;' onclick='this.hide(); $(\"small_" + e.href + "\").show();'></div></span>" } );
}
});

var links = [];
$$('#profile_content a').each( function( e ){
  links.push( e.href );
} );

html = '<hr/><h3>Your Links</h3> <table class="info"><thead><th>thmbnl</th><th>URL</th></thead><tbody>';
$A(links).each( function(link){
    html += "<tr><td><img id='med_" + link + "' src='http://" + request_url + "?url=" + encodeURIComponent( link ) + "&size=" + med_size + "&client=" + client + "&oauth_token=" + oauth_token + "&no_cache=" + no_cache + "' style='border: 1px gray solid'/></td><td><a href='" + link + "'>" + link.truncate( 70 ) + "</a></td></tr>";
  });
  html += "</tbody></table>";
  //$('content').insert( { after: html });
});
