function getObj(objID)
{
    if		(document.getElementById) {return document.getElementById(objID);}
    else if (document.all) {return document.all[objID];}
    else if (document.layers) {return document.layers[objID];}
}

function hideCalendar()
{
	getObj('CalendarTable').style.display = 'none';
	hideActionDiv(); 
	hideActionLayer();
}

function checkClick(e) 
{
	e?evt	= e:evt = event;
	CSE		= evt.target?evt.target:evt.srcElement;
	if (getObj('CalendarTable'))
	{
		if (!isChild(CSE,getObj('CalendarTable')))
		{
			if(getObj('CalendarTable').style.display != 'none')	
			{
				hideActionLayer();
			}
			getObj('CalendarTable').style.display='none';
		}
	}
}

function isChild(s,d) 
{
	while(s) 
	{
		if (s==d) 
			return true;
		s = s.parentNode;
	}
	return false;
}

function Left(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj		= obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function Top(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
	
document.write('<table id="CalendarTable" style="position:absolute;border-collapse:collapse;background:#FFFFFF;border:1px solid #ABABAB;display:none; z-index:100000;" cellpadding=2>');

document.write('<tr><td style="cursor:pointer" onclick="csubm()"><img src="../images/calendar/arrowleftmonth.gif"></td><td colspan=5 id="mns" align="center" style="font:bold 13px Arial"></td><td align="right" style="cursor:pointer" onclick="caddm()"><img src="../images/calendar/arrowrightmonth.gif"></td></tr>');

document.write('<tr><td align=center style="background:#ABABAB;font:12px Arial">S</td><td align=center style="background:#ABABAB;font:12px Arial">M</td><td align=center style="background:#ABABAB;font:12px Arial">T</td><td align=center style="background:#ABABAB;font:12px Arial">W</td><td align=center style="background:#ABABAB;font:12px Arial">T</td><td align=center style="background:#ABABAB;font:12px Arial">F</td><td align=center style="background:#ABABAB;font:12px Arial">S</td></tr>');

for(var kk=1;kk<=6;kk++) 
{
	document.write('<tr>');
	for(var tt = 1; tt <=7; tt++) 
	{
		num	= 7 * (kk - 1) - (-tt);
		document.write('<td id="v' + num + '" style="width:18px;height:18px">&nbsp;</td>');
	}
	document.write('</tr>');
}
document.write('</table>');

document.all?document.attachEvent('onclick', checkClick):document.addEventListener('click', checkClick, false);

// Calendar script
var strToday			= new Date;
var iTodayMonth			= strToday.getMonth();
var iTodayYear			= strToday.getFullYear();
var iCurSelDay			= '';
var iCurSelMonth		= strToday.getMonth();
var iCurSelYear			= strToday.getFullYear();

var hCurrentValue;
var bAppend;
var strElementInUse;
var thisform;
function BuildCalendar(strElementName, form, iEventID, iTicketID) 
{
	strElementInUse	= strElementName;
	thisform		= form;
	if(strElementName == 'strExcludedDates') strElementName = 'OtherDatesLink';

	hTicketID		= document.getElementById("TheTicketID");
	if(strElementName.substr(0, 11) == 'chosendates') 
	{
		iTicketID	= strElementName.substr(11);
		hTicketID.value	= iTicketID;
	}

	hTicketID		= document.getElementById("TheTicketID");
	if(hTicketID != null)
	{	hTicketID.value	= iTicketID; }

	if(iEventID > 0 )
	{
	}
	else
	{
		hEvent		= document.getElementById("TheEventID");
		if(hEvent != undefined && hEvent != null)
		{
			iEventID	= hEvent.value;
		}
	}

	hCurrentValue	= eval("document." + form + "." + strElementName);

	if(hCurrentValue == undefined || hCurrentValue == null)
	{
		hCurrentValue	= document.getElementById(strElementName);
	}

	getObj('CalendarTable').style.left		= Left(hCurrentValue) + 'px';
	getObj('CalendarTable').style.top		= Top(hCurrentValue) + hCurrentValue.offsetHeight + 'px';
	getObj('CalendarTable').style.display	= '';

	showActionLayer(Left(hCurrentValue), Top(hCurrentValue) + hCurrentValue.offsetHeight, '162', '150');

	if (strElementName.length > 14) strElementName	= strElementName.substr(0, 14);
	if (strElementName.substr(0, 11) == 'chosendates') strElementName	= 'chosendates';

	switch(strElementName)
	{
		case 'OtherDatesLink':
			break;

		case 'chosendates':
			prepcalendar('', iCurSelMonth, iCurSelYear, iEventID, iTicketID, 'yes');
			break;

		default:
			strCurSel			= hCurrentValue.value;	
			aCurSel				= strCurSel.split('-');
			bDateExists			= true;

			for(var k = 0; k < aCurSel.length; k++) 
			{
				if(isNaN(aCurSel[k]))
					bDateExists	= false;
			}

			if(bDateExists & (aCurSel.length == 3)) 
			{
				iCurSelDay		= aCurSel[0];
				iCurSelMonth	= aCurSel[1] - 1;		// Do this as GetMonth makes Jan = 0 etc
				iCurSelYear		= aCurSel[2];

				prepcalendar(iCurSelDay, iCurSelMonth, iCurSelYear, iEventID, iTicketID);
			}
			break;
	}
}

function evtTgt(e)
{
	var el;
	if(e.target)			el = e.target;
	else if(e.srcElement)	el = e.srcElement;
	if(el.nodeType==3)		el = el.parentNode;		// defeat Safari bug
	return el;
}

function EvtObj(e)
{
	if(!e) e = window.event; return e;
}

function date_over(e) 
{
	evtTgt(EvtObj(e)).style.background='#FFCC66';
}

function date_out(e) 
{
	evtTgt(EvtObj(e)).style.background='#C4D3EA';
}

function date_click(e) 
{
	if(strElementInUse.substr(0, 11) == 'chosendates') 
	{
		strActualElement = strElementInUse;
		strElementInUse	 = strElementInUse.substr(0, 11);
	}

	switch(strElementInUse)
	{
		case 'strEventDateFromD':
		case 'strEventDateToD':
			strNewDate = iTotalSquares[evtTgt(EvtObj(e)).id.substring(1,evtTgt(EvtObj(e)).id.length)];
			hHandle = document.getElementById(strElementInUse);
			hHandle.value = strNewDate;
			getObj('CalendarTable').style.display = 'none';
			break;

		case 'OtherDatesLink1':
		case 'OtherDatesLink2':
		case 'OtherDatesLink3':
		case 'OtherDatesLink4':
		case 'OtherDatesLink5':
		case 'OtherDatesLink6':
		case 'OtherDatesLink7':
		case 'OtherDatesLink8':
		case 'OtherDatesLink9':

			strElementInUseOld	= strElementInUse;
			strElementInUse		= 'strExcludedDates' + strElementInUse.substr(14, 1);
			strDropToUse		= 'OtherExDatesDrop' + strElementInUse.substr(16, 1);

			hExDates			= eval("document." + thisform + "." + strElementInUse);
			var strNewDate		= iTotalSquares[evtTgt(EvtObj(e)).id.substring(1,evtTgt(EvtObj(e)).id.length)];

			if(hExDates.value.indexOf(strNewDate) == -1)
			{
				strNewExDates	= hExDates.value + ',' + strNewDate;
			}

			var strNewExDates	= (strNewExDates.substr(0, 1) == ',' ? strNewExDates.substr(1, (strNewExDates.length)) : strNewExDates);
			hExDates.value		= strNewExDates;

			strElementInUse		= strElementInUseOld;

			AddOtherExDate(thisform, strNewExDates, strDropToUse, 'Excluded');
			break;
		
		case 'strExcludedDates':
			hExDates			= eval("document." + thisform + "." + strElementInUse);
			var strNewDate		= iTotalSquares[evtTgt(EvtObj(e)).id.substring(1,evtTgt(EvtObj(e)).id.length)];

			strNewExDates		= (hExDates.value.indexOf(strNewDate) == -1 ? hExDates.value + ',' + strNewDate : hExDates.value);

			strNewExDates		= (strNewExDates.substr(0, 1) == ',' ? strNewExDates.substr(1, (strNewExDates.length)) : strNewExDates);
			hExDates.value		= strNewExDates;

			AddOtherExDate(thisform, strNewExDates, 'OtherExDatesDrop', 'Currently Excluded');
			break;
		
		case 'chosendates':
			strActualElementH	= strActualElement + 'hidden';
			hIncDates			= eval("document." + thisform + "." + strActualElementH);
			
			var strNewDate		= iTotalSquares[evtTgt(EvtObj(e)).id.substring(1,evtTgt(EvtObj(e)).id.length)];

			strNewIncDates		= (hIncDates.value.indexOf(strNewDate) == -1 ? hIncDates.value + ',' + strNewDate : hIncDates.value);

			strNewIncDates		= (strNewIncDates.substr(0, 1) == ',' ? strNewIncDates.substr(1, (strNewIncDates.length)) : strNewIncDates);
			hIncDates.value		= strNewIncDates;

			AddOtherIncDate(thisform, strNewIncDates, strActualElement, 'Chosen Dates');

			strElementInUse		= strActualElement;
			break;

		default:
			hCurrentValue.value = iTotalSquares[evtTgt(EvtObj(e)).id.substring(1,evtTgt(EvtObj(e)).id.length)];
			getObj('CalendarTable').style.display = 'none';
			hideActionDiv();
			hideActionLayer();
			break;
	}
	
}

var aMonths			= new Array('JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC');
var aNormalYear		= new Array('31','28','31','30','31','30','31','31','30','31','30','31');
var aLeapYear		= new Array('31','29','31','30','31','30','31','31','30','31','30','31');
var iTotalSquares	= new Array(42);

function f_available(obj) 
{
	obj.style.background		= '#C4D3EA';
	obj.style.font				= '10px Arial';
	obj.style.color				= '#333333';
	obj.style.textAlign			= 'center';
	obj.style.textDecoration	= 'none';
	obj.style.border			= '1px solid #6487AE';
	obj.style.cursor			= 'pointer';
}

function f_unavailable(obj) 
{
	obj.style.background		= '#C4D3EA';
	obj.style.font				= '10px Arial';
	obj.style.color				= '#ABABAB';
	obj.style.textAlign			= 'center';
	obj.style.textDecoration	= 'line-through';
	obj.style.border			= '1px solid #6487AE';
	obj.style.cursor			= 'default';
}

function f_selected(obj) 
{
	obj.style.background		= '#FFF799';
	obj.style.font				= 'bold 10px Arial';
	obj.style.color				= '#333333';
	obj.style.textAlign			= 'center';
	obj.style.border			= '1px solid #6487AE';
	obj.style.cursor			= 'pointer';
}

// day selected
var bPassThrough	= false;
function prepcalendar(iCurSelDay, iCurSelMonth, iCurSelYear, iEventID, iTicketID, bDownloading) 
{
	now						= new Date();
	iTodayDay				= now.getDate();
	td						= new Date();

	td.setDate(1);
	td.setFullYear(iCurSelYear);
	td.setMonth(iCurSelMonth);
	
	iDayoftheWeek			= td.getDay();
	getObj('mns').innerHTML = aMonths[iCurSelMonth] + ' ' + iCurSelYear;
	aDaysInMonth			= ((iCurSelYear%4) == 0) ? aLeapYear : aNormalYear;

	var strThisLocation		= (window.location.hostname.substr(0, 7) == 'bavaria' ? window.location.hostname + '/nick/etickets' : window.location.hostname);
//alert('iEventID: ' + iEventID);
	if(iEventID > 0)
	{
		if(bDownloading == 'yes')
		{
			hTicket		= document.getElementById("TheTicketID");
			iTicketID	= hTicket.value;

			hDownloading	= document.getElementById("Downloading");
			hDownloading.value = 'yes';

			var URL		= 'http://' + strThisLocation + '/admin/downloadevent/solddates.php?eventid=' + iEventID + '&ticketid=' + iTicketID +'&year=' + iCurSelYear + '&month=' + (iCurSelMonth + 1) + '&dummy=' + new Date().getTime();
//alert('URL 1a: ' + URL);
			ExDates		= createRequest();
			ExDates.open("GET", URL, true);

			ExDates.onreadystatechange = function () { MakeCalendar(true); };

			ExDates.send(null);
		}
		else
		{
			var URL		= 'http://' + strThisLocation + '/buy/excludeddates.php?eventid=' + iEventID + '&ticketid=' + iTicketID +'&year=' + iCurSelYear + '&month=' + (iCurSelMonth + 1) + '&dummy=' + new Date().getTime();
//alert('URL 1b: ' + URL);
			ExDates		= createRequest();
			ExDates.open("GET", URL, true);

			ExDates.onreadystatechange = function () { MakeCalendar(false); };

			ExDates.send(null);
		}
	}
	else
    {
        var URL         = 'http://' + strThisLocation + '/buy/excludeddates.php?dummy=' + new Date().getTime();
        ExDates         = createRequest();
        ExDates.open("GET",URL, true);
        ExDates.onreadystatechange = function () { MakeCalendar(false); };
        ExDates.send(null);
   }
}


function MakeCalendar(download)
{
	var message = '';

	message += 'readyState: ' + ExDates.readyState + "\n";

	if(ExDates.readyState == 4)
	{
		// Extract the response text from the XML HTTP response.
		// This will be an string of dates, seperated by forward slash, 
		// that we'd like to exclude from the calendar. 
		strExcludedDates		= ExDates.responseText;

		// Sort the dates into an array by spliting the dates by the forward slash.
		aExcludedDates			= strExcludedDates.split('/');
	
		var depth = 0;
		for(i = 0; i < aExcludedDates.length; i++)
		{
			message += 'Exclude dates: ' + aExcludedDates[i] + '; ';	
			
			depth++;

			if(depth == 3) 
			{
				message += "\n";
				depth = 0;
			}
		}

		

		// Define now using the current date.
		now						= new Date();
		// Define today.
		iTodayDay				= now.getDate();
		// Define td using the current date.
		td						= new Date();

		message += "\n" + 'now: ' + now + ';' + "\n";
		message += 'iTodayDay: ' + iTodayDay + ';' + "\n";
		message += 'td: ' + td + "\n";

		// Reset td, which current contains todays date.
		// Reset the day to the first.
		td.setDate(1);
		// Reset the year to our year.
		td.setFullYear(iCurSelYear);
		// Reset the month to our month.
		td.setMonth(iCurSelMonth);

		message += 'iCurSelectYear: ' + iCurSelYear + '; iCureSelMonth: ' + iCurSelMonth + ";\n";

		message += ' new td: ' + td + "\n";

		// From our td object, which has been adjusted to the date we require,
		// determine which day in the week the day actually is.
		// E.g. The value returned by getDay() is a number between 0 and 6. Sunday is 0, Monday is 1 and so on.
		iDayoftheWeek			= td.getDay();

		message += 'Day in the week: ' + iDayoftheWeek + ';' + "\n";

		// Using our month and year, reset the header for the actual calendar.
		getObj('mns').innerHTML = aMonths[iCurSelMonth] + ' ' + iCurSelYear;

		// Determine the days in the current month.
		// Factor in the leap year, normal year senario.
		aDaysInMonth			= ((iCurSelYear%4) == 0) ? aLeapYear : aNormalYear;
		message += 'Days in ' + aMonths[iCurSelMonth] + ': ' + aDaysInMonth[iCurSelMonth] + ';' + "\n";

		// Work through each day and prepare the calender output.
		for(var iDayCount = 1; iDayCount <= 42; iDayCount++) 
		{
			message += '#############################' + "\n" + 'Calender layout square: ' + iDayCount + "\n";
			
			f_available(getObj('v' + parseInt(iDayCount)));
			
			// What decision are we making here???
			message += 'if ((' + iDayCount + '>= (' + iDayoftheWeek + '- (-1))) && (' + iDayCount + '<= ' + iDayoftheWeek + '- (-' + aDaysInMonth[iCurSelMonth] + ')))' + "\n";

			if ((iDayCount >= (iDayoftheWeek - (-1))) && (iDayCount <= iDayoftheWeek - (-aDaysInMonth[iCurSelMonth]))) 
			{
				message += 'We\'ve found a calendar square for the correct day.' + "\n";

				// dip. TRUE if we're handling a date that is less than our current day, but matches our month and year.
				dip = ((iDayCount - iDayoftheWeek < iTodayDay) && (iCurSelMonth == iTodayMonth) && (iCurSelYear == iTodayYear) && download == false);
				
				// Use unknown!
				htd	= ((iCurSelDay != '') && (iDayCount - iDayoftheWeek == iCurSelDay));

				bDoActions	= true;

				if (dip)
				{
					message += "dip\n";
					f_unavailable	(getObj('v' + parseInt(iDayCount)));
				}
				else if (htd)
				{
					message += "htd\n";
					strTodayDBStyleMonth		= iCurSelMonth - (-1);
					if(strTodayDBStyleMonth < 10)
						strTodayDBStyleMonth	= '0' + strTodayDBStyleMonth;
					
					strTodayDBStyleDay			= iDayCount - iDayoftheWeek;
					if(strTodayDBStyleDay < 10)
						strTodayDBStyleDay		= '0' + strTodayDBStyleDay;

					strTodayDBStyle = '' + iCurSelYear + '-' + strTodayDBStyleMonth + '-' + strTodayDBStyleDay;

					bAvailable	= true;
					var iACount = 0;
					for(iACount = 0; iACount < aExcludedDates.length; iACount++)
					{
						if(aExcludedDates[iACount] == strTodayDBStyle)
						{
							bAvailable = false;
						}
					}

/*
					var strShortElement	= strElementInUse.substring(0, 4);
					hChosenMonth		= document.getElementById(strElementInUse);
					iChosenMonth		= hChosenMonth.value.substr(3, 2);
					if(strShortElement == 'Edit' && iChosenMonth == strTodayDBStyleMonth)
					{
						bAvailable = true;
					}
*/

					if(bAvailable == true)
					{
						f_selected		(getObj('v' + parseInt(iDayCount)));
					}
					else
					{
						f_unavailable	(getObj('v' + parseInt(iDayCount)));
						getObj('v' + parseInt(iDayCount)).onmouseover	= null;
						getObj('v' + parseInt(iDayCount)).onmouseout	= null;
						getObj('v' + parseInt(iDayCount)).onclick		= null;
						bDoActions	= false;
					}
				}
				else
				{
					message += "other\n";
					strTodayDBStyleMonth		= iCurSelMonth - (-1);
					if(strTodayDBStyleMonth < 10)
						strTodayDBStyleMonth	= '0' + strTodayDBStyleMonth;
					
					strTodayDBStyleDay			= iDayCount - iDayoftheWeek;
					if(strTodayDBStyleDay < 10)
						strTodayDBStyleDay		= '0' + strTodayDBStyleDay;
					
					strTodayDBStyle = '' + iCurSelYear + '-' + strTodayDBStyleMonth + '-' + strTodayDBStyleDay;

					bAvailable	= true;
					var iACount = 0;
					for(iACount = 0; iACount < aExcludedDates.length; iACount++)
					{
						if(aExcludedDates[iACount] == strTodayDBStyle)
						{
							bAvailable = false;
						}
					}

					if(bAvailable == true)
					{
						f_available		(getObj('v' + parseInt(iDayCount)));
					}
					else
					{
						f_unavailable	(getObj('v' + parseInt(iDayCount)));
						getObj('v' + parseInt(iDayCount)).onmouseover	= null;
						getObj('v' + parseInt(iDayCount)).onmouseout	= null;
						getObj('v' + parseInt(iDayCount)).onclick		= null;
						bDoActions	= false;
					}
				}

				if(bDoActions == true)
				{
					message += "bDoAction == true\n";
					getObj('v' + parseInt(iDayCount)).onmouseover	= (dip) ? null : date_over;
					getObj('v' + parseInt(iDayCount)).onmouseout	= (dip) ? null : date_out;
					getObj('v' + parseInt(iDayCount)).onclick		= (dip) ? null : date_click;
				}

				getObj('v' + parseInt(iDayCount)).innerHTML		= iDayCount - iDayoftheWeek;	

				strMonthToReturn		= iCurSelMonth - (-1);
				if(strMonthToReturn < 10)
					strMonthToReturn	= '0' + strMonthToReturn;
				
				strDayToReturn			= iDayCount - iDayoftheWeek;
				if(strDayToReturn < 10)
					strDayToReturn		= '0' + strDayToReturn;

				iTotalSquares[iDayCount] = '' + strDayToReturn + '-' + strMonthToReturn + '-' + iCurSelYear;
			}
			else 
			{
				message += 'This isn\'t a valid day in this month, disable the square; step through' + "\n";
				getObj('v' + iDayCount).innerHTML				= '&nbsp;';
				getObj('v' + parseInt(iDayCount)).onmouseover	= null;
				getObj('v' + parseInt(iDayCount)).onmouseout	= null;
				getObj('v' + parseInt(iDayCount)).style.cursor	= 'default';
			}
		}
	}

	//alert(message);
}

function caddm() 
{
	hEventID		= document.getElementById("TheEventID");
	if(hEventID != null)
	{	iEventID		= hEventID.value;	}
	else
	{	iEventID		= '0';				}

	hTicketID		= document.getElementById("TheTicketID");
	if(hTicketID != null)
	{	iTicketID		= hTicketID.value;	}
	else
	{	iTicketID		= '0';				}

	hDownloading	= document.getElementById("Downloading");
	if(hDownloading != null)
	{	bDownloading	= hDownloading.value;	}
	else
	{	bDownloading	= 'no';				}
	
	var message = '1 iCurSelMonth: ' + iCurSelMonth + "\n";
	iCurSelMonth	+= 1;
	message += '2 iCurSelMonth: ' + iCurSelMonth + "\n";
	if(iCurSelMonth >= 12) 
	{
		message += '3 iCurSelMonth: ' + iCurSelMonth + "\n";
		iCurSelMonth = 0;
		iCurSelYear++;
	}

	message += '4 iCurSelMonth: ' + iCurSelMonth + "\n";

	cdayf();

	message += '5 iCurSelMonth: ' + iCurSelMonth + "\n";

	message += 'prepcalendar(\'\', ' + iCurSelMonth + ', ' +  iCurSelYear + ', ' + iEventID + ', ' +  iTicketID + ', ' +  bDownloading + ');' + "\n";

	//alert(message);
	
	prepcalendar('', iCurSelMonth, iCurSelYear, iEventID, iTicketID, bDownloading);
}

function csubm() 
{
	aDaysInMonth	= ((iCurSelYear%4)==0) ? aLeapYear : aNormalYear;

	hEventID		= document.getElementById("TheEventID");
	if(hEventID != null)
	{	iEventID		= hEventID.value;	}
	else
	{	iEventID		= '0';				}

	hTicketID		= document.getElementById("TheTicketID");
	if(hTicketID != null)
	{	iTicketID		= hTicketID.value;	}
	else
	{	iTicketID		= '0';				}

	hDownloading	= document.getElementById("Downloading");
	if(hDownloading != null)
	{	bDownloading	= hDownloading.value;	}
	else
	{	bDownloading	= 'no';				}

	var message = '1 iCurSelMonth: ' + iCurSelMonth + "\n";
	iCurSelMonth	-=1;
	message += '2 iCurSelMonth: ' + iCurSelMonth + "\n";
	if (iCurSelMonth < 0) 
	{
		message += '3 iCurSelMonth: ' + iCurSelMonth + "\n";
		iCurSelMonth = 11;
		iCurSelYear--;
	}

	message += '4 iCurSelMonth: ' + iCurSelMonth + "\n";

	cdayf(bDownloading);

	message += '5 iCurSelMonth: ' + iCurSelMonth + "\n";

	message += 'prepcalendar(\'\', ' + iCurSelMonth + ', ' +  iCurSelYear + ', ' + iEventID + ', ' +  iTicketID + ', ' +  bDownloading + ');' + "\n";

	//alert(message);

	prepcalendar('', iCurSelMonth, iCurSelYear, iEventID, iTicketID, bDownloading);
}

function cdayf(sDownload) 
{
	if ((iCurSelYear > iTodayYear) | ((iCurSelYear == iTodayYear) && (iCurSelMonth >= iTodayMonth)))
		return;
	else 
	{
		if(sDownload == 'no')
		{
			iCurSelYear		= iTodayYear;
			iCurSelMonth	= iTodayMonth;
		}
	}
}

function setEventandTicketID(strForm, iEventID, iTicketID)
{
	hTicketID		= document.getElementById("TheTicketID");
	if(hTicketID != null)
	{	hTicketID.value	= iTicketID;	}

	hEventID		= document.getElementById("TheEventID");
	if(hEventID != null)
	{	hEventID.value	= iEventID;		}
}

prepcalendar('', iCurSelMonth, iCurSelYear, '', '') 
