
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 when mouse moves over link?
var tipFollowMouse= true;
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 160;
var offX= 50;	// how far from mouse to show tip
var offY= 40;
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#326298";
var tipBorderColor= "#000080";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing:
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('../skin_files/pop_up_philadelphia.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Main Line</font></b><p><font face="Verdana" size="2" color="000000">Today the Main Line is another name for the western suburbs of Philadelphia along Lancaster Avenue (U.S. Route 30) and the former Pennsylvania Railroad Main Line, extending from the city limits to approximately Paoli, Pennsylvania comprising an area of approximately 200 square miles. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[1] = new Array('../skin_files/pop_up_bryn_mawr.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Bryn Mawr</font></b><p><font face="Verdana" size="2" color="000000">Bryn Mawr is a census-designated place on the border of Montgomery County and Delaware County, Pennsylvania, just west of Philadelphia, along Lancaster Avenue (US-30), and the home of Bryn Mawr College. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[2] = new Array('../skin_files/pop_up_villanova.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Villanova</font></b><p><font face="Verdana" size="2" color="000000">Villanova is an unincorporated community in the U.S. state of Pennsylvania. It straddles Lower Merion Township of Montgomery County and Radnor Township of Delaware County. It is part of the Pennsylvania Main Line and is served by the SEPTA R5 regional rail train. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[3] = new Array('../skin_files/pop_up_gladwyne.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Gladwyne</font></b><p><font face="Verdana" size="2" color="000000">Gladwyne is one of the premier living locations in the Philadelphia area and is convenient to downtown Philadelphia and Wilmington, DE and to the Rt. 202 "High Tech" Corridor. Gladwyne is also a mere 20 minutes from Valley Forge National Park; an absolute must visit. History, fly fishing, horseback riding, R/C Model Airplane area, hiking and bicycling. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[4] = new Array('../skin_files/pop_up_wayne.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Wayne</font></b><p><font face="Verdana" size="2" color="000000">For over a hundred years, Wayne has been considered one of the best, if not the best, places in the western suburbs of Philadelphia to live and raise a family. The school system has been recognized as one of the best in the country, the median income is very high and the crime rate is very low. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[5] = new Array('../skin_files/pop_up_radnor.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Radnor</font></b><p><font face="Verdana" size="2" color="000000">Radnor Township is the &#8220;Best Place to Live in the Suburbs&#8221;, according to Philadelphia Magazine. Of course, Radnor residents have known that since 1682, when the Township was officially founded. Since then, Radnor&#8217;s government has worked hard at maintaining the Township&#8217;s delightful mix of residential, rural, and business. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[6] = new Array('../skin_files/pop_up_rosemont.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Rosemont</font></b><p><font face="Verdana" size="2" color="000000">Rosemont station Part of the geographic area is served by the Bryn Mawr, Pennsylvania zip code. Rosemont is served by its own stops on both the R5 SEPTA Regional Rail line and the Norristown High Speed Line.</font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[7] = new Array('../skin_files/pop_up_berwyn.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Berwyn</font></b><p><font face="Verdana" size="2" color="000000">Devon-Berwyn is a census-designated place that probably describes the densely populated area at the center of what the residents and the post office consider the two separate towns of Devon and Berwyn, in Chester County, Pennsylvania, United States. As of the 2000 census, the population was 5,067. Devon and Berwyn are both part of Pennsylvanias Main Line. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[8] = new Array('../skin_files/pop_up_haverford.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Haverford</font></b><p><font face="Verdana" size="2" color="000000">The township is primarily residential with retail and service businesses and some light industry. The largest industry is the Philadelphia Chewing Gum Corporation. There are two shopping centers, Manoa with 28 businesses and Pilgrim Gardens with about 12. The tallest buildings in the township are two apartment buildings of five stories. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[9] = new Array('../skin_files/pop_up_ardmore.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Ardmore</font></b><p><font face="Verdana" size="2" color="000000">Ardmore is a community of approximately 13,000 residents, located on the Main Line, west of Philadelphia. Historic downtown, one of the largest business districts in our area, contains a delightful mix of restaurants and small specialty shops, including antique and gift shops. Historic Ardmore is adjacent to Suburban Square, one of Americas oldest shopping centers. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[10] = new Array('../skin_files/pop_up_narberth.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Narberth</font></b><p><font face="Verdana" size="2" color="000000">Because of its size and convenient layout, Narberth is a walking town, with shopping, most recreational facilities, religious organizations, the library and school all within a comfortable walk. The roughly one-half square mile area of the Borough is cut in half by the Pennsylvania railroad tracks which divide the town into the north side and the south side. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[11] = new Array('../skin_files/pop_up_lower_merion.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Lower Merion</font></b><p><font face="Verdana" size="2" color="000000">Lower Merion is community characterized by a deep sense of civic pride and involvement. Over 18 business and civic associations provide an opportunity for residents to participate in their community. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[12] = new Array('../skin_files/pop_up_wynnewood.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Wynnnewood</font></b><p><font face="Verdana" size="2" color="000000">Wynnewood, Pennsylvania is a suburban community located outside of Philadelphia in Lower Merion Township, Pennsylvania. Wynnewood was named in 1691 for Dr. Thomas Wynne, William Penns physician and the first Speaker of the Pennsylvania General Assembly.  </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[13] = new Array('../skin_files/pop_up_tredyffrin.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Tredyffrin</font></b><p><font face="Verdana" size="2" color="000000">Tredyffrin Township is a township located in eastern Chester County, Pennsylvania, USA. The population was 29,062 at the 2000 census. Originally settled in the late 17th century, Tredyffrin is bounded by Delaware and Montgomery Counties. It includes on its northern boundary a small part of Valley Forge National Historic Park, where George Washington encamped during the American War of Independence.  </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[14] = new Array('../skin_files/pop_up_easttown.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Easttown</font></b><p><font face="Verdana" size="2" color="000000">With bus and rail transportation and access to the Pennsylvania Turnpike, the Schuylkill Expressway and the 202 Interstate Easttown provides good job availability in Philadelphia and a broad suburban area. A variety of shopping, good health care, professional sporting events, plays and concerts and areas of historic interest are nearby. Civic, social and service groups abound. </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[15] = new Array('../skin_files/pop_up_eagleview_estates.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Eagleview Estates</font></b><p><font face="Verdana" size="2" color="000000">Community Information </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[16] = new Array('../skin_files/pop_up_easttown.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Carriages on Elm</font></b><p><font face="Verdana" size="2" color="000000">Community Information </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");
messages[17] = new Array('../skin_files/pop_up_Community.jpg','<table border="0" cellspacing="1" id="AutoNumber3">          <tr>            <td rowspan="2" valign="top"><b>            <font face="Verdana" color="#433A34">Community</font></b><p><font face="Verdana" size="2" color="000000">Community Information </font></td>            <td valign="top">&nbsp;</td>          </tr>          <tr>            <td valign="top">&nbsp;</td>          </tr>        </table>',"#FFFFFF");



////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  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
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ns4) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

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-20+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)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

