{include file="$gentemplates/$header_tpl"}{*debug*}

{if !$invite_off}
	{if !$provider}

		<h3 style='margin:0px; height:25px'>{$lang.invite_friends.header_text}</h3>
		<div id='frontEnd'>

			<form action='' method='POST' name='openinviter'>

				<div style='border:none;'>
					{*<dl class='thTableRow'><dd align='right'><label for='email_box'>{$lang.invite_friends.email}</label></dd><dt><input class='thTextbox' type='text' name='email_box' value='{$email_box}'></dt></dl>
					<dl class='thTableRow'><dd align='right'><label for='password_box'>{$lang.invite_friends.password}</label></dd><dt><input class='thTextbox' type='password' name='password_box' value='{$password_box}'></dt></dl>*}
					<dl class='thTableRow'><dd align='right'><label for='provider_box'>{$lang.invite_friends.email_provider}</label></dd><dt>
						<select class='thSelect' name='provider'>
						{foreach from=$providers key=k item=v}
						<option value="{$k}">{$v}</option>
						{/foreach}
						</select></dt></dl>
					<dl class='thTableImportantRow'><dd colspan='2' align='left'><input class='thButton' type='submit' name='import' value='{$lang.invite_friends.import_contacts}'></dd></dl>
			</form>
		</div>

	{else}
		<h3 style='margin:0px; height:25px'>{$lang.invite_friends.header_text}</h3>
		<div id='frontEnd'>
			<script type='text/javascript'>
			{literal}
			function toggleAll(element) 
			{
			var form = document.forms.openinviter, z = 0;
			for(z=0; z<form.length;z++)
				{
				if(form[z].type == 'checkbox')
					form[z].checked = element.checked;
				}
			}
			{/literal}
			</script>
			<form name="openinviter" method="POST" action="">
				<input type='hidden' name='step' value='send_invites'>
				<dl><dd>
					<div class='thTable'>
						<dl class='thTableRow'><dd align='left' valign='top'><label for='message_box'>{$lang.invite_friends.message}</label>&nbsp;&nbsp;&nbsp;</dd><dt><textarea rows='5' cols='50' name='message_box' class='thTextArea' style='width: 500px; height: 100px;'>{$message}</textarea></dt></dl>
						<dl class="thTableRow">
						<dd colspan="2" align="left">
						<!--<input type='submit' name='send' value='Send Invites' class='thButton' >-->
						</dd>
						</dl>
					</div></dd></dl>
					<dl><dd></dd></dl>
					<div class='thTable' align='left'><dl class='thTableHeader'><dd colspan="">{$lang.invite_friends.your_contacts}</dd></dl>
						<dl style='padding:5px 0;' class='thTableDesc'><dt class='float_left' style='width:30px;'><input type='checkbox' onChange='toggleAll(this)' name='toggle_all' title="{$lang.invite_friends.select_deselect_all}" checked></dt><dt class='float_left' style='width:200px;'>{$lang.invite_friends.name}</dt><dt class='float_left' style='width:200px;'>{$lang.invite_friends.e_mail}</dt></dl>

						{foreach from=$emails key=k item=v}
							<dl style='padding:5px 0;' class='thTableOddRow'><dt class='float_left' style='width:30px;'><input name='check_{$k}' value='{$k}' type='checkbox' class='thCheckbox' checked><input type='hidden' name='email_{$k}' value='{$v.email}'><input type='hidden' name='name_{$k}' value='{$v.name}'></dt><dt class='float_left' style='width:200px;'>{$v.name}</dt><dt class='float_left' style='width:200px;'>{$v.email}</dt></dl>
						{/foreach}

						<dl class='thTableRow'><dd align='left' colspan='2'><!--<input type='submit' name='send' value='".$lang["invite_friends"]["send_invites"]."' class='thButton' >--></dd></dl>
						<dl class='thTableFooter'><dd  style='padding:3px;'><input type='submit' name='send' value="{$lang.invite_friends.send_invites}" class='thButton'></dd></dl>
					</div>
			</form>
		</div>

	{/if}
{else}
	<font color="red">{$lang.invite_friends.invite_off}</font><br>
{/if}





{include file="$gentemplates/$footer_tpl"}