// IE5.0 fix for Array.push method
if (!Array.prototype.push) {
Array.prototype.push = function() {
 for (var i=0; i<arguments.length; i++)
 this[this.length] = arguments[i];
}
}
function name_values(instring) {
// Assumption: ';' is a restricted character in a value.
// Returns an array of variable names set by this function.
var vars = new Array();
rc = "\235";
instring = instring.replace(/\\\;/g, rc);
var pattern = /[a-zA-Z0-9]+\=[\/:#a-zA-Z0-9\-\+\., \235]+/gi;
var y = instring.match(pattern);
for (i=0; i<y.length; i++) {
 var s = y[i].split("=");
 s[1] = s[1].replace(rc, ";");
 vars[i] = "v_" + s[0];
 eval(vars[i] + " = '" + s[1] + "'");
}
return vars;
}
function chkVar(pvarname) {
if (eval(pvarname) && eval(pvarname) != "")
 return true;
else
 return false;
}
function arrayElt(pArr, pElt) {
// Assumes a string array and a string element.
for (j=0; j<pArr.length; j++) {
 if (pArr[j].toUpperCase() == pElt.toUpperCase())
 return j;
}
return "-1";
}
function Today() {
var d = new Date();
return ((d.getMonth() + 1) + "/" + d.getDate() + "/" + d.getFullYear());
}
function dateAdd(indt, days, sign) {
var d = new Date(indt);
var dv = d.valueOf();
var ndv;
if (sign == "+")
 ndv = dv + (days*(1000*60*60*24));
else
 ndv = dv - (days*(1000*60*60*24));
var nd = new Date(ndv);
return ((nd.getMonth() + 1) + "/" + nd.getDate() + "/" + nd.getFullYear());
}
function IESplit(re, st) {
 var ret = new Array();
while ((x=re.exec(st)) != null) {
 ret.push(st.substring(0, st.indexOf(x[1])));
 ret.push(x[1]);
 st = st.substr(st.indexOf(x[1]) + x[1].length);
}
return ret;
}
// Custom parameters set by the 6th argument to show_calendar function.
var v_CloseOnSelect, v_AppendOrReplace, v_AppendChar, v_ReturnData;
var v_InlineX, v_InlineY, v_Title, v_CurrentDate, v_AllowWeekends;
var v_Resizable, v_Width, v_Height, v_SelectAfter, v_NSHierarchy;
var v_SelectBefore, v_CallFunction, v_PopupX, v_PopupY;
var v_Nav, v_SmartNav, v_Fix, v_WeekStart, v_Weekends;
var weekend = new Array();
var weekendColor = "#ECECEC";
var fontface = "Verdana";
var fontsize = 2;
var gNow = new Date();
var ggWinCal; // Really global variable pointing to the calendar window
var currX, currY;
var cx, cy; // Client co-ords
var x, y; // Co-ords of the point at first click
var incrX, incrY;
var mDown, mUp;
// ----------- VARIABLE DECLARATIONS END -----------
// Browser Detection
isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;
isDOM = (document.getElementById) ? true : false;
// Month names in YOUR Language (French/Spanish..)
Calendar.Months = ["JANUAR", "FEBRUAR", "MÄRZ", "APRIL", "MAI", "JUNI", "JULI", "AUGUST", "SEPTEMBER", "OKTOBER", "NOVEMBER", "DEZEMBER"];
// Short Month names in YOUR Language
Calendar.SMonths = ["JAN", "FEB", "MÄR", "APR", "MAI", "JUN", "JUL", "AUG", "SEP", "OKT", "NOV", "DEZ"];
// Non-Leap year Month days..
Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// Leap year Month days..
Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
Calendar.DOW = ["SONNTAG", "MONTAG", "DIENSTAG", "MITTWOCH", "DONNERSTAG", "FREITAG", "SAMSTAG"];
Calendar.count = 0;
// For inline calendar, the default contents of the layer. (v1.3)
Calendar.gInitText = "KALENDAR";
function Calendar(p_item, p_WinCal, p_month, p_year, p_format, p_type) {
// Argument p_type defines if the calendar is popup or inline
// If p_type is INLINE,
// you must pass p_inline parameter which specifies the name of the layer
// which displays the calendar inline.
// --->
if ((p_month == null) && (p_year == null)) return;
if (p_WinCal == null)
 this.gWinCal = ggWinCal;
else
 this.gWinCal = p_WinCal;
if (p_month == null) {
 this.gMonthName = null;
 this.gMonth = null;
 this.gYearly = true;
} else {
 this.gMonthName = Calendar.get_month(p_month);
 this.gMonth = new Number(p_month);
 this.gYearly = false;
}

this.gType = "POPUP";
this.WHO = "window.opener.";
this.gYear = p_year;
this.gFormat = p_format;
this.gBGColor = "white";
this.gFGColor = "black";
this.gTextColor = "black";
this.gHeaderColor = "black";
this.gReturnItem = p_item;
this.gTitle = "Calendar";
}
Calendar.get_month = Calendar_get_month;
Calendar.get_daysofmonth = Calendar_get_daysofmonth;
Calendar.get_dow = Calendar_get_dow;
Calendar.calc_month_year = Calendar_calc_month_year;
Calendar.CreateCalendarLayer = Calendar_CreateCalendarLayer;
Calendar.Close = Calendar_Close;
Calendar.Lwwrite = Calendar_Lwwrite;
Calendar.isWeekend = Calendar_isWeekend;
Calendar.processDateData = Calendar_processDateData;
Calendar.readDate = Calendar_readDate;
function Calendar_get_month(monthNo, pLanguage) {
return Calendar.Months[monthNo];
}
function Calendar_get_dow(dayNo) {
return Calendar.DOW[dayNo];
}
function Calendar_get_daysofmonth(monthNo, p_year) {
/* Check for leap year .. */
if ((p_year % 4) == 0) {
 if ((p_year % 100) == 0 && (p_year % 400) != 0)
 return Calendar.DOMonth[monthNo];
 return Calendar.lDOMonth[monthNo];
} else
 return Calendar.DOMonth[monthNo];
}
function Calendar_calc_month_year(p_Month, p_Year, incr) {
/* return an 1-D array with 1st element being the calculated month and second being the calculated year */
var ret_arr = new Array();
if (incr == -1) {
 // B A C K W A R D
 if (p_Month == 0) {
 ret_arr[0] = 11;
 ret_arr[1] = parseInt(p_Year, 10) - 1;
 }
 else {
 ret_arr[0] = parseInt(p_Month, 10) - 1;
 ret_arr[1] = parseInt(p_Year, 10);
 }
} else if (incr == 1) {
 // F O R W A R D
 if (p_Month == 11) {
 ret_arr[0] = 0;
 ret_arr[1] = parseInt(p_Year, 10) + 1;
 }
 else {
 ret_arr[0] = parseInt(p_Month, 10) + 1;
 ret_arr[1] = parseInt(p_Year, 10);
 }
}
return ret_arr;
}
function Calendar_isWeekend(pday) {
var i;
for (i=0; i<weekend.length; i++) {
 if (parseInt(pday) == parseInt(weekend[i]))
 return true;
}
return false;
}
function Calendar_processDateData(vInputData, pFormat) {
// InputData is of the form Today, Today+15 or Today-5 or a date value..
var m;
var td = Today();
var ree = new RegExp("(Today)(([\\+\\-])([0-9]+))?", "i");
if ((m = vInputData.match(ree)) != null) {
 if (m[1].toUpperCase() == "TODAY" && m[0].length> 5)
 return dateAdd(td, m[4], m[3]);
 else if (m[1].toUpperCase() == "TODAY")
 return td;
} else {
 // Read the date in its format
 return Calendar.readDate(vInputData, pFormat);
}
}
function Calendar_readDate(indt, infmt) {
var re = "";
var whoarr = new Array();
whoarr.push("Dummy");
var mach = IESplit(new RegExp("(DD|MM|YYYY)"), infmt);
for (i=0; i<mach.length; i++) {
 switch (mach[i].toUpperCase()) {
 case "DD":
 re += "(\\d{1,2})"; whoarr.push(mach[i]); break;
 case "MM":
 re += "(\\d{1,2})"; whoarr.push(mach[i]); break;
 case "YYYY":
 re += "(\\d{4})"; whoarr.push(mach[i]); break;
 default:
 re += mach[i];
 }
}
var dpart,mpart,ypart;
var rege = new RegExp(re, "i");
if (rege.test(indt)) {
 var ma = indt.match(rege);
 for (i=0; i<ma.length; i++) {
 switch (whoarr[i]) {
 case "DD":
 dpart = parseInt(ma[i], 10); break;
 case "MM":
 mpart = parseInt(ma[i], 10); break;
 case "YYYY":
 ypart = parseInt(ma[i], 10); break;
 }
 }
}
if (!(dpart||mpart||ypart))
 return null;
else
 return(new Date(mpart+"/"+dpart+"/"+ypart));
}
function Calendar_Close(pType, pINLINE) {
ggWinCal.close();
ggWinCal = null;
}
new Calendar();
Calendar.prototype.getMonthlyCalendarCode = function() {
// Begin Table Drawing code here..
return "<TABLE ALIGN=\"CENTER\" WIDTH='" + (v_Width-30) + "' BORDER=0 BGCOLOR=\"" + this.gBGColor + "\">" + this.cal_header() + this.cal_data() + "</TABLE>";
}
Calendar.prototype.onclickfn = function() {
// This should return the code string for the onclickfn in the calendar document.
var whois = this.WHO + "document." + v_NSHierarchy + this.gReturnItem + ".value";
return "apchar = ''; ((" + whois + " == '') ? '' : '" + this.appendChar + "');\n" + whois + " = " + "apchar + pday;\n";
}
Calendar.prototype.showSmartNavBar = function() {
var selcalendar = "<table border=0 bgcolor=#C5CEDE><tr><td rowspan=2 bgcolor=#C5CEDE>";

selcalendar += "<select class='campo' name='selMonth' onchange=\"" +
 this.WHO + "Build(" +
 "'" + this.gReturnItem + "', document.frmCal.selMonth.selectedIndex, '" +
 this.gYear + "', '" + this.gFormat + "', '" + this.gType + "');\">\n";
for (i=0; i<12; i++) {
 selcalendar += "<option value=\"" + i + "\" ";
 if (parseInt(this.gMonth) == i)
 selcalendar += "selected";
 selcalendar += ">" + Calendar.Months[i] + "</option>\n";
}
selcalendar += "<\/select>\n</td><td rowspan=2 bgcolor=#C5CEDE>";
selcalendar += "<input class='campo' name=\"cy\" size=4 maxlength=4 value=\"" + this.gYear +
 "\" onchange=\"" +
 "javascript:" + this.WHO + "Build(" +
 "'" + this.gReturnItem + "', '" + this.gMonth +
 "', document.frmCal.cy.value, '" + this.gFormat + "', '" + this.gType + "');\" " +
 "onkeydown=\"javascript:kdwn(this);\"" +
 ">\n";
selcalendar += "</td><td bgcolor=#C5CEDE>" +
 "<A HREF=\"javascript:void(0);\" onClick=\"document.frmCal.cy.value++;document.frmCal.cy.onchange();return false;\">" +
 "<FONT FACE=Arial color=white>^</FONT></A>" +
 "</td></tr><tr><td bgcolor=#C5CEDE>" +
 "<A HREF=\"javascript:void(0);\" onClick=\"document.frmCal.cy.value--;document.frmCal.cy.onchange();return false;\">" +
 "<FONT FACE=Arial color=white>v</FONT></A>" +
 "</td></tr></table>";
this.wwrite(selcalendar);
}
Calendar.prototype.show = function() {
var vCode = "";
this.gWinCal.document.open();
// Setup the page...
this.wwrite("<html>");
this.wwrite("<head><title>Calendar</title>");
this.wwrite("<style>");
this.wwrite("body {background-image: url(/imagenes/top2.jpg);background-repeat:  repeat-x;background-position: top;}");
this.wwrite("a { font-family: Verdana; font-size: 10px; text-decoration: none}");
this.wwrite("td { font-family: Verdana; font-size: 10px; text-decoration: none}");
this.wwrite(".campo {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; border: #000000; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}");
this.wwrite("</style>");
if (this.gType == "POPUP")
 this.wwrite("<script language='javascript'>" + 
			"function onClickFn(pday){\n" +			this.onclickfn() + "}\n<\/script>");	else
		orig_onClickFnCode = this.onclickfn();	if (v_SmartNav == "Yes" && this.gType == "POPUP")
		this.wwrite("<script language='javascript'>\n" + 
			"function kdwn(pthis){" + 
			"if(event.keyCode==13)pthis.onchange();else return false;}\n" + 
			"</script>");
this.wwrite("</head>");
this.wwrite("<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'" +
 "link=\"" + this.gLinkColor + "\" " +
 "vlink=\"" + this.gLinkColor + "\" " +
 "alink=\"" + this.gLinkColor + "\" " +
 "text=\"" + this.gTextColor + "\" LANGUAGE=javascript onload=\"window.focus();\">");

// For Smart navigation
this.wwrite('<table border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="70" align="center" valign="top"><img src="/imagenes/logo2_al.jpg" width="202" height="56"></td></tr></table>');
if (v_SmartNav == "Yes")
 this.wwrite("<form name=\"frmCal\" onsubmit=\"return false;\">");
this.wwrite("<TABLE align=center WIDTH='" + (v_Width-30) + "' BORDER=0 CELLPADDING=0 BGCOLOR='#989DA5'><TR><TD>" +
 "<TABLE BORDER=0 WIDTH='100%' CELLPADDING=1 BGCOLOR='#C5CEDE'>" + "<TR><TD BGCOLOR='#989DA5'>" +
 "<FONT COLOR=white FACE='" + fontface + "'><B>" + this.gTitle + "</B></FONT>" +
 "</TD><TD BGCOLOR='#989DA5' ALIGN=RIGHT>" + "<FONT COLOR=white FACE='" + fontface + "'><B>" +
 "<A HREF='javascript:" + this.WHO + "Calendar.Close(\"" + this.gType + "\", \"" + this.INLINE + "\");' " +
 "STYLE='color:white'>" + "x</A></B></FONT></TD></TR>");
if (v_SmartNav != "Yes")
{
this.wwrite("<TR></TR><TD BGCOLOR='#C5CEDE'>");
this.wwriteA("<FONT FACE='" + fontface + "'><B>");
this.wwriteA(this.gMonthName + " " + this.gYear);
this.wwriteA("</B></TD>");

// Code to let users fix the calendar or let it move
this.wwriteA("<TD BGCOLOR='#C5CEDE' ALIGN=RIGHT>" + "</TD></TR>");
}
this.wwriteA("<TR><TD COLSPAN=2>");

if (v_SmartNav == "Yes")
 this.showSmartNavBar();
if (v_Nav == "Yes") {
 // Show navigation buttons
 var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
 var prevMM = prevMMYYYY[0];
 var prevYYYY = prevMMYYYY[1];

 var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
 var nextMM = nextMMYYYY[0];
 var nextYYYY = nextMMYYYY[1];
 this.wwrite("<TABLE WIDTH='" + (v_Width-30) + "' BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#ECECEC'><TR><TD ALIGN=center>");
 this.wwrite("<FONT COLOR=black FACE='" + fontface + "'>" +
 "[<A HREF=\"" + "javascript:" + this.WHO + "Build(" + "'" + this.gReturnItem + "', '"
 + this.gMonth + "', '" + (parseInt(this.gYear, 10)-1) + "', '" + this.gFormat + "', '" + this.gType + "'" +
 ");\"><<<\/A>]</FONT></TD><TD ALIGN=center>");
 this.wwrite("<FONT COLOR=black FACE='" + fontface + "'>" +
 "[<A HREF=\"" + "javascript:" + this.WHO + "Build(" +
 "'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "', '" + this.gType + "'" +
 ");\"><<\/A>]</FONT></TD><TD ALIGN=center>");
 this.wwrite("</TD><TD ALIGN=center>");
 this.wwrite("<FONT COLOR=black FACE='" + fontface + "'>" +
 "[<A HREF=\"" + "javascript:" + this.WHO + "Build(" + "'" + this.gReturnItem + "', '"
 + gNow.getMonth() + "', '" + gNow.getFullYear() + "', '" + this.gFormat + "', '" + this.gType + "'" +
 ");\">Heute<\/A>]</FONT></TD><TD ALIGN=center>");
 this.wwrite("<FONT COLOR=black FACE='" + fontface + "'>" +
 "[<A HREF=\"" + "javascript:" + this.WHO + "Build(" + "'" + this.gReturnItem + "', '"
 + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "', '" + this.gType + "'" +
 ");\">><\/A>]</FONT></TD><TD ALIGN=center>");
 this.wwrite("<FONT COLOR=black FACE='" + fontface + "'>" +
 "[<A HREF=\"" + "javascript:" + this.WHO + "Build(" + "'" + this.gReturnItem + "', '"
 + this.gMonth + "', '" + (parseInt(this.gYear, 10)+1) + "', '" + this.gFormat + "', '" + this.gType + "'" +
 ");\">>><\/A>]</FONT></TD></TR></TABLE>");
}
// Get the complete calendar code for the month..
vCode = this.getMonthlyCalendarCode();
this.wwrite(vCode);
this.wwrite("</TD></TR></TABLE></TD></TR></TABLE>");
// For Smart navigation
if (v_SmartNav == "Yes")
 this.wwrite("</form>");
this.wwrite("</font></body></html>");
this.gWinCal.document.close();
}
Calendar.prototype.cal_header = function() {
var vCode = "<TR>";
for (i=v_WeekStart,j=0; j<7; i++,j++,i=i%7)
 vCode = vCode + "<TD WIDTH='" + ((i==6) ? 16 : 14) + "%'>" +
 "<FONT FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>" +
 Calendar.DOW[i].substring(0, 3) + "</B></FONT></TD>";
vCode = vCode + "</TR>";
return vCode;
}
Calendar.prototype.cal_data = function() {
var vDate = new Date();
vDate.setDate(1);
vDate.setMonth(this.gMonth);
vDate.setFullYear(this.gYear);
var vFirstDay = vDate.getDay();
var vDay=1;
var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
var vOnLastDay=0;
var vCode = "";

var linkText = "";
var linkCloseText = "";
closecodeP = "window.close();";
closecodeI = "Calendar.Close(\"" + this.gType + "\", \"" + this.INLINE + "\"); ";
var whois = this.WHO + "document." + this.gReturnItem + ".value";
/* Get day for the 1st of the requested month/year.. */
vCode = vCode + "<TR>";
for (j=v_WeekStart,i=0; j!=vFirstDay; j++,i++,j=j%7) {
 vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j) + "><FONT FACE='" + fontface + "'>&nbsp;</FONT></TD>";
}
// Write rest of the 1st week
for (j=vFirstDay; i<7; j++,i++,j=j%7) {
 vDate.setDate(vDay);
 if ((this.gAllowWeekends == "No" && Calendar.isWeekend(j)) ||
 (vDate <v_SelectAfter || vDate> v_SelectBefore)) {
 linkText = "";
 linkCloseText = "";
 } else {
 linkText = "<A HREF='javascript:" +
 ((this.CallFunction != "") ? (this.WHO + this.CallFunction + "();") : "") + closecodeI + "' "
 + "onClick=\"onClickFn('" + ((this.returnData == "Date") ? this.format_data(vDay) : this.format_dow(vDay)) +
 "');" + ((this.CallFunction != "") ? (this.WHO + this.CallFunction + "();") : "") + closecodeP + "return true;\">";
 linkCloseText = "<\/A>";
 }
 vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j) + "><FONT FACE='"
 + fontface + "'>" + linkText + this.format_day(vDay) + linkCloseText + "</FONT></TD>";
 vDay = vDay + 1;
}
vCode = vCode + "</TR>";
// Write the rest of the weeks
for (k=2; k<7; k++) {
 vCode = vCode + "<TR>";
 for (j=v_WeekStart,i=0; i<7; j++,i++,j=j%7) {
 vDate.setDate(vDay);
 if ((this.gAllowWeekends == "No" && Calendar.isWeekend(j)) ||
 (vDate <v_SelectAfter || vDate> v_SelectBefore)) {
 linkText = "";
 linkCloseText = "";
 } else {
 linkText = "<A HREF='javascript:" + ((this.CallFunction != "") ? (this.WHO + this.CallFunction + "();") : "")
 + closecodeI + "' onClick=\"onClickFn('" + ((this.returnData == "Date") ? this.format_data(vDay) : this.format_dow(vDay))
 + "');" + ((this.CallFunction != "") ? (this.WHO + this.CallFunction + "();") : "") + closecodeP +
 "return true;" + "\">";
 linkCloseText = "<\/A>";
 }
 vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j) + "><FONT FACE='" + fontface + "'>" +
 linkText + this.format_day(vDay) + linkCloseText + "</FONT></TD>";
 vDay = vDay + 1;
 if (vDay> vLastDay) {
 vOnLastDay = 1;
 break;
 }
 }
 if (i == 6)
 vCode = vCode + "</TR>";
 if (vOnLastDay == 1)
 break;
}
// Fill up the rest of last week with proper blanks, so that we get proper square blocks
for (m=1; m<(7-i); m++) {
 if (this.gYearly)
 vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j+m) +
 "><FONT FACE='" + fontface + "' COLOR='gray'>&nbsp;</FONT></TD>";
 else
 vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j+m) +
 "><FONT FACE='" + fontface + "' COLOR='gray'>" + m + "</FONT></TD>";
}
return vCode;
}
Calendar.prototype.format_day = function(vday) {
var highDate;
if (this.gCurrentDate != "NONE")
 highDate = this.gCurrentDate;
else
 highDate = gNow;
var vNowDay = highDate.getDate();
var vNowMonth = highDate.getMonth();
var vNowYear = highDate.getFullYear();
if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
 return ("<FONT COLOR=\"RED\"><B>" + vday + "</B></FONT>");
else
 return (vday);
}
Calendar.prototype.write_weekend_string = function(vday) {
// Return special formatting for the weekend day.
if (Calendar.isWeekend(vday) || (vday>5))
 return (" BGCOLOR=\"" + weekendColor + "\"");
return "";
}
Calendar.prototype.format_data = function(p_day) {
// Supports format consisting of 'DD/MM/YYYY'
var vData = this.gFormat;
var vMonth = 1 + this.gMonth;
vMonth = (vMonth.toString().length <2) ? "0" + vMonth : vMonth;
var vY4 = new String(this.gYear);
var vDD = (p_day.toString().length <2) ? "0" + p_day : p_day;
vData = vData.replace(/YYYY/ig, vY4);
vData = vData.replace(/DD/ig, vDD);
vData = vData.replace(/MM/ig, vMonth);
return vData;
}
Calendar.prototype.format_dow = function(p_day) {
var vData;
var vMonth = 1 + this.gMonth;

vMonth = (vMonth.toString().length <2) ? "0" + vMonth : vMonth;
var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase();
var vFMon = Calendar.get_month(this.gMonth).toUpperCase();
var vY4 = new String(this.gYear);
var vDD = (p_day.toString().length <2) ? "0" + p_day : p_day;
var vDate = new Date(vMonth + "\/" + vDD + "\/" + vY4);
vData = Calendar.get_dow(vDate.getDay());

return vData;
}
Calendar.prototype.wwrite = function(wtext) {
 this.gWinCal.document.writeln(wtext);
}
Calendar.prototype.wwriteA = function(wtext) {
this.gWinCal.document.write(wtext);
}
function Calendar_CreateCalendarLayer(pLeft, pTop, pInitText) {}
function Calendar_Lwwrite(pText, pINLINE) {}
function Build(p_item, p_month, p_year, p_format, p_type, p_custom) {
if (p_custom && p_custom != "") {
 // Reset the name/value variables which should not be carried forward to the next calendar..
 v_CurrentDate = "";
 // Read Custom parameters from the custom string here..
 var vvars = name_values(p_custom);
 var whois = "document." + p_item + ".value";
 // If the return item has some date in it, take that as the starting date for the calendar.
 var returnItemValue = eval(whois);
 if (returnItemValue != "")
 v_CurrentDate = returnItemValue;
 v_Weekends = chkVar("v_Weekends") ? v_Weekends : "06";
 for (i=0; i<v_Weekends.length; i++)
 weekend.push(parseInt(v_Weekends.charAt(i)));
} else
 v_CurrentDate = "";
// If the current date is specified, split it & send it to the calendar...
var vCurrentDate;
if (chkVar("v_CurrentDate")) {
 if (Calendar.processDateData(v_CurrentDate, p_format) == null)
 vCurrentDate = new Date();
 else
 vCurrentDate = new Date(Calendar.processDateData(v_CurrentDate, p_format));
 p_month = vCurrentDate.getMonth();
 p_year = vCurrentDate.getFullYear().toString();
} else
 vCurrentDate = "NONE";
v_Resizable = "No";
v_SelectAfter = (typeof v_SelectAfter == "string") ?
 new Date(Calendar.processDateData(v_SelectAfter, p_format)) :
 v_SelectAfter;
v_SelectBefore = (typeof v_SelectBefore == "string") ?
 new Date(Calendar.processDateData(v_SelectBefore, p_format)) :
 v_SelectBefore;
v_NSHierarchy = isNav ?
 (chkVar("v_NSHierarchy") ? (v_NSHierarchy + ".document.") : "")
 : "";
v_CallFunction = chkVar("v_CallFunction") ? v_CallFunction : "";
v_Nav = chkVar("v_Nav") ? v_Nav : "Yes";
v_SmartNav = chkVar("v_SmartNav") ? v_SmartNav : "No";
v_Fix = chkVar("v_Fix") ? v_Fix : "Yes";
v_WeekStart = chkVar("v_WeekStart") ? parseInt(v_WeekStart) : 0;
var vHeight, vWidth;
v_Width = chkVar("v_Width") ? v_Width : 300;
v_Height = chkVar("v_Height") ? v_Height : 250;
vWidth = chkVar("v_Width") ? v_Width : 300;
vHeight = chkVar("v_Height") ? v_Height : 250;
if (v_SmartNav == "Yes")
 vHeight += 30;
v_PopupX = chkVar("v_PopupX") ? v_PopupX : 400;
v_PopupY = chkVar("v_PopupY") ? v_PopupY : 190;

if (!ggWinCal || ggWinCal.closed)
 ggWinCal = window.open("", "Calendario", "width=" + vWidth + ",height=" + vHeight +
 ",status=no,resizable=" + v_Resizable + ",screenX=" + v_PopupX +
 ",screenY=" + v_PopupY + ",left=" + v_PopupX + ",top=" + v_PopupY);
ggWinCal.opener = self;
var p_WinCal = ggWinCal;
if (isNav && !isDOM) {
 ggWinCal.captureEvents(Event.RESIZE);
}
gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format, p_type);
gCal.gCurrentDate = vCurrentDate;
gCal.gAllowWeekends = "Yes";
gCal.closeable = true;
gCal.returnMode = "Replace";
gCal.returnData = "Date";
gCal.appendChar = "";
gCal.CallFunction = chkVar("v_CallFunction") ? v_CallFunction : "";
gCal.gTitle = v_Title ? v_Title : gCal.gMonthName + "/" + gCal.gYear;
// Customize your Calendar here..
gCal.gBGColor="white";
gCal.gLinkColor="black";
gCal.gTextColor="black";
gCal.gHeaderColor="darkgreen";

gCal.show();
}
function show_calendar() {
v_WeekStart=1;
p_item = arguments[0];
p_month = new String(gNow.getMonth());
p_year = new String(gNow.getFullYear().toString());
p_format = "DD/MM/YYYY";
p_type = "POPUP";
p_custom = "CloseOnSelect=Yes;AppendOrReplace=Replace;AppendChar=';';ReturnData=Date;Title=Calendar;AllowWeekends=Yes;Resizable=No;SmartNav=Yes";
Build(p_item, p_month, p_year, p_format, p_type, p_custom);
}
