{include file="$gentemplates/$header_tpl"}
	<script type="text/javascript" src="{$site_root}{$index_theme_path}/js/class.wall_events.js"></script>
	<script type="text/javascript" src="{$site_root}{$index_theme_path}/js/jquery.jplayer.min.js"></script>
	<link href="{$site_root}{$index_theme_path}{$index_theme_css_path}/player_skin/jplayer.blue.monday_{$default_left}.css" rel="stylesheet" type="text/css" />
	<link href="{$server}{$template_root}{$template_css_root}/jquery/nivo-slider.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="{$server}{$template_root}/js/jquery/jquery.nivo.slider.js"></script>
	
	{include file="$gentemplates/wall_events_audio_player.tpl"}
	
	<h2>{$lang.left_menu.homepage}</h2>
	<!-- take tour -->
	{if $taketour}	
	<h3 class="p-b5">
		<span id="taketour_hide" {if $events.events}style="display:none;"{/if}>{$lang.profile.taketour_hide}</span>
		<span id="taketour_show">{$lang.profile.taketour_show}</span>
		<div style="padding-top:height:30px;" class="float_right">
			<div id="hide_image" style="{if $events.events}display: none; padding: 12px 0px 0px 4px;{/if}">
				<a class="hide_search_form" onclick="ShowHideTour(1); return false;" href="#" id="icon_click">&nbsp;</a>
			</div>
			<div id="show_image" style="{if !$events.events}display: none; padding: 5px 1px 0px 4px;{/if}">
				<a class="show_search_form" onclick="ShowHideTour(2); return false;" href="#" id="icon_click">&nbsp;</a>
			</div>
		</div>
	</h3>
    <div class="slider-wrapper theme-default">
        <div id="slider" class="nivoSlider" {if $events.events}style="display:none;"{/if}>
			{foreach item=item from=$taketour}
				{if $item.url}<a href="{$item.url}">{/if}
				<img src="{$item.file_path}" alt="" title="{$item.title}" />
				{if $item.url}</a>{/if}
			{/foreach}
        </div>
    </div>
	{/if}	
	<!-- end take tour -->

	<h3 class="p-b5" style="margin-bottom:0;">{$lang.wall_events.header}
		{if $group_adult_allow}
			<span class="adult_content_check_span float_right">
				<label for="adult_content_check">{$lang.adult_content_check}</label>&nbsp;&nbsp;
				<input id="adult_content_check" type="checkbox" {if $user_adult_allow}checked{/if} onclick="changeAdultAllow(this, {literal}function(resp){if(resp.status == 1){window.wall_events.reload();}}{/literal})" />
			</span>
		{/if}
	</h3>
	<div id="wall_events" class="wall_events">
		{include file="$gentemplates/wall_events.tpl"}
	</div>

	{literal}
	<script>
		window.wall_events = new WallEvents().init({
			type: 'homepage',
			all_loaded: parseInt('{/literal}{$events.all_loaded}{literal}'),
			min_id: {/literal}{if $events.min_id}{$events.min_id}{else}0{/if}{literal},
			max_id: {/literal}{if $events.max_id}{$events.max_id}{else}0{/if}{literal},
			id: 'wall_events',
			url: '{/literal}{$server}/ajax_backend.php{literal}',
			view_button_title: '{/literal}{$lang.button.view_more|escape:javascript}{literal}',
			send_button_title: '{/literal}{$lang.button.send|escape:javascript}{literal}',
			placeholder: '{/literal}{$lang.wall_events.placeholder_home|escape:javascript}{literal}',
			onInit: function(){
				$('#wall_events_wrapper').find('input, textarea').placeholder();
			}
		});

		$(document).ready(function() {
			$('#slider').nivoSlider();
			controlNav: false;
		});

		function ShowHideTour(par) {
			if (par == '1') {
				document.getElementById('taketour_hide').style.display = 'none';
				document.getElementById('taketour_show').style.display = 'inline';
				document.getElementById('hide_image').style.display = 'none';
				document.getElementById('show_image').style.display = 'inline';
				document.getElementById('slider').style.display = 'none';
			} else {
				document.getElementById('taketour_show').style.display = 'none';
				document.getElementById('taketour_hide').style.display = 'inline';
				document.getElementById('hide_image').style.display = 'inline';
				document.getElementById('show_image').style.display = 'none';
				document.getElementById('slider').style.display = '';
			}
		}
	</script>
	{/literal}

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