//
// ChristianityToday.com JavaScript
// Version 1.1
// Copyright © 2006 Christianity Today International
//

// variables
	// user-agent identity
	var version = parseInt(navigator.appVersion);
	var isNS  = (navigator.appName.indexOf('Netscape') >= 0);
	var isNS4 = (isNS && version == 4);
	var isNS5 = (isNS && version > 4);
	var isFF  = (navigator.userAgent.indexOf('Firefox') >= 0);
	var isIE  = !isNS;
	var isIE4 = (isIE && version == 4);
	var isIE5 = (isIE && version > 4);
	var isMac = (navigator.appVersion.indexOf('Macintosh') >= 0);
	var isWin = !isMac;
	var isAOL = (navigator.userAgent.indexOf('AOL') >= 0);

	// Flash detection; minimum: version 4.0
	var flashVersion = 0;
	for (var i = 4; i <= 10; i++)
	{
		if (isIE)
		{
			document.write('<script language="VBScript" type="text/vbscript">\n');
			document.write('On Error Resume Next\n');
			document.write('CreateObject("ShockwaveFlash.ShockwaveFlash." & i)\n');
			document.write('If Err = 0 Then\n');
			document.write('flashVersion = i\n');
			document.write('End If\n');
			document.write('</script>\n');
		}
		else
		{
			var plugin = navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
			if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf('.') - 1)) >= i)
			{
				flashVersion = i;
			}
		}
	}

	// events
	var clickURL;
	var mouseX = 0;
	var mouseY = 0;
	var pageWidth = 0;
	var pageHeight = 0;

	// settings
	var menuDelay = 100;
	var allowFrame = true;
	var menuDivArray = new Array('globalMenu', 'channelMenu');

	// page tools
	var windowArray = new Array();
	var pageURL = (window != top) ? document.referrer : location.href;
	var emailURL = 'email.html?title=%%title%%&url=%%url%%';
	var printURL = '/print.html?id=%%id%%';
	var similarURL = '/search.html?similar=%%url%%';
	var contextStyles =
	[
		['intro', 'cite', 'ital-off'],
		['bio', 'cite', 'ital-off']
	];

// cookie management
	function readCookie(name)
	{
		var cookieArray = document.cookie.split('; ');
		for (var i = 0; i < cookieArray.length; i++)
		{
			var nameValueArray = cookieArray[i].split('=', 2);
			if (nameValueArray[0] == name) return(nameValueArray[1]);
		}
		return(null);
	}

	function writeCookie(name, value, expires)
	{
		if (expires)
		{
			document.cookie = name + '=' + value + '; expires=' + expires.toUTCString();
		}
		else
		{
			document.cookie = name + '=' + value;
		}
	}

// query extraction
	function getQueryVariable(name)
	{
		var query = window.location.search.substring(1);
		var vars = query.split('&');
		for (var i = 0; i < vars.length; i++)
		{
			var pair = vars[i].split('=');
			if (pair[0] == name)
			{
				return pair[1];
			}
		}
		return null;
	}

function activateMenu ()
	{ //this function fixes the conflict in IE with css menus and tooltips
	document.detachEvent('onmousemove', mouseMove);
	window.attachEvent('onload', sfHover);

	}

function activateTips ()
	{	//this function fixes the conflict in IE with css menus and tooltips
		window.detachEvent('onload', sfHover);
		document.attachEvent('onmousemove', mouseMove);

	}


// event capturing
	if (isNS4)
	{
		window.captureEvents(Event.ONLOAD);
		window.onLoad = pageLoad;
		window.captureEvents(Event.ONUNLOAD);
		window.onUnload = pageUnload;
		document.captureEvents(Event.CLICK);
		document.onClick = mouseClick;
		document.captureEvents(Event.MOUSEMOVE);
		document.onMouseMove = mouseMove;
	}

	if (isNS5)
	{
		window.addEventListener('load', pageLoad, false);
		window.addEventListener('unload', pageUnload, false);
		document.addEventListener('click', mouseClick, false);
		document.addEventListener('mousemove', mouseMove, false);
	}

	if (isIE)
	{
		window.attachEvent('onload', pageLoad);
		window.attachEvent('onunload', pageUnload);
		document.attachEvent('onmousemove', mouseMove);
		document.attachEvent('onclick', mouseClick);
	}

