<!--
/*
chooseDate.js
 
this takes the call from the pick arrive/depart date in the parent page
it discriminates between arrive and depart
 
this is in parent holding page
 
*/
function monthForward()
{
//alert("forward");
monthIncrement(whichDate);
//returns passData
whichDate = passData;
if (whichType == "roomToDate")
		{
		frameClass = "roomFrame";
		}
		else
		{
		frameClass = "dateFrame";
		}
		x= document.getElementById(whichDiv);
		x.innerHTML = "<iframe src = \""+ whichPage + "\" class = \"" + frameClass +"\" frameborder=\"0\" ></iframe>";
}
function monthBackward()
{
monthDecrement(whichDate);
//returns passData
whichDate = passData;
if (whichType == "roomToDate")
		{
		frameClass = "roomFrame";
		}
		else
		{
		frameClass = "dateFrame";
		}
		x= document.getElementById(whichDiv);
		x.innerHTML = "<iframe src = \""+ whichPage + "\" class = \"" + frameClass +"\" frameborder=\"0\" ></iframe>";
}

function pickDateToRoomDate(whichTypeIn,whichPageIn,whichDivIn,whichRoomIn)
{
	// is any picker active
	// gets type and page from html table in particular holding page
	if (pickerActive != "yes")
	{
		// set global variabe to which type of date is beeing chosen
whichType = whichTypeIn;
whichPage = whichPageIn; 
whichDiv = whichDivIn;
whichRoom = whichRoomIn;
		// stop mouseover having any further effect this is a global variable
		pickerActive = "yes"; // in pickerVariables.js

		// open picker.html in iframe
		// because it can be called from various directory level use whichPage in the call
		// set iframe class
		if (whichType == "roomToDate")
		{
		frameClass = "roomFrame";
		}
		else
		{
		frameClass = "dateFrame";
		}
		x= document.getElementById(whichDiv);
		x.style.top = "360px";
		x.innerHTML = "<iframe src = \""+ whichPage + "\" class = \"" + frameClass +"\" frameborder=\"0\" ></iframe>";

	} // end if picker active
} // end pickArrive

function pickRoomToDateDate(whichTypeIn,whichPageIn,whichDivIn,whichRoomIn)
{
//alert(whichDate);
	// is any picker active
	// gets type and page from html table in particular holding page
	if (pickerActive != "yes")
	{
		// set global variabe to which type of date is beeing chosen
whichType = whichTypeIn;
whichPage = whichPageIn; 
whichDiv = whichDivIn;
whichRoom = whichRoomIn;
		// stop mouseover having any further effect this is a global variable
		pickerActive = "yes"; // in pickerVariables.js

		// open picker.html in iframe
		// because it can be called from various directory level use whichPage in the call
		if (whichType == "roomToDate")
		{
		frameClass = "roomFrame";
		}
		else
		{
		frameClass = "dateFrame";
		}
		x= document.getElementById(whichDiv);
		x.style.top = "200px";
		x.innerHTML = "<iframe src = \""+ whichPage + "\" class = \"" + frameClass +"\" frameborder=\"0\" ></iframe>";

	} // end if picker active

} // end room to date

// this is the return from chooseCalendar.js
function setReturnedDates(whichDate)
{
	// split which date into year month day - remember month number starts at zero
	//thisYear/0 - thisMonthName/1 - displayDayNumber/2 - thisMonthNumber/3;
	splitDate = whichDate.split("-");

	switch(whichType)
	{
	case "arrive":
		// set display
		showChosenArriveDate = splitDate[2] + " " +splitDate[1] + " " + splitDate[0];
		x= document.getElementById("arriveCell");
		x.innerHTML = showChosenArriveDate;
		// set hidden form
		chosenArriveDate.setFullYear(splitDate[0],splitDate[3],splitDate[2]); // declared as new date(0 in pickerVariables.js
		y = document.getElementById("arriveDateElement");
		y.value = chosenArriveDate;
		break;

	case "depart":
		// set display
		showChosenDepartDate = splitDate[2] + " " + splitDate[1] + " " + splitDate[0];
		x= document.getElementById("departCell");
		x.innerHTML = showChosenDepartDate;
// set hidden form
		chosenDepartDate.setFullYear(splitDate[0],splitDate[3],splitDate[2]); // declared as new date(0 in pickerVariables.js
		y = document.getElementById("departDateElement");
		y.value = chosenDepartDate;
		break;

	default:
		alert("an error has occurred; please contact Redcetera");
	}

	x= document.getElementById("pickDateToRoomDiv");
	x.style.top = "-2000px";
	x.innerHTML = "";



	// reset to global variable allow mouseover
	pickerActive = "no";
}

// -->

