<!--
function CheckboxCheck(CheckboxID)
{
	if (document.getElementById(CheckboxID).disabled) return;
	Chk = document.getElementById(CheckboxID);				
	if (Chk.checked) Chk.checked = false;
	else Chk.checked = true;

	CheckboxValidate(CheckboxID);
}

function NumSelectedCheckbox( parClass, parClassOther, parMore)
{
	intCnt=0;		
	for (var i = 0; i < allChecked.length; i++) {												
		if (allChecked[i].className==parClass||allChecked[i].className==parClassOther)
		{
			if (allChecked[i].checked && (allChecked[i].id!=parMore))
			{ 			
				//Business Rule1.4
				//If user selects "My logo is not here" from FRONT of card section, 
				//user may select one or more logos from the BACK of card section
				if (allChecked[i].value!='none')
				{
					intCnt=intCnt+1;
				}
			}					
		} 
	} 
	return intCnt;	
}

function CheckboxPairing(parID, parChecked, parSide)
{	
	//Front of CARD Pairing logic when the checkbox has been checked
	//Blank out the IDs it leave alone
	if (parChecked)
	{
		// Set the default values of the forced unselection of a check box 
		// to be True, but the current checkbox to False (this will keep the 
		// original value in the current checkbox)		
		
		if (parSide=='Front' || parSide=='FrontOther')
		{
			b84451=(parID!='F84451');
			//b84450=(parID!='F84450');
			b84127=(parID!='F84127');
			b84454=(parID!='F84454');
			b84453=(parID!='F84453');
			//b84144=(parID!='F84144');			
			//b84111=(parID!='F84111');
			//b84452=(parID!='F84452');
			b84461=(parID!='F84461');
			b84464=(parID!='F84464');
			b84459=(parID!='F84459');
			b84367=(parID!='F84367');
			b84463=(parID!='F84463');
			b84464=(parID!='F84464');
			b84470=(parID!='F84470');
			b84471=(parID!='F84471');
			b84472=(parID!='F84472');
			b84478=(parID!='F84478');
			b84477=(parID!='F84477');

			// The following products can only be paired with 84451 
			// (New PHCS Logo), 84454 (Healthy Directions) and 84459
			// (PHCS Blank/Healthy Directions)
			if (parID=='F84451' || parID=='F84454' || parID=='F84459')
			{
				b84451=false;
				b84454=false;					
				b84459=false;
			}

			// The following products can only be paired with 84454 
			// (Healthy Directions) and 84459 (PHCS Blank/Healthy Directions)
			if (parID=='F84454' || parID=='F84459')
			{
				b84454=false;					
				b84459=false;
			}

			// The following products can only be paired with 84454 
			// (Healthy Directions) and 84450 (PHCS MD Plan)
			if (parID=='F84454' || parID=='F84450')
			{
				b84454=false;					
				//b84450=false;
			}
		
			// The following products can only be paired with 84454 
			// (Healthy Directions) and 84452 (American Lifecare)
			if (parID=='F84454' || parID=='F84452')
			{
				b84454=false;					
				b84452=false;
			}

			// The following products can only be paired with 84454 
			// (Healthy Directions) and 84452 (American Lifecare)
			if (parID=='F84454' || parID=='F84455')
			{
				b84454=false;					
				b84455=false;
			}
						
			// The following products can only be paired with 84454 
			// (Healthy Directions) and 84461 (PHCS Hospital Only)
			if (parID=='F84454' || parID=='F84461')
			{
				b84454=false;					
				b84461=false;
			}
								
			// The following products can be paired with 84453 (New MultiPlan 
			// Logo) and 84144 (The older MultiPlan Logo)
			if (parID=='F84453'|| parID=='F84144')
			{			
				b84453=false;
				b84144=false;			
			}

			// The following products can be paired with 84127 (MPI PPO), 
			// 84095 (HealthNetwork) or 84111 (HMC PPO)
			//if (parID=='F84127' || parID=='F84095' || parID=='F84111')
			//{			
			//	b84127=false;
			//	b84095=false;			
			//	b84111=false;
			//}
			
			// Deselect all Front Checkboxes where the checkbox forced
			// unselect boolean is set to true		
			if (b84451) {document.getElementById('F84451').checked=false;}
			//if (b84450) {document.getElementById('F84450').checked=false;}
			if (b84127) {document.getElementById('F84127').checked=false;}
			if (b84454) {document.getElementById('F84454').checked=false;}
			if (b84453) {document.getElementById('F84453').checked=false;}
			//if (b84144) {document.getElementById('F84144').checked=false;}
			//if (b84111) {document.getElementById('F84111').checked=false;}
			//if (b84452) {document.getElementById('F84452').checked=false;}
			if (b84461) {document.getElementById('F84461').checked=false;}
			if (b84464) {document.getElementById('F84464').checked=false;}
			if (b84459) {document.getElementById('F84459').checked=false;}
			if (b84367) {document.getElementById('F84367').checked=false;}
			if (b84463) {document.getElementById('F84463').checked=false;}
			if (b84470) {document.getElementById('F84470').checked=false;}
			if (b84471) {document.getElementById('F84471').checked=false;}
			if (b84472) {document.getElementById('F84472').checked=false;}
			if (b84478) {document.getElementById('F84478').checked=false;}
			if (b84477) {document.getElementById('F84477').checked=false;}
		}
				
		if (parSide=='Back'|| parSide=='BackOther')
		{
			b84460=(parID!='B84460');
			b84454=(parID!='B84454');			
			b84453=(parID!='B84453');
			//b84144=(parID!='B84144');
			b84143_2=(parID!='B84143_2');
			//b84450=(parID!='B84450');
			b84459=(parID!='B84459');
			b84367=(parID!='B84367');
			//b84466=(parID!='B84466');
			//b84467=(parID!='B84467');		

			// The following products can only be paired with 84453 
			// (New MultiPlan Logo), 84144 (The older MultiPlan Logo)
			if (parID=='B84453')			
			{			
				b84453=false;
				//b84144=false;				
			}
					
			// The following products can only be paired with 84460 
			// (New PHCS Logo) and 84454 (Healthy Directions) 
			if (parID=='B84460' || parID=='B84454')
			{
				b84460=false;
				b84454=false;
			}
			
			// The following products can only be paired with 84454 
			// (Healthy Directions) and 84459 (PHCS Blank/Healthy Directions)
			if (parID=='B84454' || parID=='B84459')
			{
				b84454=false;
				b84459=false;
			}
			
			// The following products can only be paired with 84454 
			// (Healthy Directions) and 84450 (PHCS MD Plan)
			if (parID=='B84454')
			{
				b84454=false;
				//b84450=false;
			}							
					
			// Deselect all Back Checkboxes where the checkbox forced
			// unselect boolean is set to true							
			if (b84460) {document.getElementById('B84460').checked=false;}
			if (b84454) {document.getElementById('B84454').checked=false;}
			if (b84453) {document.getElementById('B84453').checked=false;}					
			//if (b84144) {document.getElementById('B84144').checked=false;}
			if (b84143_2) {document.getElementById('B84143_2').checked=false;}			
			//if (b84450) {document.getElementById('B84450').checked=false;}
			if (b84459) {document.getElementById('B84459').checked=false;}
			if (b84367) {document.getElementById('B84367').checked=false;}
			//if (b84466) {document.getElementById('B84466').checked=false;}
			//if (b84467) {document.getElementById('B84467').checked=false;}		
		}
	}
}

