function load_calendar(el,month,year){var req=new Request({async:false,method:'get',url:url_ajax_cal,data:{'id_item':id_item,'month':month,'year':year,'lang':lang},evalScripts:true,onRequest:function(){el.set('html','<img class="img_loading_month" src="'+img_loading_month+'">');},onSuccess:function(response){el.set('html',response);if(clickable_past=="off"){document.id('the_months').getElements('.past').each(function(el){el.set('opacity','0.6');});}}}).send();}
function activate_dates(){}
function calendar_nav(){$$('#cal_controls img').each(function(img){var src=img.getProperty('src');img.setStyle('cursor','pointer');var extension=src.substring(src.lastIndexOf('.'),src.length)
img.addEvent('mouseenter',function(){img.setProperty('src',src.replace(extension,'_over'+extension));});img.addEvent('mouseleave',function(){img.setProperty('src',src);});img.addEvent('click',function(){var type=img.getParent().get('id');if(type=='cal_prev'){$$('div.load_cal').each(function(el){var this_date=el.getFirst().id;var data=this_date.split('_');cur_month=parseFloat(data[0]);new_year=parseFloat(data[1]);new_month=(cur_month-months_to_show);if(new_month<1){new_month=(new_month+12);new_year=(new_year-1);}
load_calendar(el,new_month,new_year);});}else if(type=='cal_next'){$$('div.load_cal').each(function(el){var this_date=el.getFirst().id;var data=this_date.split('_');cur_month=parseFloat(data[0]);new_year=parseFloat(data[1]);new_month=(cur_month+months_to_show);if(new_month>12){new_month=(new_month-12);new_year=(new_year+1);}
load_calendar(el,new_month,new_year);});}
activate_dates();});});}
window.addEvent('domready',function(){if($$('.load_cal')){$$('.load_cal').each(function(el){var this_date=el.get('id');var data=this_date.split('_');load_calendar(el,data[0],data[1]);});activate_dates();calendar_nav();}});
