$(document).ready(function()
{	
	// IMM 090710: Handle toggling open/closed selectable component block
	$("dd.ph").click( function()
	{
		if ($('dl dd.pi img',this).attr("src") == "images/AdvantecR2_2/plus.png")
		{
			var id = $(this).attr("id").substr(3,$(this).attr("id").length-3);
			$('dl dd.pi img',this).attr("src","images/AdvantecR2_2/minus.png");
			$("#ko_"+id).removeClass("hidden");
			$("#cc_"+id).addClass("hidden");
		}
		else
		{
			var id = $(this).attr("id").substr(3,$(this).attr("id").length-3);
			$('dl dd.pi img',this).attr("src","images/AdvantecR2_2/plus.png");
			$("#cc_"+id).removeClass("hidden");
			$("#ko_"+id).addClass("hidden");
		}

	});

	// IMM 090910: Method to handle updating of static component label on component change
	$('input[type="radio"]').click( function()
	{
		$(this).parent().parent().parent().prev('dl.cs').find('dd.sl').html( $(this).attr("value").split('|')[4] );
	});

	// IMM 090910: Assign handler to open all configuration options
	$('.LnkOpnAll').click( function()
	{
		$("dd.ph").each( function()
		{
			if ($('dl dd.pi img',this).attr("src") == "images/AdvantecR2_2/plus.png")
			{
				var id = $(this).attr("id").substr(3,$(this).attr("id").length-3);
				$('dl dd.pi img',this).attr("src","images/AdvantecR2_2/minus.png");
				$("#ko_"+id).removeClass("hidden");
				$("#cc_"+id).addClass("hidden");
			}			
		});
	});

	// IMM 090910: Assign handler to close all configuration options
	$('.LnkClsAll').click( function()
	{
		$("dd.ph").each( function()
		{
			if ($('dl dd.pi img',this).attr("src") == "images/AdvantecR2_2/minus.png")
			{
				var id = $(this).attr("id").substr(3,$(this).attr("id").length-3);
				$('dl dd.pi img',this).attr("src","images/AdvantecR2_2/plus.png");
				$("#cc_"+id).removeClass("hidden");
				$("#ko_"+id).addClass("hidden");
			}			
		});
	});
});

