<!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.lblAdmin} : {$language.lblEmailTemplats}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link href="{$view_styles}/inner-formlisting.css" rel="stylesheet" type="text/css" />
<link href="{$view_styles}/right-menu.css" rel="stylesheet" type="text/css" />
{include file='CommonCustomStyles.tpl'}
</head>
<body>
<div class="outer_container">
  {include file='CommonTop.tpl'}
  <!--End:Header Container-->
  <!--***********************************************************************START CONTAINER SECTION******************************************************-->
  <div class="content_container2">   
    <div class="right-sidebar">
      <div class="side_wrapper">
        {include file="EmailTemplateSectionRightLinks.tpl"}
      </div>
    </div>
    <!--End: Right Block-->
    <div class="left_wrapper">
    <div class="content_wrapper">
	<div class="strict_fixing_right">
	{form->select name="brandID" value=$brandID options=$listBrand style="float:right;width:150px;margin-left:5px;padding:2px 5px"}
	   {include file='ContentLanguageOptions.tpl'}
	   </div>
       <h2> {$emailTempLabel}</h2>
	   
        <!-- Inner Content Container starts-->
      <div class="inner_content_wrapper">       
          <div id="common_message" ></div> 
           <div class="form_listing form_listing03">{form->start action="" method="post" name="emailTemplateSection"}            
            {form->hidden name="section"}            
            {form->hidden name="emailTempSecID"}        	
        	<ul>
            	{if $sectionContent|strstr:'{$contactEmailAdress}'}
				<li class="clearfix">
                	<div class="leftside01 mandatory">&nbsp;</div>
                    <div class="rightside01">{$language.lblNB} <strong>{$language.lblContactAddressNote|cat:' {$contactEmailAdress} '|cat:$language.lblWith} youremail@example.com.</strong>
                    </div>
                </li>
				{/if}
                <li class="clearfix">
               	  <div class="leftside01 mandatory">{$emailTempLabel}</div>
                    <div class="rightside01">
                     {form->editor  name="sectionContent" rows="20" cols="40" mode="simple" skin=2 uploads="editor-images/" validate="sectionContentHidden->isequal->1~*sectionContent->required" error=$language.errTextContent}
                     
                      {form->hidden name="sectionContentHidden"}
                    </div>
                </li>                
                <li>
                    <div class="submit-block clearfix"> 
                        <span>&nbsp; </span>
                        <div class="leftside01">&nbsp;  <label>{$language.lblCopyTemplates}</label>{form->select name="copybrandID" options=$copylistBrands style="width:150px;margin-left:5px;padding:2px 5px" caption="->{$language.lblSelect}" }	
	 {form->button name="copytemplates" class="curve-3" value="{$language.lblCopy}"}</div>
                    	<div class="rightside01">
                        {form->submit name="submitSection" value="{$language.lblSave}" class="curve-3"} <!-- {$language.lblOr}
                        {html->anchor href="/emailtemplate/" tabindex="1" caption="{$language.lblCancel}"}  -->
						
                         </div>
						
                    </div>
                </li>
            </ul>
           {form->close}
        </div>
          <!--End:From Listing-->
        </div>
        <!--End:Border 3-->
      </div>
      <!--End:Border 2-->
    </div>
    <!--End: left Block-->
    <div class="clear"></div>
  </div>
  <!--***********************************************************************END CONTAINER SECTION******************************************************-->
  <!--End:Content Container-->
  {include file='CommonBottom.tpl'}
</div>
<!--End:Outer Container-->
{include file='CommonJavaScriptBottom.tpl'}
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('.side_wrapper ul li a[rel=EmailTemplatesSection]').addClass('selected'); 
	setSideMenu();
	
	$("#brandID").change(function(){ 
		var id			=	$('#brandID').val();
		window.location.href = GLOBAL_BASE_PATH+"/emailtemplate/edit/section/bottom/brandID/"+ id+"/";
	});
	$("#copytemplates").click(function(){ 
		if($('#copybrandID').val()!="") {
		var brandID			=	$('#brandID').val();
		var copybrandID		=	$('#copybrandID').val();
		$.ajax({
			type: "GET",
			url: GLOBAL_BASE_PATH+"/emailtemplate/ajaxCopyTemplates/section/bottom/brandID/"+brandID+"/copybrandID/"+copybrandID+"/",
			success: function(msg){ 
				location.reload();
			 }
		 });
		} 
	});	
});
</script>
<script type="text/javascript" >
$('#emailTemplateSection').submit(function(){
  var sectionText =  $('#sectionContent').val();
  if($.trim(sectionText=='')){
           $('#sectionContentHidden').val(1);
       }
       else{
           $('#sectionContentHidden').val(2);
       }
})
</script>
{form->editor_script names="sectionContent"}
{html->messages_script id="common_message"}
{form->validate_script form="emailTemplateSection"}
</body>
</html>
