function showTip(elem, message){
  try {
    var box = jQuery('#box-tooltip');
    var offset = jQuery(elem).offset();
    
    box.find('div').find('div').html( message );
    box.css({ display:'block', top: (offset.top + 5) + 'px', left: (offset.left - box.width() - 10) + 'px' });
  }
  catch ( e ) {
    alert( e );
  }
}

function hideTip(){	
  try {
    var box = jQuery('#box-tooltip');
    box.css({ display:'none' });
  }
  catch ( e ) {
    alert( e );
  }
}

function showInfo(elem, infoid){
try {
    var box = jQuery('#box-extrainfo');
    var offset = jQuery(elem).offset();
    
    box.find('div').find('div').html( jQuery('#'+infoid).html() );
    
    if((offset.left - box.width()) < 10){
      box.css({ display:'block', top: (offset.top - box.height() + 10) + 'px', left: (offset.left + jQuery(elem).width() - 10) + 'px' });
    }else{
      box.css({ display:'block', top: (offset.top - box.height() + 10) + 'px', left: (offset.left - box.width() + 10) + 'px' });
    }
  }
  catch ( e ) {
    alert( e );
  }
}

function hideInfo(){	
  try {
    var box = jQuery('#box-extrainfo');
    box.css({ display:'none' });
  }
  catch ( e ) {
    alert( e );
  }
}

function showEvents(elem, infoid){
try {
    var box = jQuery('#box-extrainfo');
    var offset = jQuery(elem).offset();
    
    box.find('div').find('div').html( jQuery('#'+infoid).html() );
    
    if((offset.left - box.width()) < 10){
      box.css({ display:'block', top: (offset.top - box.height()) + 'px', left: (offset.left + jQuery(elem).width() + 4) + 'px' });
    }else{
      box.css({ display:'block', top: (offset.top - box.height()) + 'px', left: (offset.left - box.width() - 2) + 'px' });
    }
  }
  catch ( e ) {
    alert( e );
  }
}

function hideEvents(){	
  try {
    hideInfo();
  }
  catch ( e ) {
    alert( e );
  }
}
