//contains the code that handles displaying of rollovers for services on multiple parts of the site.


//globally store the mouse coords so they'll be there for the callback function
var servDescX = 0;
var servDescY = 0;


function serviceImage_onMouseOver(servId,e)
{
	
	if (window.event)
	{
		e = window.event;
	}
	
	servDescX = e.clientX + 50;
	if (document.body.scrollTop)
	{
		var scrollTop = document.body.scrollTop;
	}
	else
	{
		var scrollTop = window.pageYOffset;
	}
	servDescY = e.clientY + scrollTop - 50;

	x_return_service_description(servId,do_return_service_description_cb);
}


function do_return_service_description_cb(markup)
{
	serviceShowDescription(markup);
}


function serviceShowDescription(markup)
{
	serviceHideDescription();
	var serviceDescription = document.createElement('div');
	serviceDescription.id = 'serviceDescription';
	serviceDescription.style.position = 'absolute';
	serviceDescription.style.left = servDescX + 'px';
	serviceDescription.style.top = servDescY+'px';
	serviceDescription.innerHTML = markup;
	document.body.appendChild(serviceDescription);		
}

function serviceHideDescription()
{
	var serviceDescription = document.getElementById('serviceDescription');
	
	if (serviceDescription)
	{
		document.body.removeChild(serviceDescription);
	}
}
