var oldClassName = "";

var linkInfoStrs = new Array();
linkInfoStrs["home"		 ] = "Return to our home page.";
linkInfoStrs["procedures"] = "Learn more about our state of the art procedures, equipment & techniques.";
linkInfoStrs["offers"	 ] = "Learn more about what services we offer.";
linkInfoStrs["gallery"	 ] = "View before and after shots of cosmetic dentistry!";
linkInfoStrs["about"	 ] = "Get to know more about our doctors, staff and offices.";
linkInfoStrs["contact"	 ] = "Learn about how to contact us or how to get to our offices.";

// Image Swapping
function over( e ) 
{

	// Get the element
	var event = (e) ? e : windows.event;
	var obj = (event.target) ? event.target : event.srcElement;
	if ( obj.tagName == "IMG" ) obj = obj.parentNode;

	// Show the hint for the element.
	showHint( obj );
	
}

function out() 
{
	hideHint();
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}		

function hideHint()
{
	var x = document.getElementById("hint");
	x.style.display = "none";
}		
function showHint( obj )
{

	var hint = linkInfoStrs[obj.name];
	if (!hint) return;

	var newX = findPosX(obj) + obj.offsetWidth + 1;
	var newY = findPosY(obj);
	
	var x = document.getElementById("hint");
	x.firstChild.innerHTML = hint; 
	x.style.top = newY + 'px';
	x.style.left = newX + 'px';
	x.style.display = "block";
}

var doneOnce = false;
function restartAnimation( image ) 
{
	if ( document.all || doneOnce ) return;
	var src = image.src;
	image.src = src;
	doneOnce = true;
}