(function (a) {
    var n, i = a(window).height(),
        p = a(window).width(),
        E = i / 2,
        F = i / 4,
        G = i / 6,
        H = i / 8,
        I = i / 10,
        J = i / 12,
        ca = E / 500,
        da = F / 500,
        ea = G / 500,
        fa = H / 500,
        ga = I / 500,
        ha = J / 500,
        ia, K = false,
        r = 200,
        T, ja = 1,
        ka = 0,
        L = 0,
        C, u = [],
        M = [],
        z = false,
        U = false,
        V = false,
        va, la = false,
        ma = true,
        A = true.divWidth = 0,
        W = 0,
        wa = "Recent",
        N, v, na, O, X, oa, P, Y, pa = false,
        B, qa, Z;
    init = function () {
        a("footer").css("top", a(window).height() - 50);
	if (navigator && navigator.platform && navigator.platform.match(/^(iPad|iPod|iPhone)$/)) {
   	 }else{
	$(window).bind("resize", resizeWindow);

	}
        a("#loadLightbox").bind("click", createLightbox);
        a("#aboutus").bind("click", showAboutUs);
        a(".saveToLightBox").live("click", saveToLightBox);
        a(".removeFromLightBox").live("click", removeFromLightBox);
        v = a("#container");
        v.css("opacity", "0");
        var b = a("#searchInput");
        getDimensions();
        b.bind("click", searchArray);
        b.bind("blur", searchArrayLoseFocus);
        b.bind("keypress", submitSearch);
        B = a("#preloaderDiv");
        p < 1100 && a("head").append('<link rel="stylesheet" href="css/small.style.css" type="text/css" media="screen" />');
        ia = [
            [ha, 6],
            [ga, 5],
            [fa, 4],
            [ea, 3],
            [da, 2],
            [ca, 1]
        ];
        getJson()
    };
    textCufon = function () {
        Cufon.replace(".cufon", {
            fontFamily: "Futura Std"
        });
        Cufon.replace(".times", {
            fontFamily: "Times"
        })
    };
    testSubmitSearch = function () {
        M = [];
        a.each(n.images, function (b, c) {
            var d = c.description.split(",");
            a.each(d, function (e, j) {
                j = j.toLowerCase();
                j.match("famous".toLowerCase()) && M.push(c)
            })
        });
        createSearchBox()
    };
    submitSearch = function (b) {
        var c = this.value;
        if ((b.keyCode ? b.keyCode : b.which) == "13" && c != "") {
            M = [];
            a.each(n.images, function (d, e) {
                var j = e.description.split(",");
                a.each(j, function (s, l) {
                    l = l.toLowerCase();
                    l.match(c.toLowerCase()) && M.push(e)
                })
            });
            createSearchBox()
        }
    };
    searchArrayLoseFocus = function () {
        this.value = "..."
    };
    searchArray = function () {
        this.value = ""
    };
    showFullScreen = function () {};
    showAboutUs = function () {
        z && a("#lightBox").remove();
        if (a("#aboutUsOverlay").length == 0) {
            var b = a("body"),
                c = n.about;
            b.append("<div id='aboutUsOverlay'></div>");
            b.append("<div id='aboutUsInfo'><div id='about'>" + c + "</div></div>");
            O = a("#aboutUsOverlay");
            oa = a("#aboutUsInfo");
            O.css("opacity", "0.5");
            a("#aboutUsClose").bind("click", closeAboutUs);
            O.unbind().bind("click", closeAboutUs);
            Cufon.replace("#aboutUsInfo .cufon", {
                fontFamily: "Futura Std"
            });
            Cufon.replace("#aboutUsInfo .times", {
                fontFamily: "Times"
            });
            V = true
        } else V ? closeAboutUs() : openAboutUs();
        return false
    };
    closeAboutUs = function () {
        V = false;
        O.hide();
        oa.hide();
        return false
    };
    openAboutUs = function () {
        V = true;
        O.show();
        oa.show();
        return false
    };
    saveToLightBox = function () {
        var b = this.name,
            c = false;
        a.each(u, function (e, j) {
            if (parseFloat(b) == j.pid) c = true
        });
        if (!c) {
            a.each(n.images, function (e, j) {
                parseFloat(b) == j.pid && u.push(j)
            });
            totalLightboxImages(1);
            var d = a(".saveToLightBox");
            d.html("Remove from Lightbox");
            d.removeClass("saveToLightBox").addClass("removeFromLightBox")
        }
        return false
    };
    totalLightboxImages = function (b) {
        var c = a("#lightBoxImages");
        b = (parseFloat(c.text()) + b).toString();
        if (b < 0) b = 0;
        c.html(b);
        Cufon.replace("#lightBoxImages", {
            fontFamily: "Futura Std"
        })
    };
    removeFromLightBox = function () {
        var b = this.name,
            c = 0,
            d = 0;
        a.each(u, function (e, j) {
            if (parseFloat(b) == j.pid) {
                c = e;
                totalLightboxImages(-1)
            }
            d = e
        });
        u.splice(c, 1);
        d = d;
        a("#lightBoxImages").text(d.toString());
        a(".removeFromLightBox").html("Save to Lightbox");
        a(".removeFromLightBox").removeClass("removeFromLightBox").addClass("saveToLightBox");
        if (z) {
            a("#lightBoxContent").empty();
            a.fancybox.close();
            createLayout(false, "lightBoxContent", "lightBoxContent", u)
        }
        return false
    };
    createPDF = function () {
        if (la) closePDF();
        else {
            v.append('<div id="downloadPdf" ><a href="#" id="downloadClose">close</a><span class="cufon">Thank you for downloading your Lightbox, a PDF is currently being prepared, this could take a few minutes.</span><span id="click_link"></span></div>');
            la = true;
            var b = a("#downloadPdf");
            b.css("top", i / 2 - 75);
            b.css("left", p / 2 - 150);
            a("#downloadClose").unbind().bind("click", function () {
                b.remove();
                return false
            });
            submitForm();
            Cufon.replace("#downloadPdf .cufon", {
                fontFamily: "Futura Std"
            })
        }
        return false
    };
    submitForm = function () {
        a("downloadText").html("Your Pdf is being Created - Loading");
        var b = a.toJSON(u);
        a.post("pdf/image_example.php", {
            testJSON: b
        }, function () {
            if (a.browser.opera || a.browser.webkit) window.open("pdf/David_Ellis_Portfolio.php", "_blank");
            else if (a.browser.msie) {
                var c = window.open();
                c.opener = null;
                c.document.location = "pdf/David_Ellis_Portfolio.pdf"
            } else {
                c = window.open();
                c.opener = null;
                c.document.location = "pdf/David_Ellis_Portfolio.php"
            }
            $('#click_link').html('<span class="cufon">If you can\'t see the pdf please click the link below.<span><br/><br/><a class="times" href="pdf/David_Ellis_Portfolio.php">David_Ellis_Portfolio.pdf</a><br/>');
            Cufon.replace('#click_link .cufon', {
                fontFamily: 'Futura Std'
            });
            Cufon.replace('#click_link .times', {
                fontFamily: 'Times'
            });
        });
        return false
    };
    closePDF = function () {
        var b = a("#downloadPdf");
        la = false;
        b.remove()
    };
    createLightbox = function () {
        if (z) {
            a.browser.msie && a.browser.version == 7 && a("#imgGroup").css("height", a(window).height() - 100);
            z = false;
            a("#lightBox").remove();
            closePDF()
        } else {
            v.append('<div id="lightBox"><div id="lightBoxHeader" class="cufon">Lightbox<a id="closeLightBox">close</a></div><div id="lightBoxContent"></div><div id="lightBoxFooter"><!--<span id="terms" class="cufon">Terms: </span><strong class="times">Loren Ipsum</strong>--\><a href="#" id="createPDF" ><span class="cufon">Create PDF</span></a></div></div>');
            var b = a("#lightBox"),
                c = a("#lightBoxContent");
            b.css("top", "50px");
            b.css("left", p * 0.05 + "px");
            b.css("width", p * 0.9 + "px");
            b.css("height", i - 110 + "px");
            a("#lightBoxHeader").css("height", "30px");
            c.css("height", i - 160 + "px");
            c.css("width", p * 0.9 + "px");
            a("#lightBoxFooter").css("height", "28px");
            a("#closeLightBox").bind("click", function () {
                z = false;
                a.browser.msie && a.browser.version == 7 && a("#imgGroup").css("height", a(window).height() - 100);
                a("#lightBox").remove();
                closePDF()
            });
            a("#createPDF").bind("click", createPDF);
            z = true;
            Cufon.replace("#lightBox .cufon", {
                fontFamily: "Futura Std"
            });
            Cufon.replace("#lightBox .times", {
                fontFamily: "Times"
            });
            createLayout(false, "lightBoxContent", "lightBoxContent", u)
        }
        return false
    };
    createSearchBox = function () {
        if (!U && a("#searchBox").length == 0) {
            v.append('<div id="searchBox"><div id="searchBoxHeader" class="cufon">Search Results<a id="closeSearchBox">close</a></div><div id="searchBoxContent"></div></div>');
            P = a("#searchBox");
            Y = a("#searchBoxContent");
            P.css("top", "50px");
            P.css("left", p * 0.05 + "px");
            P.css("width", p * 0.9 + "px");
            P.css("height", i - 110 + "px");
            a("#searchBoxHeader").css("height", "30px");
            Y.css("height", i - 160 + "px");
            Y.css("width", p * 0.9 + "px");
            a("#closeSearchBox").unbind().bind("click", function () {
                a.browser.msie && a.browser.version == 7 && a("#imgGroup").css("height", a(window).height() - 100);
                U = false;
                a("#searchBox").hide()
            });
            U = true;
            Cufon.replace("#searchBox .cufon", {
                fontFamily: "Futura Std"
            });
            Cufon.replace("#searchBox .times", {
                fontFamily: "Times"
            })
        } else {
            Y.empty();
            U = true;
            a("#searchBox").show()
        }
        createLayout(false, "searchBoxContent", "searchBoxContent", M);
        return false
    };
    filterImages = function () {
        a("#navMenu li a").each(function (b, c) {
            a(c).removeClass("underline")
        });
        a(this).addClass("underline");
        a(".de-video-player").remove();
        a(".flashPlayer").remove();
        wa = this.name;
        createLayout(this.name, "imgGroup", "image");
        return false
    };
    showMovingImages = function () {
        var b = this.id;
        b = b.split(",");
        b = b[0].toLowerCase();
        a("#video").remove();
        a("#player").remove();
        if (navigator && navigator.platform && navigator.platform.match(/^(iPad|iPod|iPhone)$/)) {
      
            a("#imgGroup").append('<div id="videoPlayer"><a class="de-closeVideo" title="close">close</a><video id="video" controls height="360" width="640" ><source src="video/' + b + '.ogg" type="video/ogg" /><source src="video/' + b + '.m4v" type="video/mp4" /></video></div>');
           
			
				$('.de-closeVideo').unbind().bind('click',function(){ 
						$('#videoPlayer').remove();
				});

/* a("#video").deVideo({
                name: b
            })*/
        } else {
            var c = a(window).height(),
                d = a(window).width();
            a("#imgGroup").append('<div class="flashPlayer"><object id="player2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="667" height="400"><param name="movie" value="video/videoPlayer.swf" />\t\t\t<param name="allowfullscreen" value="true" />\t<param name="wmode" value="transparent" />\t<param name="play" value="true" />\t<param name="allowscriptaccess" value="always" /><param name="flashvars" value="play=true&file=' + b + '.flv" /><embed type="application/x-shockwave-flash" id="embedPlayer" name="player2" src="video/videoPlayer.swf" width="667" height="400"\tallowscriptaccess="always" swliveconnect="true"\tallowfullscreen="true" play="true" wmode="transparent" flashvars="play=true&file=' + b + '.flv" /></object><div class="flashPlayer-title cufon">' + b + "</div></div>");
            textCufon();
            b = a(".flashPlayer");
            var e = a(".flashPlayer-title");
            b.css("position", "absolute");
            b.css("top", "400px");
            b.css("width", "667px");
            e.css("position", "absolute");
            e.css("width", "667px");
            e.css("text-align", "center");
            e.css("top", "-20px");
            b.css("left", (d - 667) / 2 + "px");
            b.css("top", (c - 440) / 2 + "px")
        }
        return false
    };
    clearHolders = function () {
        a("#imgGroup").empty()
    };
    resizeWindow = function () {
        K = true;
        a(".flashPlayer").remove();
        a.fancybox.close();
        getDimensions();
        a("footer").css("top", i - 50);
        if (z) {
            a("#lightBox").remove();
            createLightbox()
        }
        createLayout(wa, "imgGroup", "image")
    };
    getDimensions = function () {
        i = a(window).height();
        p = a(window).width();
        E = i / 2;
        if (E > 200) E = 200;
        F = i / 4;
        if (F > 200) F = 200;
        G = i / 6;
        if (G > 200) G = 200;
        H = i / 8;
        if (H > 200) H = 200;
        I = i / 10;
        if (I > 200) I = 200;
        J = i / 12;
        if (J > 200) J = 200;
        ca = E / 500;
        da = F / 500;
        ea = G / 500;
        fa = H / 500;
        ga = I / 500;
        ha = J / 500;
        ia = [
            [ha, 6],
            [ga, 5],
            [fa, 4],
            [ea, 3],
            [da, 2],
            [ca, 1]
        ]
    };
    createNav = function () {
        var b = '<li class="times">Filter Images:</li><li class="cufon"><a href="index.html" name="Recent" class="underline" ><span class="cufon">Recent</span></a> / </li>',
            c = 1;
        a.each(n.tags, function () {
            c++
        });
        a.each(n.tags, function (d, e) {
            b += '<li class="cufon"><a href="index.html?page=' + e.name + '" name="' + e.name + '" ><span class="cufon">' + e.name + "</span></a>";
            if (d <= c) b += " / ";
            b += "</li>"
        });
        a("#navMenu").html(b);
        a("#navMenu a").bind("click", filterImages)
    };
    getJson = function () {
        $url = "/admin/wp-content/jsonData/jsonBridge.json";
        //$url = "json/jsonBridge.json";
        a.getJSON($url, function (b) {
            n = b;
            createNav();
            textCufon();
            v.css("opacity", "1");
            if (getUrlVars().page) getUrlVars().page == "about" ? showAboutUs() : createLayout(getUrlVars().page, "imgGroup", "image");
            else createLayout("Recent", "imgGroup", "image")
        })
    };
    getUrlVars = function () {
        for (var b = [], c, d = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&"), e = 0; e < d.length; e++) {
            c = d[e].split("=");
            b.push(c[0]);
            b[c[0]] = c[1]
        }
        return b
    };
    getDividers = function (b, c, d, e) {
        var j = 0,
            s = 0;
        C = L = 0;
        na = [];
        a.each(d, function (l, D) {
            if ((!c || c == "Recent" && D.recent == 1 || c == D.type) && C < 50) {
                C++;
                L++;
                na.push(D);
                s = parseFloat(D.meta_data.width) * b[0];
                j += s
            }
        });
        if (Math.ceil(j) < e * 0.85 * b[1]) T = [b[0], b[1]];
        else pa = true
    };
    createLayout = function (b, c, d, e) {
        if (d == "image") {
            W = i;
            divWidth = p;
            N = "imageGroup";
            qa = b == "Recent" ? n.recent : n.galleries;
            Z = n.images
        } else {
            var j = d == "searchBoxContent" ? a("#" + d) : a("#" + d);
            W = parseFloat(j.css("height"));
            divWidth = parseFloat(j.css("width"));
            N = d + "Group";
            qa = e;
            Z = false
        }
        e || (e = b == "Recent" ? n.recent : n.galleries);
        pa = false;
        a.each(ia, function () {
            pa || getDividers(this, b, e, divWidth)
        });
        if (T) {
            ja = T[1];
            ka = T[0]
        }
        r = parseFloat(Math.ceil(500 * ka));
        X = 0;
        a.browser.msie && X++;
        if (a.browser.msie) {
            B.empty();
            B.css("opacity", "0");
            ma && a.each(n.galleries, function (s, l) {
                B.append('<img id="preImage' + l.pid + '" src="" />');
                a("#preImage" + l.pid).attr("src", l.thumbURL).load(function () {})
            });
            createGrid(b, c, d, e)
        } else {
            B.empty();
            B.css("opacity", "0");
            a.each(na, function (s, l) {
                B.append('<img id="preImage' + l.pid + '" src="" />');
                a("#preImage" + l.pid).attr("src", l.thumbURL).load(function () {
                    if (b != "Recent" || b == "Recent" && l.recent == 1) X++;
                    if (X == L) {
                        createGrid(b, c, d, e);
                        v.css("background-image", "url()")
                    }
                })
            })
        }
    };
    createGrid = function (b, c, d, e) {
        var j = 1,
            s = 0,
            l = 0,
            D = 0,
            $ = 0,
            xa = 0;
        if (d == "image") xa = 100;
        var ra = (W - xa - ja * r) / 2,
            Q = 0,
            ya = [],
            aa = [];
        C = 0;
        var ba = [],
            sa = [];
        a.each(qa, function (w, f) {
            if ((!b || b == "Recent" && f.recent == 1 || b == f.type) && C < 50) {
                s = parseFloat(f.meta_data.width) * ka;
                D += s + s * 0.11;
                C++;
                if (a("#" + d + f.pid).length == 0) {
                    var h = f.imageURL,
                        g = f.filename;
                    g = g.split(".jpg");
                    g = g[0];
                    h = h.split(g + ".jpg");
                    h = h[0] + "large/" + g + "_large.jpg";
                    var o = "<div id='" + d + f.pid + "' class='" + f.type + " testDiv' ><a href='" + f.imageURL + "' alt='" + h + "' title='" + f.alttext + "," + f.pid + "," + f.imageURL + "," + f.filename + "' class='single_image' id='" + f.title + "' name='" + f.type + "' rel='" + N + f.pid + "'><img id='single_image' height='" + r + "px' style='height:" + r + "px' src='" + f.thumbURL + "' /></a>",
                        R = 1;
                    Z && a.each(Z, function (x, k) {
                        if (f.galleryid == k.galleryid && f.pid != k.pid) {
                            var m = k.imageURL,
                                t = k.filename;
                            t = t.split(".jpg");
                            t = t[0];
                            m = m.split(t + ".jpg");
                            m = m[0] + "large/" + t + "_large.jpg";
                            o += "<a href='" + k.imageURL + "' title='" + k.alttext + "," + k.pid + "," + k.imageURL + "," + k.filename + "' alt='" + m + "' name='subImage' rel='" + N + f.pid + "'><img style='display:none' src='' /></a>";
                            R++
                        }
                    });
                    f.alttext = f.alttext.replace("\\", "");
                    o += '<span class="imageAltText cufon" id="imageAltText' + w + '">' + f.title + "</span><br/>";
                    if (d == "image") {
                        g = " Images";
                        if (R == 1) g = "Image";
                        o += '<span class="imageNoImages times" id="imageNoImages' + w + '">' + R + g + "</span>"
                    } else o += '<span class="imageNoImages times" id="imageNoImages' + w + '">' + f.type + "</span>";
                    if (d == "lightBoxContent") o += '<a href="#" class="removeFromLightBoxDiv removeFromLightBox cufon" name="' + f.pid + '" id="removeFromLightBox' + w + '" >Remove from Lightbox</a>';
                    o += "</div>";
                    a("#" + c).append(o)
                }
                g = a("#" + d + f.pid);
                h = g.find("img");
                a.browser.opera && g.css("opacity", "0");
                var ta = g.find(".imageAltText"),
                    y = g.find(".imageNoImages");
                g.css("position", "absolute");
                if (d == "lightBoxContent") var Aa = g.find(".removeFromLightBoxDiv");
                if (!b || b && !A && b != "removeLightBox" && !K || b == "removeLightBox" && A) {
                    g.css("top", ra);
                    g.css("left", Q);
                    h.css("height", r + "px");
                    a.browser.msie || h.attr("width", parseFloat(h.css("width")));
                    var q = h.attr("width");
                    a.browser.msie && a.browser.version == 7 && g.css("width", q);
                    Q += q;
                    $ += q
                } else {
                    a.browser.msie || h.css("width", "auto");
                    va = parseFloat(h.css("height"));
                    h.css("height", r + "px");
                    sa.push([ra, Q]);
                    q = h.attr("width");
                    Q += q;
                    $ += q;
                    h.css("height", va + "px")
                }
                q = (600 - h.attr("width")) / 2;
                ta.css("left", "-" + q + "px");
                y.css("left", "-" + q + "px");
                d == "lightBoxContent" && Aa.css("left", "-" + q + "px");
                h.css("opacity", "0.25");
                parseFloat(g.css("top")) == 0 && b && h.css("opacity", "0");
                aa.push(g);
                f.type != "Film" && a("a[rel=" + N + f.pid + "]").fancybox({
                    transitionIn: "fade",
                    transitionOut: "none",
                    titlePosition: "outside",
                    overlayOpacity: 0,
                    overlayColor: "transparent",
                    showNavArrows: true,
                    cyclic: true,
                    autoScale: true,
                    autoDimensions: true,
                    titleFormat: function (x, k, m) {
                        m = '<div id="imgHeader" class="' + d + 'Viewer"><span id="fancybox-title-over" class="cufon">' + f.alttext + '</span><span id="fancybox-title-over" class="times" style="font-size:11px;">' + (m + 1) + " of " + k.length + " Images</span></div>";
                        var t = false;
                        if (a.fancybox.curResMode() == "low") {
                            m += '<div id="imgFooter" class="' + d + 'ViewerFooter"><span id="fancybox-title-over">';
                            if (k.length == 1) m += '<div id="oneImage" />';
                            var S = "";
                            var ua = k = "";
                            if (x) {
                                x = x.split(",");
                                S = x[1];
                                k = x[2];
                                ua = x[3]
                            } else {
                                S = f.pid;
                                k = f.imageURL;
                                ua = f.filename
                            }
                            a.each(u, function (Ca, Ba) {
                                if (Ba.pid == S) t = true
                            });
                            m += t ? '<a href="#" class="removeFromLightBox cufon" name="' + S + '">Remove from Lightbox</a>' : '<a href="#" class="saveToLightBox cufon" name="' + S + '">Save to Lightbox</a>';
                            m += '</span><span ><a href="' + k + '" class="cufon " style="font-size:11px;" name="' + ua + '" id="fullScreen">Full-screen</a></span></div>'
                        }
                        return m
                    },
                    onComplete: function () {
                        a("#fancybox-title").show();
                        Cufon.replace("#fancybox-wrap .cufon", {
                            fontFamily: "Futura Std"
                        });
                        Cufon.replace("#fancybox-wrap .times", {
                            fontFamily: "Times"
                        });
                        a("#fancybox-wrap").hover(function () {
                            a("#fancybox-title").show();
                            a("#fancybox-left").show();
                            a("#fancybox-right").show();
                            a("#fancybox-close").show();
                            if (a("#oneImage").length > 0) {
                                a("#fancybox-right").hide();
                                a("#fancybox-left").hide()
                            }
                        }, function () {
                            a("#fancybox-title").hide();
                            a("#fancybox-left").hide();
                            a("#fancybox-right").hide();
                            a("#fancybox-close").hide()
                        })
                    }
                });
                g.find(".single_image");
                if ((l + 1) % Math.ceil(L / ja) == 0 || l + 1 == L) {
                    var za = (divWidth - $) / 2;
                    if (!b || b && !A && b != "removeLightBox" || b == "removeLightBox" && A || K) a.each(aa, function (x, k) {
                        var m = parseFloat(k.css("left")) + za;
                        k.css("left", m)
                    });
                    j++;
                    Q = $ = 0;
                    ra += r;
                    ba.push([sa, za]);
                    ya.push(aa);
                    aa = [];
                    sa = []
                }
                l++
            } else a("#" + d + f.pid).remove()
        });
        a(".Film").find("a").unbind().bind("click", showMovingImages);
        if (b && A || b == "removeLightBox" && !A || K) a.each(ya, function (w, f) {
            a.each(f, function (h, g) {
                var o = Math.floor(Math.random() * 6),
                    R = parseFloat(ba[w][0][h][0]),
                    ta = parseFloat(ba[w][0][h][1] + ba[w][1]);
                o *= 100;
                g.animate({
                    top: R,
                    left: ta
                }, 500 + o, function () {});
                g.find(".single_image img").animate({
                    height: r + "px"
                }, 500 + o, function () {
                    var y = g.find(".single_image img");
                    a.browser.opera ? y.css({
                        opacity: "0.25"
                    }) : y.animate({
                        opacity: "0.25"
                    }, 1E3);
                    y = (600 - y.attr("width")) / 2;
                    g.find(".imageAltText").css("left", "-" + y + "px");
                    g.find(".imageNoImages").css("left", "-" + y + "px")
                })
            })
        });
        a("#contentcontainer").css("top", "50px");
        a("#imgGroup").css("height", W - 100 + "px");
        a(".single_image").css("height", r + "px");
        a("#" + c).css("top", 0);
        a("#" + c).css("left", 0);
        a(".imageAltText").hide();
        a(".imageNoImages").hide();
        a(".removeFromLightBoxDiv").hide();
        Cufon.replace(".imageAltText", {
            fontFamily: "Futura Std"
        });
        Cufon.replace(".imageNoImages", {
            fontFamily: "Times"
        });
        d == "lightBoxContent" && Cufon.replace(".removeFromLightBoxDiv", {
            fontFamily: "Futura Std"
        });
        a("#" + c + " div").hover(function () {
            a(this).find(".imageAltText").show();
            a(this).find(".imageNoImages").show();
            a(this).find(".removeFromLightBoxDiv").show();
            a.browser.opera || a(this).find(".single_image img").stop().animate({
                opacity: "1"
            }, 500)
        }, function () {
            a(this).find(".imageAltText").hide();
            a(this).find(".imageNoImages").hide();
            a(this).find(".removeFromLightBoxDiv").hide();
            a.browser.opera || a(this).find(".single_image img").stop().animate({
                opacity: "0.25"
            }, 800)
        });
        A = b == "Recent" ? true : false;
        a.browser.opera && a(".testDiv").css("opacity", "1");
        if (a.browser.msie && ma) {
            ma = false;
            v.css("background-image", "url()");
            createGrid(b, c, d, e)
        }
        K = false
    };
    a(document).ready(function () {
        init()
    })
})(jQuery);
