{{ header }}{{ column_left }}
<div id="content">
<div class="page-header">
	<div class="container-fluid">
		<div class="pull-right">
			<button type="submit" form="form-slideshow-plus" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
			<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a>
		</div>
		<h1>{{ heading_title }}</h1>
		<ul class="breadcrumb">
			{% for breadcrumb in breadcrumbs %}
			<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
			{% endfor %}
		</ul>
	</div>
</div>
<div class="container-fluid">
	{% if error_warning %}
	<script>
		usNotify('warning', '{{ error_warning }}');
	</script>
	{% endif %}
	<div class="panel panel-default">
		<div class="panel-heading">
			<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
		</div>
		<div class="panel-body">
			<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-slideshow-plus" class="form-horizontal">
				<div class="form-group">
					<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
					<div class="col-sm-10">
						<div class="toggle-group">
							<input type="checkbox" name="status" {% if status %}checked="checked"{% endif %} id="status" tabindex="1">
							<label for="status"></label>
							<div class="onoffswitch pull-left" aria-hidden="true">
								<div class="onoffswitch-label">
									<div class="onoffswitch-inner"></div>
									<div class="onoffswitch-switch"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="form-group required">
					<label class="col-sm-2 control-label" for="input-name">{{ entry_name }}</label>
					<div class="col-sm-10">
						<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
						{% if error_name %}
						<div class="text-danger">
							<script>
								usNotify('warning', '{{ error_name }}');
							</script>
						</div>
						{% endif %}
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="banner_image_full">{{ entry_full_img }}</label>
					<div class="col-sm-10">
						<div class="toggle-group">
							<input type="checkbox" name="full" {% if full %}checked="checked"{% endif %} id="banner_image_full" tabindex="1">
							<label for="banner_image_full"></label>
							<div class="onoffswitch pull-left" aria-hidden="true">
								<div class="onoffswitch-label">
									<div class="onoffswitch-inner"></div>
									<div class="onoffswitch-switch"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-6">
						<label class="col-sm-4 control-label" for="status_additional_banners">{{ entry_additional_banners }}</label>
						<div class="col-sm-8">
							<div class="toggle-group">
								<input type="checkbox" name="status_additional_banners" {% if status_additional_banners %}checked="checked"{% endif %} id="status_additional_banners" tabindex="1">
								<label for="status_additional_banners"></label>
								<div class="onoffswitch pull-left" aria-hidden="true">
									<div class="onoffswitch-label">
										<div class="onoffswitch-inner"></div>
										<div class="onoffswitch-switch"></div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="form-group" id="position_view" {% if (status_additional_banners is not defined or (status_additional_banners is defined and not status_additional_banners)) %}style="display:none;"{% endif %}>
					<div class="col-sm-6">
						<label class="col-sm-4 control-label" for="input-timer_view">{{ entry_timer_view }}</label>
						<div class="col-sm-8">
							<div class="toggle-group">
								<input type="checkbox" name="timer_view" {% if timer_view %}checked="checked"{% endif %} id="timer_view" tabindex="1">
								<label for="timer_view"></label>
								<div class="onoffswitch pull-left" aria-hidden="true">
									<div class="onoffswitch-label">
										<div class="onoffswitch-inner"></div>
										<div class="onoffswitch-switch"></div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-sm-6">
						<label class="col-sm-4 control-label" for="input-position_banners">{{ entry_position_banners }}</label>
						<div class="col-sm-8">
							<select name="position_banners" class="form-control" id="position_banners">
							<option value="0" {% if position_banners == 0 %}selected="selected"{% endif %}>{{ entry_position_banners_0 }}</option>
							<option value="1" {% if position_banners == 1 %}selected="selected"{% endif %}>{{ entry_position_banners_1 }}</option>
							</select>
						</div>
					</div>
				</div>
				<ul class="nav nav-tabs">
					<li id="sliders_view" class="active"><a href="#tab-settings_slides" data-toggle="tab"><i class="fa fa-picture-o" aria-hidden="true"></i> {{ text_slides }}</a></li>
					<li id="discount_products_view" {% if (status_additional_banners is not defined or (status_additional_banners is defined and not status_additional_banners)) %}style="display:none;"{% endif %}><a href="#tab-discount-products" data-toggle="tab"><i class="fa fa-sticky-note-o" aria-hidden="true"></i> {{ text_additional_banners }}</a></li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane active" id="tab-settings_slides">
						<div class="form-group row">
							<div class="col-sm-2">
								<ul class="nav nav-pills nav-stacked" id="settings">
									{% set image_row = 0 %}
									{% for oct_slideshow_plus_image in oct_slideshow_plus_images %}
									<li class="slide-li{{ image_row }}"><a href="#image-row{{ image_row }}" data-toggle="tab"><span class="delete-block-in" onclick="removeImage({{ image_row }});"><i class="fa fa-minus-circle"></i></span> {{ oct_slideshow_plus_image.title }}</a></li>
									{% set image_row = image_row + 1 %}
									{% endfor %}
								</ul>
								<ul class="nav nav-pills nav-stacked">
									<li><a href="javascript:;" onclick="addImage(); updateActive(); return false;" id="add_slide"><i class="fa fa-plus-circle"></i> {{ entry_add_new_slide }}</a></li>
								</ul>
							</div>
							<div class="col-sm-10">
								<div class="tab-content" id="slideshow-setting-block">
									{% set image_row = 0 %}
									{% for oct_slideshow_plus_image in oct_slideshow_plus_images %}
									<div class="tab-pane" id="image-row{{ image_row }}">
										<div class="col-sm-12">
											<legend style="padding-bottom:10px;" class="clearfix">
												<div class="pull-left">{{ text_settings_slides }}</div>
											</legend>
											<ul class="nav nav-tabs" id="language_slide{{ image_row }}">
												{% for language in languages %}
												<li><a href="#slide_language{{ language.language_id }}-{{ image_row }}" data-toggle="tab"><img src="language/{{ language.code }}/{{ language.code }}.png" title="{{ language.name }}" />  {{ language.name }}</a></li>
												{% endfor %}
											</ul>
											<div class="tab-content">
												{% for language in languages %}
												<div class="tab-pane" id="slide_language{{ language.language_id }}-{{ image_row }}">
													<div class="form-group is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}>
														<label class="col-sm-2 control-label" for="input-title{{ language.language_id }}">{{ entry_title }}</label>
														<div class="col-sm-10">
															<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][oct_slideshow_plus_image_description][{{ language.language_id }}][title]" value="{{ oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id] is defined ? oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id].title : '' }}" placeholder="{{ entry_title }}" class="form-control"/>
															{% if (error_oct_slideshow_plus_image[image_row][language.language_id] is defined) %}
															<div class="text-danger">
																<script>
																	usNotify('warning', '{{ error_oct_slideshow_plus_image[image_row][language.language_id] }}');
																</script>
															</div>
															{% endif %}
														</div>
													</div>
													<div class="form-group is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}>
														<label class="col-sm-2 control-label" for="input-button{{ language.language_id }}">{{ entry_button }}</label>
														<div class="col-sm-10">
															<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][oct_slideshow_plus_image_description][{{ language.language_id }}][button]" value="{{ oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id] is defined ? oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id].button : '' }}" placeholder="{{ entry_title }}" class="form-control"/>
														</div>
													</div>
													<div class="form-group is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}>
														<label class="col-sm-2 control-label" for="input-description{{ language.language_id }}">{{ entry_description }}</label>
														<div class="col-sm-10">
															<textarea name="oct_slideshow_plus_image[{{ image_row }}][oct_slideshow_plus_image_description][{{ language.language_id }}][description]" class="form-control">{{ oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id] is defined ? oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id].description : '' }}</textarea>
														</div>
													</div>
													<div class="form-group">
														<label class="col-sm-2 control-label" for="input-link{{ language.language_id }}">{{ entry_link }}</label>
														<div class="col-sm-10">
															<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][oct_slideshow_plus_image_description][{{ language.language_id }}][link]" value="{{ oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id] is defined ? oct_slideshow_plus_image.oct_slideshow_plus_image_description[language.language_id].link : '' }}" placeholder="{{ entry_link }}" class="form-control"/>
														</div>
													</div>
													<div class="form-group">
														<div class="col-sm-6">
															<label class="col-sm-4 control-label" for="slide-banner_image">{{ entry_image }}</label>
															<div class="col-sm-8">
																<a href="" id="thumb-image{{ image_row }}{{ language.language_id }}" data-toggle="image" class="img-thumbnail"><img src="{{ oct_slideshow_plus_image.thumb[language.language_id] is defined ? oct_slideshow_plus_image.thumb[language.language_id] : placeholder }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
																<input type="hidden" name="oct_slideshow_plus_image[{{ image_row }}][image][{{ language.language_id }}]" value="{{ oct_slideshow_plus_image.image[language.language_id] is defined ? oct_slideshow_plus_image.image[language.language_id] : '' }}" id="input-image{{ image_row }}{{ language.language_id }}" />
															</div>
														</div>
														<div class="col-sm-6 oct-slide-mobile_image">
															<label class="col-sm-4 control-label" for="slide-mobile_image">{{ entry_mobile_image }}</label>
															<div class="col-sm-8">
																<a href="" id="thumb-mobile_image{{ image_row }}{{ language.language_id }}" data-toggle="image" class="img-thumbnail"><img src="{{ oct_slideshow_plus_image.mobile_thumb[language.language_id] is defined ? oct_slideshow_plus_image.mobile_thumb[language.language_id] : placeholder }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
																<input type="hidden" name="oct_slideshow_plus_image[{{ image_row }}][mobile_image][{{ language.language_id }}]" value="{{ oct_slideshow_plus_image.mobile_image[language.language_id] is defined ? oct_slideshow_plus_image.mobile_image[language.language_id] : '' }}" id="input-mobile_image{{ image_row }}{{ language.language_id }}" />
															</div>
														</div>
													</div>
												</div>
												{% endfor %}
											</div>
											<div class="form-group">
												<label class="col-sm-2 control-label" for="input-sort-order">{{ entry_sort_order }}</label>
												<div class="col-sm-10">
													<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][sort_order]" value="{{ oct_slideshow_plus_image.sort_order }}" placeholder="{{ entry_sort_order }}" class="form-control"/>
												</div>
											</div>
											<div class="is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}>
												<div class="form-group">
													<label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_background_color }}</label>
													<div class="col-sm-10">
														<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][background_color]" value="{{ oct_slideshow_plus_image['background_color'] }}" placeholder="{{ entry_background_color }}" class="form-control spectrum"/>
													</div>
												</div>
												<div class="form-group">
													<label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_title_color }}</label>
													<div class="col-sm-10">
														<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][title_color]" value="{{ oct_slideshow_plus_image.title_color }}" placeholder="{{ entry_title_color }}" class="form-control spectrum"/>
													</div>
												</div>
												<div class="form-group">
													<label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_text_color }}</label>
													<div class="col-sm-10">
														<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][text_color]" value="{{ oct_slideshow_plus_image.text_color }}" placeholder="{{ entry_text_color }}" class="form-control spectrum"/>
													</div>
												</div>
												<div class="form-group">
													<label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_button_color }}</label>
													<div class="col-sm-10">
														<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][button_color]" value="{{ oct_slideshow_plus_image.button_color }}" placeholder="{{ entry_button_color }}" class="form-control spectrum"/>
													</div>
												</div>
												<div class="form-group">
													<label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_button_background }}</label>
													<div class="col-sm-10">
														<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][button_background]" value="{{ oct_slideshow_plus_image.button_background }}" placeholder="{{ entry_button_background }}" class="form-control spectrum"/>
													</div>
												</div>

												<div class="form-group">
													<label class="col-sm-2 control-label" for="slide-button_color_hover">{{ entry_button_color_hover }}</label>
													<div class="col-sm-10">
														<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][button_color_hover]" value="{{ oct_slideshow_plus_image.button_color_hover }}" placeholder="{{ entry_button_color_hover }}" class="form-control spectrum"/>
													</div>
												</div>
												<div class="form-group">
													<label class="col-sm-2 control-label" for="slide-button_background_hover">{{ entry_button_background_hover }}</label>
													<div class="col-sm-10">
														<input type="text" name="oct_slideshow_plus_image[{{ image_row }}][button_background_hover]" value="{{ oct_slideshow_plus_image.button_background_hover }}" placeholder="{{ entry_button_background_hover }}" class="form-control spectrum"/>
													</div>
												</div>
											</div>
										</div>
										<script>
											$('#language_slide{{ image_row }} a:first').tab('show');
										</script>
									</div>
									{% set image_row = image_row + 1 %}
									{% endfor %}
								</div>
							</div>
						</div>
					</div>
					<div class="tab-pane" id="tab-discount-products">
						<legend>{{ text_settings_additional_banners }}</legend>
						<div class="tab-content">
							<div class="form-group" id="oct_discount_products">
								<label class="col-sm-2 control-label" for="input-product">{{ entry_product }}</label>
								<div class="col-sm-10">
									<input type="text" name="product" value="" placeholder="{{ entry_product }}" id="input-product" class="form-control" />
									<div id="discount-product" class="well well-sm" style="height: 150px; overflow: auto;">
										{% for product in products %}
										<div id="discount-product{{ product['product_id'] }}"><i class="fa fa-minus-circle"></i> {{ product['name'] }}
											<input type="hidden" name="oct_discount_products[]" value="{{ product['product_id'] }}" />
										</div>
										{% endfor %}
									</div>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script>
	$('input[name=\'product\']').autocomplete({
		source: function(request, response) {
			$.ajax({
				url: 'index.php?route=catalog/product/autocomplete&user_token={{ user_token }}&filter_name=' +  encodeURIComponent(request),
				dataType: 'json',
				cache: false,
				success: function(json) {
			    		response($.map(json, function(item) {
						return {
							label: item['name'],
							value: item['product_id']
						}
					}));
				}
			});
		},
		select: function(item) {
	    		$('input[name=\'product\']').val('');
			$('#discount-product' + item['value']).remove();
			$('#discount-product').append('<div id="discount-product' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="oct_discount_products[]" value="' + item['value'] + '" /></div>');
		}
	});

	$('#discount-product').delegate('.fa-minus-circle', 'click', function() {
		$(this).parent().remove();
	});
</script>
<script>
	var image_row = {{ image_row }};

	function addImage() {
		html  = '<div class="tab-pane" id="image-row' + image_row + '">';
		html += '<div class="col-sm-12">';
		html += '<legend style="padding-bottom:10px;" class="clearfix"><div class="pull-left">{{ text_settings_slides }}</div></legend>';
		html += '<ul class="nav nav-tabs" id="language_slide' + image_row + '">';
		{% for language in languages %}
		html += '<li><a href="#slide_language{{ language.language_id }}-' + image_row + '" data-toggle="tab"><img src="language/{{ language.code }}/{{ language.code }}.png" title="{{ language.name }}" />  {{ language.name }}</a></li>';
		{% endfor %}
		html += '</ul>';
		html += '<div class="tab-content">';
		{% for language in languages %}
		html += '<div class="tab-pane" id="slide_language{{ language.language_id }}-' + image_row + '">';
		html += '<div class="form-group is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}><label class="col-sm-2 control-label" for="input-title{{ language.language_id }}">{{ entry_title }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][oct_slideshow_plus_image_description][{{ language.language_id }}][title]" value="" placeholder="{{ entry_title }}" class="form-control"/></div></div>';
		html += '<div class="form-group is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}><label class="col-sm-2 control-label" for="input-button{{ language.language_id }}">{{ entry_button }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][oct_slideshow_plus_image_description][{{ language.language_id }}][button]" value="" placeholder="{{ entry_title }}" class="form-control"/></div></div>';
		html += '<div class="form-group is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}><label class="col-sm-2 control-label" for="input-description{{ language.language_id }}">{{ entry_description }}</label><div class="col-sm-10"><textarea name="oct_slideshow_plus_image[' + image_row + '][oct_slideshow_plus_image_description][{{ language.language_id }}][description]" class="form-control"></textarea></div></div>';
		html += '<div class="form-group"><label class="col-sm-2 control-label" for="input-link{{ language.language_id }}">{{ entry_link }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][oct_slideshow_plus_image_description][{{ language.language_id }}][link]" value="" placeholder="{{ entry_link }}" class="form-control"/></div></div>';
		html += '<div class="form-group"><div class="col-sm-6"><label class="col-sm-4 control-label" for="slide-banner_image">{{ entry_image }}</label><div class="col-sm-8"><a href="" id="thumb-image' + image_row + '{{ language.language_id }}" data-toggle="image" class="img-thumbnail"><img src="{{ placeholder }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a><input type="hidden" name="oct_slideshow_plus_image[' + image_row + '][image][{{ language.language_id }}]" value="" id="input-image' + image_row + '{{ language.language_id }}" /></div></div><div class="col-sm-6 oct-slide-mobile_image"><label class="col-sm-4 control-label" for="slide-mobile_image">{{ entry_mobile_image }}</label><div class="col-sm-8"><a href="" id="thumb-mobile_image' + image_row + '{{ language.language_id }}" data-toggle="image" class="img-thumbnail"><img src="{{ placeholder }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a><input type="hidden" name="oct_slideshow_plus_image[' + image_row + '][mobile_image][{{ language.language_id }}]" value="" id="input-mobile_image' + image_row + '{{ language.language_id }}" /></div></div></div>';
		html += '</div>';
		{% endfor %}
		html += '</div>';
		html += '<div class="form-group"><label class="col-sm-2 control-label" for="input-sort-order">{{ entry_sort_order }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][sort_order]" value="" placeholder="{{ entry_sort_order }}" class="form-control"/></div></div>';
		html += '<div class="is_not_full" {% if full is defined and full %}style="display:none;"{% endif %}>';
		html += '<div class="form-group"><label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_background_color }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][background_color]" value="{{ oct_default_colors.background_color }}" placeholder="{{ entry_background_color }}" class="form-control spectrum"/></div></div>';
		html += '<div class="form-group"><label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_title_color }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][title_color]" value="{{ oct_default_colors.title_color }}" placeholder="{{ entry_title_color }}" class="form-control spectrum"/></div></div>';
		html += '<div class="form-group"><label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_text_color }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][text_color]" value="{{ oct_default_colors.text_color }}" placeholder="{{ entry_text_color }}" class="form-control spectrum"/></div></div>';
		html += '<div class="form-group"><label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_button_color }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][button_color]" value="{{ oct_default_colors.button_color }}" placeholder="{{ entry_button_color }}" class="form-control spectrum"/></div></div>';
		html += '<div class="form-group"><label class="col-sm-2 control-label" for="slide-banner_image_button_color">{{ entry_button_background }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][button_background]" value="{{ oct_default_colors.button_background }}" placeholder="{{ entry_button_background }}" class="form-control spectrum"/></div></div><div class="form-group"><label class="col-sm-2 control-label" for="slide-button_color_hover">{{ entry_button_color_hover }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][button_color_hover]" value="{{ oct_default_colors.button_color_hover }}" placeholder="{{ entry_button_color_hover }}" class="form-control spectrum"/></div></div><div class="form-group"><label class="col-sm-2 control-label" for="slide-button_background_hover">{{ entry_button_background_hover }}</label><div class="col-sm-10"><input type="text" name="oct_slideshow_plus_image[' + image_row + '][button_background_hover]" value="{{ oct_default_colors.button_background_hover }}" placeholder="{{ entry_button_background_hover }}" class="form-control spectrum"/></div></div>';
		html += '</div>';
		html += '</div>';
		html += '</div>';

		html2 = "<li class='slide-li" + image_row + "'><a href='#image-row" + image_row + "' data-toggle='tab'><span class='delete-block-in' onclick='removeImage(" + image_row + ");'><i class='fa fa-minus-circle'></i></span> {{ entry_new_slide }}</a></li>";

		$('#slideshow-setting-block').append(html);
		$('#settings').append(html2);

		$('#settings li').removeClass('active');

		$("#settings .slide-li" + image_row + " a").tab('show');

		image_row++;

		initSpectrum();

		checkFullImage();

		if ($('#banner_image_full').is(":checked")) {
		    $(".is_not_full").hide();
		} else {
		    $(".is_not_full").show();
		}
	}

	function removeImage(image_row) {
		$("#image-row" + image_row).remove();
		$(".slide-li" + image_row).remove();

		$('#settings a:first').tab('show');
	}
</script>
<script>
	function initSpectrum() {
		$(".spectrum").spectrum({
			preferredFormat: "rgb",
			showInitial: true,
			showInput: true,
			showAlpha: true,
			showPalette: true,
			palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]]
		});
	}

	initSpectrum();
</script>
<script>
	function updateActive() {
		$('.nav.nav-tabs').each(function () {
			$(this).children().children().first().tab('show');
		});
	}

	$('#settings a:first').tab('show');

	function checkFullImage() {
			const currentState = $('#banner_image_full').is(":checked");

			if (currentState === false) {
				$(".oct-slide-mobile_image").css('display', 'none');
			}
	}

	checkFullImage();

</script>
<script>
$(function() {
	$('#status_additional_banners').change(function() {
        var $input = $(this);

        if ($input.is(":checked")) {
            $("#discount_products_view").slideDown('slow');
            $("#position_view").slideDown('slow');
        } else {
            $("#discount_products_view").slideUp('slow');
            $("#position_view").slideUp('slow');
            $("#sliders_view a").click();
        }
    });

	$('#banner_image_full').change(function() {
        var $input_full = $(this);

        if ($input_full.is(":checked")) {
            $(".is_not_full").slideUp('slow');
						$(".oct-slide-mobile_image").slideDown('slow');
        } else {
            $(".is_not_full").slideDown('slow');
						$(".oct-slide-mobile_image").slideUp('slow');
        }
    });
});
</script>
{{ footer }}
