Esta es la funcion principal del calendario, luego hay muchas mas pero son 900 lineas de codigo...
Código PHP:
Ver originalfunction Epoch(name,mode,targetelement,multiselect)
{
this.state = 0;
this.name = name;
this
.curDate
= new Date(); this.mode = mode;
this.selectMultiple = (multiselect == true); //'false' is not true or not set at all
//the various calendar variables
//this.selectedDate = this.curDate;
this
.selectedDates
= new Array(); this.calendar;
this.calHeading;
this.calCells;
this.rows;
this.cols;
this
.cells
= new Array();
//The controls
this.monthSelect;
this.yearSelect;
//standard initializations
this.mousein = false;
this.calConfig();
this.setDays();
this.displayYear = this.displayYearInitial;
this.displayMonth = this.displayMonthInitial;
this.createCalendar(); //create the calendar DOM element and its children, and their related objects
if(this.mode == 'popup' && targetelement && targetelement.type == 'text') //if the target element has been set to be an input text box
{
this.tgt = targetelement;
this.calendar.style.position = 'absolute';
this.topOffset = this.tgt.offsetHeight; // the vertical distance (in pixels) to display the calendar from the Top of its input element
this.leftOffset = 0; // the horizontal distance (in pixels) to display the calendar from the Left of its input element
this.calendar.style.top = this.getTop(targetelement) + this.topOffset + 'px';
this.calendar.style.left = this.getLeft(targetelement) + this.leftOffset + 'px';
document.body.appendChild(this.calendar);
this.tgt.calendar = this;
this.tgt.onfocus = function () {this.calendar.show();}; //the calendar will popup when the input element is focused
this.tgt.onblur = function () {if(!this.calendar.mousein){this.calendar.hide();}}; //the calendar will popup when the input element is focused
}
else
{
this.container = targetelement;
this.container.appendChild(this.calendar);
}
this.state = 2; //0: initializing, 1: redrawing, 2: finished!
this.visible ? this.show() : this.hide();
}
y aqui es cuando lo quiero llamar en la hoja php
<script type="text/javascript">
{literal}
var bas_cal,dp_cal,ms_cal;
window.onload = function () {
dp_cal = new Epoch('epoch_popup','popup',document.getElementByI d('popup_container'));
};
</script>
Gracias!