// (c) 2006 Chris M., Vergouwen Overduin

$(document).ready(function() {
    $('.qf_option_h').click(function(event) {
    	if ($(event.target).is('td.qf_option_h') || 
    		    $(event.target).is('div.qf_elb')) {
            $(':radio', this).trigger('click');
    	}
//        return false;
    });
    $('.qf_vgroup .qf_gel').click(function(event) {
    	if ($(event.target).is('input.qf_other')) {
            if (!$(':checkbox', this).attr('checked')) {
                $(':checkbox', this).trigger('click');
                $(':text', this).removeClass('qf_inactive');
                $('input.qf_other', this).focus();
            }
            if (!$(':radio', this).attr('checked')) {
                $(':radio', this).trigger('click');
                $(':text', this).removeClass('qf_inactive');
                $('input.qf_other', this).focus();
            }
            return false;
        } else if ($(event.target).is('div.qf_gel')) {
    		$(':checkbox', this).trigger('click');
    		$(':radio', this).trigger('click');
            if ($(':checkbox', this).attr('checked')) {
                $(':text', this).removeClass('qf_inactive');
            } else {
                $(':text', this).addClass('qf_inactive');
            }
    	}
//    	return false;
    });
    $('#searchWords').focus(function() {
    	$(this).val('');
    	$(this).removeClass('searchInit');
    	$(this).addClass('searchActive');
    });
});