{{if $edit==1}}


 <SCRIPT language=javascript>
// JavaScript Document



$(function(){



	var tmp;

	$('.otherdrag').each(function(){
		tmp = $(this).css('z-index');
		if(tmp>zIndex) zIndex = tmp;
		 $(this).css('z-index',0);
	})


 make_draggable($('.otherdrag'));


});

var zIndex = 0;

     
      







function make_draggable(elements){



	elements.draggable({

handle:'h6',
		opacity: 0.8,
		containment:'parent',
		start:function(e,ui){ ui.helper.css('z-index',++zIndex);  },
		stop:function(e,ui){
$.get('update_position.php',{
				  x		: ui.position.left,
				  y		: ui.position.top,
				  z		: zIndex,

				  id	: ui.helper.context.id

	});


		}
	});


}


//ÓÒ¼ü²Ëµ¥


</SCRIPT>


{{else}}

{{/if}}
