function ajax_calendar_next_month(category){
	//na to kamo soon!!!!
	
	var cal_page_holder = document.getElementById("cal_page_holder"+category);
	var cal_prefix_holder = document.getElementById("cal_prefix_holder"+category);
	var cal_month_holder = document.getElementById("cal_month_holder"+category);
	var cal_year_holder = document.getElementById("cal_year_holder"+category);
	var cal_lang_id_holder = document.getElementById("cal_lang_id_holder"+category);
	var calendar_container = document.getElementById("calendar_container"+category);
	

	var page = cal_page_holder.value;
	var prefix = cal_prefix_holder.value;
	var current_month = cal_month_holder.value;
	var current_year = cal_year_holder.value;
	var lang_id = cal_lang_id_holder.value;

	var next_month;
	var year;
	var http = false;

	if (parseInt(current_month,10) < 12){
		next_month = parseInt(current_month,10) + 1;
		if (next_month < 10){next_month = '0' + next_month;}
		year = current_year;
	}else{
		next_month = '01';
		year = parseInt(current_year,10) + 1;
	}
	

	if(navigator.appName == "Microsoft Internet Explorer") {
  		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
 	 	http = new XMLHttpRequest();
	} 

 	 http.open("GET", "./modules/calendar/ajax_php/update_calendar.php?month=" + next_month + "&year=" + year + "&prefix=" + prefix + "&lang_id=" + lang_id + "&category_id=" + category + "&page=" + page, true);
 	 http.onreadystatechange=function() {
  	  if(http.readyState == 4) {
  	  	  //APPEND TEXT!!!!
   	   calendar_container.innerHTML  = http.responseText;
   	 }
  }
  	http.send(null);

}





function ajax_calendar_prev_month(category){
	//na to kamo soon!!!!
	
	var cal_page_holder = document.getElementById("cal_page_holder"+category);
	var cal_prefix_holder = document.getElementById("cal_prefix_holder"+category);
	var cal_month_holder = document.getElementById("cal_month_holder"+category);
	var cal_year_holder = document.getElementById("cal_year_holder"+category);
	var cal_lang_id_holder = document.getElementById("cal_lang_id_holder"+category);
	var calendar_container = document.getElementById("calendar_container"+category);

	var page = cal_page_holder.value;
	var prefix = cal_prefix_holder.value;
	var current_month = cal_month_holder.value;
	var current_year = cal_year_holder.value;
	var lang_id = cal_lang_id_holder.value;

	var prev_month;
	var year;
	var http = false;
	
	if (parseInt(current_month,10) > 1){
		prev_month = parseInt(current_month,10) - 1;
		if (prev_month < 10){prev_month = '0' + prev_month;}
		year = current_year;
	}else{
		prev_month = '12';
		year = parseInt(current_year,10) - 1;
	}
	

	if(navigator.appName == "Microsoft Internet Explorer") {
  		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
 	 	http = new XMLHttpRequest();
	} 

 	 http.open("GET", "modules/calendar/ajax_php/update_calendar.php?month=" + prev_month + "&year=" + year + "&prefix=" + prefix + "&lang_id=" + lang_id + "&category_id=" + category + "&page=" + page, true);
 	 http.onreadystatechange=function() {
  	  if(http.readyState == 4) {
  	  	  //APPEND TEXT!!!!
   	   calendar_container.innerHTML  = http.responseText;
   	 }
  }
  	http.send(null);
	
}


//-----------------------------------------------Advance year -------------------------------------------------

function ajax_calendar_next_year(category){
	//na to kamo soon!!!!
	
	var cal_page_holder = document.getElementById("cal_page_holder"+category);
	var cal_prefix_holder = document.getElementById("cal_prefix_holder"+category);
	var cal_month_holder = document.getElementById("cal_month_holder"+category);
	var cal_year_holder = document.getElementById("cal_year_holder"+category);
	var cal_lang_id_holder = document.getElementById("cal_lang_id_holder"+category);
	var calendar_container = document.getElementById("calendar_container"+category);

	var page = cal_page_holder.value;	
	var prefix = cal_prefix_holder.value;
	var current_month = cal_month_holder.value;
	var current_year = cal_year_holder.value;
	var lang_id = cal_lang_id_holder.value;

	var http = false;

	year = parseInt(current_year,10) + 1;
	

	if(navigator.appName == "Microsoft Internet Explorer") {
  		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
 	 	http = new XMLHttpRequest();
	} 

 	 http.open("GET", "modules/calendar/ajax_php/update_calendar.php?month=" + current_month + "&year=" + year + "&prefix=" + prefix + "&lang_id=" + lang_id + "&category_id=" + category + "&page=" + page, true);
 	 http.onreadystatechange=function() {
  	  if(http.readyState == 4) {
  	  	  //APPEND TEXT!!!!
   	   calendar_container.innerHTML  = http.responseText;
   	 }
  }
  	http.send(null);

}





function ajax_calendar_prev_year(category){
	//na to kamo soon!!!!

	var cal_page_holder = document.getElementById("cal_page_holder"+category);
	var cal_prefix_holder = document.getElementById("cal_prefix_holder"+category);
	var cal_month_holder = document.getElementById("cal_month_holder"+category);
	var cal_year_holder = document.getElementById("cal_year_holder"+category);
	var cal_lang_id_holder = document.getElementById("cal_lang_id_holder"+category);
	var calendar_container = document.getElementById("calendar_container"+category);

	var page = cal_page_holder.value;
	var prefix = cal_prefix_holder.value;
	var current_month = cal_month_holder.value;
	var current_year = cal_year_holder.value;
	var lang_id = cal_lang_id_holder.value;

	var prev_month;
	var year;
	var http = false;
	
	year = parseInt(current_year,10) - 1;
	
	if(navigator.appName == "Microsoft Internet Explorer") {
  		http = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
 	 	http = new XMLHttpRequest();
	} 

 	 http.open("GET", "modules/calendar/ajax_php/update_calendar.php?month=" + current_month + "&year=" + year + "&prefix=" + prefix + "&lang_id=" + lang_id + "&category_id=" + category + "&page=" + page, true);
 	 http.onreadystatechange=function() {
  	  if(http.readyState == 4) {
  	  	  //APPEND TEXT!!!!
   	   calendar_container.innerHTML  = http.responseText;
   	 }
  }
  	http.send(null);
	
}