var iStar;

		var starPos = 0;
	
		function moveStar() {
			$("#pRating").css("background-position", "0px -128px");
		}

		$(document).ready(
			function() {
			    $("#pRating").hover(
					function(e) {
					    //alert(e);
					    $("#xp").text(e.pageX - this.offsetLeft)
					    $("#yp").text(e.pageY - this.offsetTop)
					},
					function() {
					    $("#xp").text("0")
					    $("#yp").text("0")
					}
				);

			    $("#pRating").mousemove(
					function(e) {
					    if (iStar == undefined) {
					        iStar = $("#pRating").css("background");
					    }
					    $("#xp").text(e.clientX - $(this).offset().left)
					    //$("#yp").text(e.pageY - $(this).offset().top)
					    var starWidth = parseInt(parseInt($("#pRating").css("width")) / 5)
					    var starHeight = parseInt($("#pRating").css("height"))
					    starPos = Math.ceil((e.clientX - $(this).offset().left) / starWidth)
					    $("#yp").text(starPos);
					    if (starPos > 5)
					        starPos = 5;
					    if (starPos < 1)
					        starPos = 1;
					    $("#star").text(starPos)
					    $("#pRating").css("background-position", "0 -" + ((starPos * 2) * starHeight) + "px");
					}
				).mouseout(
					function() {
					    if (iStar != undefined) {
					        $("#pRating").css("background", iStar);
					    }
					}
				);
			}
		);
				
		function setStar(pId) {
			if(starPos !=0 & pId != undefined) {
				//alert(starPos);
				window.location = "/Reviews/?pid=" + pId + "&rating=" + starPos
			}
		}