jQuery(function() {
    $('img[@src*="assets/images/"]' + ".cpu").each(function(){
        $(this).before($(document.createElement("a")).addClass("cpu").attr({href: $(this).attr('src'), rel: "lightbox"}).append($(this).clone(true)));
        $(this).remove();
    });
    $('img[@src*="assets/images/"]' + ".cpu_a").each(function(){
        $(this).before($(document.createElement("a")).addClass("cpu_a").attr({href: $(this).attr('src').replace(/(\.png|\.jpe?g|\.gif)/, "_a$1"), rel: "lightbox"}).append($(this).clone(true)));
        $(this).remove();
    });
    var conf = {
        imageLoading: 'assets/js/imgpopup/lightbox-ico-loading.gif',
        imageBtnClose: 'assets/js/imgpopup/lightbox-btn-close.gif',
        imageBtnPrev: 'assets/js/imgpopup/lightbox-btn-prev.gif',
        imageBtnNext: 'assets/js/imgpopup/lightbox-btn-next.gif',
        containerResizeSpeed: 200,
        txtImage: '画像:',
        txtOf: '/'
    };

    $('a.cpu[@rel*=lightbox]').lightBox(conf);
    $('a.cpu_a[@rel*=lightbox]').lightBox(conf);
});


