var page_hits = 
{
	long_stay: function(hit_type, house_id)
	{
		var id = ((typeof house_id === 'undefined') ? 0 : house_id);
		setTimeout(function()
		{
			var url = base_url + "home/long_stay/"+hit_type+"/"+id,
					  data = {};

			$.post(url, data, function(result)
			{
			});
		},10000);		
	},
	house_hit: function(house_id)
	{
		var url = base_url+"home/house_hit/"+house_id,
				  data = {};
		$.post(url, data, function()
		{
			//trigger the long_stay timer
			page_hits.long_stay("HOUSE", house_id);
		});
	},
	increment_hits: function(house_id, type)
	{
		var url = base_url+"home/increment_hits/"+house_id+"/"+type,
				  data = {};
		$.post(url, data, function()
		{
			//nothing required
		});		
	}
};


$(document).ready(function()
{
	page_hits.long_stay("PAGE");
});

