var highlightDone = false;

jQuery(document).ready
(
	function()
	{
		jQuery(".form-allowed-tags").each
		(
			function()
			{
				jQuery(this).html("<div><b>For source code, please wrap in:</b></div>");
				jQuery(this).append("<div><code>&lt;pre class=\"brush:X\"&gt;&lt;/pre&gt;</code></div>");
				jQuery(this).append("<div>Where \"X\" is a <a href=\"http://www.megatome.com/syntaxhighlighter/\">supported syntax name found at this link</a>.");
			}
		);
		
		jQuery("#comment").each
		(
			function()
			{
				jQuery(this).keypress
				(
					function()
					{
						if(highlightDone == false)
						{
							jQuery(".form-allowed-tags").effect("highlight", {}, 2000);
							highlightDone = true;
						}
					}
				);
			}
		);
		
		jQuery(".section-toggle a").each
		(
			function()
			{
				jQuery(this).attr("href", "javascript:void(0);");
				jQuery(this).click(toggleSection);
				jQuery(this).prepend('<span>&#9656;</span>');
			}
		);
	}
);

function toggleSection()
{
	var section = jQuery(this).parent().next();
	if(section.css("display") == "none")
	{
		jQuery("span", this).html("&#9662;");
		jQuery(section).slideDown(500);
	}
	else
	{
		jQuery("span", this).html("&#9656;");
		jQuery(section).slideUp(500);
	}
}

