<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAffiliate} : {if $affiliateWidgetDetailID|default:''}{$language.lblEditWidget}{else}{$language.lblCreateWidget}{/if}</title>
{include file='CommonStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/jquery.multiselect.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/create-widget.css"/>
<link rel="stylesheet" type="text/css" href="{$view_styles}/widget-page.css" />
{include file='CommonJavaScript.tpl'}
<script type="text/javascript" src="{$view_javascript}/jquery.cycle.all.js"></script>
</head>
<body>
<!-- Outer container starts-->
<div class="outer_container"> 
  <!-- Header Container starts--> 
  {include file='CommonTop.tpl'} 
  <!-- Header Container ends--> 
  <!-- Content Container starts-->
  <div class="content_container"> 
    <!-- left wrapper starts-->
    <div class="content_wrapper">
    <div class="submit-block"> {html->anchor href={$previousURl} caption=$language.lblBack class="fixing_right textlink01"}</div>
      <h2>{if $affiliateWidgetDetailID|default:''}{$language.lblEditWidget} - {$resWidgetDetails.widgetName}{else}{$language.lblCreateWidget}{/if}</h2>
      <!-- Inner Content Container starts-->
      <div class="clearfix">
        <div class="widgetGeneratorHolder fixing_left">
          <div class="widgetGenerator">
          {form->start name="widgetForm" id="widgetForm" method="post" action=""}
          {form->hidden name="widgetMode" value=$widgetMode}
           {if $affiliateWidgetDetailID|default:''}
            {form->hidden name="affiliateWidgetDetailID" value=$affiliateWidgetDetailID|default:''}
            {/if}            
            <ul>
              <li>
                <div class="widgetExpand expand"><span>{$language.lblBasicInfo}</span></div>
                <ul class="widgetSections widgetExpandSection">
                  <li class="clearfix">
                    <div class="left fixing_left">
                      <label>{$language.lblWidgetName}</label>
                    </div>
                    <div class="right fixing_left">
                      {form->textbox name="widgetName" value={$resWidgetDetails.widgetName|default:''} class="textbox" autocomplete="off"}  
                    </div>
                  </li>
                  <li class="clearfix">
                    <div class="left fixing_left">
                      <label>{$language.lblProductCategory}</label>
                    </div>
                    <div class="right fixing_left">
                    {if $resWidgetDetails.widgetProductCategories|default:''}
                    {assign var=widgetProductCategories value=","|explode:$resWidgetDetails.widgetProductCategories}
                    {else}
                    {$widgetProductCategories=array()}
                    {/if}
                  	<select name="widgetCategory[]" multiple="multiple" class="widgetCategory" id="widgetCategory">
                    {foreach from=$resCategoryTree item="resCategoryTreeItem"}
                  <option value="{$resCategoryTreeItem.0}" {if in_array($resCategoryTreeItem.0, $widgetProductCategories)}selected="selected"{/if}>{$resCategoryTreeItem.1}</option>
                  {/foreach}
                    </select>
                    </div>
                  </li>
				  <li class="clearfix">
                    <div class="left fixing_left">
                      <label>{$language.lblFilters}</label>
                    </div>
                    <div class="right fixing_left combowrap">
                      <div class="clearfix">
                      {form->select name="widgetFilter" options=$resWidgetFilters class="singleSelectClass" value=$widgetFilter value=$resWidgetDetails.widgetFilter|default:''}     
                      </div>
                    </div>
                  </li>
                </ul>
              </li>
              <li>
                <div class="widgetExpand "><span>{$language.lblSettings}</span></div>
                <ul class="widgetSections widgetExpandSection">
                  <li class="clearfix">
                    <div class="left fixing_left">
                      <label>{$language.lblWidgetContentType}</label>
                    </div>
                    <div class="right fixing_left">
                      {form->select name="affiliateWidgetContentType" class="singleSelectClass" options="Image_with_Text->{$language.lblImageWithText}~*Text_Only->{$language.lblTextOnly}" value=$resWidgetDetails.affiliateWidgetContentType|default:''}                    
                    </div>
                  </li>
                  <li class="clearfix">
                    <div class="left fixing_left">
                      <label>{$language.lblWidgetType}</label>
                    </div>
                    <div class="right fixing_left combowrap">
                      <div class="clearfix">
                      {form->select name="affiliateWidgetContent" options="Iframe->{$language.lblIframe}~*JS->{$language.lblJS}" class="singleSelectClass" value=$resWidgetDetails.widgetType|default:''}      
                      </div>
                    </div>
                  </li>
                  <li class="clearfix">
                    <div class="left fixing_left">
                      <label>{$language.lblLanguage}</label>
                    </div>
                    <div class="right fixing_left combowrap">
                      <div class="clearfix">
                      {form->select name="languageID" options=$view_common_languages class="singleSelectClass" value=$preferredLang}                                          
                      </div>
                    </div>
                  </li>
                </ul>
              </li>
              <li>
                <div class="widgetExpand "><span>{$language.lblAppearance}</span></div>
                <ul class="widgetSections widgetExpandSection">
                  <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblTextColor}</label>
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.textColor|default:''}
                    {assign var=affiliateWidgetTextColor value=$widgetAppearance.textColor|replace:'#':''}
                    {else}
                    {assign var=affiliateWidgetTextColor value="262626"}
                    {/if}
                    {form->textbox name="affiliateWidgetTextColor" value=$affiliateWidgetTextColor class="color &#123;onImmediateChange:'generateWidget();'&#125;" autocomplete="off"  readonly="readonly" maxlength="6"}                      
                    </div>
                  </li>
                  <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblHeaderColor}</label>
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.headerColor|default:''}
                    {assign var=affiliateWidgetHeaderColor value=$widgetAppearance.headerColor|replace:'#':''}
                    {else}
                    {assign var=affiliateWidgetHeaderColor value="859d10"}
                    {/if}
                    {form->textbox name="affiliateWidgetHeaderColor" value=$affiliateWidgetHeaderColor class="color &#123;onImmediateChange:'generateWidget();'&#125;" autocomplete="off" readonly="readonly" maxlength="6"}     
                    </div>
                  </li>
                  <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblBackgroundColor}</label>
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.backgroundColor|default:''}
                    {assign var=affiliateWidgetBackgroundColor value=$widgetAppearance.backgroundColor|replace:'#':''}
                    {else}
                    {assign var=affiliateWidgetBackgroundColor value="FFFFFF"}
                    {/if}
                    {form->textbox name="affiliateWidgetBackgroundColor" value=$affiliateWidgetBackgroundColor class="color &#123;onImmediateChange:'generateWidget();'&#125;" autocomplete="off" style="background-color: rgb(255, 255, 255); color:#000;width:20%;" readonly="readonly" maxlength="6"} 
                    </div>
                  </li>
				   <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblProductPriceTextColor}</label>
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.productPriceTextColor|default:''}
                    {assign var=widgetRegualarPriceTextColor value=$widgetAppearance.productPriceTextColor|replace:'#':''}
                    {else}
                    {assign var=widgetRegualarPriceTextColor value="EF3244"}
                    {/if}
                    {form->textbox name="widgetProductPriceTextColor" value=$widgetRegualarPriceTextColor class="color &#123;onImmediateChange:'generateWidget();'&#125;" autocomplete="off" readonly="readonly" maxlength="6"} 
                    </div>
                  </li> 
                  <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblRegualarPriceTextColor}</label>
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.regualarPriceTextColor|default:''}
                    {assign var=widgetRegualarPriceTextColor value=$widgetAppearance.regualarPriceTextColor|replace:'#':''}
                    {else}
                    {assign var=widgetRegualarPriceTextColor value="999999"}
                    {/if}
                    {form->textbox name="widgetRegualarPriceTextColor" value=$widgetRegualarPriceTextColor class="color &#123;onImmediateChange:'regularPriceConstraints();'&#125;" autocomplete="off" style="background-color: rgb(0, 0, 0); color:#fff;width:20%;" readonly="readonly" maxlength="6"} 
                    </div>
                  </li>                                    
                   <!-- <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblDiscountTextColor}</label>
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.discountTextColor|default:''}
                    {assign var=widgetDiscountTextColor value=$widgetAppearance.discountTextColor|replace:'#':''}
                    {else}
                    {assign var=widgetDiscountTextColor value="F00"}
                    {/if}
                    {form->textbox name="widgetDiscountTextColor" value=$widgetDiscountTextColor class="color &#123;onImmediateChange:'generateWidget();'&#125;" autocomplete="off"  readonly="readonly" maxlength="6"} 
                    </div>
                  </li> -->
                  <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblGrabButtonColor}</label>
					  <br/>[ {$language.lblLargeOnly} ]
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.grabButtonColor|default:''}
                    {assign var=affiliateWidgetGrabButtonColor value=$widgetAppearance.grabButtonColor|replace:'#':''}
                    {else}
                    {assign var=affiliateWidgetGrabButtonColor value="BAD001"}
                    {/if}
                    {form->textbox name="affiliateWidgetGrabButtonColor" value=$affiliateWidgetGrabButtonColor class="color &#123;onImmediateChange:'grabButton();'&#125;" autocomplete="off" readonly="readonly" maxlength="6"}                       
                    </div>
                  </li>
                  <li class="clearfix">
                    <div class="left01 fixing_left">
                      <label>{$language.lblGrabButtonTextColor}</label>
					   <br/>[ {$language.lblLargeOnly} ]
                    </div>
                    <div class="right01 fixing_left">
                    {if $widgetAppearance.grabButtonTextColor|default:''}
                    {assign var=affiliateWidgetGrabButtonTextColor value=$widgetAppearance.grabButtonTextColor|replace:'#':''}
                    {else}
                    {assign var=affiliateWidgetGrabButtonTextColor value="FFFFFF"}
                    {/if}
                    {form->textbox name="affiliateWidgetGrabButtonTextColor" value=$affiliateWidgetGrabButtonTextColor class="color &#123;onImmediateChange:'grabButton();'&#125;" autocomplete="off" readonly="readonly" maxlength="6"} 
                    </div>
                  </li>
                </ul>
              </li>
              <li>
                <div class="widgetExpand "><span>{$language.lblDimensions}</span></div>
                <ul class="widgetSections widgetExpandSection">
                {form->hidden name="affiliateWidgetFormat" value=$resWidgetDetails.widget_format|default:''}  
                {form->hidden name="affiliateWidgetSize" value=$resWidgetDetails.affiliateProductSizeID|default:''}   
                  <li id="tabs" class="clearfix">
                    <div class="tabsHeader">
                      <ul>
                      {assign var="widgetSizesCounter" value=1}
                      {foreach from=$widgetSizes item="widgetSizesItem" key="widgetSizesKey"}
                      {if $resWidgetDetails.widget_format|default:'' == $widgetSizesKey}
                      {assign var="addLiClassActive" value="active"}
                      {assign var="addTabContentClassHide" value=""}
                      {elseif $resWidgetDetails.widget_format|default:''}
                      {assign var="addLiClassActive" value=""}
                      {assign var="addTabContentClassHide" value="hide"}
                      {else}
                      {assign var="addLiClassActive" value=""}
                      {assign var="addTabContentClassHide" value=""}
                      {/if}
                      <li class="clearfix widgetDimensions {$addLiClassActive}"><a rel="{$widgetSizesKey}" href="#tab-{$widgetSizesCounter}"
                      {if $widgetSizesKey eq 'Sidebar'}
                      class= "widjetsidebar">
                      <img height="46" width="27" src="{$view_images}/widget-sidebar.gif" hspace="0" vspace="0" /><br />                      
                      {$language.lblSidebar}
                      {else if $widgetSizesKey eq 'Large'}
                      class= "widjetlarge">
                      <img src="{$view_images}/widget-large.gif" width="60" height="48" /><br />
                      {$language.lblLarge}
                      {else if $widgetSizesKey eq 'Banner'}
                      class= "widjetbanner">
                      <img src="{$view_images}/widget-banner.gif" width="60" height="19" /><br />
                      {$language.lblBanner}
                      {/if} 
                      </a>
                      <div class="tabContents {$addTabContentClassHide}" id="tab-{$widgetSizesCounter}">
                      <ul class="WidgetSize">
                      {assign var="widgetSizesCounterInner" value=1}                                           
                      {foreach from=$widgetSizesItem item="widgetSizesItemInd"}  
					  {assign var="affiliateProductSize" value=$widgetSizesItemInd.affiliateProductWidthPx|cat:'*'|cat:$widgetSizesItemInd.affiliateProductHeightPx}	
                      {if $resWidgetDetails.affiliateProductSizeID|default:'' == $affiliateProductSize}
                      {assign var="addClassActive" value="active"}
                      {elseif $widgetSizesCounterInner eq 1 && $resWidgetDetails.affiliateProductSizeID|default:'' eq ''}
                      {assign var="addClassActive" value="active"}
                      {elseif $widgetSizesCounterInner eq 1 && $resWidgetDetails.widget_format != $widgetSizesKey}
                      {assign var="addClassActive" value="active"}
                      {else}
                      {assign var="addClassActive" value=""} 
                      {/if}
                      <li class="WidgetSizeInd {$addClassActive}" id="WidgetSize_{$affiliateProductSize}"><span class="width-{$widgetSizesItemInd.affiliateProductWidthPx}">&nbsp;</span><br />
                      {$affiliateProductSize}
                      </li>
                      {assign var=widgetSizesCounterInner value=$widgetSizesCounterInner+1}
                      {/foreach}                      
                      </ul>
                      </div>
                      </li>
                      {assign var=widgetSizesCounter value=$widgetSizesCounter+1}
                      {/foreach}                      
                      </ul>
                    </div>
                  </li>
                </ul>
              </li>
            </ul>
          {form->close}  
          </div>
          <div class="getCodeButton">{$language.lblSaveAndGetCode}</div>
        </div>
        <div class="widget-preview fixing_left">
          <div id="previewDiv" class="preview"> 
          </div>
          <div class="getWidgetCode" id="getWidgetCode" style="display:none;">{$language.lblGetCode}
          {form->textarea name="copyCode"} 
          </div>
        </div>
      </div>
      <!-- Inner Content Container ends-->
      <div class="clear"></div>
    </div>
    <!-- left wrapper ends--> 
    <!-- right side bar starts--> 
    <!-- right side bar ends-->
    <div class="clear"></div>
  </div>
  <!-- Content Container ends--> 
  <!-- Footer starts--> 
  {include file='CommonBottom.tpl'} 
  <!-- Footer ends--> 
