{include file="$admingentemplates/admin_top.tpl"}
{strip}
{*</font>*}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_settings.php">{$lang.button.back}</a>
</div>
{if $tabs eq 1}
<link href="{$site_root}{$template_root}/css/alert.css" rel="stylesheet" type="text/css">
	
<div class="TargetingPopup" id="TargetingPopup" style="z-index: 9991;">
	<div class="TargetingPopupLeft"></div>
	<div class="TargetingPopupHead">
		<div style="padding: 5px 0px !important;">
			<div style="position:relative;">
				<div style="position:absolute; right: 2px;">
					<img class="close" style="cursor:pointer;" alt="Close" src="{$site_root}{$template_root}/css/custom/images/TopClose.png">
				</div>
			</div>
			{$lang.builder.targeting}
		</div>
		<hr style="border: 0; height: 2px; color: #e0e0b3; background-color:#e0e0b3;"/>
	</div>
	<div class="TargetingPopupBody">
		<div style="padding: 10px !important; width: 537px; background: #fff;" class="div_name_for_lang" id="answ">
			
		</div>
		<div style="padding: 15px 0px !important;">
			<a class="admin_button_major" onclick="save();">{$lang.button.save}<span>&nbsp;</span></a>            
		</div>
	</div><div class="TargetingPopupBottom"></div>
</div>
<div id="mask"></div>
<script language="JavaScript" type="text/javascript">
	$('#TargetingPopup').hide();
</script>
{/if}
<script language="JavaScript" type="text/javascript">
var subtype_count = {$subtype_count};
var lang_collapse = "{$lang.builder.collapse}";
var lang_deletepage = "{$lang.builder.delete_page}";
var captcha_saving = "{$lang.builder.captcha_saving}";
var edit_variants = "{$lang.builder.edit_variants}";
var pls_wait = "{$lang.builder.pls_wait}";
var exit_page = "{$lang.builder.exit_page}";
</script>
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/custom/main.js"></script>
<link rel="stylesheet" href="{$site_root}{$template_root}/css/custom/jquery-ui-1.8.custom.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/editor/whizzywig.js"></script>
<script language="JavaScript" type="text/javascript">
btn._f="{$site_root}{$template_root}/editor/WhizzywigToolbar.png";
cssFile = "{$site_root}{$template_root}/editor/simple.css";
document.body.setAttribute("onbeforeunload", "if ($('#exit_flag').val()==1) return '{$lang.builder.exit_page}';");
dbuts=' bold italic underline | left center right justify | number bullet indent outdent | color hilite rule link image table clean ';
{literal}
$(document).ready(function(){
	$('.highlighttab *').tooltip();
});
{/literal}
</script>
<input id="exit_flag" type="hidden">
<div style="display:none; opacity: 1; position: absolute; top: 0px; left: 0px; margin-top: 0px;" id="help_tooltip" class="yCallout">
    <div class="yCalloutTop"></div>
    <div class="yCalloutHead">
        {$lang.builder.elem_preview}
        <hr style="border: 0; height: 2px; color: #e0e0b3; background-color:#e0e0b3;"/>
    </div>
    <div class="yCalloutBody">
        <div>
            <p></p>
        </div>
    </div><div class="yCalloutBottom"></div>
</div>
<div style="display:none; opacity: 1; position: absolute; top: 0px; left: 0px; margin-top: 0px;" id="help_tooltip_left" class="yCallout">
    <div class="yCalloutLeft"></div>
    <div class="yCalloutHead">
        {$lang.builder.elem_preview}
        <hr style="border: 0; height: 2px; color: #e0e0b3; background-color:#e0e0b3;"/>
    </div>
    <div class="yCalloutBody">
        <p></p>
    </div><div class="yCalloutBottom"></div>
