function addEvent(obj, evType, fn)
{
	if (obj.addEventListener)
	{
		obj.addEventListener(evType, fn, true);
		return true;
	} 
	else if (obj.attachEvent)
	{
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} 
	else 
	{
		return false;
	}
}

function popup(url, name, height, width) 
{ 
	var opts = "toolbar=no,status=no,location=no,menubar=no,resizable=no"; 
	opts += ",height=" + height + ",width=" + width + 
	",scrollbars=no"; 

	var popwin = window.open("", name, opts); 
	popwin.focus(); 
	popwin.location = url; 
} 

function main_sound_link_click(e) {
	popup("/listen.asp", "main_sound_window", 90, 387);
	return false;
}

function initSoundLink() {
	var a = document.getElementById("main_sound_link");
	if (a != null)
		a.onclick = main_sound_link_click;
}

function streamlineStuff() {
	var ds = document.getElementsByTagName("div");
	var nds = new Array();
	if (ds != null)
	{
		for (var n = 0; n < ds.length; n++)
		{
			if (ds[n].className.indexOf("level") >= 0)
				nds.push(ds[n]);
		}
		var nh = 0;
		for (var n = 0; n < nds.length; n++)
		{
			if (nds[n].offsetHeight > nh)
				nh = nds[n].offsetHeight;
		}
		for (var n = 0; n < nds.length; n++)
			nds[n].style.minHeight = nh + "px"
	}
}

addEvent(window, "load", streamlineStuff)

