<?php

// -----------------------------------------------------------------------
// This file is part of AROUNDMe
//
// Copyright (C) 2003 - 2007 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------

?>

<style type="text/css">
<!--
@import url(<?php echo $template_path;?>css/aroundme_form.css);
-->
</style>

<script type="text/javascript" src="speller/spellChecker.js"></script>
<script type="text/javascript">
	function openSpellChecker() {
		var speller = new spellChecker();
		speller.spellCheckAll();
	}
</script>


<form method="post" action="index.php?amn=core_ann_edit" name="frm" id="id_frm">
<input type="hidden" name="announce_id" value="<?php echo isset($announce['announce_id']) ? $announce['announce_id'] : ''; ?>" />

<div class="col_main">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_announcement']; ?><br />
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					<label for="announce_title"><?php echo $lang['txt_title']; ?></label>
					<input class="input1" type="text" size="81" name="announce_title" id="id_announce_title" value="<?php echo isset($announce) ? $announce['announce_title'] : ''; ?>" />
				</p>
				<p>				
					<label for="announce_body"><?php echo $lang['txt_announcement']; ?></label><br />				
					<textarea class="input1" cols="78" rows="10" name="announce_body" id="id_announce_body" ><?php echo isset($announce) ? $announce['announce_body'] : ''; ?></textarea><br />
				</p>			
				<p align="right">
					<input type="submit" name="sub_preview" id="id_sub_preview" class="input_submit" value="<?php echo $lang['sub_preview']; ?>"/>
					<?php
					if (isset($allow_spellcheck)) {
					?>
					<input type="button" class="input_submit" value="<?php echo $lang['sub_check_spelling'];?>" onClick="openSpellChecker();" />
					<?php }?>
					<input type="submit" name="sub_insert" id="id_sub_insert" class="input_submit" value="<?php echo $lang['sub_send'];?>"/>
				</p>
				
				<?php
				if (isset($announce['display_announce_body'])) {
				?>
				<p>
					<b><?php echo $announce['announce_title']; ?></b><br />
				</p>
				<p>
					<?php echo $announce['display_announce_body']; ?>
				</p>
				<?php } ?>
			</div>
		</div>
	</div>
	
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>

<div class="col_side">
	<div class="box">
		<div class="box_top">
			email annoucnement<br />
		</div>

		<div class="box_mid">
			<div class="content">
				<p>
					Optionally you can send this announcement via email to anyone with the following role(s) who has their 'accept email annoucements' preference set.<br />
				</p>
				
				<p>
					<b><?php echo $lang['txt_email_to'];?></b>:<br />
					<?php 
					foreach($lang['role'] as $key => $i): 
					?>
					<input type="checkbox" value="<?php echo $key;?>" />&nbsp;<?php echo $i;?><br />
					<?php
					endforeach;
					?>
				</p>
			</div>
		</div>
	</div>
		
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>

</form>