{*<!--

+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+

-->*}
{if $showAddZone}
    <img src='{$assetPath}/images/icon-zone-new.gif' border='0' align='absmiddle'>&nbsp;<a href='zone-edit.php?affiliateid={$affiliateid}' accesskey='{$keyAddNew}'>{t str=AddNewZone_Key}</a>&nbsp;&nbsp;
    {phpAds_ShowBreak}
{/if}
<br /><br />

{include file=form/general-errors.html errors=$zoneErrors title=ErrorEditingZone text=UnableToChangeZone}

{if $zoneid}
    {*// Only display the notices when *changing* a zone, not for new zones*}
    <div class='errormessage' id='warning_change_zone_type' style='display:none'> <img class='errormessage' src='{$assetPath}/images/errormessage.gif' align='absmiddle' />
        <span class='tab-r'> {t str=Warning}:</span><br />
        {t str=WarnChangeZoneType}
    </div>

    <div class='errormessage' id='warning_change_zone_size' style='display:none'> <img class='errormessage' src='{$assetPath}/images/warning.gif' align='absmiddle' />
        <span class='tab-s'> {t str=Notice}:</span><br />
        {t str=WarnChangeZoneSize}
    </div>

    {if $errors}
        <div class='errormessage'><img class='errormessage' src='{$assetPath}/images/errormessage.gif' align='absmiddle'>
            <span class='tab-r'>{t str=ErrorEditingZone}</span><br><br>";
            {t str=UnableToChangeZone}
            {foreach from=$errors item=aError }
	            $aError->message<br>
	        {/foreach}
        </div>
    {/if}
{/if}


{*zone form*}
{include file=form/form.html form=$form}
{*/zone form*}


<script language='JavaScript'>
<!--
{if $zoneHeight != null && $zoneHeight != ''}
    document.zoneHeight ='{$zoneHeight}';
{/if}
{if $zoneWidth != null && $zoneWidth != ''}
    document.zoneWidth ='{$zoneWidth}';
{/if}

{literal}
    function phpAds_formSelectSize(o)
    {
        // Get size from select
        size   = o.options[o.selectedIndex].value;

        if (size != '-')
        {
            // Get width and height
            sarray = size.split('x');
            height = sarray.pop();
            width  = sarray.pop();

            // Set width and height
            document.zoneform.width.value = width;
            document.zoneform.height.value = height;

            // Set radio
            document.zoneform.sizetype[0].checked = true;
            document.zoneform.sizetype[1].checked = false;
        }
        else
        {
            document.zoneform.sizetype[0].checked = false;
            document.zoneform.sizetype[1].checked = true;
        }
    }

    function phpAds_formEditSize()
    {
        document.zoneform.sizetype[0].checked = false;
        document.zoneform.sizetype[1].checked = true;
        document.zoneform.size.selectedIndex = document.zoneform.size.options.length - 1;
    }

    function phpAds_formDisableSize()
    {
        document.zoneform.sizetype[0].disabled = true;
        document.zoneform.sizetype[1].disabled = true;
        document.zoneform.width.disabled = true;
        document.zoneform.height.disabled = true;
        document.zoneform.size.disabled = true;
    }

    function phpAds_formEnableSize()
    {
        document.zoneform.sizetype[0].disabled = false;
        document.zoneform.sizetype[1].disabled = false;
        document.zoneform.width.disabled = false;
        document.zoneform.height.disabled = false;
        document.zoneform.size.disabled = false;
    }

    function oa_sizeChangeUpdateMessage(id)
    {
        if (document.zoneWidth != document.zoneform.width.value ||
            document.zoneHeight !=  document.zoneform.height.value) {
                oa_show(id);

        } else if (document.zoneWidth == document.zoneform.width.value &&
                   document.zoneHeight ==  document.zoneform.height.value) {
            oa_hide(id);
        }
    }

    function oa_show(id)
    {
        var obj = findObj(id);
        if (obj) { obj.style.display = 'block'; }
    }
    function oa_hide(id)
    {
        var obj = findObj(id);
        if (obj) { obj.style.display = 'none'; }
    }
{/literal}
//-->
</script>