function gup(d){var c=/(.*)(agenda)_(0|1)_([0-9]{4})\-([0-9]{1,2})\-([0-9]{1,2})\.(html|do)?/;var b=c.exec(window.location.href);var a="";if(b!==null){if(d==1){a=b[4]+"/"+b[5]+"/"+b[6]}else{a=b[1]}}return a}function setCal(a,b){Calendar.setup({inputField:a,ifFormat:"%d/%m/%Y",singleClick:true,weekNumbers:false,firstDay:1,align:b})}function dateIsSpecial(d,e,b){var a=SPECIAL_DAYS[e];if(!a){return false}for(var c in a){if(a[c]==b){return true}}return false}function ourDateStatusFunc(b,e,a,c){if(dateIsSpecial(e,a,c)){return"special"}else{return false}}function dateChanged(b){var a=b.date.getMonth();if(b.dateClicked){window.location=url_base+"agenda/agenda_1_"+b.date.getFullYear()+"-"+(a+1)+"-"+b.date.getDate()+".html"}else{window.location=url_base+"agenda/agenda_0_"+b.date.getFullYear()+"-"+(a+1)+"-"+b.date.getDate()+".html"}}function InitCal(){var a="";if(document.getElementById("calendarioM")){a="calendarioM"}if(document.getElementById("calendario")){a="calendario"}if(a!=""){var b=gup(1);if(b==""){b=momentoActual}Calendar.setup({date:b,daFormat:"%Y/%m/%d",flat:a,flatCallback:dateChanged,weekNumbers:false,firstDay:1,dateStatusFunc:ourDateStatusFunc})}}function InitSearchCal(){if(document.getElementById("fecha_ini")){setCal("fecha_ini","Bl")}if(document.getElementById("fecha_fin")){setCal("fecha_fin","Br")}};