// event handlers
	function pageLoad(evt)
	{
		// frame break
		if (window != top && allowFrame != true) top.location.replace(location.href);

		// create menu divs
		createMenuDivs();

		// display hover
		if (window.showPromo) showPromo();

		// set contextual styles
		setContextStyles();

		if (window.channelLoad) channelLoad();
	}

	function pageUnload(evt)
	{
		// close child windows
		for (var i = 0; i < windowArray.length; i++)
		{
			if (typeof windowArray[i] == 'object' && !windowArray[i].closed) windowArray[i].close();
		}

		if (window.channelUnload) channelUnload();
	}

	function mouseOver(evt)
	{
		obj = (evt.target) ? evt.target : evt.srcElement;
		if (obj.over) obj.src = obj.over.src;
		if (obj.tip) showTip(obj);
		if (obj.menu) showMenu(obj, evt);
	}

	function mouseOut(evt)
	{
		obj = (evt.target) ? evt.target : evt.srcElement;
		if (obj.out) obj.src = obj.out.src;
		if (obj.tip) hideTip(obj);
		if (obj.menu) delayHideMenu();
	}

	function mouseClick(evt)
	{
		if (isNS4)
		{
			clickURL = evt.target.href;
		}
		else if (isNS5)
		{
			node = evt.target;
			if (node)
			{
				while (node.tagName != 'A' && node.tagName != 'HTML')
				{
					node = node.parentNode;
				}
				clickURL = node.href;
			}
		}
		else if (isIE)
		{
			element = evt.srcElement;
			if (element)
			{
				while (element.tagName != 'A' && element.tagName != 'HTML')
				{
					element = element.parentElement;
				}
				clickURL = element.href;
			}
		}

		if (clickURL == null) clickURL = '';
	}

var sfHover = function sfHover() {
	//this function is to make css dropdown menus work with IE
	var sfEls = document.getElementById('nav').getElementsByTagName('LI');
	for (var i=0; i<sfEls.length; i += 1) {
		sfEls[i].onmouseover=function() {
			this.className+=' sfhover';
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(' sfhover\\b'), '');
		}
	}
}
if (window.attachEvent && document.getElementById('nav')) window.attachEvent("onload", sfHover);


	function mouseMove(evt)
	{
		if (isNS)
		{
			mouseX = evt.pageX;
			mouseY = evt.pageY;
			pageWidth = window.innerWidth;
			pageHeight = window.innerHeight;
		}
		else
		{
			mouseX = evt.clientX;
			mouseY = evt.clientY + document.body.scrollTop;

			if (document.compatMode && document.compatMode == 'CSS1Compat')
			{
				pageWidth = document.body.parentNode.clientWidth;
				pageHeight = document.body.parentNode.clientHeight;
			}
			else
			{
				pageWidth = document.body.clientWidth;
				pageHeight = document.body.clientHeight;
			}
		}

		if (tipVisible)
		{
			moveTip();

		}

	}

	function addMouseEvents(obj)
	{
		if (isNS5)
		{
			obj.addEventListener('mouseover', mouseOver, false);
			obj.addEventListener('mouseout', mouseOut, false);
		}
		if (isIE)
		{
			obj.detachEvent('onmouseover', mouseOver);
			obj.attachEvent('onmouseover', mouseOver);
			obj.detachEvent('onmouseout', mouseOut);
			obj.attachEvent('onmouseout', mouseOut);
		}
	}

// mouseovers; incompatible with NS4
	//
	// Usage:
	// <a href="LINK"><img src="IMAGE.EXT" onload="mouseLoad(this);" width="WIDTH" height="HEIGHT" title="ALT" /></a>
	//
	// Note: mouseover image must be named IMAGE_over.EXT
	//
	function mouseLoad(obj)
	{
		if (isNS4 || obj.out) return;

		obj.out = new Image();
		obj.out.src = obj.src;
		obj.over = new Image();
		obj.over.src = obj.src.replace(/.gif$/, '_over.gif').replace(/.jpg$/, '_over.jpg');

		addMouseEvents(obj);
	}

