var tooltipBoxWidth=184;
var tooltipOffsetX=-8;
var tooltipOffsetY=202;

function initTooltips() {
	$('.tooltip_button').click(
		function() {
			id=$(this).attr('id');
			tooltip_id='#tooltip_box_'+id.substr(15);
			position=$(this).offset({scroll: false});
			$(tooltip_id).css({
				position: 'absolute',
				top: (position.top+tooltipOffsetX)+'px',
				left: (position.left-tooltipBoxWidth+tooltipOffsetY)+'px'
			});
			$(tooltip_id).show();
			/*Siemens*/
			var s = document.getElementById("tooltip_button_" + id.substr(15) + "_img");
			s.src = s.src.replace("_inactive.gif",".gif");	
		}
	);

	$('.tooltip_close_button').click(
		function() {
			var box=$(this).parents('.tooltip_box')[0];
			id=$(this).parents('.tooltip_box')[0].attributes['id'].value;
			$(box).hide();
			/*Siemens*/
			var s = document.getElementById("tooltip_button_" + id.substr(12) + "_img");
			s.src = s.src.replace(".gif","_inactive.gif");	
		}
	);
}

$(function() {
	initTooltips();
});

