
<!--
/*
This code is from Dynamic Web Coding 
www.dyn-web.com 
Copyright 2001 by Sharon Paine 
Permission granted to use this code as long as this 
entire notice is included.
*/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) event = "nope";

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move with mouse movement along link?
var tipFollowMouse	= false;	
var tipWidth 			 	= 205;
var offX					 	= 20;	// how far from mouse to show tip
var offY					 	= 3; 
var tipFontFamily 	= "arial, helvetica, sans-serif";
var tipFontSize			= "8pt";
var tipFontColor		= "#000000";
var tipBgColor 			= "#ffffff";
var tipBorderColor 	= "#666666";
var tipBorderWidth 	= 1;
var tipBorderStyle 	= "solid";
var tipPadding		 	= 1;

// preload images to be placed in tooltip
//var img1 = new Image(100,100);	// (width,height)
// img1.src = "your.gif";


// variables for tooltip content 
var tip0 = '<img src="http://www.homesinboston.com/graphics/BOSTON.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000"><table border=0 cellspacing=0 cellpadding=2 align="left"><tr><td><center><img src="http://www.homesinboston.com/communities/images/thumb_p0321317_JPG.gif" width="70" height="45" border="0"></center></td></tr></table>Boston is an historic city of contrasts. Ancient red-brick sidewalks twist past handsome Federalist houses on the way to soaring glass towers housing state-of-the-art technology.  One of the most beautiful cities in the world.'
var tip1 = '<img src="http://www.homesinboston.com/graphics/BROOKLINE.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">Brookline is a jewel of a suburb.  A unique mixture of busy streets and rolling countryside, upscale shops and village pubs, gracious apartment buildings and large estates, and home for legions of academic and scientific professionals, who work at the nearby medical centers in Boston.'
var tip4 = '<img src="http://www.homesinboston.com/graphics/DEDHAM.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">Dedham is an historic suburban industrial town on the principal southern corridor of metropolitan Boston, and is the site of the earliest surviving framed house in New England, the handsome 1737 Fairbanks House.'
var tip5 = '<img src="http://www.homesinboston.com/graphics/DOVER.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">The Town of Dover is an affluent suburban community set between the western and southwestern axis of metropolitan Boston expansion.'
var tip6 = '<img src="http://www.homesinboston.com/graphics/MILTON.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">The Town of Milton is an affluent suburban community between the Neponset River and the Blue Hills.  Milton now retains a good many 19th century country houses and estates and early 19th century workers\' housing.'
var tip8 = '<img src="http://www.homesinboston.com/graphics/NEEDHAM.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">The Town of Needham is located on rocky uplands within a loop of the Charles River, almost isolated from the surrounding countryside.'
var tip9 = '<img src="http://www.homesinboston.com/graphics/NEWTON.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">Newton is a vibrant community that is desirable as a place to live and work due to its proximity to Boston, nearness to various highway and public transportation systems, attractive neighborhoods and high property values, well-run municipal government, and a strong, nationally-recognized school system.'
var tip11 = '<img src="http://www.homesinboston.com/graphics/WATERTOWN.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">Watertown is rich in ethnic diversity and culture, boasts a high level of citizen involvement and many amenities such as shopping malls, swimming pools, country and tennis clubs, skating rinks, eleven fine parks and public transportation providing easy access to Boston and surrounding communities.'
var tip12 = '<img src="http://www.homesinboston.com/graphics/WELLESLEY.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">The Town of Wellesley is a predominantly residential community, located approximately 13 miles west of Boston. Its geographic location and its visual characteristics make it a highly desirable suburb for people who work in Boston.'
var tip13 = '<img src="http://www.homesinboston.com/graphics/WESTWOOD.gif" width="205" height="24" border="0"><br><table width="205" cellpadding=3 cellspacing=0 border=0><tr><td BGCOLOR="#ffffff"><font size="1" face="arial" color="#000000">Westwood is an established community of 13,000 located 12 miles southwest of Boston. Situated at the junction of Routes 95/128 and 93, Westwood provides an excellent location for its residents and its businesses.'

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles for all but ns4. 
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv: tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}
window.onload = initTip;

/////////////////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes it to tipDiv.
//			Call positionTip function from here if tipFollowMouse
//			is set to false.
//////////////////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,txt) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	if (ns4) {
		tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + tipBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td><span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + tipFontColor + ';">' + txt  + '</span></td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {
		tip = txt;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
}

var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? mouseY-(tpHt+offY): mouseY-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
//	tipcss.visibility = "hidden";
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

//-->
