<script src="http://www.google.com/jsapi"></script>
<script>
// Load jQuery
google.load("jquery", "1.2.6");
</script>
<script>
$(function() {
//apply mouseover handlers
$("#map_rating_choices area").mouseover(function(e){
e.preventDefault();
$("#rating_choices").attr("src","/i/stars"+$(this).attr("value")+".gif");
});
//apply click handlers
$("#map_rating_choices area").click(function(e){
// stop normal link click
e.preventDefault();
// send request
$.ajax({
type: "POST",
url: "wwv_flow.show",
data: {p_arg_names:"P2_RATING",
p_arg_values:$(this).attr("value"),
p_flow_id:$('#pFlowId').attr("value"),
p_flow_step_id:$('#pFlowStepId').attr("value"),
p_instance:$('#pInstance').attr("value"),
p_request:"APPLICATION_PROCESS=NEW_RATING"
},
dataType: "json",
success: function(data, textStatus){
$("#rating").html(
"Thanks for rating, current average: " +
'<img src="/i/stars'+data[0].average+'.gif" alt="'+data[0].average+'" />'+
", number of votes: " +
data[0].count
);
}
});
});
});
</script> |