The follow function will return true if the current wordpress page is a sub page of a specific page.
function is_tree($pid) {
global $post;
if(is_page()&&($post->post_parent==$pid||is_page($pid)||in_array($pid, $post->ancestors)))
return true;
else
return false;
};