<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3><?php echo $this->crumb['last']['name']; ?></h3>
			<ul class="content-box-tabs">
			</ul>
			<div class="clear"></div>
		</div>
		<div class="content-box-content">
			<div id="notification_box" class="notification success png_bg" style="display:none;"> <a class="close" href="javascript:;"></a>
				<div name="notification_content"></div>
			</div>
			<div class="tab-content default-tab" id="tab1">
				<form id="_save_form" action="admin/user_manage/invites_ajax/" method="post">
					<fieldset>
					<p style="width:250px;">
						<label>Email address: <span style="font-weight:normal;">(One Email address on each line)</span></label>
						<textarea name="email_list" cols="30" rows="20" id="email_list"></textarea>
					</p>
					<p>
						<input class="button" type="button" onClick="ajax_post($('#_save_form'), form_process);" value="Send invitation" />
					</p>
					</fieldset>
					<div class="clear"></div>
				</form>
			</div>
		</div>
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo GET_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="Close" /></a>
			<div id="notf_cont"></div>
		</div>
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

<script type="text/javascript">

function form_process(result)
{
	if(result.errno == "-1")
	{
		if ($('#notification_box').length > 0)
		{
			$.scrollTo(0, 800, {queue:true});
			
			$("#notification_box").removeClass("success").addClass("error").fadeIn().find('[name=notification_content]').html(result.err);
			
		}
	}
	else if(result.errno == "1")
	{
		if ($('#notification_box').length > 0)
		{
			$.scrollTo(0, 800, {queue:true});
			
			$("#notification_box").removeClass("error").addClass("success").fadeIn().find('[name=notification_content]').html(result.err);
			
			setTimeout(function () {
				$('#notification_box').fadeOut();
			}, 3000);
			
			$('#email_list').val('');
		}
	}
}
</script>

</body>
</html>