$(function(){
	var com;
	$('#calPrev').click(
		function(){
			com = getMY(this.href);
		
		    var data = 'm='+com[0]+'&y='+com[1]+'&l=it';
		
		    $.post(
		    	BASEURL+'index.php/beta/stmpCal',
		    	data,
				function(d){
					document.getElementById('calExtra').innerHTML = d;
				},
				"html"
			);

			return false
		}
	);

	$('#calNext').click(
		function(){
			com = getMY(this.href);
		
		    var data = 'm='+com[0]+'&y='+com[1]+'&l=it';
		
		    $.post(
		    	BASEURL+'index.php/beta/stmpCal',
		    	data,
				function(d){
					document.getElementById('calExtra').innerHTML = d;
				},
				"html"
			);

			return false
		}
	);
})

// Funzione per il prelievo dell'anno e del mese dall'uri del calendario di CI
function getMY(URI){
	var arr = URI.split('/');
	var rtn = Array();
	var l = arr.length;
	l--;
	rtn[0] = arr[l];
	rtn[1] = arr[l-1];
	return rtn;
}


function changeCal(URI){
			com = getMY(URI);
		
		    var data = 'm='+com[0]+'&y='+com[1]+'&l=it';
		
		    $.post(
		    	BASEURL+'index.php/beta/stmpCal',
		    	data,
				function(d){
					document.getElementById('calExtra').innerHTML = d;
				},
				"html"
			);

			return false
		}

