<?php
/**
* @version 1.0.0
* @package RSEvents! 1.0.0
* @copyright (C) 2009 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined('_JEXEC') or die('Restricted access');
jimport('joomla.html.pane');
$tabs= & JPane::getInstance('Tabs',array(),true);
JHTML::_('behavior.modal');
JHTML::_('behavior.mootools');
JHTML::_('behavior.tooltip');
$db = JFactory::getDBO();
?>
<script type="text/javascript">
function newFile()
{
	document.getElementById('files').innerHTML += '<br/><input type="file" name="files[]" size="40"/>';
}

function submitbutton(task)
{
	var form = document.adminForm;
	
	if(task == 'previewevent')
	{
		window.open('<?php echo JURI::root(); ?>index.php?option=com_rsevents&view=events&layout=show&cid=<?php echo $this->data->IdEvent; ?>');
		return false;
	}
	
	if(task == 'cancel')
	{
		submitform(task);
	}
	else  
	{
		ret = true;
		if(form.EventName.value=='') { form.EventName.className = 'rserror'; ret=false; } else { form.EventName.className = '';  }	
		if(form.IdCategory.value=='0') { form.IdCategory.className = 'rserror'; ret=false; } else { form.IdCategory.className = '';   }	
		if(form.IdDesign.value=='0') { form.IdDesign.className = 'rserror'; ret=false; } else { form.IdDesign.className = '';	 }
		if(form.IdLocation.value=='0') { form.IdLocation.className = 'rserror'; ret=false; } else { form.IdLocation.className = '';  }	
		if(form.EventHost.value=='') { form.EventHost.className = 'rserror'; ret=false; } else { form.EventHost.className = ''; }
		if(form.IdUser.value=='') { form.IdUser.className = 'rserror'; ret=false; } else { form.IdUser.className = '';	 }
		if(form.EventStartDate.value=='') { form.EventStartDate.className = 'rserror'; ret=false; } else { form.EventStartDate.className = '';  }	
		if(form.EventStartDateH.value=='') { form.EventStartDateH.className = 'rserror'; ret=false; } else { form.EventStartDateH.className = ''; }	
		if(form.EventStartDateM.value=='') { form.EventStartDateM.className = 'rserror'; ret=false; } else { form.EventStartDateM.className = '';  }	
		if(form.EventEndDate.value=='') { form.EventEndDate.className = 'rserror'; ret=false; } else { form.EventEndDate.className = '';	 }
		if(form.EventEndDateH.value=='') { form.EventEndDateH.className = 'rserror'; ret=false; } else { form.EventEndDateH.className = '';  }	
		if(form.EventEndDateM.value=='') { form.EventEndDateM.className = 'rserror'; ret=false; } else { form.EventEndDateM.className = '';  }
		<?php if($this->rseventsConfig['enable.12format'] == 1) { ?>
			if(form.EventStartDateH.value > 12 || form.EventStartDateH.value < 1) { form.EventStartDateH.className = 'rserror'; ret=false; } else { form.EventStartDateH.className = ''; }	
			if(form.EventStartDateM.value > 59 || form.EventStartDateM.value < 0) { form.EventStartDateM.className = 'rserror'; ret=false; } else { form.EventStartDateM.className = '';  }
			if(form.EventEndDateH.value > 12 || form.EventEndDateH.value < 1) { form.EventEndDateH.className = 'rserror'; ret=false; } else { form.EventEndDateH.className = '';  }	
			if(form.EventEndDateM.value > 59 || form.EventEndDateM.value < 0) { form.EventEndDateM.className = 'rserror'; ret=false; } else { form.EventEndDateM.className = '';  }
		<?php } else { ?>
			if(form.EventStartDateH.value > 23 || form.EventStartDateH.value < 0) { form.EventStartDateH.className = 'rserror'; ret=false; } else { form.EventStartDateH.className = ''; }	
			if(form.EventStartDateM.value > 59 || form.EventStartDateM.value < 0) { form.EventStartDateM.className = 'rserror'; ret=false; } else { form.EventStartDateM.className = '';  }
			if(form.EventEndDateH.value > 23 || form.EventEndDateH.value < 0) { form.EventEndDateH.className = 'rserror'; ret=false; } else { form.EventEndDateH.className = '';  }	
			if(form.EventEndDateM.value > 59 || form.EventEndDateM.value < 0) { form.EventEndDateM.className = 'rserror'; ret=false; } else { form.EventEndDateM.className = '';  }
		<?php } ?>
		if(ret) submitform(task);
	}
	return false;
	 
}

</script>
<style>
.rserror 
{
	border:1px solid red;
}
</style>
<form action="index.php" method="post" enctype="multipart/form-data" name="adminForm" id="adminForm">
<?php echo $tabs->startPane('content-pane'); ?>
<?php echo $tabs->startPanel(JText::_('RSE_EVENT_TAB_INFO'),"event-info"); ?>
	<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
					<tr>
						<td>
							<label for="published">
								<?php echo JText::_( 'RSE_PUBLISHED' ).':'; ?>
							</label>
						</td>
						<td>						
							<?php echo JHTML::_('select.booleanlist','published','class="inputbox"',$this->data->published); ?>
						</td>
					</tr>
					<tr>
						<td>
							<label for="eventname">
								<?php echo JText::_( 'RSE_EVENT_NAME_DEFAULT' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="EventName" value="<?php echo $this->data->EventName; ?>" size="50" /> (*)
						</td>
					</tr>
					<tr>
						<td>
							<label for="alias">
								<?php echo JText::_( 'RSE_EVENT_ALIAS' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="EventAlias" value="<?php echo $this->data->EventAlias; ?>" size="50" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="eventsubtitle">
								<?php echo JText::_( 'RSE_EVENT_SUBTITLE' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="EventSubtitle" value="<?php echo $this->data->EventSubtitle; ?>" size="50" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="hosted">
								<?php echo JText::_( 'RSE_EVENT_HOSTER' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="EventHost" value="<?php echo $this->data->EventHost; ?>" size="50" /> (*)
						</td>
						<td>						
							
						</td>
					</tr>
					<tr>
						<td>
							<label for="category">
								<?php echo JText::_( 'RSE_EVENT_CATEGORY' ).':'; ?>
							</label>
						</td>
						<td>						
							<?php echo $this->lists['categories']; ?> (*)
						</td>
					</tr>
					<tr>
						<td>
							<label for="design">
								<?php echo JText::_( 'RSE_EVENT_DESIGN' ).':'; ?>
							</label>
						</td>
						<td>						
							<?php echo $this->lists2['designs']; ?> (*)
						</td>
					</tr>
					<tr>
						<td>
							<label for="location">
								<?php echo JText::_( 'RSE_EVENT_LOCATION' ).':'; ?> <img id="rse_hideme" style="display:none;" src="<?php echo JURI::root().'components/com_rsevents/images/loader.gif' ?>">
							</label>
						</td>
						<td>						
							<input type="text" name="lfilter" id="lfilter" value="" size="15" onkeyup="rse_search_locations(this.value);" onkeydown="rse_stop_search_locations();"/> 
							<span id="rse_locations"><?php echo $this->lists1['locations']; ?></span> (*)
						</td>
					</tr>
					<tr>
						<td>
							<label for="owner">
								<?php echo JText::_( 'RSE_EVENT_OWNER' ).':'; ?>
							</label>
						</td>
						<td>						
							<?php echo $this->lists3['username']; ?> (*)
						</td>
					</tr>
					<tr>
						<td>
							<label for="StartDate">
								<?php echo JText::_( 'RSE_EVENT_START_DATE' ).':'; ?>
							</label>
						</td>
						<td>						
							<?php echo JHTML::_('calendar', date('Y-m-d',$this->data->EventStartDate), "EventStartDate", "EventStartDate"); ?> (*)
						</td>
					</tr>
					<tr>
						<td>
							<label for="StartTime">
								<?php echo JText::_( 'RSE_EVENT_START_TIME' ).':'; ?>
							</label>
						</td>
						<td align="center">						
							<input name="EventStartDateH" value="<?php echo $this->data->EventStartDateH; ?>" size="3" maxlength="2" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" /> : <input name="EventStartDateM" value="<?php echo $this->data->EventStartDateM; ?>" size="3" maxlength="2" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" />
							<?php if($this->rseventsConfig['enable.12format'] == 1) echo JHTML::_('select.booleanlist','EventAmPm1','class="inputbox"',$this->data->EventAmPm1,'pm','am'); ?>
						</td>
					</tr>
					<tr>
						<td>
							<label for="EndDate">
								<?php echo JText::_( 'RSE_EVENT_END_DATE' ).':'; ?>
							</label>
						</td>
						<td>						
							<?php echo JHTML::_('calendar', date('Y-m-d',$this->data->EventEndDate), "EventEndDate", "EventEndDate"); ?> (*)
						</td>
					</tr>
					<tr>
						<td>
							<label for="EndTime">
								<?php echo JText::_( 'RSE_EVENT_END_TIME' ).':'; ?>
							</label>
						</td>
						<td align="center">						
							<input name="EventEndDateH" value="<?php echo $this->data->EventEndDateH; ?>" size="3" maxlength="2" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" /> : <input name="EventEndDateM" value="<?php echo $this->data->EventEndDateM; ?>" size="3" maxlength="2" onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');" />
							<?php if($this->rseventsConfig['enable.12format'] == 1) echo JHTML::_('select.booleanlist','EventAmPm2','class="inputbox"',$this->data->EventAmPm2,'pm','am'); ?>
						</td>
					</tr>
					<tr>
						<td>
							<label for="web">
								<?php echo JText::_( 'RSE_EVENT_WEB' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="EventURL" value="<?php echo $this->data->EventURL; ?>" size="50" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="phone">
								<?php echo JText::_( 'RSE_EVENT_PHONE' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="EventPhone" value="<?php echo $this->data->EventPhone; ?>" size="50" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="email">
								<?php echo JText::_( 'RSE_EVENT_EMAIL' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="EventEmail" value="<?php echo $this->data->EventEmail; ?>" size="50" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="access" class="editlinktip hasTip" title="<?php echo JText::_('RSE_EVENT_TYPE_INFO'); ?>">
								<?php echo JText::_( 'RSE_EVENT_OPTION_TYPE' ).':'; ?>
							</label>
						</td>
						<td>
							<?php echo JHTML::_('select.booleanlist','EventType','class="inputbox"',($this->data->IdEvent ? $this->data->EventType:1),JText::_('RSE_PUBLIC'),JText::_('RSE_PRIVATE')); ?>
						</td>
					</tr>
					<?php if($this->data->EventType == '0') { ?>
					<tr>
						<td width="200">
							<label for="privateUrl">
								<?php echo JText::_( 'RSE_EVENT_OPTION_PRIVATE_URL' ).':'; ?>
							</label>
						</td>
						<td>
							<strong><a href="<?php echo JURI::root().'index.php?option=com_rsevents&task=showevent&cid='.$this->data->IdEvent.'&privateUrl='.$this->data->EventPrivateUrl; ?>" target="_blank"><?php echo JURI::root().'index.php?option=com_rsevents&task=showevent&cid='.$this->data->IdEvent.'&privateUrl='.$this->data->EventPrivateUrl; ?></a></strong> - (<a href="index.php?option=com_rsevents&task=generate&cid=<?php echo $this->data->IdEvent; ?>&controller=events"><?php echo JText::_('RSE_EVENT_GENERATE_PRIVATE_URL');?></a>)
						</td>
					</tr>
					<?php } ?>
					<?php if($this->rseventsConfig['events.commenting'] != 0) { ?>
					<tr>
						<td width="200">
							<label for="comments">
								<?php echo JText::_( 'RSE_EVENT_OPTION_COMMENT' ).':'; ?>
							</label>
						</td>
						<td>
							<?php echo JHTML::_('select.booleanlist','EventEnableComments','class="inputbox"',$this->data->EventEnableComments); ?>
						</td>
					</tr>
					<?php } ?>
					<?php if ($this->rseventsConfig['enable.event.icon'] == 1) { ?>
					<tr>
						<td width="200">
							<label for="icon">
								<?php echo JText::_( 'RSE_ICON' ).':'; ?>
							</label>
						</td>
						<td>
							<?php if ($this->data->EventIcon == '') { ?>
								<input type="file" name="icon" size="40"/> <input type="button" onclick="javascript: submitbutton('apply')" value="Upload" />
							<?php } else { ?>
								<img style="vertical-align:middle;" src="<?php echo JURI::root(); ?>components/com_rsevents/images/thumbs/<?php echo str_replace('.jpg','_'.$this->rseventsConfig['event.icon.small'].'.jpg',$this->data->EventIcon); ?>" /> <a href="index.php?option=com_rsevents&task=deleteicon&controller=events&cid=<?php echo $this->data->IdEvent; ?>"><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/delete.png'; ?>" /></a>
							<?php } ?>
						</td>
					</tr>
					<?php } ?>
					<tr>
						<td>
							<label for="keywords">
								<?php echo JText::_( 'RSE_EVENT_KEYWORDS' ).':'; ?>
							</label>
						</td>
						<td>						
							<textarea id="EventKeywords" name="EventKeywords" rows="5" cols="30"><?php echo $this->data->EventKeywords; ?></textarea>
						</td>
					</tr>
					<tr>
						<td>
							<label for="keywords">
								<?php echo JText::_( 'RSE_EVENT_METADESCRIPTION' ).':'; ?>
							</label>
						</td>
						<td>						
							<textarea id="EventMetaDescription" name="EventMetaDescription" rows="5" cols="30"><?php echo $this->data->EventMetaDescription; ?></textarea>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
<?php echo $tabs->endPanel(); ?>
<?php echo $tabs->startPanel(JText::_('RSE_EVENT_TAB_DESCRIPTION'),"event-description"); ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
					<tr>
						<td>
							<label for="description">
								<?php echo JText::_( 'RSE_EVENT_DESCRIPTION' ).':'; ?>
							</label>
						</td>
						<td>
<?php $editor=& JFactory::getEditor();
echo $editor->display('EventDescription',$this->data->EventDescription,550,400,70,10); ?>						
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
<?php echo $tabs->endPanel(); ?>
<?php echo $tabs->startPanel(JText::_('RSE_EVENT_TAB_REGISTRATION'),"event-options"); ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
					<tr>
						<td width="200">
							<label for="registration">
								<?php echo JText::_( 'RSE_EVENT_OPTION_REGISTRATION' ).':'; ?>
							</label>
						</td>
						<td>
							<?php echo JHTML::_('select.booleanlist','EventEnableRegistration','class="inputbox"',$this->data->EventEnableRegistration); ?>
							<?php 
						if($this->data->EventEnableRegistration)
							{
								echo '&nbsp;&nbsp;<a href="index.php?option=com_rsevents&task=listtickets&IdEvent='.$this->data->IdEvent.'">'.JText::_('RSE_EVENT_OPTION_TICKETS').'</a>'; 
							} 
						?>
						</td>
					</tr>
					<tr>
						<td width="200">
							<label for="overbooking">
								<?php echo JText::_( 'RSE_EVENT_OPTION_OVERBOOKING' ).':'; ?>
							</label>
						</td>
						<td>
							<?php echo JHTML::_('select.booleanlist','EventOverbooking','class="inputbox"',$this->data->EventOverbooking); ?>
						</td>
					</tr>
					<tr>
						<td width="200">
							<label for="showGuest">
								<?php echo JText::_( 'RSE_EVENT_OPTION_GUEST' ).':'; ?>
							</label>
						</td>
						<td>
							<?php echo JHTML::_('select.booleanlist','EventShowGuest','class="inputbox"',$this->data->EventShowGuest); ?>
						</td>
					</tr>
					<tr>
						<td width="200">
							<label for="autoaprove" class="editlinktip hasTip" title="<?php echo JText::_('RSE_EVENT_AUTO_APROVE_INFO'); ?>">
								<?php echo JText::_( 'RSE_EVENT_AUTO_APROVE' ).':'; ?>
							</label>
						</td>
						<td>
							<?php echo JHTML::_('select.booleanlist','EventAutoApprove','class="inputbox"',$this->data->EventAutoApprove); ?>
						</td>
					</tr>
					<?php if (defined('RSEVENTS_PAYPAL') && $this->rseventsConfig['paypal.for.users'] == 1) { ?>
					<tr>
						<td width="200">
							<label for="paypal_email">
								<?php echo JText::_( 'RSE_PAYPAL_EMAIL' ).':'; ?>
							</label>
						</td>
						<td>
							<input name="EventPaypalEmail" value="<?php echo $this->data->EventPaypalEmail; ?>" size="50" />
						</td>
					</tr>
					<tr>
					   <td width="200"><label for="returnurl"><?php echo JText::_('RSE_PAYPAL_RETURN_URL') . ' : '; ?></label>
					   <td><input type="text" name="EventReturnUrl" value="<?php echo $this->data->EventReturnUrl; ?>" size="120" /></td>
					</tr>
					<?php } ?>
					<tr>
						<td width="200">
							<label for="rsform">
								<?php echo JText::_( 'RSE_EVENT_OPTION_RSFORM' ).':'; ?>
							</label>
						</td>
						<td>
							<?php echo $this->lists['forms']; ?> <a href="index.php?option=com_rsform&task=forms.manage" target="_blank"><?php echo JText::_('RSE_ADD_NEW_FORM'); ?></a>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
<?php echo $tabs->endPanel(); ?>
<?php echo $tabs->startPanel(JText::_('RSE_EVENT_TAB_FILES'),"event-files"); ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
					<tr>
						<td>
							<label for="input1">
								<?php echo JText::_( 'RSE_EVENT_FILES' ).':'; ?>
							</label>
						</td>
						<td>
							<div id="files">
							<input type="file" name="files[]" size="40"/> <input type="button" onclick="javascript: submitbutton('apply')" value="Upload" />
							</div>
							<br/><a href="" onclick="newFile();return false;"><?php echo JText::_('RSE_EVENT_ADD_FILES');?></a>
						</td>
					</tr>
				</table>
<?php if(!empty($this->files)) { ?>				
	<div id="editcell1">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="5">
						<?php echo JText::_( 'RSE_#' ); ?>
					</th>
					<th>
						<?php
							echo JText::_( 'RSE_EVENT_FILES_NAME' ); 
						?>
					</th>
					<th>
						<?php
							echo JText::_( 'RSE_EVENT_FILES_EVERYONE' ); 
						?>
					</th>
					<th>
						<?php
							echo JText::_( 'RSE_EVENT_FILES_REGISTERED' ); 
						?>
					</th>
					<th width="100">
						<?php
							echo JText::_( 'RSE_EVENT_FILES_DELETE' ); 
						?>
					</th>
				</tr>
			</thead>
			<tbody>
	<?php
	$k = 0;
	for ($i=0,$n=count($this->files);$i<$n;$i++)
	{		
		$row =& $this->files[$i];
	?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $row->IdFile; ?></td>
				<td><a href="index.php?option=com_rsevents&task=editfile&cid=<?php echo $row->IdFile; ?>" class="modal"><?php echo $row->FileName; ?></a></td>
				<td align="center"><?php echo JText::_('RSE_EVENT_FILES_BEFORE').$row->fp0.' '; ?><?php echo JText::_('RSE_EVENT_FILES_DURING').$row->fp1.' '; ?><?php echo JText::_('RSE_EVENT_FILES_AFTER').$row->fp2.' '; ?></td>
				<td align="center"><?php echo JText::_('RSE_EVENT_FILES_BEFORE').$row->fp3.' '; ?><?php echo JText::_('RSE_EVENT_FILES_DURING').$row->fp4.' '; ?><?php echo JText::_('RSE_EVENT_FILES_AFTER').$row->fp5.' '; ?></td>
				<td align="center"><a href="index.php?option=com_rsevents&task=deletefile&cid=<?php echo $row->IdFile; ?>&controller=files&IdEvent=<?php echo $row->IdEvent; ?>"><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/delete.png'; ?>" title="Delete" alt="Delete file"></a></td>
			</tr>
	<?php	$k=1-$k;
	}
	?>
			</tbody>
				</table>
</div>		
<?php } ?>		
			</td>
		</tr>
	</table>
<?php echo $tabs->endPanel(); ?>
<?php echo $tabs->startPanel(JText::_('RSE_EVENT_TAB_EXTRAS'),"event-extras"); ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
					<tr>
						<td width="150">
							<label for="extra">
								<?php $message = ($this->rseventsConfig['events.extras.youtube'] == 1 || $this->rseventsConfig['events.extras.flash'] == 1 || $this->rseventsConfig['events.extras.mp3'] == 1 || $this->rseventsConfig['events.extras.meebo'] == 1 || $this->rseventsConfig['events.extras.flickr'] == 1) ? JText::_( 'RSE_EVENT_EXTRAS_ADD' ).':' : JText::_( 'RSE_EVENT_NO_EXTRAS' ) ; 
										echo $message; ?>
							</label>
						</td>
						<td>
						<?php  
								$links=array();
								if ($this->rseventsConfig['events.extras.youtube']) $links[] ='<a href="index.php?option=com_rsevents&task=edityoutube&tmpl=component&IdEvent='.$this->data->IdEvent.'&cid=0" class="modal">'.JText::_('RSE_YOUTUBE').'</a>'; 
								if($this->rseventsConfig['events.extras.flash']) $links[] = '<a href="index.php?option=com_rsevents&task=editflash&tmpl=component&IdEvent='.$this->data->IdEvent.'&cid=0" class="modal">'.JText::_('RSE_FLASH').'</a>';
								if($this->rseventsConfig['events.extras.mp3']) $links[] = '<a href="index.php?option=com_rsevents&task=editmp3&tmpl=component&IdEvent='.$this->data->IdEvent.'&cid=0" class="modal">'.JText::_('RSE_MP3').'</a>';
								if($this->rseventsConfig['events.extras.meebo']) $links[] = '<a href="index.php?option=com_rsevents&task=editmeebo&tmpl=component&IdEvent='.$this->data->IdEvent.'&cid=0" class="modal">'.JText::_('RSE_MEEBO').'</a>';
								if($this->rseventsConfig['events.extras.flickr']) $links[] = '<a href="index.php?option=com_rsevents&task=editflickr&tmpl=component&IdEvent='.$this->data->IdEvent.'&cid=0" class="modal">'.JText::_('RSE_FLICKR').'</a>';
								echo implode(' | ',$links);
						?>
						</td>
					</tr>
				</table>
<?php if(!empty($this->extras)) { ?>				
	<div id="editcell1">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="5">
						<?php echo JText::_( 'RSE_#' ); ?>
					</th>
					<th>
						<?php
							echo JText::_( 'RSE_EVENT_EXTRA_TYPE' ); 
						?>
					</th>
					<th>
						<?php
							echo JText::_( 'RSE_EVENT_EXTRA_NAME' ); 
						?>
					</th>
					<th width="100">
						<?php
							echo JText::_( 'RSE_EVENT_EXTRA_DELETE' ); 
						?>
					</th>
				</tr>
			</thead>
			<tbody>
	<?php
	$k = 0;
	for ($i=0,$n=count($this->extras);$i<$n;$i++)
	{		
		$row =& $this->extras[$i];
		if($row->ExtraName=='flash') $row->ExtraValue = '---';
		if($row->ExtraName=='meebo') $row->ExtraValue = '---';
	?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $row->IdExtra; ?></td>
				<td align="center"><a href="index.php?option=com_rsevents&task=edit<?php echo $row->ExtraName; ?>&tmpl=component&IdEvent=<?php echo $this->data->IdEvent; ?>&cid=<?php echo $row->IdExtra; ?>" class="modal"><?php echo $row->ExtraName; ?></a></td>
				<td><?php echo substr(preg_replace('/\<br(\s*)?\/?\>/i', "\n", $row->ExtraValue),0,50); ?></td>
				<td align="center"><a href="index.php?option=com_rsevents&task=deleteextra&cid=<?php echo $row->IdExtra; ?>&controller=events&IdEvent=<?php echo $row->IdEvent; ?>"><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/delete.png'; ?>" title="Delete" alt="Delete extra"></a></td>
			</tr>
	<?php	$k=1-$k;
	}
	?>
			</tbody>
				</table>
</div>		
<?php } ?>		
			</td>
		</tr>
	</table>
<?php echo $tabs->endPanel(); ?>
<?php echo $tabs->endPane(); ?>

<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="option" value="com_rsevents" />
<input type="hidden" name="cid" value="<?php echo $this->data->IdEvent; ?>" />
<input type="hidden" name="IdEvent" value="<?php echo $this->data->IdEvent; ?>" />
<input type="hidden" name="controller" value="events" />
<input type="hidden" name="view" value="events" />
<input type="hidden" name="task" value="" />
</form>

<?php
//keep session alive while editing
JHTML::_('behavior.keepalive');
?>