(function($){
	$(document).ready(function(){
		//step 4 initial page
		if ($('#sitebuilderForm_step4').length===1) {

			$('#btnNewTemplate').click(function(){
				location.href = $('#hiddenData').attr('new-template-url');
			});

			$('select[name=controls-list]').change(function(){
				//$('#btnSave').removeAttr('disabled');
			});

			$('.content-item-list').sortable({
				placeholder: "page-row-highlight",
				update: function(event, ui){
					//$('#btnSave').removeAttr('disabled');
				},
				start:function(event, ui){
					ui.placeholder.height(ui.item.height());
				}
			}).disableSelection();

		}
		//step 4 create new page
		else {
			$('.content-fields input, .content-fields textarea, .content-fields select').change(function(){
				//$('#btnSave').removeAttr('disabled');
			});
		}
	});
})(jQuery);