

/*

Only tested in IE 6.0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

*/

var oDef;

window.onload = function() {
	if (document.all&&document.getElementById)
	{
		oDef = document.getElementById('WhatsMyDefinition');
		links = document.getElementsByTagName("a");
		for (i = 0; i < links.length; i++)
		{
			link = links[i];
			if(link.className == 'Definition')
			{
				link.onmouseover = function()
				{
					oDef.style.left = window.event.x - 60;
					oDef.style.top = window.event.y + 15;
					oDef.style.display = 'inline';
					oDef.innerHTML = '<p>Google Definition &raquo;</p>' + getDefinition(this.innerText);
				}
				link.onmouseout = function()
				{
					oDef.style.display = 'none';
				}
				link.onmousemove = function()
				{
					oDef.style.left = window.event.x - 60;
					oDef.style.top = window.event.y + 15;
				}
			}
		}
	}
}

function getDefinition(word)
{
	switch(word)
	{
		case 'ASP 3' :
			return "An Active Server Page is a web page that includes program code that is processed " +
				   "on a Microsoft web server before the page is sent to the user.";
			break
			
		case 'C#.NET' :
			return "An ECMA-compliant programming language developed in part by Microsoft in order " +
				   "to spearhead their .NET initiative.";
			break
			
		case 'SQL Server' :
			return "An enterprise class database server from Microsoft.";
			break
			
		case 'DHTML' :
			return "Dynamic HTML or DHTML designates a technique of creating interactive web sites " +
				   "by using a combination of the static markup language HTML, a client-side " +
				   "scripting language (such as JavaScript) and the style definition language " +
				   "Cascading Style Sheets";
			break
			
		case 'HTML' :
			return "A markup language to annotate hypertext documents for publication on the World Wide Web.";
			break
			
		case 'XHTML' :
			return "XHTML is a new language for building web pages that has recently been proposed as a W3C Recommendation.";
			break
			
		case 'CSS' :
			return "Set of overlay rules that are read by your HTML browser, which uses these rules " +
				   "for doing the display, layout and formatting of the XML-generated HTML file(s).";
			break
			
		case 'JavaScript' :
			return "Scripts written with JavaScript can be embedded into HTML documents. With " +
				   "JavaScript, you have many possibilities for enhancing your Web page with " +
				   "interesting elements.";
			break
			
		default :
			return "Sorry, no definition was found!";
			break
	}
}