jQuery(function() {
    var toggleOneWay = function() {
	var state = jQuery('#oneway').attr('checked') || false;

	jQuery('#flight_type input:radio').each(function() {
	  jQuery(this).next().removeClass('selected');
	}).filter(':checked').next().addClass('selected');

	jQuery('#roundtrip_box input, #roundtrip_box select').attr('disabled', state);
	jQuery('#roundtrip_box a.calendar_icon')[state ? 'addClass' : 'removeClass']('calendar_disabled');
}
toggleOneWay();
jQuery('#flight_type input:radio').click(toggleOneWay);

jQuery('#guide-search a').focus(function() { return this.blur(); });
jQuery('#flight_type input:radio').focus(function() { return this.blur(); });

jQuery('#guide-search input:text').focus(function(){
    jQuery(this).addClass('focused');
});
jQuery('#guide-search input:text').blur(function(){
    jQuery(this).removeClass('focused');
});

jQuery('#guide-search .hover_fix').hover(function() {
    jQuery(this).addClass('hover');
}, function() {
    jQuery(this).removeClass('hover');
    });
});

