function lightNav(currentMenu)
{
	var menuArray = new Array("home","products","news","store");

	for (var i=0; i < menuArray.length; i++)
	{
		if(menuArray[i] != activeMenu)
		{
			if (menuArray[i] == currentMenu)
			{
				document.getElementById('menu_' + menuArray[i]).className = "navHover";
			}
			else
			{
				document.getElementById('menu_' + menuArray[i]).className = "navNover";
			}
		}
		else
		{
			document.getElementById('menu_' + activeMenu).className = "navActive";
		}
	}
}

function popup(URL, height, width)
{
	window.open(URL, null, 'resizable=no,menubar=no,toolbar=no,scrollbars=yes,status=no,directories=no,location=no,left=0,top=0,height=' + height + ', width=' + width);
}

function ShowStoreMessageandRedirect(Mode, URL)
{
	if (Mode == 'view')
	{
		alert('You are being redirected to the Online Store to view the cart. Please use the browser back button to come back to our website.');
	}
	else
	{
		alert('We are taking you to the Online Store to add the item to the cart and display it. Please use the browser back button to come back to our website.');
	}

	redirect(URL);
}

function AddtoCart(URL)
{
	alert('You are being redirected to the Online Store to add items to the cart. Please use the navigation buttons provided at the top to come back to this website / product page.');
	redirect(URL);
}

function ViewCart(URL)
{
	alert('You are being redirected to the Online Store to view the cart. Please use the navigation buttons provided at the top to come back to this website / product page.');
	redirect(URL);
}

function redirect(URL)
{
	location.href = URL;
}

function AddtoFavorites(URL, Descr)
{
	if (URL == "")
	{
		URL = location.href;
	}
	if (Descr == "")
	{
		Descr = document.title;
	}

	if (navigator.appName == "Netscape")
	{
		alert("Please use CTRL + D to bookmark this page.");
		return;		
	}
	else
	{
		window.external.AddFavorite(URL, Descr);
	}
}

function EmailPage(URL, Title)
{
	var strEmailPage;
	if (URL == "")
	{
		URL = location.href;
	}
	if (Title == "")
	{
		Title = document.title;
	}

	strEmailPage = "/EmailFriend/Default-Health.asp?Title=" + Title + "&URL=" + URL

	redirect(strEmailPage);
}

function PrintPage()
{
	window.print();
}

function PrinterFriendlyPage()
{
	BeforePrint();
	PrintPage();
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		AfterPrint();
	}
	else
	{
		setTimeout("AfterPrint()", 1000);	
	}
}

function BeforePrint() //window.onbeforeprint()
{
	document.body.className = "print";
}

function AfterPrint() //window.onafterprint()
{
	document.body.className = "";
}


function rSubscribeToNews()
{
	rSubscribeToNewsWithChannel("");
}

function rSubscribeToNewsWithChannel(WhichChannel)
{
	var TheURL = "http://health.cch.com/thenews&CloseOnExit=True&" + Math.random() + "&Channel=" + WhichChannel + "&";
	var Width  = ( navigator.appName != "Netscape" ) ? "426" : "450";
	rSubscribe( "CCH NetNews Subscription Options", "HNSWindow", TheURL, Width );
}

function rPopUpTrial(WhichOffer)
{
	rPopUpTrialWithChannel(WhichOffer, "");
}

function rPopUpTrialWithChannel(WhichOffer, WhichChannel)
{
	var TheURL = "http://health.cch.com/trydemo&CloseOnExit=True&wo=" + WhichOffer + "&" + Math.random() + "&Channel=" + WhichChannel + "&";
	rSubscribe( "CCH Trial ID Offer", "HTRWindow", TheURL, 590 );
}

function rSubscribe(WindowTitle, WindowName, TheURL, TheWidth)
{
	var TheWindow;
	var TheDocument;
	var Width;

	TheWindow = window.open( "", WindowName, "resizable=yes,menubar=no,toolbar=no,scrollbars=yes,status=no,directories=no,location=no,width=" + TheWidth + ",height=600" );
	TheDocument = TheWindow.document;
	TheDocument.close();
	TheDocument.open("text/html", "replace");
	TheDocument.write("<HTML><HEAD><TITLE>Please wait:  Loading " + WindowTitle + "</TITLE></HEAD><BODY BGCOLOR=#FFFFFF><TABLE BORDER=0 WIDTH=100% HEIGHT=100% ><TR><TD VALIGN=CENTER ALIGN=CENTER><FONT FACE=Arial SIZE=2 COLOR=#000080><STRONG>Please wait:  Loading " + WindowTitle + ". . .</STRONG></FONT></TD></TR></TABLE></BODY></HTML>");
	TheDocument.close();
	TheWindow.focus();
	TheWindow.location = TheURL;
}