﻿var FlickrChecker = {
    HasAccess: null,
    img: new Image(),
    CheckAccess: function(AllowedFn, DeniedFn) {
    $(FlickrChecker.img).load(function() {
            if (this.height > 0) {
                FlickrChecker.HasAccess = true;
                if (AllowedFn)
                    AllowedFn();
            } else {
            FlickrChecker.HasAccess = false;
                if (DeniedFn)
                    DeniedFn();
            }
        }).error(function() {
        FlickrChecker.HasAccess = false;
            if (DeniedFn)
                DeniedFn();
        }).attr('src', 'http://flickr.com/favicon.ico');
    }
};


FlickrChecker.CheckAccess(function() {
    $(document).ready(function() {
    });
}, function() {
    $(document).ready(function() {
        $("#flickrNotAvailable").html("<p>This website accesses galleries stored on Flickr. Unfortunately your current networks blocks access to Flickr.</p>");
        $("#photos, #photoSets").hide();
    });
});