// dropdown menu
	//
	// Usage:
	// <img src="IMAGE.EXT" onload="menuLoad(this, 'MENU_NAME', 'WIDTH', 'LEFT|RIGHT');" width="WIDTH" height="HEIGHT" title="ALT" />
	//
	// Note: create menu items in a separate JavaScript file
	//

	var menu = new Array();
	var menuTimeout;

	function createMenuDivs()
	{
		if (!isNS4)
		{
			for (var i = 0; i < menuDivArray.length; i++)
			{
				var newDiv = document.createElement('div');
				newDiv.setAttribute('id', menuDivArray[i]);
				newDiv.setAttribute('style', 'display: none; width: 0px;');
				if (isNS5)
				{
					newDiv.addEventListener('mouseover', clearHideMenu, false);
					newDiv.addEventListener('mouseout', delayHideMenu, false);
				}
				if (isIE)
				{
					newDiv.attachEvent('onmouseover', clearHideMenu);
					newDiv.attachEvent('onmouseout', delayHideMenu);
				}
				document.body.appendChild(newDiv);
			}
		}
	}

	function menuLoad(obj, name, width, align)
	{
		if (isNS4 || obj.menu) return;

		obj.menu = menu[name];
		obj.menuName = name;
		obj.menuWidth = width;
		obj.menuAlign = align;

		addMouseEvents(obj);
	}

	function showMenu(obj, evt)
	{
		var menuObject;
		if (isNS4 || ! obj.menu) return;

		if (window.event)
		{
			event.cancelBubble = true;
		}
		else if (evt.stopPropagation)
		{
			evt.stopPropagation();
		}
		clearHideMenu();

		var menuDiv = 'channelMenu';
		if (obj.menuName.indexOf('global_') == 0)
		{
			menuDiv = 'globalMenu';
		}

		menuObject = document.getElementById ? document.getElementById(menuDiv) : document.all[menuDiv];

		if (menuObject)
		{
			menuObject.innerHTML = obj.menu.join('');

			menuObject.style.width = obj.menuWidth + 'px';
			if (evt.type == 'click' && obj.visibility == hidden || evt.type == 'mouseover')
			{
				menuObject.style.display = 'block';
			}
			else if (evt.type == 'click')
			{
				menuObject.style.display = 'none';
			}

			var horizontalOffset;
			var verticalOffset;
			if (obj.menuAlign == 'right')
			{
				horizontalOffset = obj.offsetLeft + obj.offsetWidth;
			}
			else
			{
				horizontalOffset = obj.offsetLeft;
			}
			verticalOffset = obj.offsetTop + obj.offsetHeight;

			var parentElement = obj.offsetParent;
			while (parentElement != null)
			{
				horizontalOffset = horizontalOffset + parentElement.offsetLeft;
				verticalOffset = verticalOffset + parentElement.offsetTop;
				parentElement = parentElement.offsetParent;
			}
			if (obj.menuAlign == 'right')
			{
				menuObject.x = horizontalOffset - obj.menuWidth;
			}
			else
			{
				menuObject.x = horizontalOffset;
			}
			menuObject.y = verticalOffset;
			menuObject.style.left = menuObject.x;
			menuObject.style.top = menuObject.y;
		}
	}

	function delayHideMenu()
	{
		if (isNS4) return;

		menuTimeout = setTimeout('hideMenu()', menuDelay);
	}

	function hideMenu()
	{
		if (isNS4) return;

		var menuObject;

		for (var i = 0; i < menuDivArray.length; i++)
		{
			menuObject = document.getElementById ? document.getElementById(menuDivArray[i]) : document.all[menuDivArray[i]];
			if (typeof menuObject != 'undefined')
			{
				menuObject.style.display = 'none';
			}
		}
	}

	function clearHideMenu()
	{
		if (typeof menuTimeout != 'undefined') clearTimeout(menuTimeout);
	}

	document.onclick = hideMenu;

