';
// Exibe caledario
document.getElementById("idCalendar").innerHTML = sHtml;
} // nmCalendarDraw
/**
* Exibe os dias do calendario.
*
* @access private
* @return string Codigo HTML com dias dos mes.
*/
function nmCalendarDrawDays()
{
var iRow = this.date.getDay() + this.weekInit;
var iDays = this.DaysInMonth();
var iRemain = iDays;
var sCal = (0 != iRow) ? "
" : "";
if (6 < iRow)
{
iRow -= 7;
}
if (0 < iRow)
{
sCal += '
';
}
while (0 < iRemain)
{
if (0 == iRow)
{
sCal += "
';
}
return sCal;
} // nmCalendarDrawDays
/**
* Exibe a lista de meses.
*
* @access private
*/
function nmCalendarDrawMonths()
{
// Inicializa lista de meses
var sMonth = "";
// Monta lista de meses
sMonth += '";
// Retorna lista de meses
return sMonth;
} // nmCalendarDrawMonths
/**
* Exibe a lista de anos.
*
* @access private
*/
function nmCalendarDrawYears()
{
// Inicializa lista de anos
var sYear = "";
var iHalf = Math.floor(this.inter / 2);
var iMax = parseInt(this.year) + iHalf;
var iMin = parseInt(this.year) - iHalf;
if (this.inter % 2)
{
iMax += 1;
}
// Monta lista de anos
sYear += '";
// Retorna lista de anos
return sYear;
} // nmCalendarDrawYears
/**
* Seta a data atual.
*
* @access private
* @param integer iNewMonth Mes da data.
* @param integer iNewYear Ano da data.
*/
function nmCalendarSetBaseDate(iNewMonth, iNewYear)
{
this.date.setDate(1);
this.date.setMonth(iNewMonth - 1);
this.date.setYear(iNewYear);
} // nmCalendarSetDate
function nmCalendarResize()
{
oTable = $(".scCalendarBorder");
if (0 == oTable.height() || 0 == oTable.width())
{
setTimeout("nmCalendarResize()", 50);
return;
}
self.parent.tb_resize(oTable.height() + 40, oTable.width() + 40);
} // nmCalendarResize
//---------- Metodos Publicos --------------------------------------------------
/**
* Volta o calendario em um mes.
*
* @access public
*/
function nmCalendarMonthDec()
{
if (1 == this.month)
{
this.month = 12;
this.year--;
}
else
{
this.month--;
}
this.ChangeDate(this.month, this.year);
} // nmCalendarMonthDec
/**
* Adianta o calendario em um mes.
*
* @access public
*/
function nmCalendarMonthInc()
{
if (12 == this.month)
{
this.month = 1;
this.year++;
}
else
{
this.month++;
}
this.ChangeDate(this.month, this.year);
} // nmCalendarMonthInc
/**
* Altera o mes da data.
*
* @access public
* @param object oSel Objeto SELECT com a lista de meses.
*/
function nmCalendarMonthMove(oSel)
{
this.month = oSel.options[oSel.selectedIndex].value;
this.ChangeDate(this.month, this.year);
} // nmCalendarMonthMove
/**
* Retorna a data selecionada.
*
* @access public
* @param integer iNewDay Dia selecionado.
*/
function nmCalendarReturnDate(iNewDay)
{
if (fCallBack)
{
fCallBack(iNewDay, this.month, this.year, this.timeFormat, this.Field, this.Seq_dyn);
}
window.close();
} // nmCalendarReturnDate
/**
* Retorna a data selecionada.
*
* @access public
* @param integer iNewDay Dia selecionado.
*/
function nmCalendarReturnDateThickbox(iNewDay)
{
if (fCallBack)
{
fCallBack(iNewDay, this.month, this.year, this.timeFormat, this.Field, this.Seq_dyn);
}
self.parent.tb_remove();
} // nmCalendarReturnDateThickbox
/**
* Altera o ano da data.
*
* @access public
* @param object oSel Objeto SELECT com a lista de anos.
*/
function nmCalendarYearMove(oSel)
{
this.year = oSel.options[oSel.selectedIndex].value;
this.ChangeDate(this.month, this.year);
} // nmCalendarYearMove