//Writes correct style sheet into page
//NOTE: style_legacy.css is for ie4 and ns4 on a mac....all other browsers use style.css
var stylesheet="style.asp";

if (navigator.platform.indexOf("Mac")!=-1)
{
	if (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4")
	{
		stylesheet="style.asp?legacy=1";
	}
	else if (navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.indexOf("MSIE 4")!=-1)
	{
		stylesheet="style.asp?legacy=1";
	}
}

document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/templates/central/includes/"+stylesheet+"\">");


//Image Rollover Function
function rollOver(img_name, img_src)
{
	if (document.images)
	{
		document [img_name].src = img_src;
	}
}

//General Purpose popUp Script
//usage: (#, #, 'name', 'url', 1/0, 1/0) where the last 2 parameters must be a 1 or 0.
function popUpWindow (window_width, window_height, window_name, window_url, _resizeable, _scrollbars )
{
	var options="resizable="+_resizeable+",scrollbars="+_scrollbars+",width="+window_width+",height="+window_height+"";
	popupWin=window.open(window_url, window_name, options);
	
	return false;
}

//directs the browser that opened the popup to the specified link
//usage: openerLink('URL STRING');
function openerLink(link_location)
{
	opener.location.href=link_location;
}

//Pops Up Glossary page for supplied term
//usage:  showGlossary('ANCHOR STRING');
function showGlossary(term)
{
	var page_2_load="/resources/glossary/";
	var first_char;

	first_char=term.charAt(0)
	first_char=first_char.toLowerCase();
	
	if(isNaN(first_char)==false)
	{
		page_2_load=page_2_load + "popup.asp";
	}
	else
	{
		page_2_load=page_2_load + "popup.asp?letter=" + first_char + "#" + term;
	}
	
	popUpWindow(400, 300, 'glossary', page_2_load, 1, 1);
	
}