// help tips
	//
	// Usage:
	// <img src="IMAGE.EXT" onload="tipLoad(this, 'MESSAGE', 'LEFT|RIGHT', WIDTH, OFFSET);" width="WIDTH" height="HEIGHT" title="ALT" />
	// <a href="LINK" onmouseover="showTip(this, 'MESSAGE', 'LEFT|RIGHT', WIDTH, OFFSET);" />
	//		the ALIGN, WIDTH, and OFFSET can be left out and they will be set to default values
	//		if ALIGN is right, the OFFSET should be set to ensure proper positioning
	//
	var tipVisible = false;

	function tipLoad(obj, message, align, width, offset)
	{
		if (isNS4) return;

		if (! obj.tip)
		{
			obj.tip = message;
			if (align == null)
			{
				align = 'left';
			}
			obj.tipAlign = align;
			if (width == null)
			{
				width = 200;
			}
			obj.tipWidth = width;
			if (offset == null)
			{
				offset = 210;
			}
			obj.tipRightOffset = offset;
			addMouseEvents(obj);
			if (obj.nodeName == "A")
			{
				showTip(obj);
			}
		}
	}

	function showTip(obj)
	{
		if (isNS4) return;

		tipVisible = true;

		var tipDiv = document.getElementById('tip');

		if (!tipDiv)
		{
			tipDiv = document.createElement('div');
			tipDiv.setAttribute('id', 'tip');
			document.body.appendChild(tipDiv);
		}

		if (tipDiv)
		{
			tipDiv.innerHTML = obj.tip;
			moveTip();
			tipDiv.style.width = obj.tipWidth + 'px';
			tipDiv.style.visibility = 'visible';
		}
	}

	function hideTip()
	{
		if (isNS4) return;

		tipVisible = false;

		var tipDiv = document.getElementById('tip');

		if (tipDiv)
		{
			tipDiv.style.visibility = 'hidden';
		}
	}

	function moveTip()
	{
		var tipDiv = document.getElementById('tip');
		if (tipDiv)
		{
			if(obj.tipAlign == 'left')
			{
				var tipX = (((mouseX) > pageWidth) ? (pageWidth) : mouseX) + 10;
			} else {
				var tipX = (((mouseX) > pageWidth) ? (pageWidth) : mouseX) - obj.tipRightOffset;
			}
			var tipY = mouseY + 25;

			if (isNS4)
			{
				tipDiv.left = tipX;
				tipDiv.top = tipY;
			}
			else
			{
				tipDiv.style.left = tipX;
				tipDiv.style.top = tipY;
			}
		}
	}

// page tools
	//
	// email this page
	// Usage:
	// <a href="javascript:emailPage();">LINK</a>
	//
	function emailPage(url)
	{
		if (url != null)
		{
			windowArray[windowArray.length] = window.open(url);
		}
		else
		{
			thisURL = emailURL.replace('%%title%%', escape(document.title)).replace('%%url%%', escape(pageURL));
			windowArray[windowArray.length] = window.open(thisURL, 'emailWindow', 'width=520,height=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');
		}
	}

	//
	// print this page
	// Usage:
	// <a href="javascript:printPage(ID);">LINK</a>
	//
	function printPage(id)
	{
		windowArray[windowArray.length] = window.open(printURL.replace('%%id%%', id), 'printWindow', 'width=760,height=400,toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1');
	}

	//
	// bookmark this page (compatible with IE only)
	// Usage:
	// <a href="javascript:bookmarkPage();">LINK</a>
	//
	function bookmarkPage()
	{
		if (isMac || isAOL)
		{
			alert('Sorry, this feature is not supported by your browser.');
			return;
		}

		if (!isNS)
		{
			window.external.AddFavorite(this.location.href, document.title);
		}
		else
		{
			alert('Click "OK", then type CTRL-D to add this page to your list of bookmarks.');
		}
	}

	//
	// set as homepage (compatible with IE only)
	// Usage:
	// <a href="javascript:setHomepage();">LINK</a>
	//
	function setHomepage()
	{
		if (!isIE || isAOL)
		{
			alert('Sorry, this feature is not supported by your browser.');
			return;
		}

		document.body.style.behavior = 'url(#default#homePage)';
		document.body.setHomePage(pageURL);
	}

	//
	// find similar pages
	// Usage:
	// <a href="javascript:findSimilar();">LINK</a>
	//
	function findSimilar()
	{
		top.location.href = similarURL.replace('%%url%%', pageURL);
	}

	//
	// adjust font size (incompatible with NS4)
	// Usage:
	// <a href="javascript:fontSize(-1|+1);">LINK</a>
	//
	function fontSize(amt)
	{
		if (isNS4)
		{
			alert('Sorry, this feature is not supported by your browser.');
			return;
		}

		if (amt == 1)
		{

		}
		else if (amt == -1)
		{

		}
	}

	//
	// toggle highlighting (incompatible with NS4)
	// Usage:
	// <a href="javascript:toggleHighlight();">LINK</a>
	//
	function toggleHighlight()
	{
		if (isNS4)
		{
			alert('Sorry, this feature is not supported by your browser.');
			return;
		}

		var elementList = document.getElementsByTagName('*');
		for (i = 0; i < elementList.length; i++)
		{
			elementList[i].className = (elementList[i].className == 'highlight') ? 'highlight_disabled' : 'highlight';
		}
		writeCookie('highlight', ((readCookie('highlight') != 'false') ? 'false' : 'true'));
	}