</div>


    <div class="show_help" style="display: none;">&nbsp;</div>
    <div class="red_header">{$lang.admin_menu.builder}</div>
    <div class="cr">&nbsp;</div>
    <div class="cr">&nbsp;</div>    
        <div class="help_text" style="display:block;">
            <div class="close_help">
                <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
            </div>
            <div class="help_body">
                {if $tabs eq 0}
                    <span class="help_title">{$lang.help}:</span><span class="help_title">{$lang.admin_help.registration_help_title}</span>{$lang.admin_help.registration_help}
                {/if}
                {if $tabs eq 1}
                    <span class="help_title">{$lang.help}:</span><span class="help_title">{$lang.admin_help.registration_help_title}</span>{$lang.admin_help.quick_search_help}
                {/if}
                {if $tabs eq 2}
                    <span class="help_title">{$lang.help}:</span><span class="help_title">{$lang.admin_help.registration_help_title}</span>{$lang.admin_help.adv_search_help}
                {/if}
                {if $tabs eq 3}
                    <span class="help_title">{$lang.help}:</span><span class="help_title">{$lang.admin_help.registration_help_title}</span>{$lang.admin_help.perfect_match_help}
                {/if}
            </div>
        </div>

<div id="tabs" style="width:100.5%;">
	<ul class="tabs" >
		<li >
			<a href="#tabs-1" >                
                   {$lang.builder.register_link}
            </a>
        </li>
		<li>
			<a href="#tabs-2">                
                   {$lang.builder.qsearch_link}                
            </a>
        </li>
		<li >
			<a href="#tabs-3" >
                   {$lang.builder.asearch_link}
            </a>
        </li>
		<li >
			<a href="#tabs-4" >
                   {$lang.builder.perfect_link}
            </a>
        </li>
        <li >
			<a href="#tabs-5" >
                   {$lang.admin_menu.custom}
            </a>
        </li>
        <li >
			<a href="#tabs-6" >
                   {$lang.admin_menu.ref_user_types}
            </a>
        </li>
	</ul>
<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{literal}
<script type="text/javascript">

$(function() {
$('#tool_tip_4 *').tooltip();
});
</script>
{/literal}	
<div class="user_operation_line" style="{if $tabs ne 0}height:4px;font-size:0px;{/if}">
	{if $tabs eq 0}
	    <div class="uol_item" onclick="CreateNewBlock(); return false;">
	        <div class="uol_in_item">{$lang.builder.add_page}</div>
	    </div> 
	{/if}
