$(document).ready(function(){
//	$("p").click(function(){
//		$(".content").show();
//	});
//	$(".x").click(function(){
//		$(".content").hide();
//	}); 
////	var theRoot   = document.getElementById("root");
//
//	$(".menu_box").each(function(i){
//		var theHandle = this.childNodes[0];
//		var theRoot = this;
//
//		Drag.init(theHandle,theRoot);
//		//o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper
//	});
//	
//	var theRoot = $(".menu_box")[0];
////	Drag.init(theRoot);
//	
//	$(".menu_box").mouseup(function(){
//		var position = $(this).position();
////		alert("left: " + position.left + ", top: " + position.top);
//	}) 
	$(".hidden").hide();
 
	$('.show').toggle(
		function(){
			$(this).parent().find('.hidden').fadeIn();
		},
		function(){
			$(this).parent().find('.hidden').fadeOut();
		}
	);	
	
	$('.change').click(function(){
		var $id = $(this).find('#icon_id').val();
		$('.type').hide();
		$("#"+$id).show();
	});
	
	var $position = $('#menu_bg').offset();
	var $p_top = $position.top;
	var $p_left = $position.left;
	var $top = new Array(); 
	var $left = new Array();
	$('.menu_box').each(function(i){
   		$top[i] = parseInt($(this).css('top'));
   		$left[i] = parseInt($(this).css('left'));
		$(this).css("top",$top[i]+$p_top);
   		$(this).css("left",$left[i]+$p_left);
 	});
 	$(window).resize(function(){
	  	var $position = $('#menu_bg').offset();
		var $p_top = $position.top;
		var $p_left = $position.left;
		$('.menu_box').each(function(i){

			$(this).css("top",$top[i]+$p_top);
	   		$(this).css("left",$left[i]+$p_left);
	 	});
	});
});

//alert($("#name"));//
