﻿/*
This should be the single point of contct for any scripts that need to refresh on a per load (ajax or not) basis
*/
function pageLoad() {
    attachLightbox();
}

function attachLightbox() {

    /* This re-attaches the lightbox to the images on product pages when they are uploaded and viewed in real-time */
    $(function () {
        $('.detailpreview a').lightBox({
            fixedNavigation: false,
            imageLoading: '/images/lightbox-ico-loading.gif',
            imageBtnPrev: '/images/lightbox-btn-prev.gif',
            imageBtnNext: '/images/lightbox-btn-next.gif',
            imageBtnClose: '/images/lightbox-btn-close.gif',
            imageBlank: '/images/lightbox-blank.gif'
        });
    });
}

function RefreshGrid(clientId, uniqueId) {
    $find(clientId).ajaxRequestWithTarget(uniqueId, "Refresh")
}

function MM_preloadImages() { //v3.0
  var d = document; if (d.images) {
    if (!d.MM_p) d.MM_p = new Array();
    var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
      if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; }
  }
}

