/*********************************************************************
 function to load events
**********************************************************************/
//var ajax = new sack();
function LoadEvents(TheDate)
{
	if (parent.document.getElementById("EventsListing"))
	{		
			/*
			ajax.requestFile = "EventsListing.asp?Date=" + TheDate;                       // Specifying which file to get

			ajax.onCompletion = showClientData;     // Specify function that will be executed after file has been found
			ajax.runAJAX();
			*/
			//alert('inside' + parent.document.getElementById("EventsInitial"));
			parent.document.getElementById("EventsInitial").src = "Events/EventsListing.asp?Date=" + TheDate;
	}
	else
	{
			//parent.document.location.href = "../Events.asp?Date=" + TheDate
	}
}

function showClientData()
{
	parent.document.getElementById("EventsListing").innerHTML= ajax.response;
}

function LoadEventsDetails(EventID, EventScheduleID)
{
	if (parent.document.getElementById("EventsListing"))
	{		
		/*  Getting rid of AJAX - Hiral 20/04/2009
			if (parent.document.getElementById("EventsInitial"))		// check in iframe or not
			{
				ajax.requestFile = "EventDetails.asp?EventID=" + EventID + "&EventScheduleID=" + EventScheduleID;
			}	
			else
			{
				ajax.requestFile = "Events/EventDetails.asp?EventID=" + EventID + "&EventScheduleID=" + EventScheduleID;                       // Specifying which file to get
			}
			ajax.onCompletion = showClientData;     // Specify function that will be executed after file has been found
			ajax.runAJAX();    
		*/
		parent.document.getElementById("EventsInitial").src = "EventDetails.asp?EventID=" + EventID + "&EventScheduleID=" + EventScheduleID;
	}
	else
	{
		document.location = "EventDetails.asp?EventID=" + EventID + "&EventScheduleID=" + EventScheduleID;
	}
}
function autofitIframe(id){
      /*   if (!document.mimeType && document.all && document.getElementById)
				{
                if(parent.document.getElementById(id))
					{ alert('before1');
					//parent.document.getElementById(id).style.height=this.document.body.offsetHeight+"px";
					alert('after1');
					}
                }
        else*/
			
		if(document.getElementById) {
                if(parent.document.getElementById(id))
					{
						//alert('before2');	
					parent.document.getElementById(id).style.height=this.document.body.scrollHeight+"px";
						//alert('after2');
					}
                }
        } 

/*******************************************************
* function to combine time and date together
********************************************************/
function CombineDateTime(IDExt)
{
	var DateValue = document.getElementById("EventsDate" + IDExt).value;
	var HourValue = document.getElementById("EventsHour" + IDExt).value;
	var MinuteValue = document.getElementById("EventsMinute" + IDExt).value;
	var	HrValue = document.getElementById("EventsHR" + IDExt).value;

	document.getElementById("EventsDateTime" + IDExt).value = DateValue + ' ' + HourValue + ':' + MinuteValue + ':00 ' + HrValue;
}
