//Used for the '7 Point Rating System' on Fig Hunter dot com... Written by Pseudolonewolf, 19 Nov 09.

//Preload images:
var r7imgs=new Array();
for(i=0;i<7;i++){
	r7imgs[i]=new Image(10,10);
	r7imgs[i].src="http://www.fighunter.com/styles/7R"+i+".png";	
}

//Use AJAX to rate:
function Rate7(db,sid,R){
	document.getElementById('r7div_'+sid).innerHTML="<b>NOW RATING...</b>";

	var AJAX=AJAXthing();
	if(AJAX==null){
		alert("Your browser is horrendously obsolete and cannot run this function. Tsk.");
		return;
	}
	AJAX.onreadystatechange=function(){
		if(AJAX.readyState==4) document.getElementById('r7div_'+sid).innerHTML=AJAX.responseText;
	}
	AJAX.open("GET","do7rating.php?db="+db+"&sid="+sid+"&R="+R,true);
	AJAX.send(null);
}

var r7lastRolledover=0;
function R7Rollover(evt,db,sid,thing){
	var e=evt||window.event;

	var b=document.getElementById('r7floatbox');
	b.style.visibility='visible';
	b.style.left=(e.clientX + document.body.scrollLeft - document.body.clientLeft +10)+'px';
	b.style.top=(e.clientY + document.body.scrollTop - document.body.clientTop +10)+'px';

	if(r7lastRolledover==thing) return;

	b.innerHTML="Loading...";

	r7lastRolledover=thing;

	var AJAX=AJAXthing();
	if(AJAX==null){
		alert("Your browser is horrendously obsolete and cannot run this function. Tsk.");
		return;
	}
	AJAX.onreadystatechange=function(){
		if(AJAX.readyState==4) b.innerHTML=AJAX.responseText;
	}
	AJAX.open("GET","get7ratings.php?db="+db+"&sid="+sid,true);
	AJAX.send(null);
}