{if $ajax ne 2}
<div id="show_block">
<div class="panel_subtabs main_content_text" style="padding-left: 0;">
<div class="main_content_text">
{/if}
    <div id="page_content" >
    <div style="width: 50%; float: left;">  
           <div class="main_content_text">
                <dl class="design_dl">
                    <dd class="design_left_dd" style="margin-bottom: 10px;"><b>{$lang.settings.color_theme}:&nbsp;</b></dd>
                    <dd class="fl design_right_dd">
                        <form method="GET" name="theme" id="theme" action="{$form.action}">
                        <input type="hidden" name="section" value="17">
                        <input type="hidden" name="sel" value="change">
                        <input type="hidden" name="par" value="color">
                        &nbsp;&nbsp;
                        <select name="color_theme" style="width: 147px" onchange="ChangeTheme(); return false;" >
                        {foreach item=item from=$themes}
                            <option value="{$item.name}" {if $item.sel eq 1}selected{/if}>{$item.title}</option>
                        {/foreach}
                        </select>
                        </form>
                    </dd>
                </dl>
            </div>
            
            <form method="POST" name="index_page" id="index_page" action="{$form.action}" enctype="multipart/form-data">
            <input type="hidden" name="sel" value="change"/>
            <input type="hidden" name="par" value="index_page"/>
            <input type="hidden" name="section" value="32"/>
            <input type="hidden" name="current_theme" value="{$current_theme}"/>        
                <dl class="design_dl">
                    <dd style="margin-bottom: 10px;" class="design_left_dd"><b>{$lang.admin.design_management.index_form_page}:</b></dd>
                    <dd><input type="radio" name="index_form" {if $index_form eq "quick_search"}checked=""{/if} onclick="ChangeSettings('index_left', 'quick_search');ChangeSettings('index_center', 'index_foto'); $('#index_center').css('width','67.5%'); $('#index_left').css('width','32%');" value="quick_search"/>{$lang.admin.design_management.quick_search}</dd>
                    <dd><input type="radio" name="index_form" {if $index_form eq "registration"}checked=""{/if} onclick="ChangeSettings('index_left', 'registration');ChangeSettings('index_center', 'index_foto'); $('#index_center').css('width','67.5%'); $('#index_left').css('width','32%');" value="registration"/>{$lang.admin.design_management.registration_block}</dd>
                    <dd><input type="radio" name="index_form" {if $index_form eq "search_widget"}checked=""{/if} onclick="ChangeSettings('index_left', 'search_widget_images'); ChangeSettings('index_center', 'search_widget_form'); $('#index_center').css('width','30.2%'); $('#index_left').css('width','69%');" value="search_widget"/>{$lang.admin.design_management.search_widget}</dd>
                </dl>
                <dl class="design_dl">
                    <dd style="margin-bottom: 10px; margin-left:0;" ><b>{$lang.admin.design_management.index_view_page}:</b></dd>
                    <dd><input type="radio" name="index_view" {if $index_view eq "success_stories"}checked=""{/if} onclick="ChangeSettings('index_bottom', 'success_stories');" value="success_stories"/>{$lang.admin.design_management.success_stories_block}</dd>
                    <dd><input type="radio" name="index_view" {if $index_view eq "new_users"}checked=""{/if} onclick="ChangeSettings('index_bottom', 'new_users');" value="new_users"/>{$lang.admin.design_management.new_users_block}</dd>
                    <dd><input type="radio" name="index_view" {if $index_view eq "top"}checked=""{/if} onclick="ChangeSettings('index_bottom', 'top');" value="top"/>{$lang.admin.design_management.top_block}</dd>
                    <dd><input type="radio" name="index_view" {if $index_view eq "none"}checked=""{/if} onclick="ChangeSettings('index_bottom', 'none');" value="none"/>{$lang.admin.design_management.none}</dd>
                </dl>
            </form>
            
    </div>
    <div style="width: 50%; float: left; padding-top: 10px; background: #ffffff;">
        <div style="overflow: hidden; width: 100%;">
            <div id="index_center" style="float: left; width: {if $index_form eq "search_widget"}30.2{else}67.5{/if}%;"><img style="width: 100%;" src="{$site_root}{$template_root}/images/index_settings/{if $index_form == 'search_widget'}search_widget_form{else}index_foto{/if}.png" /></div>
            <div id="index_left" style="float: left; width: {if $index_form eq "search_widget"}69{else}32{/if}%;"><img style="width: 100%;" src="{$site_root}{$template_root}/images/index_settings/{$index_form}{if $index_form == 'search_widget'}_images{/if}.png" /></div>
        </div>
        <div id="index_bottom"><img style="width: 99.5%; {if $index_view == 'none'}display: none;{/if}" {if $index_view != 'none'}src="{$site_root}{$template_root}/images/index_settings/{$index_view}.png"{/if} /></div>
    </div>
</div>	
{if $ajax ne 2} 
</div>
</div>
<div>
    <a href="#" class="admin_button_major" id="index_form" onclick="document.index_page.submit();">{$lang.button.save}<span>&nbsp;</span></a>
</div>
</div>
{/if}
<script type="text/javascript">
{literal}
	function ChangeSettings(div, new_img){
		if(new_img == 'none'){
			$("#"+div).find("img").hide();
		}else{
			$("#"+div).find("img").show().attr('src', "{/literal}{$site_root}{$template_root}{literal}/images/index_settings/"+new_img+'.png');
		}
	}

	function ChangeTheme(){
		var new_theme = $("select[name=color_theme]").val();
		$.post("admin_settings.php", {section:'32', theme: new_theme, ajax: '2'}, function(data){
			$("#page_content").html(data);
		})
	}

			
	function Save_index(){
		var form = $("input:radio[name=index_form]:checked").val(); alert(form);
	}
        
{/literal}
</script>