function show_tooltip(element,moveright,movedown) { // offset = { 'quality': 9, 'delivery': 17, 'support': 24} a = $(element) pos = a.viewportOffset() t = $(element) t.setStyle('left: ' + (getAbsoluteLeft(element+'pic') + moveright) + 'px') t.setStyle('top: ' + (getAbsoluteTop(element+'pic') + movedown) + 'px') // t.appear({duration: 0.0, to: 1}); t.show() } function hide_tooltip(element) { t = $(element) // t.fade({duration: 0.2}); t.hide() } function getAbsoluteLeft(objectId) { // Get an object left position from the upper left viewport corner o = document.getElementById(objectId) oLeft = o.offsetLeft // Get left position from the parent object while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oLeft += oParent.offsetLeft // Add parent left position o = oParent } return oLeft } function getAbsoluteTop(objectId) { // Get an object top position from the upper left viewport corner o = document.getElementById(objectId) oTop = o.offsetTop // Get top position from the parent object while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oTop += oParent.offsetTop // Add parent top position o = oParent } return oTop }