test abitrary url against current page
Excluding edge cases (querystring, hash tags, etc), this seems to work for all my test cases:

/**
 * Determine whether a given url matches the current page.
 * 
 * @param string $test_path     A file path (no domain, no querystring, etc)
 * @return boolean 
 */
function _nwr1_is_current_url($test_path){
    $test_path = trim($test_path, '/');
    $test_norm_path = drupal_lookup_path('source', $test_path);
    $this_nid = (arg(0) == 'node' &amp;&amp; is_numeric(arg(1))) ? arg(1) : FALSE;
    $this_norm_path = ($this_nid) ? "node/$this_nid" : FALSE;
    $success = FALSE;   

    // test by source (eg node/XXXX - preferred)
    if($test_norm_path &amp;&amp; $this_norm_path &amp;&amp; ($test_norm_path==$this_norm_path) ){
        $success = TRUE;

    // test by path 
    }else if($test_path &amp;&amp; current_path() &amp;&amp; ($test_path==current_path()) ){
        $success = TRUE;
    }
    return $success;
}