$j.fn.bogi_tooltip = function() { 
    // $j('.jImageListWidget').scrollable();
    if (test_for_buggy_offet()) {
        var offset=[20,0]
    } else {
        var offset=[-40,0]
        
    }
    
    // loop through each target 
    return this.each(function() { 
         // console.log('i am ', this);
         // get handle to tabs API. 
         jthis=$j(this)
         var rel=jthis.attr('rel');
         // console.log('this is rel:',rel);
         // console.log(result);
         var target_id=parseInt(rel);
         var api=$j(this).tooltip({
             effect:'toggle',     //slide    
             tip:'#jImageListTooltipWidget_tooltip',
             delay:10,
             offset:offset,
             api:true
         });
         // console.log('api=',api);
         func=(function(){
             // console.log('on before show', this,' id=',target_id);
             tip=api.getTip();
             bild = bilderliste[target_id];
             tip.find('.caption').html(bild.caption);
             tip.find('.copyright_content').html((bild.copyright==null) ? 'BOGI PARK' : bild.copyright);
             tip.find('.beschreibung').html(bild.beschreibung);
         })
         api.onBeforeShow(func);
     })
 }
 
 
$j(document).ready(function(){
     $j('.jImageWidget_has_a_tool_tip a').bogi_tooltip();
});