$(document).ready(function() {
	$("#left").sortable({
		connectWith: ['#right'],
		update: function() {
			var left_arr = $("#left").sortable("toArray");
			var left_bar = left_arr.join();
			$.post("/user/index/box", {sidebar: "left", boxes: left_bar});
		}
	});
	$("#right").sortable({
		connectWith: ['#left'],
		update: function() {
			var right_arr = $("#right").sortable("toArray");
			var right_bar = right_arr.join();
			$.post("/user/index/box", {sidebar: "right", boxes: right_bar});
		}
	});
	$(".box").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
		.find(".box-title")
			.addClass("ui-widget-header ui-corner-all")
			.end()
		.find(".box-content");
});

//$("#box-toggle").click(function(event) {
//	event.preventDefault();
//	$("#box-1").slideToggle();
//})

function star_over(el) {
//	if(el.className == 'star_rated') return false;
	var temp = new Array();
	temp = el.id.split('_');
	id = temp[1];
	for(var index = 1; index <= id; index++) {
		document.getElementById('star_'+index).className = 'star_on';
	}
	for(var index = 10; index > id; index--) {
		document.getElementById('star_'+index).className = 'star_off';
	}
}

function star_out(el) {
	if(el.className == 'star_rated') return false;
	var temp = new Array();
	temp = el.id.split('_');
	id = temp[1];
	for(var index = 1; index <= id; index++) {
		document.getElementById('star_'+index).className = 'star_off';
	}
}

function star_click(el) {
	var temp = new Array();
	temp = el.id.split('_');
	id = temp[1];
	for(var index = 1; index <= id; index++) {
		document.getElementById('star_'+index).className = 'star_rated';
	}
}

function slideChange() {}
