(function(){
	$(document).ready(function(){

		$('#btnNewAd').click(function(){
			//location.href = $('#hiddenData').attr('new-ad-url');
			alert("Not implemented yet.");
		});

		$('#content ul.content-item-list li input, #chkToggle').change(function(){
			$('#btnSave').removeAttr('disabled');
		});

		$('#chkToggle').click(function(){
			$("input[name='active[]']").attr('checked', this.checked);
		});

		$("input[name='displayorder[]']").spinner({
			step:1,
			numberformat:'n',
			min:0,
			max:20,
			spin:function(){
				$('#btnSave').removeAttr('disabled');
			}
		});

		$('.content-item-list li:even').addClass('odd');

	});
})(jQuery);