﻿function GetRealID(strID, blnNoSharp) {
    var strRealID = '';

    if (document.getElementById) {
        var Element = document.getElementById(strID);

        if (Element != null) {
            strRealID = Element.id;
        }
        else {
            // Cannot get element the normal way. Use jQuery & regular expressions 
            // See http://docs.jquery.com/Selectors
            // And http://docs.jquery.com/Selectors/attributeEndsWith#attributevalue
            strRealID = $('[id$=' + strID + ']').attr('id');
        }
    }
    else {
        // No getElementById support
    }

    if ( blnNoSharp ) {
        return strRealID;
    }
    else {
        return '#' + strRealID;
    }
}

function GetRealName(strID) {
    var strRealName = '';
    
    if ( document.getElementById ) {
        var Element = document.getElementById(strID);
        if ( Element != null ) {
            strRealName = Element.id;
        }
        else {
            // Cannot get element the normal way. Use jQuery & regular expressions 
            // See http://docs.jquery.com/Selectors
            // And http://docs.jquery.com/Selectors/attributeEndsWith#attributevalue
            
            
            strRealName = $('[name$=' + strID + ']').attr('name');
            
            // javascript:alert($('input[name=\'grpVraag10\']').length);
            // RealID for grpVraag10 = ctl00_Body_rbMeerkeuze14
            // alert('RealName for ' + strID + ' = ' + strRealName);
        }
    }
    else {
        // No getElementById support
    }

    return strRealName;
}
