/** Prettify JSON .*/
function prettifyJSON() {
    $.each( $('.prettify-json'), function() {
        var ugly = $(this).val();
        var obj = JSON.parse(ugly);
        var pretty = JSON.stringify(obj, undefined, 4);
        $(this).val(pretty);
        console.log(pretty);
    });
}


/** Populate value of radio buttons linked to text fields.*/
$('#answer-form').on('submit', function() {
    $('.radio-text-group').each(function() {
        var text = $(this).find('input[type=text]').val();
        $(this).find('input[type=radio]').val(text);
    });
});


$(document).ready(function() {
    prettifyJSON();
});
@@ -559,16 +559,387 @@
 ;%0A%7D);%0A%0A%0A
+/** Perform a Z39.50 search.*/%0Afunction z3950Search(query, callback) %7B%0A    $.ajax(%7B%0A        type: 'GET',%0A        url: '/z3950/search/oclc/html',%0A        data: %7Bquery: query%7D,%0A        success: function(results) %7B%0A            callback(results);%0A        %7D, error: function(err) %7B%0A            alert('Z3950 ERROR: ' + err.status + %22 %22 + err.statusText);%0A        %7D%0A    %7D);%0A%7D%0A%0A%0A
 $(docume

Add Z3950 search function