Theming user-profile
You should be able to get the account of the current page via

$account = menu_get_object('user');


and then check

if ($account-&gt;uid == $user-&gt;uid) 


menu_get_object will grab the loaded object based on the url