// mySafemail hides email addresses from spam crawlers by creating them via Javascript on the client
function mySafemail(name, domain, display) {
		displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
		document.write('<a href=mailto:' + name + '@' + domain + '>' + displayed + '</a>');
}

// opens a browser window and moves it to the center of the users screen
function openWindow(url, width, height) {
	var arguments, h, w, moreInfo;
	
	arguments = "width=" + width + ",height=" + height + ",resizable=yes,dependent,scrollbars=no";
	
	moreInfo = window.open(url, moreInfo, arguments);
	
	h = screen.height;
	w = screen.width;

	h = h / 2 - (height/2);
	w = w / 2 - (width/2);

	// to center the new window
	moreInfo.moveTo(w,h);
}			
// -->


/*	------------- make IE display PNG files -----------------	*/

ie = document.all && document.fireEvent && navigator.platform == "Win32";

if (ie)
{
	document.writeln('<style type="text/css">img.png { visibility:hidden; background:transparent; } </style>');
	window.attachEvent("onload", loadPngs);
	window.attachEvent("onmousover", 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";
		}
	}
}

/*	------------- make IE display transparent backgroung PNG files -----------------	*/

if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent)
{
	window.attachEvent("onload", alphaBackgrounds);
}

function alphaBackgrounds()	{
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (i=0; i<document.all.length; i++)
	{
		var bg = document.all[i].currentStyle.backgroundImage;
		if (itsAllGood && bg)
		{
			if (bg.match(/\.png/i) != null)
			{
				var mypng = bg.substring(5,bg.length-2);
				document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='crop')";
				document.all[i].style.backgroundImage = "url('images/space.gif')";
			}
		}
	}
}


