		
	function GAF_stars(rating) {
		if (rating>0) {
			stars='<span title="'+rating+' out of 10">';
			rnd = Math.round(rating);			
			if (rnd>0)
				for (var i=0;i<rnd;i++) {
					stars+='<img src="http://www.freelancer.com/img/star.gif" border="0">';
				}
			if (rnd<10)
				for (var i=0;i<10-rnd;i++) {
					stars+='<img src="http://www.freelancer.com/img/star2.gif" border="0">';
				}
			stars += '</span>';
			return stars;			
		} else
			return null;
	}
			
		

function GAF_update_profile_callback(json) {
		document.getElementById('GAF_profile').innerHTML = '<div onclick="window.open(\''+json.profile.url+'\',\'_blank\')" style="cursor:hand;cursor:pointer"><h3>'+json.profile.username+
			((json.profile.company)?', '+json.profile.company:'')+'</h3>'+
			'<center>'+'<a href="'+json.profile.url+'" target="_blank">Hire me</a> on <a href="'+json.profile.url+'" target="_blank"><font color="blue"><strong>Freelancer.com</strong></font></a></center>'+
			'<dl>'+
			((json.profile.address.country!=null && json.profile.address.city!=null)?'<dt>Location</dt><dd>'+json.profile.address.country+', '+json.profile.address.city+'</dd>':'')+
			((json.profile.provider_rating.count>0)?'<dt>My Rating</dt><dd>'+GAF_stars(json.profile.provider_rating.avg)+'<br>'+json.profile.provider_rating.avg+' out of 10'+'<br>'+json.profile.provider_rating.count+' reviews'+'</dd>':'')+
			((json.profile.hourlyrate>0)?'<dt>Hourly rate</dt><dd>$'+json.profile.hourlyrate+'</dd>':'')+
			((json.profile.jobs.length>0)?'<dt>Expertise</dt><dd><ul><li>'+json.profile.jobs.join('</li><li>')+'</li></ul></dd>':'')+
			'</dl>'
			+'</div></div>'
			;
}




