// when a thumbnail is pressed
function load_microfiche_image(url, key, showimg) {
if(showimg == 'no')
{
jQuery("#loader_image_div2").show();
jQuery.ajax({
type: 'get',
url: harpersAjax.ajaxurl,
data: {action: "microfiche_load_image"},
success: function(data) {
jQuery('#noImageContainer').html(data);
jQuery("#loader_image_div").hide();
},
error: function(err) {
alert('Error: ' + err.statusText);
}
});
return false;
} else {
// show the viewer for full sized indivdual pages (will fetch page to land on)
jQuery("#loader_image_div").show();
var a = key; // which page, starts at page 0
var len = parseInt(microfiche_images.length) - 1;
var top_nav = '';
if(a === 0) {
top_nav = 'Prev';
} else {
top_nav = 'Prev';
}
if(isNumber(microfiche_images[key][0])) {
top_nav = top_nav+'
'+ microfiche_images[key][0] +' of '+ maxval +'
';
} else {
top_nav = top_nav+' '+ microfiche_images[key][0] +'
';
}
if(a == len ) {
top_nav = top_nav+'Next';
} else {
top_nav = top_nav+'Next';
}
jQuery("div#lightbox .topRow, div#lightbox .botRow").html(top_nav);
jQuery.ajax({
type: 'get',
url: harpersAjax.ajaxurl,
data: {action: "microfiche_load_image",img: microfiche_images[key][2]},
success: function(data) {
jQuery('#imageContainer').html(data);
jQuery("#overlay, #lightbox").fadeIn(300);
jQuery('#lightbox').css("top", jQuery(window).scrollTop() + 20);
jQuery("#loader_image_div").hide();
},
error: function(err) {
alert('Error: ' + err.statusText);
}
});
}
}
/*
* Helper functions used by issue pages
*/
/*
* This Javascript function is used to create a two dimensional array.
*/
function Create2DArray(rows)
{
var arr = [];
for(var i=0; i