var Counts =
{
	init: function()
	{
		var szType 		= $('type').getValue();
		var szFilename 	= '';
		var pParams 	= {};
		
		if (!szType)
		{
			return;
		}
		
		switch (szType)
		{
			case ('tv'):
				var iSid 		= $('sid').getValue();
				var iEid 		= $('eid').getValue();
				var szFilename 	= 'incrementShow';
				var pParams		= { sid: iSid, eid: iEid };
				break;
				
			case ('film'):
				var iFid 		= $('fid').getValue();
				var szFilename 	= 'incrementFilm';
				var pParams		= { fid: iFid };
				break;
		}
		
		if ((!iSid || !iEid) && !iFid)
		{
			return;
		}
		
		var pAjaxOptions =
		{
			method: 'post',
			parameters: pParams
		}
			
		new Ajax.Request(VidsTv.getBaseUrl() + 'app-lite/' + szFilename  + '.php', pAjaxOptions);
	}
}

Event.observe(window, 'load', Counts.init);