function cBuyBrick( strRadioBrickChoice, strPanel_4x8, strPanel_12x12 )
{
	// Parameters
	this.m_strRadioBrickChoice = strRadioBrickChoice;
	this.m_rbl = null;
	this.m_strPanel_4x8 = strPanel_4x8;
	this.m_strPanel_12x12 = strPanel_12x12;
	this.m_ctrlPanel_4x8 = null;
	this.m_ctrlPanel_12x12 = null;
	
	// Function that runs when the page loads
	//
	this.onLoad = function()
	{
		//alert( 'In cBuyBrick onLoad function - this.m_strRadioBrickChoice:' + this.m_strRadioBrickChoice );
		// nothing really needs to happen here
		this.m_rbl = document.getElementById( this.m_strRadioBrickChoice );
		var ii = this.m_strRadioBrickChoice.length;

		this.m_ctrlPanel_4x8 = document.getElementById( this.m_strPanel_4x8 );
		this.m_ctrlPanel_12x12 = document.getElementById( this.m_strPanel_12x12 );
		this.radioClick();
	};
	
	// On radio click
	//
	this.radioClick = function()
	{
		var strDiv;
		var ctrlDivVisible = null;
		var ctrlDivHidden = null;
		var radios = this.m_rbl.getElementsByTagName( 'input' );
		
		for( ii = 0; ii < radios.length; ii++ )
		{
			if( radios[ii].type == 'radio' )
			{
				strDiv = radios[ii].value;
				if( radios[ii].checked )
				{
					if( strDiv == 'BrickDiv4x8' )
					{
						ctrlDivVisible = this.m_ctrlPanel_4x8;
						ctrlDivHidden = this.m_ctrlPanel_12x12;
						break;
					}
					else
					{
						if( strDiv == 'BrickDiv12x12' )
						{
							ctrlDivVisible = this.m_ctrlPanel_12x12;
							ctrlDivHidden = this.m_ctrlPanel_4x8;;
							break;
						}
					}
				}
			}
		}
		
		// Do we know which control is visible and which is not?
		if( ( ctrlDivVisible != null ) && ( ctrlDivHidden != null ) )
		{
			// Set the visibility to the appropriate value
			ctrlDivVisible.style.display = 'block';
			ctrlDivHidden.style.display = 'none';
		}
	};

	return this;
}