function CheckboxValidate(CheckboxID)
{	
	Chk = document.getElementById(CheckboxID);
	
	//Business Rule 1.7
	//User may select only one PHCS PPO logo variant, one MultiPlan PPO logo variant, 
	//and one MultiPlan complementary network logo variant on the FRONT and/or back 
	//of card. For a list of logo variants.	
	if (Chk.checked) CheckboxPairing(Chk.id, Chk.checked, Chk.className);	
	
	allChecked = document.getElementsByTagName('input');
		
	//Business Rule 1.2
	//If user selects one or more logos from the FRONT of card section, 
	//disable the BACK of card section by un-enabling the check boxes. 
	//This is a temporary restriction until we are able to provide 
	//secondary network search results that are additive to the 
	//primary network search results.	
	intFront=NumSelectedCheckbox( 'Front', 'FrontOther', 'Fmore');	
	for (var i = 0; i < allChecked.length; i++) {												
		if (allChecked[i].className=='Back'||allChecked[i].className=='BackOther')
		{		
			allChecked[i].disabled = (intFront > 0);		
		}
	}
	
	//Business Rule 1.3
	//If user selects one or more logos from the BACK of card section, 
	//disable the FRONT of card section by un-enabling the check boxes.
	//This is a temporary restriction until we are able to provide 
	//secondary network search results that are additive to the 
	//primary network search results.
	intBack=NumSelectedCheckbox( 'Back', 'BackOther', 'Bmore');
	for (var i = 0; i < allChecked.length; i++) {												
		if (allChecked[i].className=='Front'||allChecked[i].className=='FrontOther')
		{
			allChecked[i].disabled = (intBack > 0);			
		}
	}
		
	//Business Rule 1.5
	//If user selects no logos from the FRONT of card section, user may 
	//select one or more logos from the BACK of card section. 
	//------Business Rule Applies as long as intFront = 0
	
}

function ToggleOther(CheckboxID)
{	

	// Business Rule 1.1.
	// Can't find your logo(s)? section on FRONT and BACK of card is collapsed 
	// in the default state for each box, until the user clicks the 
	// "Click here to see more logos" link or arrow in that box. 
	
	SetValue='none';			
	if (CheckboxID=='ALL' || CheckboxID=='Fmore')
	{
		if (FOther1.style.display=='none')
		{
		SetValue='';
		}	
		FOther1.style.display=SetValue;	
		FOther2.style.display=SetValue;		
		FOther3.style.display=SetValue;							
		FOther4.style.display=SetValue;	
		FOther5.style.display=SetValue;	
	}	
	
	if (CheckboxID=='ALL' || CheckboxID=='Bmore')
	{
		if (BOther1.style.display=='none')
		{
		SetValue='';
		}	
		BOther1.style.display=SetValue;	
		BOther2.style.display=SetValue;		
		BOther3.style.display=SetValue;							
		BOther4.style.display=SetValue;	
	}	
}
-->
