function getVideoShowCounts() {
	var myAjax = new Ajax.Request(
			'/_site/channel/get_video_show_counts.asp', 
			{
				method: 'get', 
				parameters: '', 
				asynchronous: false,  
				onComplete: function(response) {
					currentCounts = eval('(' + response.responseText + ')');
					drawCounts(currentCounts);
				}
			});
}


/*---------------------------------------------------------------*/

function drawCounts(Counts) {
	
	if (!document.getElementById('PagingControls')) {
		drawCounts(Counts);
	}

	
	strCounts = '(Showing ' + Counts['counts'][0].FirstRecord + '- ' + Counts['counts'][0].LastRecord + ' of ' + Counts['counts'][0].TotalRecords + ')';
	
	table = '';
	if (Counts['counts'][0].Menutab == 'S'){
	table =  '<table height="16" border="0" cellpadding="0" cellspacing="0" align="right">';
	table += '<tr>' 
	table += '<td height="16" align="right" class="text twelve medium grey"></td>';
	table += '<td width="10"></td>';
	
	if (Counts['counts'][0].CurrentPage > 1) {
		table += '<td width="20" height="16" align="center"><a href="#" onclick="getVideoShowData('+ '\'' + Counts['counts'][0].Menutab + '\'' + ','+ '\'' + Counts['counts'][0].View  + '\''+',' + '\'' + 99999 + '\',' + 99999 + ',' + eval(parseInt(Counts['counts'][0].CurrentPage) - 1) + ');getVideoShowCounts();return false;"><div style="background:url(/_site/graphics/channel/btn_prev_small.png) no-repeat 0px 0px; height:16px; width:20px" title="Previous Page"></div></a></td>';
		}
	else
		{
		table += '<td width="20" height="16" align="center"><div style="background:url(/_site/graphics/channel/btn_prev_small.png) no-repeat 0px -16px; height:16px; width:20px" title="Previous Page"></div></td>';
		}
	
	table += '<td width="2"></td>';
	
	if (Counts['counts'][0].CurrentPage < Counts['counts'][0].TotalPages) {
		table += '<td width="20" height="16" align="center"><a href="#" onclick="getVideoShowData('+ '\'' + Counts['counts'][0].Menutab + '\'' + ',' + '\'' + Counts['counts'][0].View  + '\''+ ',' + '\'' + 99999 + '\',' + 99999 + ',' + eval(parseInt(Counts['counts'][0].CurrentPage) + 1) + ');getVideoShowCounts();return false;"><div style="background:url(/_site/graphics/channel/btn_next_small.png) no-repeat 0px 0px; height:16px; width:20px" title="Next Page"></div></a></td>';
		}
	else
		{
		table += '<td width="20" height="16" align="center"><div style="background:url(/_site/graphics/channel/btn_next_small.png) no-repeat 0px -16px; height:16px; width:20px" title="Next Page"></div></td>';
		}
		
	table += '</tr>'
	table += '</table>';
	}
	
	document.getElementById("RecordCountsTop").innerHTML = table;

	table =  '<table width="100%" cellspacing="8" cellpadding="0" height="44" bgcolor="#CCCCCC" style="border-top: solid 1px #DDDDDD; border-bottom: solid 1px #999999">';
	table += '<tr>' 

	table += '<td width="273" height="28" class="Menu_Text" style="padding-left:10px">' + strCounts + '</td>';
	
	if (Counts['counts'][0].CurrentPage > 1) {
		table += '<td width="80" height="28" align="center"><a href="#" onclick="getVideoShowData('+ '\'' + Counts['counts'][0].Menutab + '\'' + ',' + '\'' + Counts['counts'][0].View  + '\''+ ',' + '\'' + 99999 + '\',' + 99999 + ',' + eval(parseInt(Counts['counts'][0].CurrentPage) - 1) + ');getVideoShowCounts();return false;"><div style="background:url(/_site/graphics/channel/btn_prev.png) no-repeat 0px 0px; height:28px; width:80px" title="Previous Page"></div></a></td>';
		}
	else
		{
		table += '<td width="80" height="28" align="center"><div style="background:url(/_site/graphics/channel/btn_prev.png) no-repeat 0px -28px; height:28px; width:80px" title="Previous Page"></div></td>';
		}
	
	if (Counts['counts'][0].CurrentPage < Counts['counts'][0].TotalPages) {
		table += '<td width="80" height="28" align="center"><a href="#" onclick="getVideoShowData('+ '\'' + Counts['counts'][0].Menutab + '\'' + ',' + '\'' + Counts['counts'][0].View  + '\''+ ',' + '\'' + 99999 + '\',' + 99999 + ',' + eval(parseInt(Counts['counts'][0].CurrentPage) + 1) + ');getVideoShowCounts();return false;"><div style="background:url(/_site/graphics/channel/btn_next.png) no-repeat 0px 0px; height:28px; width:80px" title="Next Page"></div></a></td>';
		}
	else
		{
		table += '<td width="80" height="28" align="center"><div style="background:url(/_site/graphics/channel/btn_next.png) no-repeat 0px -28px; height:28px; width:80px" title="Next Page"></div></td>';
		}
	
	table += '</tr>';
	table += '</table>';
	
	document.getElementById("PagingControls").innerHTML = table;
	
	setLinks(Counts['counts'][0].TimeSpan);

}

	

