var next_photo_id=0;
var photo_urls={};
var imgLoading=new Image();
imgLoading.src='/wp-content/uploads/2007/12/photo_loading.jpg';
function createPhotoTip(elem,url,caption) {
//	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 tt_header=document.createElement('div');
		tt_header.id='tt_header';
		tt_header.className='tt_header';
		tt_header.innerHTML=caption;
		var d=document.createElement ( 'div' );
		d.className='tooltip';
		d.id='photo_tooltip_for_'+photo_id;
		d.style.zIndex = 1000;
		var img=document.createElement ( 'img' );
		img.id='photo_for_'+photo_id;
		img.src=imgLoading.src;
		d.appendChild(tt_header);
		d.appendChild(img);
		document.body.appendChild(d);
		var i=new Image();
		Event.on ( i, 'load', function(e) {
			img.src=i.src;
			img.width=i.width;
			img.height=i.height;
		} );
	i.src=url;
	}
	createTip ( elem, 'photo_tooltip_for_'+photo_id, false );
}
