var files = new Array(); var selectedFile = null; var visibleFiles=4; $(document).ready(function () { var selectedValue = false; var selectedIndex = 0; var cp_pid; var cm_pid; var start=0; var end = 50; if ($('#fileField').attr('value') != '') { selectedValue = $('#fileField').attr('value'); } cp_pid = $('#edit-collection-pid').attr('value'); cm_pid = $('#model_pid').attr('value'); $.getJSON("/filechooser/generatePreview/"+cp_pid+"/"+cm_pid+"?start="+start+"&end="+end,function (data) { $('#fileList').html(''); if (data.length == 0) { $('#fileList').append('