</div>
{form->basepath_script}
{form->rootpath_script}

<script type="text/javascript">
var selectText = "{$language.lblSelect}";
var siteUrl = "{$siteUrl}";
var httpsSiteUrl = "{$httpsSiteUrl}";
var errProductCategory = "{$language.errProductCategory}";
var errWidgetName = "{$language.errWidgetName}";
var lblLoadingWidget = "{$language.lblLoadingWidget}";
var affiliateWidgetDetailID = '';
var currencyForJS = '';
var lblCheckAll ="{$language.lblCheckAll}" ;
var lblUncheckAll ="{$language.lblUncheckAll}" ;
var lblSelectOptions ="{$language.lblSelectOptions}" ;
var lblHashSelected ="{$language.lblHashSelected}";
var lblSelectCity='{$language.lblSelectCities}';
var lblSelectBusiness = "{$language.lblSelectBusiness}";
var lblselected 	= "{$language.lblselected}";
{if $affiliateWidgetDetailID|default:''}
affiliateWidgetDetailID = '{$affiliateWidgetDetailID|default:''}';
{/if} 
</script>
<script type="text/javascript" src="{$view_javascript}/jquery.multiselect.widget.js"></script>
<script type="text/javascript" src="{$view_javascript}/ajax.widget.page.js"></script>
<script type="text/javascript" src="{$view_javascript}/affiliate.widget.page.js"></script>
<script type="text/javascript" src="{$view_javascript}/jscolor/jscolor.js"></script>
<script>
$(document).ready(function(e) {
$('.main_menu').find("a[rel='manageWidget']").addClass('active');
});
</script>
</body>
</html>
