function getElementsByStyleClass (className) {
	var all = document.all ? document.all :
	document.getElementsByTagName('*');
	var elements = new Array();
	for (var e = 0; e < all.length; e++)
	if ( ( all[e].className.indexOf(className) !=-1 ) && ( ( all[e].className.indexOf('soldout') ==-1 ) || ( className != 'calendar_dates' ) ) )
	elements[elements.length] = all[e];
	return elements;
	}
	
function createTooltipsByClass (targetClass,tooltipClass,html) {
	myDates = getElementsByStyleClass(targetClass);
	for ( i=0; i < myDates.length ; i++ ) {
		var myDate = myDates[i];
		if ( ( myDate.childNodes.length <= 1 ) && ( myDate.innerHTML ) ) {
			var newdiv = document.createElement('div');
			newdiv.className ='tooltip ' + tooltipClass;
			newdiv.style.display = 'none';
			if (targetClass == 'calendar_dates') {
				newdiv.innerHTML = '<span class="ttDate">' + myDate.id + '<\/span><br><br>' + html;
			} else {
				newdiv.innerHTML = html;
			}
			myDate.appendChild(newdiv);
			Tooltip.add(myDate,newdiv);
		}
	}
}

function tagDates () {
	createTooltipsByClass ('shrinkrap','','<p><strong>Shrink Rap<\/strong><br><br>Ed Shea and local psychiatrist Rendueles Villalba, MD lead informal, post-show discussions to examine the play from the psychological perspective.  Ed and Rendueles will often host one specialist whose field is germane to the discussion of the play. Shrink Rap is included in the price of admission.<\/p>');
	createTooltipsByClass ('discuss','','<img src="/images/rich.jpg" style="float:left;padding-right:10px;"><p><em>Discussion Sunday<\/em> at 2nd Story Theatre is made possible through major funding support from the Rhode Island Council for the Humanities, an independent state affiliate of the National Endowment for the Humanities.<\/p>');
	createTooltipsByClass ('calendar_dates','available','seats still available');
}

if (window.addEventListener) {
	window.addEventListener("load", function () { tagDates(); }, false);
	} else if (window.attachEvent) {
	window.attachEvent('on' + "load", function () { tagDates(); });
}