var next_photo_id=0;
var photo_urls={};
var imgLoading=new Image();
imgLoading.src='/images/loadings.gif';

function createPhotoTip(elem,url) {
 if (!yh_tt || !elem || elem.tt_div ) return ; // already initialized or not ready to initialize yet.
 var photo_id=photo_urls[url];
 if (!photo_id) {
  photo_id=++next_photo_id;
  photo_urls[url]=photo_id;
}


if ( !Dom.get('photo_tooltip_for_'+photo_id)) {
  var i;
  i=new Image();
  i.src=url;
  var d=document.createElement ( 'div' );
  d.className='tooltip';
 d.id='photo_tooltip_for_'+photo_id;
 var img=document.createElement ( 'img' );
 img.id='photo_for_'+photo_id;
  img.src=imgLoading.src;
  d.appendChild(img);
 document.body.appendChild(d);
  if (!i.complete) {
   Event.on ( i, 'load', function(e) {
    Dom.get('photo_for_'+photo_id).src=i.src;
   } );
  } else {
   img.src=i.src;
  }
 }
 createTip ( elem, 'photo_tooltip_for_'+photo_id, false );
}