/*	------------- make IE display transparent PNG files -----------------	*/

ie = document.all && document.fireEvent && navigator.platform == "Win32";

if (ie)
{
	document.writeln('<style type="text/css">img.png { visibility:hidden; } </style>');
	window.attachEvent("onload", loadPngs);
}

function loadPngs()
{
	if (ie)
	{
		var i, a, f;
		for(i=0; (a = document.getElementsByTagName("img")[i]); i++)
		{
			if ((a.className == "png") || (a.className == "icon png"))
			{
				a.style.width = a.width + "px";
				a.style.height = a.height + "px";
				a.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"', sizingMethod='scale')";
				a.src = "images/space.gif";
			}
			a.style.visibility = "visible";
		}
	}
}


/*	------------- popup window -----------------	*/

	var win = null;

	function newWindow(mypage,myname,w,h,scroll,pos)
	{
		if (pos == "random")
		{
			LeftPosition = (screen.width)?Math.floor(Math.random()*(screen.width-w)) :100;
			TopPosition = (screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
		}
		
		if (pos == "center")
		{
			LeftPosition = (screen.width)?(screen.width-w)/2:100;
			TopPosition=(screen.height)?(screen.height-h)/2:100;
		}
		
		else if ((pos != "center" && pos != "random") || pos == null)
		{
			LeftPosition = 0; TopPosition = 20;
		}


		settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=yes,toolbar=no,resizable=yes';

		

		win = window.open(mypage,myname,settings);
		if (win.focus)
		{
			win.focus();
		}

	}


/*	------------- expands & collapses menus -----------------	*/

	function switchIt(name)
	{
		if (document.getElementById)
		{
			var el = document.getElementById(name).style;
		}
		else
		{
			if (document.All)
			{
				var el = document.all[name].style;
			}
			else
			{
				if (document.layers)
				{
					var el = document.layers[name].style;
				}
			}
		}

		if (el.display == 'block')
		{
			el.display = 'none';
			
		}
		else
		{
			el.display = 'block';
			
		}
	}
