
var g_starOver 	= false;

function starOver ( obj, n )
{

	g_starOver = true;
	for ( i = 0; i < n; i++ )
		document.getElementById('star'+i).src = '/images/starbig.jpg';
	for ( i = n; i < 5; i++ )
		document.getElementById('star'+i).src = '/images/starbig3.jpg';
	obj.src = '/images/starbig2.jpg';

}

function starOut ( )
{

	g_starOver = false;
	setTimeout('starOut2()',10);
		
}

function starOut2 ( )
{

	if (g_starOver == false)
	{
		n = parseInt(document.getElementById('rating').value);
		for ( i = 0; i <= n; i++ )
			document.getElementById('star'+i).src = '/images/starbig.jpg';
		for ( i = n+1; i < 5; i++ )
			document.getElementById('star'+i).src = '/images/starbig3.jpg';
	}
		
}

function starClick ( n )
{

	document.getElementById('rating').value = n;
	document.getElementById('rtext').innerHTML = '('+(n+1)+')';

}

function showStars ( )
{

	for ( i = 0; i < 5; i++ )
	{
	
		document.write
		('<img src=\'/images/starbig.jpg\' \
		title=\''+(i+1)+' out of 5 Stars\' \
		id=\'star'+i+'\' \
		style=\'cursor: pointer\' \
		width=22 height=25 \
		onMouseOver=\'starOver(this,'+i+')\' \
		onClick=\'starClick('+i+')\' \
		onMouseOut=\'starOut()\'>');
	
	}

}

function smallRating ( n ) 
{
	n--;
	for ( i = 0; i <= n; i++ )
		document.write('<img src=\'/images/star.jpg\' title=\''+(n+1)+' out of 5 Stars\'  height=17 width=13/>');
	for ( i = n+1; i < 5; i++ )
		document.write('<img src=\'/images/star2.jpg\' title=\''+(n+1)+' out of 5 Stars\'  height=17 width=13/>');

}

function bigRating ( n ) 
{
	n--;
	for ( i = 0; i <= n; i++ )
		document.write('<img src=\'/images/starbig.jpg\' title=\''+(n+1)+' out of 5 Stars\'  width=22 height=25/>');
	for ( i = n+1; i < 5; i++ )
		document.write('<img src=\'/images/starbig3.jpg\' title=\''+(n+1)+' out of 5 Stars\'  width=22 height=25/>');

}

function commentNavigation(page, page_max, id)
{

	var hrefstart = '/'+id;
	var out = '<table width="100%"><tr><td width="50%" nowrap><b>Page ' + page + ' of ' + (page_max==0?1:page_max) + '</b> ';
	
	if ( page - 3 > 0 ) out += '<a href="/'+id+'/1#comments">&laquo; First</a> ... ';
	if ( page - 1 > 0 ) out += '<a href="/'+id+'/'+(page-1)+'#comments">&laquo;</a> ';
	if ( page - 2 > 0 ) out += '<a href="/'+id+'/'+(page-2)+'#comments">' + (page - 2) + '</a> ';
	if ( page - 1 > 0 ) out += '<a href="/'+id+'/'+(page-1)+'#comments">' + (page - 1) + '</a> ';
	
	out += '<b>[' + page + ']</b> ';
	
	if ( page + 1 <= page_max ) out += '<a href="/'+id+'/'+(page+1)+'#comments">' + (page + 1) + '</a> ';
	if ( page + 2 <= page_max ) out += '<a href="/'+id+'/'+(page+2)+'#comments">' + (page + 2) + '</a> ';
	if ( page + 1 <= page_max ) out += '<a href="/'+id+'/'+(page+1)+'#comments">&raquo;</a> ';
	if ( page + 3 <= page_max ) out += '... <a href="/'+id+'/'+page_max+'#comments">Last &raquo;</a> ';
	
	out += '</td></tr></table>';	

	document.getElementById('navtop').innerHTML = out;
	document.getElementById('navbottom').innerHTML = out;
	
}

function deleteComment(cid, id, page) 
{
	
	var conf = confirm('Are you sure you want to delete this Comment?\nNote: This operation CANNOT be undone.');
	if (conf) 
	{
		window.location = '/info/?a=deleteComment&cid='+cid+'&i='+id+'page='+page;
	}	
	
}

function modifyComment(cid) 
{
	
	activeUrl('/info/?a=modifyComment&cid='+cid);
	
}

function cancelModComment() 
{
	
	document.getElementById("comment").value = '';
	document.getElementById("cid").value = 0;
	document.getElementById("post").value = oldSubmitValue;
	document.getElementById("cancel").style.display = 'none';
	
}
