<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>

  <script runat="server">
  bool admin = false;
  
  void Page_Load(object sender, System.EventArgs ea) {
    try{    
       if (umbraco.cms.businesslogic.member.Member.GetCurrentMember() != null)
      {
        admin = umbraco.cms.businesslogic.member.Member.GetCurrentMember().Groups.ContainsKey(4686);
      }
    }
    catch{}  

  }
</script>

<asp:Content ContentPlaceHolderId="Head" runat="server">

<% if (admin) { %>
<script type="text/javascript">
$(document).ready(function() {
  $("#announceEvent").click(function () { 

    $("#eventselector").modal();
    
  });
  $("#cancelAnnounceEvent").click(function () { 
    $.modal.close();
  });
});
</script>
<% } %>
</asp:Content>



<asp:content ContentPlaceHolderId="Main" runat="server">



  <div id="body" class="subpage wrapper">
  
  <div style="margin-top: 25px;">
      <umbraco:Macro Alias="Breadcrumb" runat="server"></umbraco:Macro>
  </div>
    
    
  <h1><umbraco:Item field="pageName" runat="server"></umbraco:Item></h1>
  
  <div class="options">
      <% if (admin) { %>
        <a id="announceEvent" class="act add">Announce an event</a>
      <% } %>
  </div>
  
  

  <umbraco:Item field="bodyText" runat="server"></umbraco:Item>
  
  <div class="divider"></div>
  
  <umbraco:Macro ResultsXslt="" MultipleResultsCaption="" Alias="Member-Locator" runat="server" UnitInKm="1" SendMails="1"></umbraco:Macro>
  
        
        
        </div>
  
  <% if (admin) { %>
  <div id="eventselector" style="display:none">
  <h3>Please select the event</h3>
  <umbraco:Macro Alias="Events-UpcomingList" runat="server"></umbraco:Macro>
  <p>
      <small><a href="#" style="text-decoration:underline" id="cancelAnnounceEvent">Cancel</a></small>
  </p>
  </div>
  <% } %>
    
</asp:content>