$(function(){
	var dpClassName;
	var dpClassID;
	var dpText="";
	var dpTextC="";
	var dpstarAmount="";
	var arrDpStar=new Array('','很差','差','一般','不错','很好');

	$(".clearfix em").each(function() {
		starAmount=parseFloat($("#hide_"+$(this).attr("id")).val());
		starAmount=parseInt(starAmount+0.5);
		if(starAmount==0)
			starAmount=5;
		$(this).removeClass().addClass("selectS" +starAmount);
		$(this).next().text(arrDpStar[starAmount]);
	});

	$(".selectStar em a").bind("click",function(){
		dpClassName = "selectS" + $(this).attr("id");
		dpClassID = $(this).parent().attr("id");
		$(this).parent().removeClass().addClass(dpClassName);		
		dpTextC =arrDpStar[$(this).attr("id")] ;
		$(this).parent().next().text(dpTextC);		
		$(this).parent().next().next().val($(this).attr("id"));
		return false;
	})	
	.bind("mouseover",function(){
		dpTextC =arrDpStar[$(this).attr("id")] ;
		$(this).parent().removeClass().addClass("selectS" + $(this).attr("id"));
		$(this).parent().next().text(dpTextC);
	})	
	.bind("mouseout",function(){
		$(this).parent().removeClass("selectS" + $(this).attr("id"));
		if($(this).parent().attr("id") == dpClassID){
			$(this).parent().addClass(dpClassName);
		}
		$(this).parent().next().text(dpTextC);
	});
	$("#dpStar1").find("a").each(function(){
			$(this).unbind( "click" );
			$(this).unbind("mouseover");
			$(this).unbind("mouseout");
		});
});
