function rateShow (show_id, rating, container)
{
	doHTTP('/utpc_ajax.php?act=rate_show&show_id='+show_id+'&rating='+rating+'', 'reviewRating', container);
}

function reviewRating (s, elem)
{
	fe = document.getElementById(elem);
	str = "";

	a = s.split("|");
	success = a[0];
	ok = false;
	if (success == 'ok')
	{
		if (a[1] != '' && !isNaN (a[1]))
		{
			ok = true;
			r = parseFloat(a[1]);
			for (i=0; i < 5; i++)
			{
				img = '';
				if (i >= r)			{ img = "starbig-gray"; }
				else if (i+1 > r)	{ img = "starbig-half"; }
				else 				{ img = "starbig"; }
				str += "<img src='/images/ifc/rating/"+img+".png'  width='24' height='22' border='0' hspace='2' />";
			}

			d = document.getElementById ('ratingGraphic');
			d.innerHTML = str;
			str = "Post rated, thank you. New show rating is "+r;
		}
	}
	if (!ok)
	{
		str = s;
	}
	fe.className = 'ajaxResult';
	fe.innerHTML = str;
}

function tellFriend (show_id, email, container)
{
	doHTTP('/utpc_ajax.php?act=tell_friend&show_id='+show_id+'&email='+email+'', 'reviewTellFriend', container);
}

function reviewTellFriend (s, elem)
{
	fe = document.getElementById(elem);
	str = "";

	ok = false;
	str = (s == 'ok') ? "Thank you. Email invitation was sent to your friend" : s;

	fe.className = 'ajaxResult';
	fe.innerHTML = str;
}
