;ET.CRUISES = 
{
    init: function()
    {
        // If search button clicked
        $('#cru_submitButton').bind('click', function()
        {  
    		if($('#cruiseSearchForm').find('#destination').length > 0 && $('#cruiseSearchForm').find('#destination').val() == '1')
    		{
    			var destination = $('#cruiseSearchForm name=["destination_id"]').value();
    			destination = destination.split(' ');
    			$('#cruiseSearchForm').action += destination[1] + '/findacruise/';
    		}
        	$('#cruiseSearchForm').submit();
        });
        
        // If any drop down changed
        $('#cruiseSearchForm select').bind('change', function()
        {
            $('#cruiseSearchForm').submit();
    		var elements = document.forms[0].elements;
    		for(var i=0;i<elements.length;++i)
    		{
    			if(elements[i].type == 'select-one')
    			{
    				elements[i].disabled = true;
    			}
    		}
        });

        // Cruise content select boxes
        $('#cruisesSelectForm select').bind('change', function()
        {
            if($(this).val() !== '')
            {
                window.location.href = $(this).val();
            }
        });
    }
};
ET.CRUISES.init();
