﻿G2_DeclareFunctions(
{
	// Hide the flights and prices in the flight search
	HideFlightsAndPrice : function()
	{
		var tblSearch = G2DOM.GetParentByProgid(event.srcElement, "tblSearch");
		var tblPrice = G2DOM.GetChildByProgid(tblSearch,"tblPrice");
		var tdBook = G2DOM.GetChildByProgid(tblSearch,"tdBook");
		
		if(tblPrice)
			G2_HideControl(tblPrice,true);
		if(tdBook)
			G2_HideControl(tdBook,true);
	},
	
	// Disable the book buttons after selecting the class(before the price is updated)
	DisableBook : function(elm)
	{
		var rowSearch = G2DOM.GetParentByProgid(elm, "rowSearch");
		var tdBook = G2DOM.GetChildByProgid(rowSearch,"tdBook");
		
		// Get the book button of the currnet result - inbound or outbound
		var pnlResults = G2DOM.GetParentByProgid(elm, "pnlResults");
		var tdResultBook = G2DOM.GetChildByProgid(pnlResults,"tdResultBook");
		
		if(tdBook)
			tdBook.disabled = true;
		if(tdResultBook)
			tdResultBook.disabled = true;
	}
	
}); // close G2_DeclareFunctions