function removeFromCompare(id) {
    $("#remove_from_compare_"+id).addClass("ajax");
    $.getJSON('/json' + compare_href + '?delete=' + id, null, function(data) {
        window.location.href = window.location.href;
    });
}

function toggleParams(id) {
    if ($('#table_'+id+' tr.data').hasClass('hidden'))
    {
        $('#table_'+id+' tr.data').removeClass('hidden');
        $('#hide_'+id).html(hide_txt);
    }
    else
    {
        $('#table_'+id+' tr.data').each( function (j) {

                ok     = true;
                len    = $('td', this).length;
                oldval = '';
                $('td', this).each( function (i) {

                        if (i != 0 && i != (len-1))
                        {
                            if (i != 1)
                            {
                                //alert(oldval+' '+$(this).html());
                                if (oldval != $(this).html())
                                {
                                    ok = false;
                                }
                            }
                            oldval = $(this).html();
                        }

                    }
                );

                if (ok)
                {
                    $(this).addClass('hidden');
                }

            }
        );
        $('#hide_'+id).html(show_txt);
    }
}

function clearCompare() {
    $("#clear_results").addClass("ajax");
    $.getJSON('/json' + compare_href + '?clear=1', null, function(data) {
        window.close();
    });
}

