{include file="$gentemplates/$header_tpl"}
{strip}
	<h2>{$lang.organizer.page_title}</h2>
        
	{*if $form.err && $form.section eq ''}
	<p class="error_msg">*&nbsp;{$form.err}</p>
	{/if*}
	<div class="search_result_list">
	<div class="float_left" style="width:48%">
		<h3 class="p-b5">{$lang.organizer.general_options}</h3>
		<p><a href="{$seo_site_root}/organizer.php?sel=bookmarks">{$lang.organizer.my_bookmarks}</a></p>
		{if ($use_pilot_module_events)}
		<p><a href="{$site_root}/{$seo.events_calendar}?from=organizer">{$lang.organizer.my_events_stats}</a></p>
		{/if}
		<p><a href="{$seo_site_root}/organizer.php?sel=billing">{$lang.organizer.billing_history}</a></p>
		<p><a href="{$seo_site_root}/organizer.php?sel=homepage_management">{$lang.organizer.homepage_management}</a></p>
	<!--	<p><a href="{$seo_site_root}/organizer.php?sel=homepage_management&type=layout">{$lang.organizer.my_page_layout}</a></p>
		<p><a href="{$seo_site_root}/organizer.php?sel=homepage_management&type=page_styles">{$lang.organizer.my_page_styles}</a></p>-->
		{if $form.section ne 'calendar_action'}
		<h3 class="p-b5">{$lang.organizer.my_stats}</h3>
			{foreach item=item from=$user_stat}
				<p style="overflow:hidden;">
					<font class="float_left">{$lang.organizer[$item.name]}:&nbsp;</font>
					<a class="float_left" href="{$item.link}">{$item.value}</a>
				</p>
			{/foreach}		
		{/if}
	</div>
	<div class="float_right" style="width:48%">
		<h3 class="p-b5" style="overflow: hidden;"><span class="float_left">{$lang.organizer.calendar}</span><a href="{$seo_site_root}/organizer.php?sel=date" class="float_right">{$lang.organizer.calendar_management}</a></h3>
		<div id="calendar">{$calendar_out_put}</div>
		{if $form.section ne 'calendar_action'}
			<h3 class="p-b5">{$lang.organizer.my_other_site_profiles}</h3>
			{if $site_profiles}
				{foreach item=item from=$site_profiles}
				<p>
					<a href="http://{$item.link}" target="_blank">{$item.descr}</a>&nbsp;
					<a href="{$seo_site_root}/organizer.php?sel=del_profile&id={$item.id}" class="small-del-icon" alt="{$lang.organizer.del_profile}" title="{$lang.organizer.del_profile}">&nbsp;</a>
				</p>
				{/foreach}
			{else}
				<p>{$lang.organizer.no_site_profiles}</p>
			{/if}
			<p>
				<input type="button" value="{$lang.organizer.add_profile}" onclick="ShowAddProfileForm();">
			<p>
			<div id="add_profile_form" {if $form.err && $form.section eq '1'} style="display: inline; margin: 10px 0;"{else} style="display: none; margin: 10px 0;"{/if}>
				<form method="post" action="{$seo_site_root}/organizer.php" style="margin: 0px; padding: 0px;">
					<input type="hidden" name="sel" value="save_profile">
					
                                        {*if $form.err && $form.section eq '1'}
						<p class="error_msg">*&nbsp;{$form.err}</p>
					{/if*}
                                        
						<p>{$lang.organizer.url}:&nbsp;<font class="error_msg">*</font>&nbsp;
							<span class="text_hidden">http://&nbsp;</span>
							<input type="text" name="profile_url" style="width: 170px;" value="{$data.profile_url}" maxlength="70">
						</p>
						<p>
							{$lang.organizer.description}:&nbsp;<font class="error_msg">*</font>&nbsp;
							<input onkeyup="BadWords('profile_descr');" type="text" name="profile_descr" id="profile_descr" style="width: 170px;" value="{$data.profile_descr}" maxlength="255">
                            <div id="bad_div_profile_descr" class="bad_div_left"></div>
						</p>
						<p><input type="submit" value="{$lang.organizer.save_profile}"></p>
					</dl>
				</form>
			</div>
		{/if}

		{if $form.section eq 'calendar_action'}
			<p>
				<input type="button" onclick="ShowCalendarAddForm(); return false;" value="{$lang.organizer.create_action}">
			</p>
			<div id="calendar_add_form" {if !($form.err && $form.section eq 'calendar_action')} style="display: none;"{/if}>
				<form method="post" action="{$seo_site_root}/organizer.php" style="margin: 0px; padding: 0px;">
					<input type="hidden" name="sel" value="save_action">
					{*if $form.err && $form.section eq 'calendar_action'}
						<p class="error_msg">*&nbsp;{$form.err}</p>
					{/if*}
					<p>
						{$lang.organizer.action_date}:&nbsp;<font class="error_msg">*</font><br />
						<select name="day" >
						{section name=d loop=$day}
							<option value="{$day[d].value}" {if $day[d].sel}selected="selected"{/if}>{$day[d].value}</option>
						{/section}
						</select>&nbsp;
						<select name="month" >
						{section name=m loop=$month}
							<option value="{$month[m].value}" {if $month[m].sel}selected="selected"{/if}>{$month[m].name}</option>
						{/section}
						</select>&nbsp;
						<select name="year" >
						{section name=y loop=$year}
							<option value="{$year[y].value}" {if $year[y].sel}selected="selected"{/if}>{$year[y].value}</option>
						{/section}
						</select>&nbsp;&nbsp;
						<select name="hour" >
						{section name=h loop=$hour}
							<option value="{$hour[h].value}" {if $hour[h].sel}selected="selected"{/if}>{$hour[h].value}</option>
						{/section}
						</select>&nbsp;
						<select name="min" >
						{section name=i loop=$min}
							<option value="{$min[i].value}" {if $min[i].sel}selected="selected"{/if}>{$min[i].value}</option>
						{/section}
						</select>
					</p>
					<p>
						{$lang.organizer.action_name}:&nbsp;<font class="error_msg">*</font><br />
						<input type="text" name="action_name" id="action_name" style="width: 250px;" onkeyup="BadWords('action_name');" value="{$data.action_name}" maxlength="70">
                        <div id="bad_div_action_name" class="bad_div_left"></div>
					</p>
					<p>
						{$lang.organizer.action_descr}:&nbsp;<font class="error_msg">*</font><br />
						<textarea name="action_descr" id="action_descr" style="width: 250px;" onkeyup="BadWords('action_descr');" rows="5">{$data.action_descr}</textarea>
                        <div id="bad_div_action_descr" class="bad_div_left"></div>
					</p>
					<p>
						<input type="submit" value="{$lang.organizer.save_action}">
					</p>
				</form>
			</div>
			{if $user_actions ne 'empty'}
				<div style="display:table;width:100%;padding: 15px 0;">		
					{include file="$gentemplates/pagination_top.tpl"}
				</div>
			
				<form style="margin: 0px;" action="{$seo_site_root}/organizer.php" method="post">
					<input type="hidden" name="sel" value="del_action">
					<input type="hidden" name="day" value="{$form.day}">
					<input type="hidden" name="month" value="{$form.month}">
					<input type="hidden" name="year" value="{$form.year}">
					{foreach item=item from=$user_actions}
						<p>
							<input type="checkbox" value="{$item.id}" name="del_id[]">&nbsp;
							{$item.name}({$item.date})
						</p>
						<p>
							{$item.contain}
						</p>
					{/foreach}
					<p>
						<input type="submit" value="{$lang.organizer.del_selected}">
					</p>
				</form>
				{include file="$gentemplates/pagination_bottom.tpl"}				
			{/if}
		{/if}
	</div>
        </div>
{* {if $banner.right}<div style="float: left;">{$banner.right}</div>{/if}	*}					  	
{/strip}
{literal}
<script type="text/javascript">

