function submitSearch()
{
	var search = document.forms[0].txtSearch;
	var searchPage = "search.html"; 
	var url = String(document.location.href);
	var len = Number(url.length);
	if (url.toLowerCase().substring(len - 3) != "cms")
	{
		searchPage = "../" + searchPage;
	}
	document.location = searchPage + "?searchcriteria=" + search.value;
	return false;
}
function SubscribeWindow(index)
{
	window.open('/_cms/subscribe.aspx?email='+ document.forms[0].subscribeemail.value + 

'&subtype='+index+'&action=new','_blank','menubar=0,status=0,toolbar=0,width=400px,height=300px');
}
function keyPressEvent(e) 
{
	if (event)
	{
		if (event.keyCode == 13) 
		{
			submitSearch();
			return false;
		}
	}
}
function emailPage()
{
	var sPageUrl = "http://" + location.host + location.pathname; 
	if (document.search) sPageUrl += document.search;
	var sPage = "/biobasics.emailpage.asp?pageurl=" + escape(sPageUrl);
	window.open(sPage, "emailwin", "width=500,height=250,status,resizable");
}
function bioBasicsInit()
{
	try
	{
		setContinueButtons();
		fixCalendarLinks();
		var elem = document.getElementById("divider");
		if ( elem.length ) elem = elem[0];
		elem.src = "/images/spacer.gif";
	}
	catch(e) {}
}
// this is designed to fix a relative path issue
// with the calendar module appearing on a detail page
function fixCalendarLinks()
{
	// if we are not on a detail page ignore
	if  ( location.pathname.indexOf ( "itemid" ) == -1 ) return;
	if ( document.getElementsByTagName )
	{
		var anchors = document.getElementsByTagName("A");
		for ( var i = 0; i < anchors.length; i ++ )
		{
			// find bio calendar links
			// and remove the first appearances
			// of article.cms and detail.cms
			// so that the page name will resolve correctly
			var anchor = anchors[i];
			if ( anchor.href.indexOf ( "bio_calendar" ) > -1   )
			{
				var href = anchor.href;
				if ( href.indexOf ( "article.cms" ) > -1)
				{
					href = href.replace ( /article.cms\//, "" );
					anchor.href = href;
				}
				else if ( href.indexOf ( "detail.cms" ) > -1 )
				{
					href = href.replace ( /detail.cms\//, "" );
					anchor.href = href;
				}
			}
		}
	}
}
function setContinueButtons()
{
	var imgs = document.images;
	for (var i = 0; i < imgs.length; i++)
	{
		if (imgs[i].name == "$continue")
		{
			imgs[i].src = "/images/btn_continue_biobasics.gif";
		}
	}
}
//window.attachEvent ( "onload", bioBasicsInit );