var starGo='';

function $(v) { return(document.getElementById(v)); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function xy(e,v) { return(v?(agent('msie')?event.clientY+document.body.scrollTop:e.pageY):(agent('msie')?event.clientX+document.body.scrollTop:e.pageX)); }
function starUpdate(e) { var v=parseInt($('starUser').innerHTML); $('starCurr').title=v; req=new XMLHttpRequest(); req.open('GET',CorrectWWW('http://www.akxl.net/labs/getvote.aspx?entry=' + voteEntry + '&vote='+v),false); req.send(null); }
function starRevert() { var v=parseInt($('starCurr').title); $('starCurr').style.width=Math.round(v*84/100)+'px'; $('starUser').innerHTML=(v>0?Math.round(v)+'%':''); $('starUser').style.color='#888'; document.onmousemove=''; }
function starCurr(e) {
	function starMove(e) {
		var eX=xy(e)-$('star').offsetLeft-214,eY=xy(e,1)-$('star').offsetTop;
		if(eX<1 || eX>84 || eY<0 || eY>19) { 
			starGo=''; starRevert();
		} else { 
			$('starCurr').style.width=eX+'px'; $('starUser').style.color='#111'; $('starUser').innerHTML=Math.round(eX/84*100)+'%';
		}
	}
	if(!starGo) { starGo=1; document.onmousemove=starMove; }
}

function CorrectWWW(theUrl)
{
	// -- The current page has a www address
	// -- The AJAX requested page has an absolute, not relative, address
	// -- The AJAX requested page does not have a www address
	if (window.location.href.indexOf("www.") != -1 && 
		theUrl.indexOf("http://") != -1 && 
		theUrl.indexOf("www.") == -1)
	{
		theUrl = theUrl.replace("http://", "http://www.");
	}

	// -- The current page does not have a www address
	// -- The AJAX requested page has an absolute, not relative, address
	// -- The AJAX requested page has a www address
	else if (window.location.href.indexOf("www.") == -1 && 
		     theUrl.indexOf("http://") != -1 && 
		     theUrl.indexOf("www.") != -1)
	{
		theUrl = theUrl.replace("http://www.", "http://");
	}

	return theUrl;
}