var sMax;	// Isthe maximum number of stars
var preSet; // Is the PreSet value onces a selection has been made
var rated;

// Rollover for image Stars //
function rating(num){
	sMax = 5;	// Isthe maximum number of stars
	pre_t=num.id.substring(2);

	s = num.id.substring(2,1); // Get the selected star
	for(i=1; i<=sMax; i++){		
		if(i<=s){
			document.getElementById("s"+i+pre_t).className = "move";
		}else{
			document.getElementById("s"+i+pre_t).className = "";
		}
	}
}

// For when you roll out of the the whole thing //
function off(me,c_rat){
	pre_t=me.id.substring(2);
	sMax = 5;	// Isthe maximum number of stars
	for(i=1; i<=sMax; i++){
		if (c_rat>=i){
			document.getElementById("s"+i+pre_t).className = "on";
		}else{
			document.getElementById("s"+i+pre_t).className = "";
		}
	}
}

// Rating //
function rateIt(bookmark_url_id,rating_value,base_url){
	window.location.href=base_url+"index.php?action=bookmark&bm_cmd=rate&url_id="+bookmark_url_id+"&rating_value="+rating_value;
	//window.alert("index.php?action=bookmark&bm_cmd=rate&url_id="+bookmark_url_id+"&rating_value="+rating_value);
	//href="{$base_url}index.php?action=bookmark&bm_cmd=rate&url_id={$bm.bookmark_url_id}&rating_value=5" 	
}
