function gup(e){var b="(.*)(agenda)_(0|1)_([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}).(html|do)?";var d=new RegExp(b);var c=d.exec(window.location.href);var a="";if(c!=null){if(e==1){a=c[4]+"/"+c[5]+"/"+c[6]}else{a=c[1]}}return a}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 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 InitSearchCal(){if(document.getElementById("fecha_ini")){setCal("fecha_ini","Bl")}if(document.getElementById("fecha_fin")){setCal("fecha_fin","Br")}}function setCal(a,b){Calendar.setup({inputField:a,ifFormat:"%d/%m/%Y",singleClick:true,weekNumbers:false,firstDay:1,align:b})};