gallery_object.debug = false;
gallery_object.encrypted = false;
gallery_object.mid = "";
gallery_object.params = "none=none";
gallery_object.key = "((68-2)*3.9)/2";
gallery_object.baseUrl = "mirino.com";
var _2 = [];
var gallery_data = [];
var browser = {};

function browserDetect() {
    var version = 0;
    var x = navigator.userAgent.toLowerCase();
    browser.chrome = /chrome/.test(x);
    browser.msie = /msie/.test(x);
    browser.safari = /safari/.test(x);
    browser.notChrome = /version/.test(x);
    browser.firefox = /firefox/.test(x);
    browser.opera = /opera/.test(x);
    browser.current = "unknown";
    browser.offsetTop = 0;
    browser.offsetLeft = 0;
    browser.mobile = "none";
    if (/ipad/.test(x)) {
        browser.mobile = "ipad"
    } else if (/iphone/.test(x)) {
        browser.mobile = "iphone"
    } else if (/ipod/.test(x)) {
        browser.mobile = "ipod"
    } else if (/android/.test(x)) {
        browser.mobile = "android"
    }
    if (browser.msie) {
        version = x.split("msie")[1].split("; ")[0].replace(/ /g, '');
        browser.current = "msie";
        if (version.substr(0, 1) == "7") {
            browser.offsetTop = 143;
            browser.offsetLeft = 214
        }
    }
    if (browser.chrome) {
        version = x.split("chrome/")[1].split(" ")[0];
        browser.safari = false;
        browser.current = "chrome"
    }
    if (browser.safari && browser.notChrome) {
        version = x.split("version/")[1].split(" ")[0];
        browser.current = "safari"
    }
    if (browser.firefox) {
        version = x.split("firefox/")[1].split(" ")[0];
        browser.current = "firefox"
    }
    if (browser.opera) {
        version = x.replace(/.*/i, '').replace(/opera\//, '');
        browser.current = "opera"
    }
    browser.version = version;
    return version
}
browserDetect();
Array.prototype.Add = function (_value) {
    this.push(_value);
    return this
};
Array.prototype.Remove = function (_value) {
    for (var i = 0; i < this.length; i++) {
        if (this[i] == _value) {
            this.splice(i, 1);
            break
        }
    }
    return this
};
Array.prototype.RemoveAll = function (_value) {
    for (var i = 0; i < this.length; i++) {
        if (this[i] == _value) {
            this.splice(i, 1);
            this.RemoveAll(_value);
            break
        }
    }
    return this
};
Array.prototype.RemoveNulls = function () {
    for (var i = 0; i < this.length; i++) {
        if (!this[i]) {
            this.splice(i, 1);
            break
        }
    }
    return this
};
Array.prototype.RemoveDups = function () {
    var _dups = [];
    var _ok = true;
    for (var i = 0; i < this.length; i++) {
        if (_dups.MatchPattern(this[i]) == true) {
            this.splice(i, 1);
            _ok = false
        } else {
            _dups.push(this[i])
        }
    }
    if (_ok == false) {
        this.RemoveDups()
    }
    return this
};
Array.prototype.maxCol = function (n) {
    var v = 0;
    for (var i = 0; i < this.length; i++) {
        if (this[i][n] * 1 > v * 1) {
            v = this[i][n]
        }
    }
    return v
};
Array.prototype.MatchPattern = function (_pattern) {
    if (_pattern) {
        for (var i = 0; i < this.length; i++) {
            if (this[i]) {
                if (this[i].toString() === _pattern.toString()) {
                    return true
                }
            }
        }
    }
    return false
};
Array.prototype.RemovePattern = function (_pattern) {
    if (_pattern) {
        for (var i = 0; i < this.length; i++) {
            if (this[i]) {
                if (this[i].toString() === _pattern.toString()) {
                    this.splice(i, 1);
                    this.RemovePattern(_pattern);
                    return true
                }
            }
        }
    }
    return false
};
Array.prototype.SortNumbers = function () {
    var x, y, holder;
    for (x = 0; x < this.length; x++) {
        for (y = 0; y < (this.length - 1); y++) {
            if (this[y] > this[y + 1]) {
                holder = this[y + 1];
                this[y + 1] = this[y];
                this[y] = holder
            }
        }
    }
};
Array.prototype.Clear = function () {
    while (this.length) {
        this.pop()
    }
};
Array.prototype.RemoveMulti = function (_value, _col) {
    for (var i = 0; i < this.length; i++) {
        if (this[i][_col] == _value) {
            this.splice(i, 1);
            break
        }
    }
    return this
};
Array.prototype.Pattern2Index = function (_pattern) {
    if (_pattern) {
        for (var i = 0; i < this.length; i++) {
            if (this[i]) {
                if (this[i].toString() === _pattern.toString()) {
                    return i
                }
            }
        }
    }
    return -1
};
String.prototype.trim = function () {
    return this.replace(/^\s+|\s+$/g, "")
};
String.prototype.ltrim = function () {
    return this.replace(/^\s+/, "")
};
String.prototype.rtrim = function () {
    return this.replace(/\s+$/, "")
};
String.prototype.addslashes = function () {
    return this.replace(/'/gi, "\'")
};
String.prototype.addSlashes2Qoutes = function () {
    return this.replace(/"/gi, '\"')
};

function nInt(_str) {
    if (_str === null || _str === "" || _str === " " || _str === undefined) {
        _str = 0
    }
    _str = _str.toString().replace(/[^0-9|\-|\.]/gi, '');
    _str = Math.round(_str);
    if (_str.toString() == "NaN" || _str.toString() === "undeifined" || _str.toString() === "") {
        _str = 0
    }
    return (_str)
}
function get_time() {
    var t = new Date();
    return t.getTime()
}
function text2ascii(_string) {
    var out = "";
    for (var i = 0; i < _string.toString().length; i++) {
        out += _string.toString().charCodeAt(i) + "."
    }
    return out
}
function ascii2text(_string) {
    var out = "";
    var arr = _string.toString().split(".");
    for (var i = 0; i < arr.length; i++) {
        if (arr[i]) {
            out += String.fromCharCode(arr[i])
        }
    }
    return out
}
function randNum(_n) {
    return Math.floor(Math.random() * nInt(_n))
}
function qsValue(_id, qs) {
    var x = "";
    if (!qs) {
        qs = window.location.search.substring(1)
    }
    qs = qs.split("&");
    for (var i = 0; i < qs.length; i++) {
        x = qs[i].split("=");
        if (x[0] == _id) {
            if (x[1] && x[1] !== undefined) {
                return x[1]
            } else {
                return ""
            }
        }
    }
    return ""
}
function qsValueReplace(_id, _v, qs) {
    var x = "";
    var qsOut = [];
    if (!qs) {
        qs = window.location.search.substring(1)
    }
    if (qs) {
        if (qs.indexOf(_id) < 0) {
            qs = qs + "&" + _id + "=" + _v
        }
    } else {
        return _id + "=" + _v
    }
    qs = qs.split("&");
    for (var i = 0; i < qs.length; i++) {
        x = qs[i].split("=");
        if (x) {
            if (x[0] == _id) {
                x[1] = _v
            }
        }
        qsOut.push(x[0] + "=" + x[1])
    }
    return qsOut.join("&")
}
function showHide(_id) {
    if ($(_id).attr("style").match(/none/)) {
        $(_id).show("slow")
    } else {
        $(_id).hide("fast")
    }
}
function galleryGetWidth(_id) {
    $("#mirino-gallery-main").width(0);
    var ret = $("div.mirino-gallery-container").width();
    if (gallery_object.navigation) {
        ret -= 5
    } else {
        $("#mirino-gallery-navigation").width(0)
    }
    if (gallery_object.showRelated == "1") {
        ret -= 5
    } else {
        $("#mirino-gallery-related").width(0)
    }
    $("div.mirino-gallery-container").children().each(function () {
        ret -= $(this).width()
    });
    return ret - 5
}
function ie7Support() {
    top.$(".site-scope div").each(function () {
        if ($(this).css("display") == "inline-block") {
            $(this).css("display", "inline");
            $(this).css("zoom", "1")
        }
    })
}
function _timer() {
    this.func = null;
    this.delay = 70;
    this.tID = null;
    this.isRunning = false;
    this.isLoaded = true
}
_timer.prototype.start = function () {
    if (this.isRunning) {
        return
    }
    this.clearInterval();
    this.isRunning = true;
    this.setInterval(this.func, this.delay)
};
_timer.prototype.setInterval = function (func, delay) {
    this.func = func;
    this.delay = delay;
    this.tID = window.setInterval(func, delay)
};
_timer.prototype.clearInterval = function () {
    this.isRunning = false;
    if (this.tID) {
        clearInterval(this.tID)
    }
};

function createCookie(_name, _value, _days) {
    if (!nInt(_days)) {
        _days = 30
    }
    var _date = new Date();
    _date.setTime(_date.getTime() + (_days * 24 * 60 * 60 * 1000));
    document.cookie = _name + "=" + (_value.toString()) + "; expires=" + _date.toGMTString() + "; path=/"
}
function setCookie(_name, _value, _days) {
    if (!nInt(_days)) {
        _days = 30
    }
    var _date = new Date();
    _date.setTime(_date.getTime() + (_days * 24 * 60 * 60 * 1000));
    document.cookie = _name + "=" + (_value.toString()) + "; expires=" + _date.toGMTString() + "; path=/"
}
function readCookie(_name, _default) {
    var _cookies = document.cookie.split('; ');
    for (var i = 0; i < _cookies.length; i++) {
        var _cookie = _cookies[i].split('=');
        if (_cookie[0].trim() == _name) {
            return (_cookie[1].toString())
        }
    }
    if (_default) {
        createCookie(_name, (_default));
        return _default
    }
    return false
}
function deleteCookie(name) {
    createCookie(name, "", -1)
}
var _4 = {
    _e: function (a) {
        if (!a) {
            return ""
        }
        if (browser.current == "msie" && nInt(browser.version) < 9) {
            return (eval('func = ' + a.toString() + ''))
        } else {
            return eval('(' + a + ')')
        }
    },
    _c: function (a) {
        return String.fromCharCode(a)
    },
    a: function (a) {
        return this.f(a, this.d(this.j.b))
    },
    b: function (a, b, c) {
        for (var d = ""; b < c; b++) {
            d += a[b]
        }
        return d
    },
    c: function (a, b) {
        return a.substr(a.length - b, b)
    },
    d: function (a) {
        return this.g(this._c(a))
    },
    e: function (a) {
        for (var b = 0, c = ""; b < a; b++) {
            c += "" + this._c(48)
        }
        return c
    },
    f: function (a, b) {
        if (!a) {
            return ""
        }
        if (!b) {
            a = a.toString().split(this._e(this.j.a))
        } else {
            a = a.toString();
            a = a.replace(/\/\*.*?\*\//g, "");
            a = a.replace(/\n+/g, " ");
            a = a.replace(/\s+/g, " ");
            if (gallery_object.encrypted == false) {
                a = this.g(a, b)
            }
        }
        var n = 1;
        if (b) {
            n = this.j.b * 1
        }
        if (typeof (a) == "object") {
            for (var c = 0, g = 0, f = ""; c < a.length; c = c + n) {
                if (b) {
                    f += this._c(a[c] / b)
                } else {
                    f += this._c(a[c])
                }
            }
        } else {
            a = a.toString();
            for (var c = 0, g = 0, f = ""; c < a.length; c = c + n) {
                if (b) {
                    f += this._c(a.substring(c, c + n) / b)
                } else {
                    f += this._c(a.substring(c, c + n))
                }
            }
        }
        if (!f) {
            return ""
        }
        if (this.j.z) {
            f = f.replace(/[^a-zA-Z0-9\s\n.\,\{\}\[\]\(\)\!\@\#\$\%\^\&\*\-\_\+\=\<\>\?\/\:\; \"\'\|\`\~]/g, "")
        }
        return f
    },
    g: function (a, b) {
        if (typeof a == "function") {
            a = a.toString()
        }
        if (a == null || a == undefined) {
            return a
        }
        for (var c = 0, g = "", h = 0; c < a.length; c++) {
            h = a.toString().charCodeAt(c);
            if (b) {
                h = b * h
            }
            g += this.c(this.e(6) + h, this.j.b)
        }
        return g
    },
    h: [93, 47, 51, 123, 97, 91, 45, 122, 125, 50, 44],
    i: function () {
        this.j.a = "";
        this.j.b = gallery_object.key;
        this.l();
        for (var a = 0; a < this.k.length; a++) {
            this.j.a += this._c(this.h[this.k[a]])
        }
    },
    j: {
        c: 0,
        z: 0
    },
    k: [1, 5, 4, 6, 7, 0, 3, 9, 10, 2, 8, 1],
    l: function () {
        var b = 0;
        var c = 0;
        for (var a = 0; a < this.j.b.length; a++) {
            b = this.j.b.charCodeAt(a);
            if (a % 2 == 1) {
                c -= b
            } else {
                c += b
            }
        }
        this.j.b = Math.ceil(c - this.k[1])
    }
};
_2[0] = function (fn, context, params) {
    aLog("_2[0] :: Params Function");
    return function () {
        fn.apply(context, params)
    }
};
_2[1] = function () {
    aLog("_2[1] :: ~Que Complete");
    if (gallery_object.timer) {
        _4.j.z = 0;
        gallery_object.timer.isLoaded = true
    }
    gallery_object.timer.start()
};
_2[2] = function () {
    aLog("_2[2] :: ~~JSONP Call :: " + gallery_object.params);
    _4.j.z = 1;
    var u = 'http://' + gallery_object.baseUrl + '/index.php/ajax/' + gallery_object.ajax + '?meid=' + gallery_object.gid + '&mid=' + gallery_object.mid + '&' + gallery_object.params + '&url=' + gallery_object.currentUrl + '&transport=jsonp&token=' + gallery_object.token + "&callback=gallery_object.cb";
    u = u.replace("&&", "&");
    gallery_object.mTypeNoUpdate = 0;
    aLog(u);
    $.ajax({
        url: u,
        dataType: 'jsonp',
        type: 'GET',
        jsonp: 'callback',
        jsonpCallback: "gallery_object.cb"
    })
};
_2[3] = function () {
    aLog("_2[3] :: Empty")
};
_2[4] = function (data) {
    aLog("_2[4] :: Append JS to Head");
    $("head").append('' + '<script type="text/javascript">' + _4.f(_4._e(_4.a(_2[9]))(data)) + '</script>');
    _4._e(_4.a(_2[1])).call()
};
_2[5] = function () {
    aLog("_2[5] :: Get QS Params");
    var _o = {};
    if (gallery_object.searchMode) {
        _o.mode = gallery_object.searchMode
    }
    if (_4._e(_4.a(_2[25])).call()) {
        _o.s = _4._e(_4.a(_2[25])).call()
    }
    if (_4._e(_4.a(_2[26])).call()) {
        _o.t = _4._e(_4.a(_2[26])).call()
    }
    if (_4._e(_4.a(_2[27])).call()) {
        _o.srt = _4._e(_4.a(_2[27])).call()
    }
    _o.mt = gallery_object.mType;
    _o.page = gallery_object.page;
    _o.rows = gallery_object.rows;
    _o.columns = gallery_object.columns;
    return _o
};
_2[6] = function (data) {
    aLog("_2[6] :: Append CSS to Head");
    $("head").append('' + '<style type="text/css">' + _4.f(_4._e(_4.a(_2[9]))(data)).replace(/}/g, "}" + _4._c(13)) + '</style>');
    _4._e(_4.a(_2[1])).call()
};
_2[7] = function (data) {
    aLog("_2[7] :: Append Data in eid");
    $(gallery_object.eid).append(_4.f(_4._e(_4.a(_2[9]))(data)));
    _4._e(_4.a(_2[1])).call()
};
_2[8] = function (data) {
    aLog("_2[8] :: Replace Data in eid");
    $(gallery_object.eid).html(_4.f(_4._e(_4.a(_2[9]))(data)));
    _4._e(_4.a(_2[1])).call()
};
_2[9] = function (data) {
    aLog("_2[9] :: Parse JSONP Callback");
    var _return = '';
    $.each(data, function (i, item) {
        _return = item
    });
    return _return
};
_2[10] = function () {
    if (!gallery_object.timer.isLoaded) {
        return
    } else {
        if (gallery_object.que.length) {
            aLog("_2[10] :: " + gallery_object.que[0]);
            gallery_object.timer.isLoaded = false;
            var f = null;
            if (gallery_object.encrypted) {
                f = _4._e(_4.a(gallery_object.que[0][0]))
            } else {
                f = _4._e(gallery_object.que[0][0])
            }
            if (typeof f != "function") {
                gallery_object.que.shift();
                gallery_object.timer.isLoaded = true;
                return
            }
            if (gallery_object.encrypted) {
                gallery_object.cb = _4._e(_4.a(gallery_object.que[0][1]))
            } else {
                gallery_object.cb = _4._e(gallery_object.que[0][1])
            }
            gallery_object.ajax = gallery_object.que[0][2];
            gallery_object.params = _4._e(_4.a(_2[30]))(gallery_object.que[0][3]);
            if (gallery_object.que[0][4]) {
                gallery_object.eid = gallery_object.que[0][4]
            }
            gallery_object.que.shift();
            f.call()
        } else {
            gallery_object.timer.isLoaded = true;
            gallery_object.timer.clearInterval()
        }
    }
};
_2[11] = function () {
    aLog("_2[11] :: Append Srcipt Tag to Head");
    var _head = document.getElementsByTagName('head').item(0);
    var _path = gallery_object.eid + '?' + Math.random(0, 1000) + '=' + Math.random(0, 1000);
    var Node = document.createElement('script');
    Node.setAttribute('language', 'javascript');
    Node.setAttribute('type', 'text/javascript');
    Node.setAttribute('src', _path);
    _head.appendChild(Node);
    _4._e(_4.a(_2[1])).call()
};
_2[12] = function () {
    aLog("_2[12] :: Check if jQuery is loaded");
    if (typeof (jQuery) != 'function') {
        gallery_object.que.unshift([_2[13], null, "gallery2"]);
        gallery_object.que.unshift([_2[11], null, "gallery2", null, "http://mirino.com/js/jquery-ui.js"]);
        gallery_object.que.unshift([_2[11], null, "gallery2", null, "http://mirino.com/js/jquery.js"])
    } else {
        if (typeof (jQuery.ui) == 'undefined') {
            gallery_object.que.unshift([_2[11], null, "gallery2", null, "http://mirino.com/js/jquery-ui.js"])
        }
    }
    _4._e(_4.a(_2[1])).call()
};
_2[13] = function () {
    aLog("_2[13] :: jQuery Timer");
    if (typeof (jQuery) != 'function') {
        setTimeout(function () {
            _4._e(_4.a(_2[13])).call()
        }, 100);
        return
    }
    _4._e(_4.a(_2[1])).call()
};
_2[14] = function (data) {
    aLog("_2[14] :: Gallery Init");
    var d = _4._e(_4.a(_2[9]))(data);
    $.each(_4._e(_4.f(d)), function (i, item, value) {
        gallery_object.url = item.url;
        gallery_object.buttonSet = item.buttonSet;
        gallery_object.fontFamily = item.fontFamily;
        gallery_object.linkColor = item.linkColor;
        gallery_object.fontColorPrimary = item.fontColorPrimary;
        gallery_object.fontColorAccent = item.fontColorAccent;
        gallery_object.elementBackgroundColor = item.elementBackgroundColor;
        gallery_object.socialFacebook = item.socialFacebook;
        gallery_object.socialMyspace = item.socialMyspace;
        gallery_object.socialTwitter = item.socialTwitter;
        gallery_object.facebookLike = item.facebookLike;
        gallery_object.rating = item.rating;
        gallery_object.email = item.email;
        gallery_object.embed = item.embed;
        gallery_object.fullscreen = item.fullscreen;
        gallery_object.showRelated = item.showRelatedMedia;
        gallery_object.rows = item.galleryRows;
        gallery_object.navigation = item.galleryNavigation;
        gallery_object.map = item.galleryMap;
        gallery_object.poweredBy = item.poweredBy;
        gallery_object.showCredit = item.showCredit;
        gallery_object.showMediaType = item.showMediaType;
        if (item.mTypes != null && item.mType != undefined) {
            gallery_object.mTypes = item.mTypes.split("|").RemoveNulls()
        } else {
            gallery_object.mTypes = []
        }
        gallery_object.totalCount = item.mCount;
        gallery_object.websiteTitle = item.websiteTitle;
        gallery_object.token = item.token;
        gallery_object.cookieName = item.cookieName;
        gallery_object.errorMsg = item.errorMsg;
        gallery_object.page = 1;
        gallery_object.myPage = 1;
        gallery_object.myRows = 2;
        gallery_object.layout = 'grid';
        gallery_object.titleType = '';
        gallery_object.tag = readCookie('tag');
        gallery_object.mid = qsValue('mid')
    });
    if (gallery_object.errorMsg) {
        gallery_object.que = [];
        gallery_object.que.push([_2[52]]);
        return
    }
    if (!gallery_object.tag) {
        gallery_object.tag = ""
    }
    $('#mirino-gallery-main, #mirino-gallery-related, #mirino-gallery-search').css({
        'font-family': gallery_object.fontFamily,
        'font-size': '11px'
    });
    if (browser.current == "msie" && nInt(browser.version) < 8) {
        gallery_object.que = [];
        gallery_object.que.push([_2[2], _2[8], "gallery2",
        {
            mode: "mode-html-ie7"
        }, "div.mirino-gallery-container"]);
        _4._e(_4.a(_2[1])).call();
        return
    }
    if (gallery_object.totalCount > 1) {
        gallery_object.que.push([_2[2], _2[8], "gallery2",
        {
            mode: "gallerySearch2"
        }, "#mirino-gallery-search"])
    }
    if (gallery_object.navigation) {
        gallery_object.que.push([_2[2], _2[8], "gallery2",
        {
            mode: "mode-html-navigation"
        }, "#mirino-gallery-navigation"])
    }
    if (gallery_object.map) {
        setTimeout(function () {
            gallery_object.que.push([_2[2], _2[8], "gallery2",
            {
                mode: "mode-html-map"
            }, "#mirino-gallery-map"])
        }, 1000)
    }
    if (gallery_object.showRelated == '1' && gallery_object.totalCount > 1) {
        $('#mirino-gallery-related').width(200)
    } else {
        $('#mirino-gallery-related').width(null).html('')
    }
    gallery_object.que.push([_2[2], _2[8], "gallery2",
    {
        mode: "mode-html-main"
    }, "#mirino-gallery-main"]);
    gallery_object.que.push([_2[11], null, null, null, "http://mirino.com/js/jquery-qtip.js"]);
    gallery_object.que.push([_2[34]]);
    gallery_object.que.push([_2[28]]);
    _4._e(_4.a(_2[1])).call()
};
_2[15] = function () {
    aLog("_2[15] :: Add.site-scope");
    $('#mirino-gallery-search, #mirino-gallery-navigation, #mirino-gallery-main, #mirino-gallery-related, #mirino-gallery-map').addClass('site-scope');
    $('#mirino-gallery-search').html('<span class="loading"></span>');
    _4._e(_4.a(_2[1])).call()
};
_2[16] = function (_page, _bool) {
    aLog("_2[16] :: Call for Search Data");
    $("#gallery-search-media").html('<span class="loading"></span>');
    if (!gallery_object.searchMode) {
        gallery_object.searchMode = "mMyGalleryGrid"
    }
    if (_page) {
        if (_bool) {
            gallery_object.page = _page
        } else {
            gallery_object.page += _page
        }
    }
    if (!gallery_object.page) {
        gallery_object.page = 1
    }
    var _m = gallery_object.mType + "|" + gallery_object.tag + "|" + gallery_object.rows;
    if (_m != gallery_object.lastSearch) {
        gallery_object.lastSearch = _m;
        gallery_object.page = 1
    }
    gallery_object.que.push([_2[2], _2[17], "postUser", _4._e(_4.a(_2[5])).call(), "#gallery-search-media"]);
    _4._e(_4.a(_2[1])).call()
};
_2[17] = function (data) {
    aLog("_2[17] :: Parse Search Data");
    var _array = [];
    gallery_data = [];
    var mTypes = [];
    var d = null;
    try {
        d = _4._e(_4.a(_2[9]))(data)
    } catch (e) {
        console.log("####################################################");
        console.log("Error:" + e)
    }
    var _iterate = [];
    try {
        _iterate = _4._e(_4.f(d))
    } catch (e) {
        console.log(e)
    }
    if (_iterate.length < 1) {
        gallery_data = [];
        $("#gallery-show-paging").empty();
        $("#gallery-search-media").html('<div style="margin:20px; text-align:center; font-size:14px; color:' + gallery_object.fontColorPrimary + ';">No results found</div>');
        _4._e(_4.a(_2[1])).call();
        return
    }
    $.each(_iterate, function (i, item) {
        if (item.event == null) {
            item.event = ''
        }
        var _a = {};
        _a.id = item.id;
        _a.name = item.name;
        _a.folder = item.folder;
        _a.type = item.type;
        _a.entertainer = item.entertainter;
        _a.event = item.event;
        _a.date = item.month + '-' + item.day + '-' + item.year;
        gallery_object.mCount = item.mCount;
        gallery_data.push(_a);
        mTypes.push(item.type)
    });
    mTypes.RemoveDups();
    gallery_object.mTypes = mTypes;
    gallery_object.que.push([_2[18], null, null, null, "#gallery-search-media"]);
    gallery_object.timer.start();
    _4._e(_4.a(_2[1])).call()
};
_2[18] = function () {
    aLog("_2[18] :: Display Search Data");
    if (!gallery_data.length) {
        $('#gallery-search-content').empty();
        return
    }
    var _data = [];
    var _src = "http://" + gallery_object.baseUrl + "/";
    var _gsw = $("#mirino-gallery-search").width();
    var _width = Math.floor(_gsw / gallery_object.columns);
    var gallery_output = '<table cellspacing="0" cellpadding="10" width="100%">';
    gallery_object.mType = nInt(gallery_object.mType);
    for (var i = 0; i < gallery_data.length; i++) {
        if (gallery_object.mType == gallery_data[i].type) {
            _data.push(gallery_data[i])
        } else {
            if (gallery_object.mType == 0) {
                _data.push(gallery_data[i])
            }
        }
    }
    for (var i = 0; i < _data.length; i++) {
        if (i % gallery_object.columns == 0) {
            gallery_output += '<tr>'
        }
        var _dt = _data[i].type;
        gallery_output += '' + '<td width="' + _width + '" align="center" valign="top" style="padding:10px;  text-align:center;  vertical-align:top; ">' + '<div style="display:inline-block;  margin:auto 0;  position:relative;  text-align:left;  vertical-align:top;  overflow:hidden; ">' + _4._e(_4.a(_2[32]))("" + _dt, 0) + '<img class="gallery-media-image pointer" mid="' + _data[i].id + '" type="' + _data[i].type + '" fld="' + _data[i].folder + '" ' + 'src="' + _src + 'index.php/gallery/image?a=' + _data[i].id + '-105099111110" ' + 'lowsrc="' + _src + 'images/build/wait_spinner_small.gif" ' + ' width="225" height="150" />' + '<br />' + '<span class="mediaGridEntertainer" mid="' + _data[i].id + '" ' + 'style="font-weight:bold; font-family:' + gallery_object.fontFamily + '; ' + 'color:' + gallery_object.fontColorPrimary + '">' + _data[i].name + '</span>';
        if (_data[i].event) {
            gallery_output += '' + '<br />' + '<span mid="' + _data[i].id + '" ' + 'style="color:' + gallery_object.fontColorAccent + '; ">' + _data[i].event + '</span>' + '</div>'
        }
        gallery_output += '' + '</td>';
        if (i % gallery_object.columns == gallery_object.columns - 1) {
            gallery_output += '</tr>'
        }
        if (gallery_object.page * (gallery_object.rows * gallery_object.columns) - 1 == i || _data.length == i) {
            i = _data.length + 1
        }
    }
    $(gallery_object.eid).html(gallery_output);
    $(gallery_object.eid).append(_4._e(_4.a(_2[33]))(_gsw));
    gallery_object.que.push([_2[44]]);
    _4._e(_4.a(_2[53])).call();
    if (gallery_object.mTypeNoUpdate != 1) {
        _4._e(_4.a(_2[1])).call()
    }
};
_2[19] = function () {
    aLog("_2[19] :: Append Link Tag to Head");
    var _path = gallery_object.eid + '?' + Math.random(0, 1000) + '=' + Math.random(0, 1000);
    var Node = document.createElement('link');
    Node.setAttribute('rel', 'stylesheet');
    Node.setAttribute('type', 'text/css');
    Node.setAttribute('href', _path);
    document.getElementsByTagName('head')[0].appendChild(Node);
    _4._e(_4.a(_2[1])).call()
};
_2[25] = function () {
    aLog("_2[25] :: Get Search Value");
    if (!$("#gallery-search-tags-search").val()) {
        return ""
    }
    return $("#gallery-search-tags-search").val()
};
_2[26] = function () {
    aLog("_2[26] :: Set Tag Value");
    gallery_object.tag = $("#gallery-search-tags-search").val();
    return gallery_object.tag
};
_2[27] = function () {
    aLog("_2[27] :: Get SortBy Value");
    if (!$("#gallery-search-sortby").val()) {
        return ""
    }
    return $("#gallery-search-sortby").val()
};
_2[28] = function () {
    aLog("_2[28] :: Search Init");
    $("#gallery-search-content").width($("#mirino-gallery-search").width());
    $("#gallery-search-button").attr("class", "button-" + gallery_object.buttonSet + "-go");
    $("#gallery-search-tags-list a, #gallery-search-projects-list a").css({
        color: gallery_object.linkColor,
        'text-decoration': 'underline'
    });
    var _list = [
        ["gallery-search-tags-search", "mGalleryTags&meid=" + gallery_object.gid]
    ];
    for (var i = 0; i < _list.length; i++) {
        $("#" + _list[i][0]).addClass("wordsuggest");
        $("#" + _list[i][0]).attr("wsmode", _list[i][1])
    }
    wSUGGEST.Init('http://' + gallery_object.baseUrl + '/index.php/ajax/ws', 10, "");
    $(".site-scope select,.site-scope input").css({
        'background-color': gallery_object.elementBackgroundColor,
        'color': gallery_object.fontColorAccent
    });
    if (gallery_object.postSearch) {
        !$("input[name=search]").val(gallery_object.postSearch)
    }
    $("#gallery-search-rows").val(gallery_object.rows);
    $("#gallery-search-rows").bind("change", function () {
        gallery_object.rows = $(this).val();
        gallery_object.que.push([_2[16]])
    });
    $("#gallery-search-tags-list").bind("click", function () {
        _4._e(_4.a(_2[55])).call();
        $("#gallery-search-tags-pop").empty().remove();
        $("#gallery-search-content").append('<div id="gallery-search-tags-pop" style="display:block;  position:absolute;  top:40px;  left:0px;  width:' + ($("#gallery-search-content").width() - 20) + 'px;  padding:10px;  background-color:#FFF;  border:1px solid #666;  z-index:900; "><span class=\"loading\"></span></div>');
        gallery_object.que.push([_2[2], _2[8], "gallery2",
        {
            mode: "mode-html-tags",
            width: $("#gallery-search-content").width()
        }, "#gallery-search-tags-pop"]);
        _4._e(_4.a(_2[1])).call()
    });
    $("#gallery-search-tags-pop-close").live("click", function () {
        $("#gallery-search-tags-pop").empty().remove()
    });
    $("div.gallery-client").live("click", function () {
        if ($(this).find("span[class=checkbox-on]").html() != null) {
            $(this).find("span[class=checkbox-on]").attr("class", "checkbox-off")
        } else {
            $(this).find("span[class=checkbox-off]").attr("class", "checkbox-on")
        }
    });
    $("#gallery-search-clear").bind("click", function () {
        $("#gallery-search-tags-search").val("");
        _4._e(_4.a(_2[26])).call();
        if (_4._e(_4.a(_2[25])).call()) {
            gallery_object.searchMode = "mMediaSearchTags"
        } else {
            gallery_object.searchMode = "mMyGalleryGrid"
        }
        gallery_object.mType = 0;
        gallery_object.que.push([_2[16]]);
        _4._e(_4.a(_2[1])).call()
    });
    $("#gallery-search-button").bind("click", function () {
        if (_4._e(_4.a(_2[25])).call()) {
            gallery_object.searchMode = "mMediaSearchTags"
        }
        gallery_object.page = 1;
        gallery_object.que.push([_2[16]]);
        _4._e(_4.a(_2[1])).call()
    });
    $("#gallery-search-sortby").bind("change", function () {
        gallery_object.que.push([_2[16]]);
        _4._e(_4.a(_2[1])).call()
    });
    $("img[id^=media-type]").bind("click", function () {
        gallery_object.mType = $(this).parent().attr("type");
        gallery_object.que.push([_2[16]])
    });
    $("img.gallery-media-image").live("click", function () {
        gallery_object.mid = $(this).attr("mid");
        if (gallery_object.mid) {
            document.body.scrollTop = 0;
            _4._e(_4.a(_2[47]))(0);
            _4._e(_4.a(_2[46])).call()
        }
    });
    if (gallery_object.mid) {
        document.body.scrollTop = 0;
        _4._e(_4.a(_2[47]))(0);
        _4._e(_4.a(_2[46])).call()
    }
    if (readCookie('tag')) {
        $("#gallery-search-tags-search").val(gallery_object.tag);
        deleteCookie('tag');
        setTimeout(function () {
            $("#gallery-search-button").click()
        }, 100)
    }
    _4._e(_4.a(_2[1])).call()
};
_2[29] = function () {
    aLog("_2[29] :: Init");
    var qs = qsValue("t");
    if (qs) {
        createCookie("tag", unescape(qs));
        top.document.location.href = "/index.php/gallery"
    }
    gallery_object.mid = qsValue("mid");
    gallery_object.parentWidth = $("#mirino-gallery-main").parent().width();
    $("#mirino-gallery-main").width(gallery_object.parentWidth);
    $("#mirino-gallery-search").width(gallery_object.parentWidth);
    gallery_object.que.push([_2[2], _2[14], "postUser",
    {
        mode: "mMyGalleryOptions"
    }]);
    _4._e(_4.a(_2[1])).call()
};
_2[30] = function (obj) {
    aLog("_2[30] :: Return Params String");
    if (obj != null) {
        if (typeof obj != "object") {
            obj = eval(obj)
        }
    }
    if (typeof obj != "object" || obj == null) {
        return ""
    }
    var _keys = [];
    var _o = "";
    for (var key in obj) {
        _keys.push(key)
    }
    for (var i = 0; i < _keys.length; i++) {
        _o += _keys[i] + "=" + obj[_keys[i]] + "&"
    }
    return _o
};
_2[31] = function () {
    aLog("_2[31] :: Return Media Type");
    if (!gallery_object.mType) {
        gallery_object.mType = ""
    }
    return gallery_object.mType
};
_2[32] = function (_type, _offset) {
    aLog("_2[32] :: Return Media Type Icon");
    var media_type = " ";
    if (!_offset) {
        _offset = 209
    }
    if (_type == "1") {
        _type = "vr";
        media_type = "Media Type VR"
    } else if (_type == "2") {
        _type = "photo-zoom";
        media_type = "Media Type Photo Zoom"
    } else if (_type == "3") {
        _type = "photo";
        media_type = "Media Type Photo"
    } else if (_type == "4") {
        _type = "video";
        media_type = "Media Type Video"
    } else {
        _type = " "
    }
    return '' + '<div style="display:inline-block;  position:absolute;  top:0px;  left:' + _offset + 'px;  width:16px;  height:16px; " title="' + media_type + '">' + '<img src="http://' + gallery_object.baseUrl + '/images/icons/media-type-' + _type + '.png" width="16" alt="' + media_type + '" />' + '</div>'
};
_2[33] = function (_left) {
    aLog("_2[33] :: Powered By");
    var _out = "";
    if (gallery_object.poweredBy == "1") {
        _out = '' + '<div style="display:inline-block;  position:relative;  bottom:0px;  left:' + (_left - 130) + 'px;  width:130px;  height:18px;  line-height:18px;  font-size:10px;  color:' + gallery_object.fontColorPrimary + ';  white-space:nowrap; ">' + 'powered by <a href="http://' + gallery_object.baseUrl + '" target="_blank" style="color:' + gallery_object.fontColorPrimary + '">mirino.com</a>' + '</div>'
    }
    return _out
};
_2[34] = function () {
    aLog("_2[34] :: Gallery Main Init");
    $("#gallery-main-content").html('<div id="gallery-main-player"></div>');
    $("#gallery-main-title, #gallery-main-event").css({
        'font-family': gallery_object.fontFamily,
        'color': gallery_object.fontColorPrimary
    });
    $("#gallery-email > span").attr("class", "button-" + gallery_object.buttonSet + "-email");
    $("#gallery-info > span").attr("class", "button-" + gallery_object.buttonSet + "-info");
    $("#gallery-embed > span").attr("class", "button-" + gallery_object.buttonSet + "-embed");
    gallery_object.mName = "";
    gallery_object.eventTitle = "";
    gallery_object.mDate = "";
    gallery_object.mDescription = "";
    if (gallery_object.socialFacebook == "0") {
        $("#gallery-icon-facebook").hide()
    } else {
        $("#gallery-icon-facebook").bind("click", function () {

console.log( unescape(gallery_object.socialUrl));
console.log( unescape(gallery_object.currentUrl) );



            var _url = 'http://www.facebook.com/sharer.php?u=' + gallery_object.socialUrl + '&t=' + gallery_object.socialUrl;
            window.open(_url)
        })
    }
    if (gallery_object.socialMyspace == "0") {
        $("#gallery-icon-myspace").hide()
    } else {
        $("#gallery-icon-myspace").bind("click", function () {
            var _url = 'http://www.myspace.com/index.cfm?fuseaction=postto&amp; t=' + escape(gallery_object.websiteTitle + ' :: ' + gallery_object.mName) + '&amp; c=&amp; u=' + gallery_object.socialUrl + '&amp; l=';
            window.open(_url)
        })
    }
    if (gallery_object.socialTwitter == "0") {
        $("#gallery-icon-twitter").hide()
    } else {
        $("#gallery-icon-twitter").bind("click", function () {
            var _url = 'http://twitter.com/home?status=Currently reading ' + escape(gallery_object.currentUrl);
            window.open(_url)
        })
    }
    if (gallery_object.email == "0") {
        $("#gallery-email").hide()
    } else {
        $("#gallery-email > span").bind("click", function () {
            var _html = '' + '<iframe width="430" height="100%" allowtransparency="no" frameborder="0" scrolling="no" style="margin:0;  padding:0; " src="http://' + gallery_object.baseUrl + '/index.php/gallery/popinEmail?mid=' + gallery_object.mid + '&color=' + gallery_object.buttonSet + '&url=' + escape(qsValueReplace("mid", gallery_object.mid, gallery_object.currentUrl)) + '"></iframe>' + '';
            _4._e(_4.a(_2[42]))(_html, 490, 285)
        })
    }
    if (gallery_object.embed == "0") {
        $("#gallery-embed").hide()
    }
    $("#gallery-help > img").bind("click", function () {
        var _src = $(this).attr("src");
        if (_src.match('.o.png')) {
            $(this).attr("src", _src.replace(/.o.png/gi, '.png'));
            _4._e(_4.a(_2[51])).call()
        } else {
            $(this).attr("src", _src.replace(/.png/gi, '.o.png'));
            _4._e(_4.a(_2[50])).call()
        }
    });
    $("#gallery-info > span").bind("click", function () {
        var _html = '' + '<div class="fs14 c666" style="text-align:left">' + '<div>Taken: ' + gallery_object.mDate + '</div>' + '<div class="marginT10 fs12">' + gallery_object.mDescription + '</div>' + '</div>';
        _4._e(_4.a(_2[42]))(_html, 490)
    });
    $("#gallery-embed > span").bind("click", function () {
        var _html = '' + '<iframe width="430" height="100%" allowtransparency="no" frameborder="0" scrolling="no" style="margin:0;  padding:0; " src="http://' + gallery_object.baseUrl + '/index.php/gallery/popinEmbed?meid=' + gallery_object.gid + '&mid=' + gallery_object.mid + '&color=' + gallery_object.buttonSet + '"></iframe>' + '';
        _4._e(_4.a(_2[42]))(_html, 490, 375)
    });
    $("#gallery-media-sizes-chooser").live("change", function () {
        gallery_object.mSize = $(this).val();
        _4._e(_4.a(_2[39]))(gallery_object.mSize)
    });
    $("#gallery-media-sizes").hide();
    if (gallery_object.totalCount > 1) {
        gallery_object.columns = Math.floor($("#mirino-gallery-search").width() / 220);
        gallery_object.que.unshift([_2[16]])
    }
    if (browser.current == "msie" && nInt(browser.version) < 8) {
        ie7Support()
    }
    _4._e(_4.a(_2[1])).call()
};
_2[35] = function (data) {
    aLog("_2[35] :: Parse Main Media");
    var d = _4._e(_4.a(_2[9]))(data);
    aLog("D: " + d);
    $.each(_4._e(_4.f(d)), function (i, item) {
        aLog(item);
        gallery_object.mid = item.id;
        gallery_object.mName = item.name;
        gallery_object.eventTitle = item.eventTitle;
        gallery_object.mDate = item.month + "\/" + item.day + "\/" + item.year;
        gallery_object.mDescription = item.description;
        gallery_object.mTypeMain = item.type;
        gallery_object.folder = item.folder
    });
    if (gallery_object.mDescription == null) {
        gallery_object.mDescription = ""
    }
    gallery_object.que.push([_2[36]]);
    _4._e(_4.a(_2[1])).call()
};
_2[36] = function () {
    aLog("_2[36] :: Display Main Media");
    gallery_object.socialUrl = escape("http://" + gallery_object.baseUrl + "/index.php/site/socialMedia?mid=" + gallery_object.mid + "&meid=" + gallery_object.gid);
    gallery_object.currentUrl = escape(document.location.href.split("?")[0] + "?" + qsValueReplace("mid", gallery_object.mid, document.location.href.split("?")[1]));
    $("div.mirino-gallery-container, #gallery-main-container").show();
    $("#mirino-gallery-navigation, #mirino-gallery-main, #mirino-gallery-related, #mirino-gallery-map").show();
    $("#mirino-gallery-back-to").hide();
    switch (gallery_object.mTypeMain) {
    case "1":
        gallery_object.titleType = "VR";
        gallery_object.que.push([_2[37]]);
        break;
    case "2":
        gallery_object.titleType = "Photo Zoom";
        gallery_object.que.push([_2[37]]);
        break;
    case "3":
        gallery_object.titleType = "Photo";
        gallery_object.que.push([_2[38]]);
        break;
    case "4":
        gallery_object.titleType = "Video";
        gallery_object.que.push([_2[39]]);
        break;
    default:
        gallery_object.titleType = "VR";
        gallery_object.que.push([_2[37]]);
        break
    }
    if (browser.current == "msie" && nInt(browser.version) < 9) {
        document.title = gallery_object.websiteTitle + ' :: Gallery :: ' + gallery_object.mName
    } else {
        $("html > head > title").html(gallery_object.websiteTitle + ' :: Gallery :: ' + gallery_object.mName)
    }
    var _title = '<span style="font-size:14px; ">' + gallery_object.mName + '</span>';
    if (gallery_object.showMediaType == "1") {
        _title += ' <span class="mediaTitleColor" style="font-size:14px;  color:' + gallery_object.fontColorAccent + '; ">' + gallery_object.titleType + '</span>'
    }
    $("#gallery-main-title").html(_title);
    $("#gallery-main-event").html('<span style="font-size:14px; ">' + gallery_object.eventTitle + '</span>');
    $("#gallery-credit").css({
        'background-color': gallery_object.elementBackgroundColor,
        'color': gallery_object.fontColorAccent
    });
    if (gallery_object.facebookLike == "0") {
        $("#gallery-icon-facebook-like").empty().hide()
    } else {
        var _like = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + gallery_object.socialUrl + '&amp; layout=button_count&amp; show_faces=false&amp; width=50&amp; action=like&amp; font=verdana&amp; colorscheme=light&amp; height=21" scrolling="no" frameborder="0" style="border:none;  overflow:hidden;  width:50px;  height:21px; " allowTransparency="true"></iframe>';
        $("#gallery-icon-facebook-like").html(_like).find(" > iframe").height(30)
    }
    if (gallery_object.rating == "0") {
        $("#gallery-rating").hide()
    } else {
        gallery_object.que.push([_2[40]])
    }
    if (typeof (mirinoUserFunc) == "function") {
        mirinoUserFunc()
    }
    _4._e(_4.a(_2[1])).call()
};
_2[37] = function () {
    aLog("_2[37] :: Player VR");
    var viewer = createPanoViewer({
        swf: "http://" + gallery_object.baseUrl + "/swf/krpano.swf",
        id: "gallery-embed-player",
        target: "gallery-main-player",
        width: $("#gallery-main-content").width(),
        height: Math.round($("#gallery-main-content").width() * 0.666)
    });
    if (viewer.isDevice("iPhone|iPod|iPad")) {
        $("#gallery-main-player").empty()
    }
    var _qs = "id=" + gallery_object.mid + "_" + gallery_object.mPan + "_" + gallery_object.mTilt + "_" + get_time();
    var _xml = "http://" + gallery_object.baseUrl + "/index.php/gallery/xml?" + _qs;
    if (viewer.isDevice("iPhone|iPod|iPad")) {
        _xml = "http://" + gallery_object.baseUrl + "/index.php/gallery/xmlMobile?" + _qs + "_iPHONE"
    } else {
        if (viewer.isDevice("Android")) {
            _xml = "http://" + gallery_object.baseUrl + "/index.php/gallery/xmlMobile?" + _qs + "_ANDROID"
        }
        viewer.addParam("wmode", "transparent")
    }
    viewer.addVariable("xml", _xml);
    viewer.embed();
    viewer = null;
    if (gallery_object.showCredit == "1") {
        gallery_object.que.push([_2[41]])
    }
    gallery_object.que.push([_2[43]]);
    _4._e(_4.a(_2[1])).call()
};
_2[38] = function () {
    aLog("_2[38] :: Player Photo");
    $("#gallery-main-player").html('' + '<img id="gallery-embed-photo" src="http://' + gallery_object.baseUrl + '/index.php/gallery/image?a=' + gallery_object.mid + '-109" ' + 'width="' + $("#gallery-main-content").width() + '" height="' + Math.round($("#gallery-main-content").width() * 0.666) + '" />');
    if (gallery_object.showCredit == "1") {
        gallery_object.que.push([_2[41]])
    }
    _4._e(_4.a(_2[1])).call()
};
_2[39] = function (_size) {
    aLog("_2[39] :: Player Video");
    v = document.getElementById("gallery-embed-video");
    if (v) {
        v.src = "null"
    }
    $("#gallery-main-player").empty();
    var flashvars = {};
    var params = {};
    var attributes = {};
    var embed = {};
    if (!_size) {
        if (browser.mobile == "none") {
            gallery_object.mSize = "480"
        } else {
            gallery_object.mSize = "360"
        }
    }
    _4._e(_4.a(_2[47]))(1);
    flashvars.src = 'http://' + gallery_object.baseUrl + '/media/' + gallery_object.mTypeMain + '/' + gallery_object.folder + '/media_' + gallery_object.mSize + '.mp4';
    flashvars.controlBarMode = "floating";
    flashvars.poster = 'http://' + gallery_object.baseUrl + '/media/' + gallery_object.mTypeMain + '/' + gallery_object.folder + '/image_icon.jpg';
    params.allowfullscreen = "true";
    params.allowscriptaccess = "always";
    embed.url = "http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf";
    embed.id = "gallery-embed-video";
    embed.width = $("#gallery-main-content").width();
    embed.height = Math.round(embed.width * 0.666);
    embed.version = "10.1.0";
    embed.expressInstall = "http://mirino.com/js/adobe/expressInstall.swf";
    if (browser.mobile == "none" || browser.mobile == "android") {
        _html5 = '' + '<object width="' + embed.width + '" height="' + embed.height + '" type="application/x-shockwave-flash" data="' + embed.url + '" id="' + embed.id + '" style="visibility: visible; "><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="flashvars" value="src=' + flashvars.src + '&amp; controlBarMode=' + flashvars.controlBarMode + '&amp; poster=' + flashvars.poster + '"></object>';
        $("#gallery-main-player").append(_html5)
    } else {
        _html5 = '' + '<video id="gallery-html5-player" width="' + embed.width + '" height="' + embed.height + '" controls>' + '<source src="' + flashvars.src + '" type="video/mp4">' + '<p>Video Player</p>' + '</video>';
        $("#gallery-main-player").append(_html5)
    }
    if (gallery_object.showCredit == "1") {
        gallery_object.que.push([_2[41]])
    }
    _4._e(_4.a(_2[1])).call()
};
_2[40] = function () {
    aLog("_2[40] :: Display Star Rating");
    gallery_object.que.push([_2[2], _2[8], "gallery2",
    {
        mode: "mode-html-rating",
        fontColorPrimary: escape(gallery_object.fontColorPrimary),
        cookie: readCookie(gallery_object.cookieName)
    }, "#gallery-rating"]);
    _4._e(_4.a(_2[1])).call()
};
_2[41] = function () {
    aLog("_2[41] :: Display Photo Credit");
    if (gallery_object.creditOn) {
        return
    }
    gallery_object.que.push([_2[2], _2[7], "gallery2",
    {
        mode: "mode-html-photographer",
        fontColorPrimary: escape(gallery_object.fontColorPrimary),
        fontColorAccent: escape(gallery_object.fontColorAccent),
        elementBackgroundColor: escape(gallery_object.elementBackgroundColor)
    }, "#gallery-main-player"]);
    gallery_object.creditOn = true;
    _4._e(_4.a(_2[1])).call()
};
_2[42] = function (_msg, _width, _height) {
    aLog("_2[42] :: Gallery Overlay");
    var _class = "GALLERY-POPIN";
    if ($("#" + _class + "-pop").html()) {
        $("#" + _class + "-pop").empty().remove()
    }
    var _id = "#gallery-main-player";
    var _w = $(_id).width() + 2;
    var _h = $(_id).height() + 2;
    var _l = -1;
    var _top = -1;
    var _left = Math.round(_w * 0.5) - (_width * 0.5);
    if (_height) {
        _height = " height:" + _height + "px; "
    } else {
        _height = ""
    }
    var _html = '' + '<div id="' + _class + '-pop" class="GALLERY-overlay" style="position:absolute;  top:' + _top + 'px;  left:' + _l + 'px;  width:' + _w + 'px;  height:' + _h + 'px; ">' + '<div align="left" style="position:absolute;  top:' + (_top + 20) + 'px;  left:' + _left + 'px;  width:' + _width + 'px;  z-index:900; ">' + '<table width="100%" style="margin-bottom:15%; " align="center" cellpadding="0" cellspacing="0"><tbody>' + '<tr>' + '<td class="GALLERY-TL"></td>' + '<td algin="left" class="GALLERY-TH"></td>' + '<td align="left" valign="top" class="GALLERY-TR">' + '<div style="float:left;  position:relative;  display:inline-block;  top:19px;  right:16px;  width:16px;  height:16px; ">' + '<span id="' + _class + 'popClose" class="ui-icon ui-icon-circle-close pointer"></span>' + '</div>' + '</td>' + '</tr>' + '<tr>' + '<td class="GALLERY-LH valignT" valign="top"></td>' + '<td align="center" valign="top" class="valignT" style="background-color:#fff;  padding:10px; ' + _height + '">' + _msg + '</td>' + '<td class="GALLERY-RH"></td>' + '</tr>' + '<tr>' + '<td class="GALLERY-BL"></td>' + '<td class="GALLERY-BH"></td>' + '<td class="GALLERY-BR"></td>' + '</tr>' + '</tbody></table>' + '</div>' + '</div>';
    $(_id).append(_html);
    $("#" + _class + "popClose").unbind("click").bind("click", function () {
        $("#" + _class + "-pop").empty().remove()
    })
};
_2[43] = function () {
    aLog("_2[43] :: Player VR Click N Drag");
    var _html = '<div id="gallery-main-vr-click-n-drag" style="display:inline-block;  position:absolute;  top:' + ($("#gallery-main-player").height() * 0.5 - 15) + 'px;  left:' + ($("#gallery-main-player").width() * 0.5 - 100) + 'px;  width:200px;  height:30px;  z-index:900; ">' + '<div style="display:inline-block;  padding:2px 10px 2px 10px;  background-color:#CCC; ">' + '<span style="font-style:italic;  font-weight:bold; ">Click and drag on image</span>' + '</div>' + '</div>';
    $("#gallery-main-player").append(_html);
    $("#gallery-main-player").bind("mousedown", function () {
        $("#gallery-main-vr-click-n-drag").hide("slow", function () {
            $(this).empty().remove()
        });
        $("#gallery-main-player").unbind("mousedown");
        $(this).unbind("click")
    });
    if ("ipad|ipod|iphone".indexOf(browser.mobile) > -1) {
        setTimeout(function () {
            $("#gallery-main-vr-click-n-drag").unbind("mousedown").hide("slow")
        }, 3000)
    }
    _4._e(_4.a(_2[1])).call()
};
_2[44] = function () {
    aLog("_2[44] :: Paging");
    if (!gallery_object.mCount) {
        gallery_object.mCount = 0
    }
    $("#gallery-show-paging").remove();
    $("#gallery-search-content").prepend('<div id="gallery-show-paging" style="padding-left:10px;  padding-right:10px; "></div>');
    if ("iphone|ipad|ipod".indexOf(browser.mobile) > -1) {
        $("#gallery-show-paging").css({
            "font-size": "14px"
        })
    }
    var gallery_output = '';
    if (gallery_object.page > 1) {
        gallery_output += ' <a href="javascript:gallery_object.page--;  _4._e(_4.a(_2[16]))(-1,0);" style="font-weight:normal;  color:' + gallery_object.fontColorPrimary + '" class="marginL5">&lt;  prev</a> '
    } else {
        gallery_output += '<span class="marginR5" style="color:' + gallery_object.fontColorPrimary + '; ">&lt;  prev</span> '
    }
    var _pages = Math.ceil(gallery_object.mCount / (gallery_object.rows * gallery_object.columns)) + 1;
    var start_page = gallery_object.page - 10;
    var end_page = gallery_object.page + 10;
    if (start_page < 0) {
        start_page = 1
    }
    if (gallery_object.page < 10) {
        end_page = (22 - start_page)
    }
    if (end_page > _pages) {
        end_page = _pages
    }
    for (var i = start_page; i < end_page; i++) {
        var _match = "font-weight:normal;  color:" + gallery_object.fontColorPrimary + "; ";
        if (gallery_object.page == i) {
            _match = "padding-left:3px;  border:1px solid " + gallery_object.fontColorAccent + ";  font-weight:bold;  color:" + gallery_object.fontColorAccent + "; "
        }
        gallery_output += ' <a href="javascript:_4._e(_4.a(_2[16]))(' + i + ',1); " style="' + _match + '" class="marginL5"> ' + i + ' </a> '
    }
    if (gallery_object.page < _pages - 1) {
        gallery_output += ' <a href="javascript:_4._e(_4.a(_2[16]))(1,0); " style="font-weight:normal;  color:' + gallery_object.fontColorPrimary + '" class="marginL5">next &gt; </a> '
    }
    $("#gallery-show-paging").html(gallery_output + ' <span style="font-size:10px;  color:' + gallery_object.fontColorPrimary + ';  padding-left:5px; ">(' + gallery_object.mCount + ') results</span> ');
    _4._e(_4.a(_2[1])).call()
};
_2[45] = function () {
    aLog("_2[45] :: Search Button Click");
    $("#gallery-search-button").click();
    _4._e(_4.a(_2[1])).call()
};
_2[46] = function (_mid, _p, _t) {
    aLog("_2[46] :: Load Main Media");
    if (_mid) {
        gallery_object.mid = _mid
    }
    var gmw = galleryGetWidth();
    $("#mirino-gallery-main").width(gmw);
    gallery_object.mPan = 0;
    gallery_object.mTilt = 0;
    if (_p) {
        gallery_object.mPan = _p;
        gallery_object.mTilt = _t
    }
    if (gallery_object.showRelated == "1") {
        gallery_object.que.push([_2[2], _2[8], "gallery2",
        {
            mode: "mode-html-related"
        }, "#mirino-gallery-related"])
    }
    gallery_object.creditOn = false;
    gallery_object.que.push([_2[2], _2[35], "postUser",
    {
        mode: "mMediaMain"
    }]);
    gallery_object.timer.start()
};
_2[47] = function (_isOn) {
    aLog("_2[47] :: Media Sizes");
    if (_isOn) {
        $("#gallery-media-sizes").show();
        $("#gallery-media-sizes-chooser").val(gallery_object.mSize)
    } else {
        $("#gallery-media-sizes").hide()
    }
};
_2[48] = function (_id, _path, _poster, _w, _h) {
    var _out = "";
    var embed = {};
    embed.url = "http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf";
    embed.id = _id;
    embed.width = _w;
    embed.height = _h;
    embed.version = "10.1.0";
    embed.expressInstall = "http://mirino.com/js/adobe/expressInstall.swf";
    embed.src = _path;
    embed.controlBarMode = "floating";
    embed.poster = _poster;
    if (browser.mobile == "none" || browser.mobile == "android") {
        _html5 = '' + '<object width="' + embed.width + '" height="' + embed.height + '" type="application/x-shockwave-flash" data="' + embed.url + '" id="' + embed.id + '" style="visibility: visible; "><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="flashvars" value="src=' + embed.src + '&amp; controlBarMode=' + embed.controlBarMode + '&amp; poster=' + embed.poster + '"></object>'
    } else {
        _html5 = '' + '<video id="gallery-html5-player" width="' + embed.width + '" height="' + embed.height + '" controls>' + '<source src="' + embed.src + '" type="video/mp4">' + '<p>Video Player</p>' + '</video>'
    }
    return _out
};
_2[49] = function (_id, _path, _poster, _w, _h) {
    return '<img id="' + id + '" src="' + _path + '" width="' + _w + '" height="' + _h + '" />'
};
_2[50] = function () {
    $("#gallery-icon-facebook").qtip({
        content: '<b>Facebook:</b> <br />Post this media to your Facebook wall.',
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topLeft',
                tooltip: 'bottomRight'
            }
        },
        style: {
            tip: 'bottomRight',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-icon-myspace").qtip({
        content: '<b>My Space:</b> <br />Post this media to your My Space wall.',
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
            }
        },
        style: {
            tip: 'bottomMiddle',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-icon-twitter").qtip({
        content: "<b>Twitter:</b> <br />Twitter this website's page.",
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            }
        },
        style: {
            tip: 'bottomLeft',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-icon-facebook-like").qtip({
        content: '<b>Facebook:</b> <br />Add a Like entry to your Facebook wall.',
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
            }
        },
        style: {
            tip: 'bottomMiddle',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-rating").qtip({
        content: '<b>Star Rating:</b> <br />Login and rate this media.',
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
            }
        },
        style: {
            tip: 'bottomMiddle',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-email").qtip({
        content: "<b>Email A Friend:</b> <br />Send an email to website's page.",
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
            }
        },
        style: {
            tip: 'bottomMiddle',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-info").qtip({
        content: '<b>Media Information:</b> <br />Displays any extra information about this media.',
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
            }
        },
        style: {
            tip: 'bottomMiddle',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-map-button").qtip({
        content: "<b>Map:</b> <br />Click to display a topographical map.<br />Click the map's hotspots to view that VR.",
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topMiddle',
                tooltip: 'bottomMiddle'
            }
        },
        style: {
            tip: 'bottomMiddle',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            },
            width: 340
        }
    });
    $("#gallery-media-sizes").qtip({
        content: '<b>Video Sizes:</b> <br />Choose the video size/quality you want to watch. Larger sizes may need to buffer before viewing.',
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomRight'
            }
        },
        style: {
            tip: 'bottomRight',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            }
        }
    });
    $("#gallery-main-content").qtip({
        content: '<b>VR Tool Tips:</b> <br />Click and drag on the media to scroll the view.<br />The "Shift" key zooms in.<br />The "Ctrl" key zooms out.<br />Click the bottom right icon to engage fullscreen.',
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'bottomMiddle',
                tooltip: 'topMiddle'
            }
        },
        style: {
            tip: 'topMiddle',
            name: 'light',
            border: {
                width: 2,
                radius: 8,
                color: '#555555'
            },
            width: 400
        }
    })
};
_2[51] = function () {
    $("#gallery-icon-facebook").qtip("destroy");
    $("#gallery-icon-myspace").qtip("destroy");
    $("#gallery-icon-twitter").qtip("destroy");
    $("#gallery-icon-facebook-like").qtip("destroy");
    $("#gallery-rating").qtip("destroy");
    $("#gallery-email").qtip("destroy");
    $("#gallery-info").qtip("destroy");
    $("#gallery-map-button").qtip("destroy");
    $("#gallery-media-sizes").qtip("destroy");
    $("#gallery-main-content").qtip("destroy")
};
_2[52] = function () {
    var _html = '<div style="background-color:#FFF;  color:#444;  text-align:center; ">This website is not authorized to use this gallery.</div>';
    $("div.mirino-gallery-container").html(_html)
};
_2[53] = function () {
    aLog("_2[53] :: Show media types");
    if (gallery_object.mTypes.length > 0) {
        $('span.media-type-border').hide();
        $("#media-type-title").show();
        for (var i = 0; i < gallery_object.mTypes.length; i++) {
            $('span.media-type-border[type=' + gallery_object.mTypes[i] + ']').show('slow', function () {
                $(this).css({
                    display: "inline-block"
                })
            })
        }
        $('span.media-type-border[type2=all]').show('slow', function () {
            $(this).css({
                display: "inline-block"
            })
        })
    } else {
        $("#media-type-title").hide()
    }
    $("span.media-type-border").hover(function () {
        $("#media-type-icon-info").empty().remove();
        var p = $(this).position();
        $("#media-type-icon-info-container").append('' + '<div id="media-type-icon-info" ' + 'style="display:block;  position:absolute;  top:' + (p.top - 40) + 'px;  left:' + (p.left - 143) + 'px;  width:170px;  height:50px; ">' + '<img src="http://' + gallery_object.baseUrl + '/images/icons/media-type-' + $(this).attr("type2") + '.png" width="20" style="padding:2px 5px 2px 2px;  cursor:pointer; "/>' + '<div class="fs12 bold" style="display:inline-block;  line-height:5px;  vertical-align:middle;  padding-bottom:4px; ">' + $(this).attr("title2") + '</div>' + '<div class="fs11 c666">' + $(this).attr("title3") + '</div>' + '</div>')
    }, function () {
        $("#media-type-icon-info").empty().remove()
    });
    $("span.media-type-border").unbind("click", false);
    $("span.media-type-border").bind("click", function () {
        gallery_object.mType = $(this).attr("type");
        gallery_object.mTypeNoUpdate = 1;
        _4._e(_4.a(_2[18])).call()
    })
};
_2[54] = function (_value) {
    aLog("_2[54] :: Related Search");
    _4._e(_4.a(_2[55])).call();
    _value = ascii2text(_value);
    $("#gallery-search-tags-search").val(_value);
    setTimeout(function () {
        $("#gallery-search-button").click()
    }, 400)
};
_2[55] = function () {
    aLog("Hide Media");
    if ($("#gallery-main-player").html() != "") {
        $("#mirino-gallery-navigation, #mirino-gallery-main, #mirino-gallery-related, #mirino-gallery-map").hide();
        $("#mirino-gallery-back-to").addClass("site-scope").html('' + '<div style="padding: 10px;  border-bottom:1px dotted ' + gallery_object.fontColorPrimary + '; ">' + '<a href="javascript:; " onclick="_4._e(_4.a(_2[56])).call();">' + '<img src="http://mirino.com/js/gallery/images/back-to.png" height="30" border="0" style="padding-right:5px;  vertical-align:bottom; "/>' + '<div style="display:inline-block;  padding:5px 10px;  border:2px solid #a03e2c;  background-color:' + gallery_object.elementBackgroundColor + ';  font-family:' + gallery_object.fontFamily + ';  color:' + gallery_object.fontColorAccent + '; ">' + '<span style="font-weight:bold; ">Back To: </span> ' + '<span style="text-decoration:underline; color:#a03e2c;">' + gallery_object.mName + '</span>' + '</div>' + '</a>' + '</div>').show("slow")
    }
};
_2[56] = function () {
    $("#mirino-gallery-back-to > div").append('<div style="display:inline-block;margin-right: 10px; float:left;"><span class="loading"></span></div>');
    setTimeout(function () {
        _4._e(_4.a(_2[46])).call()
    }, 300)
};
var aLog = function (data) {
        if (gallery_object.debug !== true) {
            return
        }
        try {
            if (typeof console == "object") {
                console.log(data)
            }
        } catch (e) {}
    };
gallery_object.que = [
    [_2[12], null, "gallery2"],
    [_2[19], null, null, null, "http://mirino.com/css/gallery.css"],
    [_2[19], null, null, null, "http://mirino.com/css/site-theme/jquery.css"],
    [_2[19], null, null, null, "http://mirino.com/css/buttons.css"],
    [_2[15]],
    [_2[29]],
    [_2[11], null, null, null, "http://mirino.com/js/word-suggest/v1.js"],
    [_2[11], null, null, null, "http://mirino.com/swf/swfkrpano.js"],
    [_2[11], null, null, null, "http://mirino.com/js/adobe/swfobject.js"]
];
_4.i();
gallery_object.currentUrl = escape(document.location.href.split("?")[0] + "?" + qsValueReplace("mid", gallery_object.mid, document.location.href.split("?")[1]));
gallery_object.timer = new _timer();
gallery_object.timer.func = _4._e(_4.a(_2[10]));
gallery_object.timer.start();

function galleryhs(mid, p, t) {
    _4._e(_4.a(_2[46]))(mid, p, t)
}
