var stringDiv;
$(function()
{
	$('span.delete').hide();
	$('div.delete').hide();
	$('a.delete').click(function() {
		$(this).parent().find('.delete').show();
		return false;
	});
	$('a.no').click(function() {
		$(this).parent().hide();
		return false;
	});
	$("#roster").sortable({
		cursorAt: 'top',
		items: 'li',
		update : function () {
			stringDiv = "";
			$("#roster").children().each(function(i) {
			  stringDiv += " "+$(this).attr("id") + '=' + i + '&';
			});

			 $.ajax({
			   type: "POST",
			   url: "/admin/content/update_roster_list",
			   data: stringDiv
			 });
		  
		  }
		});
	$("#dock_list").sortable({
		cursorAt: 'top',
		items: 'li',
		update : function () {
			stringDiv = "";
			$("#dock_list").children().each(function(i) {
			  stringDiv += " "+$(this).attr("id") + '=' + i + '&';
			});

			 $.ajax({
			   type: "POST",
			   url: "/admin/content/update_dock_list",
			   data: stringDiv
			 });
		  
		  }
		});
		$('#dock').Fisheye(
			{
				maxWidth: 50,
				items: 'a',
				itemsText: 'span',
				container: '.dock-container',
				itemWidth: 50,
				proximity: 90,
				halign : 'center'
			}
		);
	$('#menu li.branches').hover(function() {
		$(this).parent().find('ul').show();
		$(this).addClass('branches-on');
		$(this).removeClass('branches');
	},
	function() {
		$(this).parent().find('ul').hide();
		$(this).addClass('branches');
		$(this).removeClass('branches-on');
	});
});