<u><a href="/invite/<?php print arg(1); ?>"  >Invite more people </a></u>
<br /><br />
<?php
global $user;
if (user_is_anonymous()) return false;

if (isset($_GET['q'])) {
  $a = explode('/', $_GET['q']);
  $node = node_load($a[1]);
  if ($node->type != 'team') {
    return false;
  }
}
?>
<div class="team-invitations"></div>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery.ajax({
    type: 'POST',
    url: Drupal.settings.basePath + 'invitations/teams',
    enctype: 'application/x-www-form-urlencoded',
    data: {
      ajax: true,
      team_id: '<?php print $node->nid; ?>'
    },
    success: function(r) {
      var response = jQuery.parseJSON(r);
      if (response.status != undefined && response.status == 'ok') {
	jQuery('.team-invitations').html(response.data);
      }
    }
  });  
});
</script>