// page load routines
	// set contextual styles (incompatible with NS4)
	function setContextStyles()
	{
		if (isNS4) return;

		var elementList = document.getElementsByTagName('*');
		for (i = 0; i < elementList.length; i++)
		{
			for (j = 0; j < contextStyles.length; j++)
			{
				if (elementList[i].className == contextStyles[j][0])
				{
					currentNode = elementList[i].firstChild;
					while (currentNode)
					{
						if (currentNode.className == contextStyles[j][1])
						{
							switch (contextStyles[j][2])
							{
								case 'ital-off':
									currentNode.style.fontStyle = 'normal';
									break;
								case 'ital-on':
									currentNode.style.fontStyle = 'italic';
									break;
								case 'bold-off':
									currentNode.style.fontWeight = 'normal';
									break;
								case 'bold-on':
									currentNode.style.fontWeight = 'bold';
									break;
								default:
									break;
							}
						}
						currentNode = currentNode.nextSibling;
					}
				}
			}
		}
	}

// global dropdown menus
	// CHRISTIANITY TODAY menu
	menu['global_christianitytoday'] = new Array();
	menu['global_christianitytoday'][0] = '<a href="http://www.christianitytoday.com/ct/" target="_parent">Christianity Today</a>';
	menu['global_christianitytoday'][1] = '<a href="http://www.booksandculture.com/" target="_parent">Books &amp; Culture</a>';
	menu['global_christianitytoday'][2] = '<a href="http://www.christianitytoday.com/ch/" target="_parent">Christian History</a>';
	menu['global_christianitytoday'][3] = '<a href="http://www.christianleadershipalliance.org/" target="_parent">Christian Leadership Alliance</a>';
	menu['global_christianitytoday'][4] = '<a href="http://blog.christianitytoday.com/ctmovies/" target="_parent">CT Entertainment Blog</a>';
	menu['global_christianitytoday'][5] = '<a href="http://www.ctlibrary.com/" target="_parent">CT Library</a>';
	menu['global_christianitytoday'][6] = '<a href="http://blog.christianitytoday.com/ctliveblog/" target="_parent">CT Liveblog</a>';
	menu['global_christianitytoday'][7] = '<a href="http://blog.christianitytoday.com/ctpolitics/" target="_parent">CT Politics Blog</a>';
	menu['global_christianitytoday'][8] = '<a href="http://blog.christianitytoday.com/women/" target="_parent">Her.meneutics (Women&#39;s) Blog</a>';
	menu['global_christianitytoday'][9] = '<a href="http://www.christianitytoday.com/international/" target="_parent">International Christianity</a>';
	menu['global_christianitytoday'][10] = '<a href="http://www.christianitytoday.com/globalconversation/" target="_parent">The Global Conversation</a>';

	// PASTORAL LEADERSHIP menu
	menu['global_pastoralleadership'] = new Array();
	menu['global_pastoralleadership'][0] = '<a href="http://www.christianitytoday.com/le/" target="_parent">Leadership Journal</a>';
	menu['global_pastoralleadership'][1] = '<a href="http://www.catalystleadershipdigital.com/" target="_parent">Catalyst Leadership</a>';
	menu['global_pastoralleadership'][2] = '<a href="http://www.giftedforleadership.com/" target="_parent">Gifted for Leadership</a>';
	menu['global_pastoralleadership'][3] = '<a href="http://www.shapevine.com/" target="_parent">Missional Living</a>';
	menu['global_pastoralleadership'][4] = '<a href="http://www.outofur.com/" target="_parent">Out of Ur Blog</a>';
	menu['global_pastoralleadership'][5] = '<a href="http://www.preachingtoday.com/" target="_parent">Preaching Today</a>';
	
	// CHURCH MANAGEMENT menu
	menu['global_churchmanagement'] = new Array();
	menu['global_churchmanagement'][0] = '<a href="http://www.buildingforministry.com/" target="_parent">Building for Ministry</a>';
	menu['global_churchmanagement'][1] = '<a href="http://www.churchlawtoday.com/" target="_parent">Church Law Today</a>';
	menu['global_churchmanagement'][2] = '<a href="http://www.churchlawtoday.com/cltrinfo.php" target="_parent">Church Law &amp; Tax Report</a>';
	menu['global_churchmanagement'][3] = '<a href="http://www.churchlawtoday.com/ctainfo.php" target="_parent">Church Finance Today</a>';
	menu['global_churchmanagement'][4] = '<a href="http://www.churchsafety.com/" target="_parent">Church Safety</a>';
	menu['global_churchmanagement'][5] = '<a href="http://www.christianitytoday.com/yc/" target="_parent">Products &amp; Services</a>';
	menu['global_churchmanagement'][6] = '<a href="http://www.reducingtherisk.com/" target="_parent">Reducing the Risk</a>';
	menu['global_churchmanagement'][7] = '<a href="http://blog.yourchurch.net/" target="_parent">Your Church Blog</a>';
	menu['global_churchmanagement'][8] = '<a href="http://www.christianitytoday.com/yc/" target="_parent">Your Church Magazine</a>';
	menu['global_churchmanagement'][9] = '<a href="http://store.yahoo.com/cgi-bin/clink?yhst-78230354700659+u6MRfC+index.html" target="_parent">Your Church Resources</a>';

	// LEADER TRAINING menu
	menu['global_leadertraining'] = new Array();
	menu['global_leadertraining'][0] = '<a href="http://www.buildingchurchleaders.com/" target="_parent">Building Church Leaders</a>';
	menu['global_leadertraining'][1] = '<a href="http://www.roundtripmissions.com/" target="_parent">Round Trip Missions</a>';
	menu['global_leadertraining'][2] = '<a href="http://www.smallgroups.com/" target="_parent">Small Groups</a>';
	menu['global_leadertraining'][3] = '<a href="http://www.christianitytoday.com/childrensministry/" target="_parent">Today&#39;s Children&#39;s Ministry</a>';

	// DISCIPLESHIP menu
	menu['global_discipleship'] = new Array();
	menu['global_discipleship'][0] = '<a href="http://www.christianitytoday.com/biblestudies/" target="_parent">Christian Bible Studies</a>';
	menu['global_discipleship'][1] = '<a href="http://www.christiancollegeguide.net/" target="_parent">Christian College Guide</a>';
	menu['global_discipleship'][2] = '<a href="http://www.christianitytoday.com/workplace/" target="_parent">Faith in the Workplace</a>';
	menu['global_discipleship'][3] = '<a href="http://www.giftedforleadership.com/" target="_parent">Gifted for Leadership</a>';
	menu['global_discipleship'][4] = '<a href="http://www.christianitytoday.com/holidays/" target="_parent">Holidays</a>';
	menu['global_discipleship'][5] = '<a href="http://www.christianitytoday.com/iyf/" target="_parent">Ignite Your Faith (Teens)</a>';
	menu['global_discipleship'][6] = '<a href="http://www.kyria.com/" target="_parent">Kyria (Women)</a>';
	menu['global_discipleship'][7] = '<a href="http://www.christianitytoday.com/mp/" target="_parent">Marriage Partnership</a>';
	menu['global_discipleship'][8] = '<a href="http://www.christianitytoday.com/moi/" target="_parent">Men of Integrity</a>';
	menu['global_discipleship'][9] = '<a href="http://www.christianitytoday.com/momsense/" target="_parent">MomSense (Parenting)</a>';
	menu['global_discipleship'][10] = '<a href="http://www.seminarygradschool.com/" target="_parent">Seminary/Grad Guide</a>';
	menu['global_discipleship'][11] = '<a href="http://www.christianitytoday.com/shopping/" target="_parent">Shopping</a>';
	
	// MAGAZINES menu
	menu['global_magazines'] = new Array();
	menu['global_magazines'][0] = '<a href="http://www.christianitytoday.com/ct/" target="_parent">Christianity Today</a>';
	menu['global_magazines'][1] = '<a href="http://www.booksandculture.com/" target="_parent">Books &amp; Culture</a>';
	menu['global_magazines'][2] = '<a href="http://www.catalystleadershipdigital.com/" target="_parent">Catalyst Leadership Digital</a>';
	menu['global_magazines'][3] = '<a href="http://www.christianitytoday.com/lawandtax/" target="_parent">Church Law &amp; Tax Report</a>';
	menu['global_magazines'][4] = '<a href="http://www.churchlawtoday.com/ctainfo.php" target="_parent">Church Finance Today</a>';
	menu['global_magazines'][5] = '<a href="http://www.kyria.com/digital/" target="_parent">Kyria Digital</a>';
	menu['global_magazines'][6] = '<a href="http://www.christianitytoday.com/le/" target="_parent">Leadership</a>';
	menu['global_magazines'][7] = '<a href="http://www.christianitytoday.com/moi/" target="_parent">Men of Integrity</a>';
	menu['global_magazines'][8] = '<a href="http://www.christianitytoday.com/momsense/" target="_parent">MomSense</a>';
	menu['global_magazines'][9] = '<a href="http://www.christianleadershipalliance.org/outcomes/" target="_parent">Outcomes</a>';
	menu['global_magazines'][10] = '<a href="http://www.christianitytoday.com/yc/" target="_parent">Your Church</a>';
	menu['global_magazines'][11] = '<a href="http://www.christianitytoday.com/free/features/magazines.html" target="_parent">Free Trial Offers</a>';
	menu['global_magazines'][12] = '<a href="http://www.christianitytoday.com/myaccount/?page=magazines" target="_parent">Customer Care</a>';
	menu['global_magazines'][13] = '<a href="http://www.ctiadvertising.com/" target="_parent">Advertise with Us</a>';
	
	// FREE menu
	menu['global_free'] = new Array();
	menu['global_free'][0] = '<a href="http://www.christianitytoday.com/free/features/magazines.html" target="_parent">Magazines</a>';
	menu['global_free'][1] = '<a href="http://store.yahoo.com/biblestudies/freesamples.html" target="_parent">Bible Studies</a>';
	menu['global_free'][2] = '<a href="http://www.christianitytoday.com/ecards/" target="_parent">E-cards</a>';
	menu['global_free'][3] = '<a href="http://buildingchurchleaders.com/store/freesamples.html" target="_parent">Leader Training</a>';
	menu['global_free'][4] = '<a href="http://www.christianitytoday.com/free/features/newsletters.html" target="_parent">Newsletters</a>';
	menu['global_free'][5] = '<a href="http://www.preachingtoday.com/illustrations/search.html?type=keyword&amp;filter=ptsource:free" target="_parent">Preaching Resources</a>';
	menu['global_free'][6] = '<a href="http://www.christianitytoday.com/help/features/rss.html" target="_parent">RSS Feeds</a>';

