$(document).ready
(
	function ()
	{
		// setup popup FAQ lists
		$('.popupFAQ').each
		(
			function (i, FAQlist)
			{
				// look for any non paragraphs
				$(FAQlist).children('*').each
				(
					function (j, element)
					{
						// hide all paragraphs and ul tags
						if ((element.tagName.toLowerCase() == 'p') || (element.tagName.toLowerCase() == 'ul'))
						{
							$(element).hide();
						}
						else if (element.nodeType == 1)
						{
							// add a behavior to this element to show any following paragraphs/uls
							$(element).bind('click', function(event)
							{
								var current = this.nextSibling;
								while (current != null)
								{
									if (current.nodeType == 1)
									{
										if
										(
											(current.tagName.toLowerCase() == 'p') ||
											(current.tagName.toLowerCase() == 'ul')
										)
										{
											// toggle the paragraphs show/hide
											$(current).toggle('fast');
											current = current.nextSibling;
										}
										else
										{
											current = null;
										}
									}
									else
									{
										current = current.nextSibling;
									}
								}
							});
						}
					}
				)
			}
		);
	}
);