function show_calendar_container()
	{
	 var calendar_container = document.getElementById('calendar_select_date_and_time_container');
	 calendar_container.style.visibility = 'visible'; 
	}

function hide_calendar_container()
	{
	 var calendar_container = document.getElementById('calendar_select_date_and_time_container');
	 calendar_container.style.visibility = 'hidden'; 
	}

var xmlhttp = getXmlHttpRequestObject(); 


function display_calendar(duration, jump, day)
	{
	 var calendar_display = document.getElementById('calendar_event_container');
	 
	 if (typeof xmlhttp == "undefined") 
		{}
	 else
		{
		 xmlhttp.open("GET", "display_calendar.php?dur="+duration+"&jump="+jump+"&day="+day, true);
		 
		 xmlhttp.send(null);
		 
		 xmlhttp.onreadystatechange=function() 
										{
										 if (xmlhttp.readyState==4 && xmlhttp.status==200) 
											{
											 calendar_display.innerHTML = xmlhttp.responseText;
											}
										}
		}
	 
	}


function fill_date_and_time_field(date_time_info, id_name)
	{
	 var date_and_time_field = document.getElementById(id_name); 
	 
	 date_and_time_field.value = date_time_info; 
	 hide_calendar_container(); 
	 date_and_time_field.focus(); 
	}



function getXmlHttpRequestObject()
	{
	 var xmlhttp; 
	 
	 try
		{
		 xmlhttp = new XMLHttpRequest();
		}
	 catch(err1)
		{
		 var ieXmlHttpVersions = new Array();
		 ieXmlHttpVersions[ieXmlHttpVersions.length] = "MSXML2.XMLHttp.7.0";
		 ieXmlHttpVersions[ieXmlHttpVersions.length] = "MSXML2.XMLHttp.6.0";
		 ieXmlHttpVersions[ieXmlHttpVersions.length] = "MSXML2.XMLHttp.5.0";
		 ieXmlHttpVersions[ieXmlHttpVersions.length] = "MSXML2.XMLHttp.4.0";
		 ieXmlHttpVersions[ieXmlHttpVersions.length] = "MSXML2.XMLHttp.3.0";
		 ieXmlHttpVersions[ieXmlHttpVersions.length] = "MSXML2.XMLHttp";
		 ieXmlHttpVersions[ieXmlHttpVersions.length] = "Microsoft.XMLHttp";
		 
		 var i;
		 for (i=0; i < ieXmlHttpVersions.length; i++)
			{
			 try
				{
				 xmlhttp = new ActiveXObject(ieXmlHttpVersions[i]);
				 break;
				}
			 catch (err2)
				{
				 //alert("This page will not work correctly because your browser is too old.");
				}
			}
		}
	 
	 return xmlhttp;
	}
