/* Author: 

*/

$(document).ready(function() {
	
	$('.toggleable').toggle();
	
	$('.toggle').click(function(){
		$(this).next().slideToggle( 'normal' );
		if( ! $(this).is( ':checkbox' ) ) {
			return false;
		}
	});

	$('dt span').css('display','block');

	$('.form_edit').css('display','none');
	
	$('.edit-control, .add-control').click(function() {
		$(this).next().slideToggle( 'fast' )
	});

	$('.status_success').delay(5000).slideUp();

	$('.form_submit_delete').click(function() {
		var c = confirm('Are you sure you wish to delete this question?');
		return c;
	});

	$("#faq_category_list").sortable({
		opacity: 0.6, cursor: 'move', update: function() {
			var order = $(this).sortable("serialize") + '&pageaction=update_faq_category_order';
			$.post("/admin/update_order", order, function(theResponse){
				$("#contentRight").html(theResponse);
			});
		}
	});

	$("#practice_list").sortable({
		opacity: 0.6, cursor: 'move', update: function() {
			var order = $(this).sortable("serialize") + '&pageaction=update_practice_order';
			$.post("/admin/update_order", order, function(theResponse){
				$("#contentRight").html(theResponse);
			});
		}
	});

	$("#doctor_list").sortable({
		opacity: 0.6, cursor: 'move', update: function() {
			var order = $(this).sortable("serialize") + '&pageaction=update_doctor_order';
			$.post("/admin/update_order", order, function(theResponse){
				$("#contentRight").html(theResponse);
			});
		}
	});

	$("label.in").inFieldLabels();

});


$(function() {
    $('.wysiwyg').wysiwyg({
		controls: {
			strikeThrough: { visible: false },
			underline: { visible: false },
			justifyLeft: { visible: false },
			justifyCenter: { visible: false },
			justifyRight: { visible: false },
			justifyFull: { visible: false },
			indent: { visible: false },
			outdent: { visible: false },
			subscript: { visible: false },
			superscript: { visible: false },
			insertImage: { visible: false },
			code: { visible: false },
			cut: { visible: true },
			copy: { visible: true },
			paste: { visible: true },
			html: { visible: true },
			insertTable: { visible: false }
		}	
	});
});




















