function addLink (s, id, type) {
linksArray =['<a href = http://' + $('#textOutLink').val() + ' target = "_blank">',
'',
'<a href = "javascript: showParagraph(' + id + ',-1)">',
'',
'<a href = "javascript: showSummary(' + id + ')">'
];
$.getJSON($SCRIPT_ROOT + '/edit/linkProblem', {id: id},
function (data) {
linksArray[3] = '<a href = "javascript: showProblem(' + data.par_id + ',' + data.pr_num + ',-1)">';
console.log('<a href = "javascript: showProblem(' + data.par_id + ',' + data.pr_num + ',-1)">')
s = linksArray[type] + s +'</a>';
console.log(linksArray)
})
console.log(1)
console.log(s)
return s;
}