YHA.Page.Hostels.GroupEnq = Base.extend
({
	constructor: function(maxNoOnwardJourneyfHostels)
	{
		Event.observe(window, 'load', this.windowOnLoad.bindAsEventListener(this));
  		
  		this.maxNoOnwardJourneyfHostels = maxNoOnwardJourneyfHostels;
	},
	
	windowOnLoad: function()
	{
  		
  		this.showAdditionalHostels();
  		Event.observe($('number_of_additional_hostels'), 'change', this.showAdditionalHostels.bind(this));
	},
	
	showAdditionalHostels: function()
	{
	    var showHostels = $F('number_of_additional_hostels');
	    
	    for (i=1; i<=this.maxNoOnwardJourneyfHostels; i++)
	    {
	        $('additionalHostelContainer' + i).style.display = (showHostels >= i) ? 'block' : 'none';
        }
    }
});