﻿function AtLeastOneContactNo_ClientValidate(source, args)
{
    var txtAreaCode = $("*[id$='txtAreaCode']")[0];
    var txtTelNumber = $("*[id$='txtTelNumber']")[0];
    var txtWorkArea = $("*[id$='txtWorkArea']")[0];
    var txtWorkTel = $("*[id$='txtWorkTel']")[0];
    var txtCell = $("*[id$='txtCell']")[0];
        
    if ((txtCell != null && txtCell.value != "") 
          || (txtAreaCode != null && txtTelNumber != null && txtAreaCode.value != "" && txtTelNumber.value != "")
          || (txtAreaCode == null && txtTelNumber != null && txtTelNumber.value != "")
          || (txtWorkArea != null && txtWorkTel != null && txtWorkArea.value != "" && txtWorkTel.value != "")
          || (txtWorkArea == null && txtWorkTel != null && txtWorkTel.value != ""))
        args.IsValid = true;
    else
        args.IsValid = false;            
}

function IBOAtLeastOneContactNo_ClientValidate(source, args)
{

    var txtAreaCode = $("*[id$='txtIBOAreaCode']")[0];
    var txtTelNumber = $("*[id$='txtIBOContactNum']")[0];
    var txtCell = $("*[id$='txtIBOCellNo']")[0];
        
    if ((txtCell != null && txtCell.value != "") 
          || (txtAreaCode != null && txtTelNumber != null && txtAreaCode.value != "" && txtTelNumber.value != "")
          || (txtAreaCode == null && txtTelNumber != null && txtTelNumber.value != ""))
        args.IsValid = true;
    else
        args.IsValid = false;     
}
