// Extranet JS

var siteID = "Extranet"

function EnableTextBox(checkboxId, textboxId)
{	
	var checkbox = document.getElementById(checkboxId);	
	var txtBox = document.getElementById(textboxId)	;
	if(txtBox == null) //this textbox may be hidden, specifically ESPs would not have this textbox displayed in the supplier optin page
		return;
	txtBox.disabled = !checkbox.checked;			
}

function EnableCheckBox(checkboxId, checkbox2Id)
{	
	var checkbox = document.getElementById(checkboxId);	
	var checkbox2 = document.getElementById(checkbox2Id);	
	if(checkbox2 == null) //this checkbox may be hidden, specifically ESPs would not have this checkbox displayed in the supplier optin page
		return;
	checkbox2.disabled = !checkbox.checked;		
	if(checkbox2.parentElement != null) // need to add this check as this element does not exist for fire fox
		checkbox2.parentElement.disabled = !checkbox.checked;		
	if(!checkbox.checked)
		checkbox2.checked = false;	
	
}

function ToggleSPFeeOptinControls(optinCheckBoxId, licenceeFeeOverridecheckboxId, frontdeskAdminFeeOverridecheckboxId, spFeeOverridecheckboxId, licenceeFeeOverrideTextBoxId, frontdeskAdminFeeTextBoxId, spFeeOverrideTextBoxId)
{	
	EnableCheckBox(optinCheckBoxId, licenceeFeeOverridecheckboxId);
	EnableCheckBox(optinCheckBoxId, frontdeskAdminFeeOverridecheckboxId);
	EnableCheckBox(optinCheckBoxId, spFeeOverridecheckboxId);
	EnableTextBox(spFeeOverridecheckboxId, spFeeOverrideTextBoxId);
	EnableTextBox(licenceeFeeOverridecheckboxId, licenceeFeeOverrideTextBoxId);
	EnableTextBox(frontdeskAdminFeeOverridecheckboxId, frontdeskAdminFeeTextBoxId);			
}