function ShowCalendarAddForm() {
	if (document.getElementById('calendar_add_form').style.display == 'none') {
		document.getElementById('calendar_add_form').style.display = 'inline';
	} else {
		document.getElementById('calendar_add_form').style.display = 'none';
	}
	return;
}

function ShowAddProfileForm() {
	if (document.getElementById('add_profile_form').style.display == 'none') {
		document.getElementById('add_profile_form').style.display = 'inline';
	} else {
		document.getElementById('add_profile_form').style.display = 'none';
	}
	return;
}

function showToolTip(par,text){
	var obj = document.getElementById('tooltip');
	obj.innerHTML = text;
	obj.style.display = 'block';
	
	if($('#top_'+par).position().left > 820 && $('#top_'+par).position().left <=880)
		obj.style.left = ($('#top_'+par).position().left-59) + 'px';
	else if($('#top_'+par).position().left > 880)
		obj.style.left = ($('#top_'+par).position().left-111) + 'px';
	else
		obj.style.left = $('#top_'+par).position().left + 'px';
	obj.style.top = $('#top_'+par).position().top+'px';
}
function hideToolTip(){
	document.getElementById('tooltip').style.display = 'none';
}

var req = null;

function InitXMLHttpRequest() {
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function LoadOrgCalendar(destination, url) {
	InitXMLHttpRequest();
	// Load the result from the response page
	if (req) {
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				destination.innerHTML = req.responseText;
			} else {
				destination.innerHTML = "<div align='center' style='width: 330px;'>Loading data...</div>";
			}
		}
		req.open("GET", SEO_SITE_ROOT+"/organizer.php?sel=ajax_calendar&act=1"+url, true);
		req.send(null);
	} else {
		destination.innerHTML = 'Browser unable to create XMLHttp Object';
	}
}
</script>
{/literal}
{include file="$gentemplates/$footer_tpl"}