</div>
<div class="cr"></div>
	<div id="tabs-1" >
		{if $tabs eq 0}
		<table border="0" width="96%">
		<tr><td width="387px">
			<div class="column">
                    <div class="portlet first_page" page_id="1">
                    <div class="portlet-header">
						<span class="padding-left-5">{$lang.builder.page} 1:</span>&nbsp;
						<div class="inline">{$lang.users.page[1]}</div>
						<div class="inline" style="position:relative; top: 2px;">&nbsp;
							<a href="#" onclick="return false;"><img title="{$lang.builder.edit_header}" alt="{$lang.builder.edit_header}" src="{$site_root}{$template_root}/images/builder/pen.png"></a>
						</div>
					</div>
                    <div class="portlet-content">
						<ul class="draw_area" style="list-style-type: none;margin: 0px; padding: 0px;" >
							{foreach item=item from=$elements name=elements}
							{if $item.page eq '1'}
							{if $item.name_for_lang eq 'id_within'}
							{else}
                            <li class="edit_section2{if $item.category eq 'text_del'} custom{/if}{if $item.category == 'partner_criteria' || $item.category == 'partner_interests'} help_text{/if}" category="{if $item.category eq 'text_del'}custom{else}{$item.category}{/if}" id_elem="{$item.id}" element_type="input_element">
								<table width="315px" style="padding-left:5px;">
									<tr>
										<td>
											<img id_elem="{$item.id}" class="info" src="{$site_root}{$template_root}/images/controls/information.png">
										</td>
										<td width="100%" class="elem_small_text" mandatory="{$item.mandatory}">
											{if $item.category eq 'custom'}
												{if $lang.userspr[$item.name_for_lang] ne ''}
													{$lang.userspr[$item.name_for_lang]}
												{else}
													{$item.name_for_lang}
												{/if}
											{else}
												{if $lang.profile[$item.name_for_lang] ne ''}
													{$lang.profile[$item.name_for_lang]}
												{else}
														{$item.name_for_lang}
												{/if}
											{/if}
										</td>
										<td width="0%" class="control">
											<div class="control" style="display:none; position: relative;">
												{if $item.is_system eq '0'}
												<div style="position: absolute; right: -55px; top: -9px; cursor: pointer;">
													<img alt="{$lang.builder.del_elem}" title="{$lang.builder.del_elem}" class="deleteadd" src="{$site_root}{$template_root}/images/controls/icn_delete.gif">
												</div>
												{/if}
												<div style="position: absolute; right: -20px; top: -10px; cursor: pointer;" class="div_editelem">
													<img alt="{$lang.builder.edit_elem}" title="{$lang.builder.edit_elem}" class="editelement" src="{$site_root}{$template_root}/images/controls/icn_edit.gif">
												</div>
											</div>
                                        </td>
                                        <td width="0%">
                                            {if $item.is_system eq '1'}
                                            <div style="position: relative;">
												<div style="position: absolute; right: -50px; top: -10px;">
													<img title="{$lang.builder.is_system}" alt="{$lang.builder.is_system}" src="{$site_root}{$template_root}/images/controls/lock.png">
												</div>
                                            </div>
                                            {/if}
										</td>
									</tr>
								</table>
							</li>
							{/if}
							{/if}
							{/foreach}
						</ul>
                        <div style="height: 35px;">
                            <div style="position:relative">
                                <div style="position:absolute; width: 350px;">
                                    <div class="control" align="left" style="padding: 5px; display:none; float:left;">
                                        <a href="#" class="builder" onclick="Cancel($(this).parents('.portlet')); return false;"><img style="position: relative; top: 3px; padding-right: 0px;" alt="Cancel" id="cancel" src="{$site_root}{$template_root}/images/controls/cancel.png"></a><a href="#" class="builder" onclick="Cancel($(this).parents('.portlet')); return false;">{$lang.builder.cancel}</a>
                                    </div>
                                    <div class="control" align="right" style="padding: 5px 10px 5px 5px; display:none;">
                                        <a href="#" class="builder" onclick="ExitEditBlock($(this).parents('.portlet'), 1);return false;">
                                            <img style="position: relative; top: 3px; padding-right: 0px;" alt="OK" id="ok" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.save}');return false" src="{$site_root}{$template_root}/images/controls/new_ok.png">
                                        </a>
                                        <a href="#" class="builder" onclick="ExitEditBlock($(this).parents('.portlet'), 1);return false;">{$lang.builder.save_pos}</a>
                                    </div>
                                </div>
                                <div style="position:absolute; width: 350px;" class="edit_block builder">
                                    <div align="left" style="padding: 5px; float:left;">
                                        <a class="builder" href="#" onclick="EnterEditBlock($(this).parents('.portlet'), 1); return false;">
                                            <img alt="{$lang.builder.edit_elem}" title="{$lang.builder.edit_elem}" src="{$site_root}{$template_root}/images/controls/icn_edit.gif" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.edit}');return false">
                                        </a>
                                        <a class="builder" href="#" onclick="EnterEditBlock($(this).parents('.portlet'), 1); return false;">{$lang.builder.edit_page}</a>
                                    </div>
                                </div>
                            </div>
                        </div>
					</div>
				</div>
				{foreach item=item_page from=$pages name=item_page}
				{assign var="system" value=0}
				{if $item_page.id > 1}
					<div class="portlet" page_id="{$item_page.id}">
						<div class="portlet-header">
							<span class="padding-left-5">{$lang.builder.page} 1:</span>&nbsp;
							<div class="inline">{assign var="count" value=$item_page.id}{$lang.users.page[$count]}</div>
							<div class="inline" style="position:relative; top: 2px;">&nbsp;
								<a href="#" onclick="return false;"><img title="{$lang.builder.edit_header}" alt="{$lang.builder.edit_header}" src="{$site_root}{$template_root}/images/builder/pen.png"></a>
							</div>
						</div>
						<div class="portlet-content">
							<ul class="draw_area" style="list-style-type: none;margin: 0px; padding: 0px;">
								{foreach item=item from=$elements name=elements}
								{if $item.page eq $item_page.id}
								<li class="edit_section2{if $item.category eq 'text_del'} custom{/if}{if $item.category == 'partner_criteria' || $item.category == 'partner_interests'} help_text{/if}" category="{if $item.category eq 'text_del'}custom{else}{$item.category}{/if}" id_elem="{$item.id}" element_type="input_element">
									<table width="315px" style="padding-left:5px;">
										<tr>
											<td style="padding-left:5px;">
                                                <img id_elem="{$item.id}" class="info" src="{$site_root}{$template_root}/images/controls/information.png">
											</td>
											<td width="100%" class="elem_small_text" mandatory="{$item.mandatory}">
                                                {if $item.category eq 'custom'}
                                                    {if $lang.userspr[$item.name_for_lang] ne ''}
                                                        {$lang.userspr[$item.name_for_lang]}
                                                    {else}
                                                        {$item.name_for_lang}
                                                    {/if}
                                                {else}
                                                    {*if $lang.users[$item.name_for_lang] ne ''}
                                                        {$lang.users[$item.name_for_lang]*}
                                                    {if $lang.profile[$item.name_for_lang] ne ''}
                                                        {$lang.profile[$item.name_for_lang]}
                                                    {else}
                                                        {$item.name_for_lang}
                                                    {/if}
                                                {/if}
											</td>
                                            <td width="0%" class="control" style="display:none;">
                                                <div class="control" style="display:none; position: relative;">
                                                    {if $item.is_system eq '0'}
                                                    <div style="position: absolute; right: -50px; top: -10px; cursor: pointer;">
                                                        <img alt="{$lang.builder.del_elem}" title="{$lang.builder.del_elem}" class="deleteadd" src="{$site_root}{$template_root}/images/controls/icn_delete.gif">
                                                    </div>
                                                    {/if}
                                                    <div style="position: absolute; right: -20px; top: -10px; cursor: pointer;" class="div_editelem">
                                                        <img alt="{$lang.builder.edit_elem}" title="{$lang.builder.edit_elem}" class="editelement" src="{$site_root}{$template_root}/images/controls/icn_edit.gif">
                                                    </div>
                                                </div>
                                            </td>
                                            <td width="0%">
                                            	{if $item.is_system eq '1'}
                                            	{assign var="system" value=1}
                                            	<div style="position: relative;">
													<div style="position: absolute; right: -50px; top: -10px;">
														<img title="{$lang.builder.is_system}" alt="{$lang.builder.is_system}" src="{$site_root}{$template_root}/images/controls/lock.png">
													</div>
                                            	</div>
                                            	{/if}
                                            </td>
										</tr>
									</table>
								</li>
								{/if}
								{/foreach}
							</ul>
                            <div style="height: 35px;">
                                <div style="position:relative">
                                    <div style="position:absolute; width: 350px;">
                                        <div class="control" align="left" style="padding: 5px; display:none; float:left;">
                                            <a href="#" class="builder" onclick="Cancel($(this).parents('.portlet')); return false;"><img style="position: relative; top: 3px; padding-right: 0px;" alt="Cancel" id="cancel" src="{$site_root}{$template_root}/images/controls/cancel.png"></a><a href="#" class="builder" onclick="Cancel($(this).parents('.portlet')); return false;">{$lang.builder.cancel}</a>
                                        </div>
                                        <div class="control" align="right" style="padding: 5px 10px 5px 5px; display:none;">
                                            <a href="#" class="builder" onclick="ExitEditBlock($(this).parents('.portlet'), 1);return false;"><img style="position: relative; top: 3px; padding-right: 0px;" alt="OK" id="ok" src="{$site_root}{$template_root}/images/controls/new_ok.png"></a><a href="#" class="builder" onclick="ExitEditBlock($(this).parents('.portlet'), 1);return false;">{$lang.builder.save_pos}</a>
                                        </div>
                                    </div>
                                    <div style="position:absolute; width: 350px;" class="edit_block builder">
                                        <div align="left" style="padding: 5px; float:left;">
                                            <a class="builder" href="#" onclick="EnterEditBlock($(this).parents('.portlet'), 1); return false;">
                                                <img alt="{$lang.builder.edit_elem}" title="{$lang.builder.edit_elem}" src="{$site_root}{$template_root}/images/controls/icn_edit.gif">
                                            </a>
                                            <a class="builder" href="#" onclick="EnterEditBlock($(this).parents('.portlet'), 1); return false;">{$lang.builder.edit_page}</a>
                                        </div>
                                        <div align="right" style="padding: 5px 10px 5px 5px;">
                                        	{if $system ne 1 }
                                            <a class="delete_block builder" href="#" onclick="DeleteBlock($(this).parent()); return false;">
                                                <img alt="{$lang.builder.del_elem}" title="{$lang.builder.del_elem}" class="deleteadd" src="{$site_root}{$template_root}/images/controls/icn_delete.gif">
                                            </a>
                                            <a class="delete_block builder" href="#" onclick="DeleteBlock($(this).parent()); return false;">
                                                {$lang.builder.del_page}
                                            </a>
                                            {/if}
                                        </div>

                                    </div>
                                </div>
                            </div>
						</div>
					</div>	
				{/if}
				{/foreach}
			</div>

            <div class="portlet empty_block" page_id="0" style="display:none;">
                <div class="portlet-header">
                    <span class="padding-left-5">{$lang.builder.page} 1:</span>&nbsp;
                    <div class="inline">{$lang.builder.new_page_title}</div>
                    <div class="inline" style="position:relative; top: 2px;">&nbsp;
                        <a href="#" onclick="return false;"><img src="{$site_root}{$template_root}/images/builder/pen.png"></a>
                    </div>
                </div>
                <div class="portlet-content">
                    <ul class="draw_area" style="list-style-type: none; margin: 0; padding: 0; width: 60%;" >

                    </ul>
                </div>
                <div style="height: 35px;">
                    <div style="position:relative">
                        <div style="position:absolute; width: 350px;">
                            <div class="control" align="left" style="padding: 5px; display:none; float:left;">
                                <a href="#" class="builder" onclick="Cancel($(this).parents('.portlet')); return false;"><img style="position: relative; top: 3px; padding-right: 0px;" alt="Cancel" id="cancel" src="{$site_root}{$template_root}/images/controls/cancel.png"></a><a href="#" class="builder" onclick="Cancel($(this).parents('.portlet')); return false;">{$lang.builder.cancel}</a>
                            </div>
                            <div class="control" align="right" style="padding: 5px 10px 5px 5px; display:none;">
                                <a href="#" class="builder" onclick="ExitEditBlock($(this).parents('.portlet'), 1);return false;"><img style="position: relative; top: 3px; padding-right: 0px;" alt="OK" id="ok" src="{$site_root}{$template_root}/images/controls/new_ok.png"></a><a href="#" class="builder" onclick="ExitEditBlock($(this).parents('.portlet'), 1);return false;">{$lang.builder.save_pos}</a>
                            </div>
                        </div>
                        <div style="position:absolute; width: 350px;" class="edit_block builder">
                            <div align="left" style="padding: 5px; float:left;">
                                <a class="builder" href="#" onclick="EnterEditBlock($(this).parents('.portlet'), 1); return false;">
                                    <img alt="{$lang.builder.edit_elem}" title="{$lang.builder.edit_elem}" src="{$site_root}{$template_root}/images/controls/icn_edit.gif">
                                </a>
                                <a class="builder" href="#" onclick="EnterEditBlock($(this).parents('.portlet'), 1); return false;">{$lang.builder.edit_page}</a>
                            </div>
                            <div align="right" style="padding: 5px 10px 5px 5px;">
                                <a class="delete_block builder" href="#" onclick="DeleteBlock($(this).parent()); return false;">
                                    <img alt="{$lang.builder.del_elem}" title="{$lang.builder.del_elem}" class="deleteadd" src="{$site_root}{$template_root}/images/controls/icn_delete.gif">
                                </a>
                                <a class="delete_block builder" href="#" onclick="DeleteBlock($(this).parent()); return false;">
                                    {$lang.builder.del_page}
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

		</td>
        <td width="100%" valign="top">
			<div style="padding-top: 0px; position: relative;" id="prop_area">
				<div class="ui-widget-content enter_edit_element" style="padding: 2px; float: left; display: block; position: absolute; display: none; background: #f0f7ff;z-index:5;">
				<div class="ui-widget-header">
					<div style="padding-top: 0px; padding-bottom: 0px; ">
						<div style="position:relative;">
							<div style="position:absolute;left:-12px;top:2px;">
								<img src='{$site_root}{$template_root}/images/builder/arrow.gif'>
							</div>
						</div>
						<div style="position:relative;">
							<div style="position:absolute;right:3px;top:4px; cursor:pointer;" onclick="CancelEditElem();">
								<img src="{$site_root}{$template_root}/images/controls/icn_close_white.gif" alt="{$lang.builder.close_tools}" title="{$lang.builder.close_tools}">
							</div>
						</div>

                        <div style="display: table-cell; height:20px; vertical-align:middle; width: 100%;" >
						&nbsp; {$lang.builder.edit_element}
                        </div>
					</div>
				</div>
				<div class="edit_text" style="display: none; padding: 10px;">
					<input type="checkbox" id="mandatory" onclick="UpdateTooltipText();"> {$lang.builder.mandatory}{*<br>
                    <input type="checkbox" id="couple_box" onclick="UpdateTooltipText();"> {$lang.builder.couple}<br>*}
                    <div id="link_for_edit"></div>
                    <div id="captcha" style="padding: 10px; display: none;">
                        <input type="radio" name="captcha" value="1" {if !$use_recaptcha}checked{/if}> {$lang.builder.use_defcaptcha}<br>
                        <img style="padding-top: 5px;" src="{$site_root}{$admin_theme_path}{$index_theme_images_path}/captcha.jpg"><br>
                        <input type="radio" name="captcha" value="2" {if $use_recaptcha}checked{/if}> {$lang.builder.use_recaptcha}<br>
                        <img style="padding-top: 5px;" src="{$site_root}{$admin_theme_path}{$index_theme_images_path}/recaptcha.jpg"><br>
                        <div id="captcha_settings">
                            <table>
                                <tr>
                                    <td>
                                        {$lang.builder.pub_key}
                                    </td>
                                    <td>
                                        <input id="captcha_public_key" value="{$recaptcha_public_key}">
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        {$lang.builder.private_key}
                                    </td>
                                    <td>
                                        <input id="captcha_private_key" value="{$recaptcha_private_key}">
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <a href="#" onclick="SaveCaptcha(); return false;">{$lang.builder.save_captcha}</a>&nbsp;&nbsp;<span id="captcha_ok"></span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <br><br>
					<b>{$lang.builder.edit_label}</b><br><br>
					<textarea style="width: 450px; height: 100px;" id="wysiwyg"></textarea>
					<span style="display:none;" id="wysiwyg_span"></span>
					<script language="JavaScript" type="text/javascript">
						sels = ' Textbox ';
						opts['textbox'] = new Array("Text box", "Right", "Left");
						vals['textbox'] = new Array("","<div style='float:right;width:200px;border:1px solid;padding:.5em;margin:0 5px;'>&nbsp;","<div style='float:left;width:200px;border:1px solid;padding:.5em;margin:0 5px;'>&nbsp;");
						makeWhizzyWig("wysiwyg", dbuts + buts);
					</script>
				</div>

				<div class="edit_input" style="display: none; padding: 10px;">
					{*<b>{$lang.builder.edit_input}</b>
					<br><br>*}
					{$lang.builder.input_pos}<br>
					<input type="radio" id="position" name="position" value="left" onchange="SetPosition(this.value);"> {$lang.builder.pos_left}<br>
					<input type="radio" id="position" name="position" value="right" onchange="SetPosition(this.value);"> {$lang.builder.pos_right}<br>
					<input type="radio" id="position" name="position" value="top" onchange="SetPosition(this.value);"> {$lang.builder.pos_top}<br>
					<input type="radio" id="position" name="position" value="bottom" onchange="SetPosition(this.value);"> {$lang.builder.pos_bottom}<br>
				</div>
				<div style="height: 35px;">
                    <div style="position: relative; top: 22px; left:22px;">
                        <div style="position: absolute; top: 0px; left: -252px; margin-top: 0px;" id="element_tooltip" class="yCallout">
                            <div class="yCalloutTop"></div>
                            <div class="yCalloutHead">
                                {$lang.builder.elem_preview}
                                <hr style="border: 0; height: 2px; color: #e0e0b3; background-color:#e0e0b3;"/>
                            </div>
                            <div class="yCalloutBody">
                                <div>
                                    <p></p>
                                </div>
                            </div><div class="yCalloutBottom"></div>
                        </div>
                    </div>
					<div class="control" align="left" style="padding: 5px; float:left;">
						<a href="#" class="builder" onclick=""><img style="position: relative; top: 3px; padding-right: 0px;" alt="Preview" id="preview" src="{$site_root}{$template_root}/images/builder/preview.png"></a>
						<a href="#" class="builder" onclick="">{$lang.builder.preview}</a>
					</div>
					<div class="control" align="center" style="padding: 5px; float:left;">
						<a href="#" class="builder" onclick="CancelEditElem();return false;"><img style="position: relative; top: 3px; padding-right: 0px;" alt="Cancel" id="cancel" src="{$site_root}{$template_root}/images/controls/cancel.png"></a><a href="#" class="builder" onclick="CancelEditElem();return false;">{$lang.builder.cancel}</a>
					</div>
					<div class="control" align="right" style="padding: 5px 10px 5px 5px; float:left;">
						<a href="#" class="builder" onclick="SaveText();return false;"><img style="position: relative; top: 3px; padding-right: 0px;" alt="OK" id="ok" src="{$site_root}{$template_root}/images/controls/new_ok.png"></a><a href="#" class="builder" onclick="SaveText();return false;">{$lang.builder.save_changes}</a>
					</div>
				</div>
			</div>
				<div class="before_edit_element" style="float: left; display: none; position: absolute; padding-right: 10px;">
					{include file="$site_path/$admin_theme_path/admin_builder_tools.tpl"}
				</div>
			</div>
		</td><td>&nbsp;</td></tr></table>
		{/if}
	</div>

    <div id="tabs-2">
		{if $tabs eq 1}
		{include file="$site_path/$admin_theme_path/admin_builder_tab1.tpl"}
		{/if}
	</div>
    <div id="tabs-3">
		{if $tabs eq 2}
		{include file="$site_path/$admin_theme_path/admin_builder_tab2.tpl"}
		{/if}
    </div>
    <div id="tabs-4">
		{if $tabs eq 3}
		{include file="$site_path/$admin_theme_path/admin_builder_tab3.tpl"}
		{/if}
    </div>
</div> {* tabs *}
{/strip}
{literal}
<script language="JavaScript" type="text/javascript">
var doeval = "";
var tabnum='{/literal}{$tabs}{literal}';
{/literal}
{foreach item=item from=$lang.users.page name=elements}
{assign var="count" value=$smarty.foreach.elements.iteration}
{literal}
    var flag = 1;
    $(".portlet").each(function(){
         if($(this).attr("page_id") == "{/literal}{$count}{literal}"){
             flag = 0;
         }
    });
    if(flag){
        if("{/literal}{$lang.users.page[$count]}{literal}" != "{/literal}{$lang.builder.new_page_title}{literal}")
            doeval = doeval + CreateNewBlock("{/literal}{$lang.users.page[$count]}{literal}");
    }
{/literal}
{/foreach}
</script>
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
{/literal}		
</script>
{include file="$admingentemplates/admin_bottom.tpl"}
