var debugMatchAcrossUnitFlag = false;

/*
Method checks to see if the unit is enabled
*/
function matchAcrossUnitSibling_isRadioUnitEnabled()
{
    var radioButton = document.getElementById(this.rdoYesNoID);
    var result=false;
    
    if(debugMatchAcrossUnitFlag)
    {
        alert("Method: matchAcrossUnitSibling_isRadioUnitEnabled");
    }
        
    //Check to see if the object exists
    if(radioButton !=null)
    {
        if(debugMatchAcrossUnitFlag)
        {
            alert("Found Radio button: " + this.rdoYesNoID);
        }
        
        //Set the result to the checked indicator
        if(radioButton.checked == true)
        {
            result = true;        
            
            if(debugMatchAcrossUnitFlag)
            {
                alert("Radio button is checked");
            }        
        }
        else
        {            
            if(debugMatchAcrossUnitFlag)
            {
                alert("Radio button is NOT checked");
            }        
        }
    }
    else
    {
        if(debugMatchAcrossUnitFlag)
        {
            alert("Radio button: " + this.rdoYesNoID + " NOT Found");
        }
        
    }

    return result;
}

//Constructor
//function matchAcrossUnitSibling(rdoYesNoIDItem, ddlSiblingIDItem, vehicleIndexItem, relatedValidatorID)
function matchAcrossUnitSibling(rdoYesNoIDItem, ddlSiblingIDItem, vehicleIndexItem, enableValidatorFunctionPointer, disableValidatorFunctionPointer)
{
    //alert("Constructor - targetKeyItem: " + targetKeyItem);
    //alert("Constructor - this.targetKey: " + this.targetKey
    if(debugMatchAcrossUnitFlag)
    {
        alert("matchAcrossUnitSibling Constructor - this.targetKey: " + this.targetKey);
    }
    
    this.rdoYesNoID = rdoYesNoIDItem;  //Radio Button that dictates if the object is enabled
    //this.yesValue = yesValueItem;  //Radio Button Value that dictates if the object is enabled
    this.ddlSiblingID = ddlSiblingIDItem;  //Radio Button Value that dictates if the object is enabled
    this.vehicleIndex = vehicleIndexItem;  //Radio Button Value that dictates if the object is enabled
    
    //Assign methods and functions to pointers.
    this.isRadioUnitEnabled = matchAcrossUnitSibling_isRadioUnitEnabled;
        
    //this.validatorID = relatedValidatorID;
    if(debugMatchAcrossUnitFlag)
    {
        alert(enableValidatorFunctionPointer);
    }
    this.enableValidator = enableValidatorFunctionPointer;
    this.disableValidator = disableValidatorFunctionPointer;
}

