
$(document).ready(
    function() 
    {
        $("a.more").each(
            function(i)
            {
                $(this).bind(
                    'click', 
                    {index:i}, 
                    function(e)
                    {
                        if($(this).html() == "+ MORE")
                        {
                            $(this).html("- LESS");
                        }
                        else
                        {
                            $(this).html("+ MORE");
                        }
                    }
                );
            }
        );
        /* 
        normal is for usage that won't have a line break, 
        b is when there is a potential line break (disables icon in IE)
        c is when you want the pop-up functionality, but don't want an icon
        */
        $('.external, .pdf, .externalb, .externalc, .pdfb, .pdfc, .blank, .video, .videob, .videoc').bind(
            'click', 
            function() 
            {
                window.open(this.href);
                return false;
            }
        );
    }
);

function toggleAll()
{
	if($("a.more_global").html() == "+ EXPAND ALL")
	{
		$("div.more2").each(
			function()
			{
				$(this).slideDown(500);
			}
		);
		$("div.more").each(
			function()
			{
				$(this).slideDown(500);
			}
		);
		$("a.more").each(
			function()
			{
				$(this).html("+ LESS");
			}
		);
		$("a.more_global").html("- COLLAPSE ALL");
	}
	else
	{
		$("div.more2").each(
			function()
			{
				$(this).slideUp(500);
			}
		);
		$("div.more").each(
			function()
			{
				$(this).slideUp(500);
			}
		);
		$("a.more").each(
			function()
			{
				$(this).html("+ MORE");
			}
		);
		$("a.more_global").html("+ EXPAND ALL");
	}
}

function toggle(target)
{
	var target_obj = document.getElementById(target);
	var status = target_obj.style.display;
	$(target_obj).slideToggle(500);
}

