﻿/// <reference path="jQuery/jquery-1.4.1-vsdoc.js" />
/// <reference path="jQuery/contentflow.js" />

function ViewLargeImage(sender) {
    //alert(obj.content.getAttribute('src'));
    //alert(obj.content.getAttribute('alt'));
    //alert(obj.content.getAttribute('title'));
    var src = sender.content.getAttribute('src').toLowerCase().replace('/img/', '/bigimg/');
    var alt = sender.content.getAttribute('title');
    if (src.length != 0) {
        
        var img = new Image();
        img.id = "InspirationModalImg";
        img.Class = "InspirationModalImg";
        img.src = src;
        img.alt = alt;

        $("#InspirationModalImg").remove();
        //$('.InspirationModalInside').addClass("LoadingImage");

        $(img).load(function() {    // when image has loaded...
            $(this).css('display', 'none'); // hide image by default
            //$('.InspirationModalInside').removeClass('LoadingImage');
            $(".InspirationModalInsideHolder").append(this);
            $(this).fadeIn('slow'); // fade image in

            $(".InspirationImageLargeModal").modal({
                appendTo: '.InspirationView',
                overlayId: 'InspirationViewOverlay',
                containerId: 'InspirationImageLargeModal',
                minHeight: 150,
                closeClass: 'ViewModalClose',
                opacity: 82,
                close: true,
                overlayClose: true
            });


        }).attr('src', src);

    }
}
