text: define([],
  	function () {
  		return function SettingsPopupTabLayout(titleContainer, contentcontainer)
  		{
  			$(contentcontainer).find('.layout-box button').fastClick(onLayoutChange);
  
  			this.init = function(settings)
  			{
  				var index;
  				if( settings.name == "side-panel" ) {
  					index = 0;
  				} else if( settings.name == "three-panel" ) {
  					index = 1;
  				} else {
  					index = 2;
  				}
  				selectLayout(
  					index
  					/*,
  					settings.placardUnder*/
  				);
  				//$(contentcontainer).find('.layout1opt').prop('checked', settings.placardUnder);
  				$(contentcontainer).find('.useLocBtn').prop('checked', settings.locationButton ? 'checked' : '');
  
  				/* Index.html code
  				 * // Select the placard position (point title and caption) between "under" and "hover"
  				 * // That option is only valid when using "three-panel" layout
  				 * placardPosition: "hover",
  				 */
  			};
  
  			this.show = function()
  			{
  				//
  			};
  
  			this.save = function()
  			{
  				return {
  					name: getSelectedlayout(),
  					locationButton: $(contentcontainer).find('.useLocBtn').is(':checked')/*,
  					placardUnder: getLayoutOption()*/
  				};
  			};
  
  			function getSelectedlayout()
  			{
  				if( $(contentcontainer).find('.layout-box.selected').index() === 0 ) {
  					return "side-panel";
  				} else if( $(contentcontainer).find('.layout-box.selected').index() == 1 ) {
  					return "three-panel";
  				} else {
  					return "integrated";
  				}
  			}
  
  			/*
  			function getLayoutOption()
  			{
  				return $(contentcontainer).find('.layout1opt').is(":checked");
  			}
  			*/
  
  			/*
  			function onLayout1OptionChange()
  			{
  				selectLayout(0, getLayoutOption());
  			}
  			*/
  
  			function onLayoutChange(event)
  			{
  				var index = $(event.target).parent().parent().index();
  				selectLayout(index/*, getLayoutOption()*/);
  			}
  
  			function selectLayout(index/*, option*/)
  			{
  				$(contentcontainer).find('.layout-box').removeClass("selected");
  				$(contentcontainer).find('.layout-box').eq(index).addClass("selected");
  
  				/*
  				if (index === 0) {
  					$(contentcontainer).find('.layout-box:nth-child(2) img').eq(0).attr("src", option ? "resources/icons/builder-professional-layout-under.png" : "resources/icons/builder-professional-layout.png");
  					$(contentcontainer).find('.layout1opt').removeAttr("disabled");
  					$(contentcontainer).find('.layoutOption').css("opacity", 1.0);
  				}
  				else {
  					$(contentcontainer).find('.layout1opt').attr("disabled", "disabled");
  					$(contentcontainer).find('.layoutOption').css("opacity", 0.5);
  				}
  				*/
  			}
  
  			this.initLocalization = function()
  			{
  				$(titleContainer).html(i18n.viewer.builderHTML.settingsTabLayout);
  
  				//$(contentcontainer).find('p').html(i18n.viewer.builderHTML.settingsLayoutExplain);
  				$(contentcontainer).find('.layout-box:nth-child(1) div').eq(0).html(i18n.viewer.builderHTML.settingsLayoutSidePanel + "<span class='newLayout'>" + i18n.viewer.builderHTML.settingsLayoutNew.toUpperCase() + "</span>");
  				$(contentcontainer).find('.layout-box:nth-child(1) img').eq(0).attr("src", "resources/icons/builder-side-panel-layout.png");
  				$(contentcontainer).find('.layout-box:nth-child(2) div').eq(0).html(i18n.viewer.builderHTML.settingsLayoutProfessional);
  				//$(contentcontainer).find('.layout-box:nth-child(2) div').eq(1).html('<input type="checkbox" class="layout1opt"/> ' + 'Place the placard under the media <a class="layoutOptionTooltip"><img src="resources/icons/builder-help.png" style="vertical-align: -4px;"/></a>');
  				$(contentcontainer).find('.layout-box:nth-child(2) img').eq(0).attr("src", "resources/icons/builder-professional-layout.png");
  				$(contentcontainer).find('.layout-box:nth-child(3) div').eq(0).html(i18n.viewer.builderHTML.settingsLayoutModern);
  				$(contentcontainer).find('.layout-box:nth-child(3) img').attr("src", "resources/icons/builder-modern-layout.png");
  				$(contentcontainer).find('.layout-box .selectedLayout').html(i18n.viewer.builderHTML.settingsLayoutSelected);
  				$(contentcontainer).find('.layout-box button').html(i18n.viewer.builderHTML.settingsLayoutSelect);
  
  				//$(contentcontainer).find('.layout1opt').change(onLayout1OptionChange);
  				/*
  				$(contentcontainer).find('.layoutOptionTooltip').popover({
  					trigger: 'hover',
  					placement: 'right',
  					html: true,
  					content: i18n.viewer.builderHTML.settingsLayoutNote
  				});
  				*/
  
  				$(contentcontainer).find('.layoutOption').html('<input type="checkbox" class="useLocBtn"/> ' + i18n.viewer.builderHTML.settingsLayoutLocBtn + ' <a class="useLocBtnTooltip"><img src="resources/icons/builder-help.png" style="vertical-align: -4px;"/></a>');
  				$(contentcontainer).find('.useLocBtnTooltip').popover({
  					trigger: 'click',
  					placement: 'top',
  					html: true,
  					content: '<img src="resources/icons/builder-settings-locate.png" style="position: absolute; top: 12px; left: 10px;"/>'
  								+ '<div style="margin-left: 30px; min-height: 65px;">' + i18n.viewer.builderHTML.settingsLayoutLocBtnHelp + '</div>'
  				});
  			};
  		};
  	}
  );
  