    $(document).ready(function(){      
        $("#chooseRating img").hover(function(){
            $("#chooseRating img").attr("src", "-images/stars/small/star_off.gif");
            $("#chooseRating img:lt("+($("#rating").val())+")").attr("src", "-images/stars/small/star_on.gif");
            var id = $(this).attr("id");
            var legend = $(this).attr("alt");
            $("#ratingLegend").html( legend );  
            $("#chooseRating img").each(function(n){
                if( $(this).attr("id") == id )
                {
                    $("#chooseRating img:lt("+(n+1)+")").attr("src", "-images/stars/small/star_on.gif");
                } 
                $(this).click(function(){
                    $("#rating").val(n+1);
                    var legend = $("#star_"+(n+1)).attr("alt");
                    $("#ratingLegend").html( legend ).fadeOut("slow", function(){$(this).fadeIn()});
                })
                
            });
        }, function(){
            if( $("#rating").val() == 0 )
            {
                $("#ratingLegend").empty();
            }
            else
            {
                $("#ratingLegend").html( $("#star_"+$("#rating").val()).attr("alt") );
            }

            $("#chooseRating img").attr("src", "-images/stars/small/star_off.gif");
            $("#chooseRating img:lt("+($("#rating").val())+")").attr("src", "-images/stars/small/star_on.gif");
        }) 
        

        $("#privacy_policy, #review_guidelines, #terms_and_conditions, #example_review").fancybox({
            overlayOpacity:0.8,
            frameWidth:720,
            zoomSpeedIn: 500, 
            zoomSpeedOut: 500,
            zoomOpacity: true,
            easingIn:	'swing',
    		easingOut:	'swing',
    		easingChange:	'swing',
        }); 
        
        $(".detailsButton").hover(function(e){
            $(".detailsDiv").css("left", e.pageX);
            $(".detailsDiv").css("top", e.pageY + 5);             
            $(".detailsDiv").css("display", "block");
        },function(e){
            setTimeout(function(){$(".detailsDiv").css("display", "none")}, 500);                              
        });
  
    }); 