//GLOBAL MULTI NL SIGNUP TOOL FUNCTIONS

function get_checked_items() {
var c_value = "";
var c_text = "";
var s_email = "";
for (var i=0; i < document.subscribeform.list.length; i++)
   {
   if (document.subscribeform.list[i].checked)
      {
      c_value = c_value + document.subscribeform.list[i].value + " ";
      
	      switch(document.subscribeform.list[i].value) {
					case "booksandculture-html":
	      		c_text = c_text + "Books & Culture (weekly) \n";
	      		break;
					case "buildingsmallgroups-html":
	      		c_text = c_text + "Building Small Groups (monthly) \n";
	      		break;
					case "biblestudies-html":
	      		c_text = c_text + "Christian Bible Studies (weekly) \n";
	      		break;
					case "history-html":
	      		c_text = c_text + "Christian History & Biography Newsletter (weekly) \n";
	      		break;
					case "ctlibrary-html":
	      		c_text = c_text + "Christian News and Research Newsletter -- ChristianityTodayLibrary.com (semimonthly) \n";
	      		break;
					case "visionproject":
	      		c_text = c_text + "The Christian Vision Project (monthly) \n";
	      		break;
					case "housenews":
	      		c_text = c_text + "Christianity.ca's Virtual House News (weekly) \n";
	      		break;
					case "churchlaughs-html":
	      		c_text = c_text + "Church Laughs (weekly) \n";
	      		break;
					case "churchplaza-html":
	      		c_text = c_text + "Church Plaza Newsletter (monthly) \n";
	      		break;
					case "collegeguide":
	      		c_text = c_text + "College Guide (monthly) \n";
	      		break;
					case "conferences":
	      		c_text = c_text + "Conferences Update (monthly) \n";
	      		break;
					case "connection-html":
	      		c_text = c_text + "The Connection -- HTML (weekly) \n";
	      		break;
					case "connection":
	      		c_text = c_text + "The Connection -- Text-only (weekly) \n";
	      		break;
					case "ctdirect-html":
	      		c_text = c_text + "CTDirect (daily) \n";
	      		break;
					case "ctweekly-html":
	      		c_text = c_text + "CTWeekly \n";
	      		break;
					case "movies-html":
	      		c_text = c_text + "CT at the Movies (weekly) \n";
	      		break;
					case "dnaofrelationships-html":
	      		c_text = c_text + "Smalley Relationship Center Newsletter (weekly) \n";
	      		break;
					case "e-cards-html":
	      		c_text = c_text + "E-Cards (Holiday Reminder) \n";
	      		break;
					case "workplace-html":
	      		c_text = c_text + "Faith in the Workplace Newsletter (biweekly) \n";
	      		break;
					case "faithvisuals":
	      		c_text = c_text + "Faith Visuals Newsletter (monthly) \n";
	      		break;
					case "hottopics":
	      		c_text = c_text + "Hot Topics Newsletter (monthly) \n";
	      		break;
					case "campuslife-html":
	      		c_text = c_text + "Ignite Your Faith Connection (weekly) \n";
	      		break;
					case "ctcourses-html":
	      		c_text = c_text + "Interactive Training Courses \n";
	      		break;
	      		case "womenleaders":
	      		c_text = c_text + "Gifted for Leadership \n";
	      		break;	      		
					case "leadership-html":
	      		c_text = c_text + "Leadership Weekly \n";
	      		break;
					case "marriage-html":
	      		c_text = c_text + "Marriage Connection (biweekly) \n";
	      		break;
					case "men-html":
	      		c_text = c_text + "Men in the Word (weekly) \n";
	      		break;
					case "parenting-html":
	      		c_text = c_text + "MOMSense Newsletter (biweekly) \n";
	      		break;
					case "music-html":
	      		c_text = c_text + "Music Connection (weekly) \n";
	      		break;
					case "outreach-html":
	      		c_text = c_text + "Outreach & Evangelism Newsletter (biweekly) \n";
	      		break;
					case "ptaudio-html":
	      		c_text = c_text + "Preaching Today Audio (monthly) \n";
	      		break;
					case "ptsermons":
	      		c_text = c_text + "Preaching Today Sermons (weekly) \n";
	      		break;
					case "wiu-html":
	      		c_text = c_text + "Preaching Connection (weekly) \n";
	      		break;
					case "singles-html":
	      		c_text = c_text + "The Singles Channel Newsletter (weekly) \n";
	      		break;
					case "childrensministry-html":
	      		c_text = c_text + "Today's Children's Ministry (monthly) \n";
	      		break;
					case "tctoolbox-html":
	      		c_text = c_text + "Today's Christian Toolbox (bimonthly) \n";
	      		break;
					case "todayschristian-html":
	      		c_text = c_text + "Today's Christian Weekly \n";
	      		break;
					case "women-html":
	      		c_text = c_text + "Women's Connection (weekly) \n";
	      		break;
					case "yourchurch-html":
	      		c_text = c_text + "Your Church (biweekly) \n";
	      		break;
					case "churchsafety":
	      		c_text = c_text + "Church Safety Alert (monthly) \n";
	      		break;
	      		case "buildingchurchleaders":
	      		c_text = c_text + "Building Church Leaders (weekly) \n";
	      		break;
	      		case "leadershipbuzz":
	      		c_text = c_text + "Leadership Buzz (bimonthly) \n";
	      		break;
	      		case "reducingtheriskquicktip":
	      		c_text = c_text + "Reducing The Risk Quick Tip (weekly) \n";
	      		break;
	      }
      }
   }

   if (c_text != "") {
	   s_email = document.subscribeform.email.value;
	   document.subscribeform.checkedboxes.value = c_value;
	   c_text = "The email address " + s_email + " has been subscribed to the following Newsletters:\n" + c_text;
	   alert(c_text);
	   return true;
	} else {
		c_text = "Please select at least one Newsletter";
	  alert(c_text);
	  return false;
	}
}
	emailre = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

	function check_email(theForm){
		if (emailre.test(theForm.email.value)) {
			return true;
		}
			alert("Please enter a valid Email address");
			theForm.email.focus();
			theForm.email.select();
			return false;
	}