Greasy Fork is available in English.

[TS] Generic Image Viewer

A more Powerful Image Viewer with info panel support for Pixiv, deviantArt, imgur, Seiga Nico and nijie.info. Support numpad keys now.

// ==UserScript==
// @name            [TS] Generic Image Viewer
// @namespace       TimidScript
// @version         2.2.47
// @description     A more Powerful Image Viewer with info panel support for Pixiv, deviantArt, imgur, Seiga Nico and nijie.info. Support numpad keys now.
// @author          TimidScript
// @homepageURL     https://github.com/TimidScript
// @copyright       © 2013+ TimidScript, Some Rights Reserved.
// @license         https://github.com/TimidScript/UserScripts/blob/master/license.txt
// @include         *
// @require         https://greasyfork.org/scripts/19967/code/TSL - GM_update.js
// @require         https://greasyfork.org/scripts/19968/code/TSLibrary - Generic.js
// @homeURL         https://greasyfork.org/en/scripts/18448
// @grant           GM_getValue
// @grant           GM_setValue
// @grant           GM_listValues
// @grant           GM_deleteValue
// @grant           GM_xmlhttpRequest
// @grant           GM_info
// @grant           GM_getMetadata
// @grant           GM_registerMenuCommand
// @run-at          document-start
// @icon            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABLySURBVFhHjZj3byNZcsf5lxn2LwYM2IBh+2ADdzjs7nh8s3uzs6PRhJ0kUcxkM4g559hNdiCbbIo55yxG5Uhp7v4KV5NanVa7Zx/xReOp1Xzv01X1quqR02tk1uo3M0Gf9enTb548+Qrhb5IeKeFVEF4k6pd5DJ8cRl4pG6zkQ2uVsoFiyltgnPmYNUuZM6QJrqAcbcvGHS4MM+JJgwdLWJ05qyOq1ZNqfd7sxM0OI0p5bK6ozoTvauEmATJabSgBNym9OW/1cPrN7Aoo229kQyzQkydPvpHxXpNuCdCAKJ/Mrf/oMPHKuWBuz7tHmlOoqhBCmmFpH5fs45IxIZmQkjHJjgcRcQsVp3yKsNfothnjJmPWbM9ZXFGtOWVyhk12bQB3mh2U1piB+1YnY7ThRqsdo7x2T8xgTVlcLBDLxGLlQn77CuhrG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bc6+28ZD+/HYOMnMU+lWNDoaDHqjyV6hSiRSpMs8DGoA4l6LsL7kkHv8ASZfKdfqpMMQ2+WmdDvM7qe44l0CeQ1dfdP2AU7NR5Sk7hem4r5inigXiEpxpRJRKxGcg+hffl0A83ScH1OKl7TyfZ/ErmqNZaO11k2jPcnkFrPZ+cXFdHFQbfeiYCqPpRfUziIr84T1g6Am7rcx2UJ3ND45O23k8wfZ/EmxeJDNjplEG8dyTuOejjeNQGzIJhFRNWkfdhPDDohm1Y0NOjHO6jR4dwBaRIRZ9StS/mM/Rl43Wtf15r2W9dY0m5/s719cXJyfn52enc4ODuHsV0jR7T1slg9PcmiZwWvN9vzw6Ozi/Oz8vFMqXVTq919fNtrX9dYim2ug9jnF/oJWCMl6zeigTT/UGujOPA3r+5ji/YimHtGsZmweFUr9ZgMsBAe0u8/FOVhiOps0G+VWs3x0AkfmC7gJn9Ozs06peFGtPZoHZj6v1Dq4Z04ig7ComfcPO/FfB1pEBHHF6xYWAAc9nmWli0qtVyyencHL/+wDZ4lqLltLZRZzcOjdTTBht1S8rN1Z6JHOy5VO2DEjpI24cdChV4oNAahD/y8Es+bzbqSGewAAAABJRU5ErkJggg==
// ==/UserScript==

/* License + Copyright Notice
********************************************************************************************
License can be found at: https://github.com/TimidScript/UserScripts/blob/master/license.txt
Below is a copy of the license the may not be up-to-date.

Copyright © TimidScript, Some Rights Reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

1) GPL-3 License is met that does not conflict with the rest of the license (http://www.gnu.org/licenses/gpl-3.0.en.html)
2) This notice must be included
3) Due credits and link to original author's homepage (included in this notice).
4) Notify the original author of redistribution
5) Clear clarification of the License and Notice to the end user
6) Do not upload on OpenUserJS.org or any other site that infringes on this license

TimidScript's Homepages:  GitHub:      https://github.com/TimidScript
                          GreasyFork:  https://greasyfork.org/users/1455
*/

/* Information
********************************************************************************************

There are two sets of keys now. One using character keys the second using are numpad keys.
Hotkeys:
  [A], [Num 1] => Auto-Height
  [S], [Num 2] => Auto-Width
  [Z], [Num 3] => Auto-Stretch
  [X], [Num .] => Enlarge/Shrink to Client Area
  [Q], [Num 0] => Reset Size

  [D], [Num 4] => Rotate Left
  [W], [Num 5] => Reset rotation transformation
  [F], [Num 6] => Rotate Right

  [X], [Num 7] => Mirror Horizontally
  [E], [Num 8] => Reset mirror transformation
  [C], [Num 9] => Mirror Vertically

  [T], [Num *] => Change colour scheme (down)
  [R], [Num /] => Change colour scheme (up)

TODO: Replace the video controls
------------------------------------
 Version History
------------------------------------
2.2.47 (2017-04-11)
 - Bugfix for Chrome support
2.2.46 Beta (2016-11-22)
 - BugFix: imgur link fix
 - Better support for videos
 - Support for video sites (gfycat)
 - Support for twitter :orig url
2.2.45 (2016-10-13)
 - Bugfix: Video loop
2.2.44 (2016-09-21)
 - Changed the hotkeys
2.2.43 (2016-09-13)
 - Separated hotkey for reset rotation and mirror image.
 - Revised hotkeys and added numpad keys
2.2.42 (2016-09-03)
 - Bugfix: "z-index" added to panels
 - Bugfix: Video panel no longer shows on sites like steam
 - Removed no longer needed nicoseiga image checking
 - Removed the article container and just kept the image in the default body parent node
 - Added my own center algorithm that handles the rotation aspect.
2.2.41 (2016-07-26)
 - Moved SWF controls to the bottom
2.2.40 (2016-05-27)
 - Altered license
2.2.39 (2016-25-25)
 - Moving to GreasyFork and preparing the removal of files from OUJS
2.2.38 (2016-04-10)
 - updateURL added
2.2.37 (2016-04-03)
 - Changed license to GPL-3
2.2.36 (2016-03-28)
 - Updated URL for Google Reverse Image Search
2.2.35 (2016-02-26)
 - Support for TamperMonkey window object separation
2.2.34 (2015-12-27)
 - Bugfix: Original title of image kept
 - Bugfix: getScrollBarThickness is called after the document has finished loading (interactive or complete).
 - Bugfix: Resizing and centring of image corrected
 - Better support for Pixiv images
 - Bugfix: SWF Support
 - Added support for mp4, flv abnd webm
 - Added loop button for videos
2.2.33 (2015-10-05)
 - Replaced base64 bmp icon with png version
2.2.32 (2015-09-23)
 - Changed the hotkeys
 - Removed colour scheme preview
 - Links only appear when you hover link panel
2.2.31 (2015-07-31) Major release due to major changes in inner workings and addition of CSS
styler.
 - Bugfix: "Unknown" is used for missing DeviantArt artist's name
 - Does not wait for the image to load. It attempts to alter page at interactive stage
 - Corrected a few typos
 - Improved all regular expressions for extracting information from url. Using match instead of replace
 - Improved the way it extracts user id from nijie.info
 - Support for DeviantArt https
 - Improved auto-hide visibility of meta panel
 - Improved extraction of metadata, such in deviantArt underscore (_) is representation of hyphen (-)
 - Added preview of all youtube thumbnails
 - Changed content to use CSS styles
 - CSS preview over hover
 - Changed hotkeys
 - Links href is only added when control bar is visible. (Remove tag suffix)
1.2.30 (2015-06-27)
 - URI (Base64) Script icon
1.2.29 (2015-06-20)
 - Removed the comment for URL alteration
1.2.28 (2015-06-19)
 - Removed cloneInto as it's no longer needed
 - In flash controls are always visible
 - Bugfix: where controls are missing for deviantart images/swf that do not have id
 - Remove postfix "?timidscript_*" from image source and url. The tag is used in a personal script that has been in beta phase since forever.
 - Source links now have the prefix "timidscript_source" to avoid being picked up by downloaders
 - Using styles to toggle visibility
 - Removed the message box.
1.2.27 (2015-05-14)
 - As of 11/05/2015 the Phone API (SPAPI) is dead. Using TSL-Pixiv library to get information from HTML.
 - Avoided the usage of Public API to bypass multiple login and timeout
 - Changed the hotkeys to match Pixiv Manga Viewer
.
.
.
1.0.1 (2013-10-06)
 - Initial Release with Pixiv Support Only
**********************************************************************************************/
//if (window !== window.top) return;

function makeStruct(names)
{
    var names = names.split(' ');
    var count = names.length;
    function constructor()
    {
        for (var i = 0; i < count; i++)
        {
            this[names[i]] = null;
        }
    }
    return constructor;
}

/*
==============================================================================================
 VYCC: Variables You Can Change
==============================================================================================*/
//GM_setValue("BGColors", '["#252525", "#EDE9E9", "#E7FDF7", "#F1E8D2"]')  //Image Background Colours


var ResizeMode = GM_getValue("ResizeMode", 0); //Bit operator for fitting and expanding images. (1 = FV, 2 = FH, 4 = Expand)
var ScrollBarThickness;
var DELAY = 1500;
//var DELAY = 500000000;

function Styler()
{
    document.stopCapture = true;
    var styler = document.createElement("div");
    styler.id = "GIVStyler"

    var tb = document.createElement("textarea");
    tb.setAttribute("style", "resize:none;width:100%;");
    //tb.setAttribute("wrap", "off");
    styler.appendChild(tb);

    tb.value = decodeURI(GM_getValue("CSS"));
    tb.onkeydown = function (e)
    {
        var k = e.which || e.keyCode;
        if (k != 9) return;
        e.preventDefault();
        var start = this.selectionStart,
            end = this.selectionEnd;

        this.value = this.value.substring(0, start) + "    " + this.value.substring(end);
        this.selectionEnd = this.selectionStart = start + 4;
    }

    tb.onkeypress = function (e)
    {
        clearInterval(tb.timeout);
        tb.timeout = setTimeout(function () { TSL.addStyle("GIViewerCSS", tb.value); }, 1000);
    }

    var con = document.createElement("section");
    con.setAttribute("style", "");
    styler.appendChild(con);

    var el = document.createElement("button");
    el.textContent = "Apply";
    el.style.width = "80px";
    el.onclick = function (e)
    {
        TSL.addStyle("GIViewerCSS", tb.value);
        var css = encodeURI(tb.value);
        GM_setValue("CSS", css);
        console.log(css);
    }
    con.appendChild(el);


    el = document.createElement("button");
    el.textContent = "Exit";
    el.style.width = "80px";
    el.onclick = function (e)
    {
        TSL.addStyle("GIViewerCSS", decodeURI(GM_getValue("CSS")));
        TSL.removeNode(styler);
        document.stopCapture = false;
    }
    con.appendChild(el);
    document.body.appendChild(styler);

    window.addEventListener("resize", function ()
    {
        tb.style.height = (styler.clientHeight - con.clientHeight) + "px";
    });

    tb.style.height = (styler.clientHeight - con.clientHeight) + "px";
}

function CreatePanelMeta(text, href)
{
    var panel = document.createElement("span");
    panel.className = "metaPanel";
    var link = document.createElement("a");

    if (text) link.textContent = text;
    if (href)
    {
        link.href = href;
        link.setAttribute("data-href", href);
    }

    panel.appendChild(link);
    return panel;
}

function CreatePanelImage(href, imgSrc, title)
{
    var panel = CreatePanelMeta(null, href);
    var image = document.createElement("img");
    image.src = imgSrc;
    panel.firstElementChild.appendChild(image);
    if (title) panel.title = title;
    return panel;
}

function CreatePanelControlIcon(text, classname, href)
{
    var panel = CreatePanelMeta(null, href);
    //panel.firstElementChild.setAttribute("src", href);
    panel.firstElementChild.href = href;
    var div = document.createElement("div");
    div.className = classname;
    panel.firstElementChild.appendChild(div);
    panel.firstElementChild.title = text;
    return panel;
}

var ControlHQ =
{
    data: new (makeStruct("imgTitle imgURL userIcon userHome userName userGallery"))(),
    flash: false,
    video: false,

    addStyles: function ()
    {
        ControlHQ.flash

        document.body.className = "CSS" + GM_getValue("CSS-Selection", 1);

        TSL.addStyle("CSS-Body", 'body {padding:0;margin:0;}');
        TSL.addStyle("CSS-MainImage", '#imageBox {vertical-align: middle; text-align:center; display:table-cell;} #theImage {top:0;bottom:0;margin:0}');

        TSL.addStyle("CSS-PanelHover", "#LinkPanel:hover, #ControlPanel:hover, #YoutubeThumbs:hover {visibility: visible !important;}");

        TSL.addStyle("CSS-LinkPaneM", '#LinkPanel a {color:red; font-size:14px; font-weight:700;font-family:font-family: "Times New Roman", Times, serif;}');

        TSL.addStyle("CSS-LinkPanel", '#LinkPanel {position: fixed; z-index: 100; left: 10px; top: 10px; z-index:100; border: 2px ridge white; padding: 2px 5px; background-image:linear-gradient(to bottom,#818180 0%,#F3F3F5 50%, #818180 100% ); box-shadow: 0 0 2px 3px black;}'
            + '.metaPanel {text-align: center;vertical-align: middle;display: table-cell;margin: 0;padding: 0;}'
            + '#LinkPanel img {height:24px;width:24px;border: 1px solid white; padding: 1px; background-color:black; margin-right: 5px;} .metaPanel + #UserHome {padding-left: 10px;} .metaPanel + [title=IQDB] {padding-left: 20px;}'
            );


        TSL.addStyle("YoutubeStyler", " #YoutubeThumbs {position:fixed;right:10px;top:10px;max-width:120px;padding: 1px;background-color:white; border:1px ridge black;}");

        TSL.addStyle("CSS-ControlPanel", "#ControlPanel {position:fixed; z-index: 100; top: 60px; left: 10px; display:inline-block; background-image:linear-gradient(to right,#818180 0%,#F3F3F5 50%, #818180 100% ); padding: 2px; border: 2px ridge white; box-shadow: 0 0 2px 3px black;}"
            + '#ControlPanel div {display:inline-block; margin:1px;} #ControlPanel {width: 80px; text-align:center;}'
            + ".resizeBTN, .transformBTN {height:32px;width: 32px; background-color: #F9FAFA; border: 2px ridge #05F505; border-radius: 5px; background-position: center center; background-repeat: no-repeat; cursor:pointer;}"
            + ".resizeBTN + .transformBTN, .transformBTN + .cssBTN {margin-top: 8px;}"
            + ".resizeBTN:hover, .cssBTN:hover, .transformBTN:hover {border-color:red;}"
            + ".cssBTN {width: 70px;height:40px;border: 2px solid #05F505; border-radius: 5px; cursor:pointer;background-color: white; padding:0!important; position:relative;}"
            + '.cssPRE {width:40px;height:20px;background-color:white; margin: 0 !important; position: absolute;left:15px;top:10px;font-family: "Courier New", Courier, monospace;font-size: 20px;font-weight: 500; color:gray}'
        );

        //INFO: Use encodeURI rather than JSON as JSON seems causes an unknown error when I try and paste it in
        var css = GM_getValue("CSS", null)
        if (!css)
        {
            css = '/*%0ACSS#%20is%20a%20class%20that%20is%20applied%20to%20the%20body.%20The%20hash%20is%20replaced%20by%20the%20button%20number%20from%20the%20style%20selection%20(1-6).%0A*/%0A%0A/*%20CSS1%20*******************************************/%0A.CSS1,%20#cssBTN1%0A%7B%0A%20%20%20%20background-color:black;%0A%7D%20%0A%0A.CSS1%20#theImage%0A%7B%0A%20%20%20box-shadow:%200%200%203px%206px%20white;%0A%7D%0A%0A#cssPRE1%0A%7B%0A%20%20%20box-shadow:%200%200%201px%203px%20white%7D%0A%0A%0A/*%20CSS2%20*******************************************/%0A.CSS2,%20#cssBTN2%0A%7B%0A%20%20%20%20background-color:white;%0A%7D%20%0A%0A.CSS2%20#theImage%0A%7B%0A%20%20%20box-shadow:%200%200%203px%206px%20black;%0A%7D%0A%0A#cssPRE2%0A%7B%0A%20%20%20box-shadow:%200%200%201.5px%203px%20black;%0A%7D%0A%0A/*%20CSS3%20*******************************************/%0A.CSS3,%20#cssBTN3%0A%7B%0A%20%20%20%20background-color:#E0E0E0;%0A%7D%20%0A%0A.CSS3%20#theImage%0A%7B%0A%20%20%20box-shadow:%200%200%203px%206px%20black;%0A%7D%0A%0A#cssPRE3%0A%7B%0A%20%20%20box-shadow:%200%200%201px%203px%20black;%0A%7D%0A%0A/*%20CSS4%20*******************************************/%0A.CSS4,%20#cssBTN4%0A%7B%0A%20%20%20%20background-color:lightblue;%0A%7D%20%0A%0A.CSS4%20#theImage%0A%7B%0A%20%20%20box-shadow:%200%200%203px%206px%20blue;%0A%7D%0A%0A#cssPRE4%0A%7B%0A%20%20%20box-shadow:%200%200%201px%203px%20blue;%0A%7D%0A%0A%0A/*%20CSS5%20*******************************************/%0A.CSS5,%20#cssBTN5%0A%7B%0A%20%20%20%20background-color:orange;%0A%7D%20%0A%0A.CSS5%20#theImage%0A%7B%0A%20%20%20box-shadow:%200%200%203px%206px%20black;%0A%7D%0A%0A#cssPRE5%0A%7B%0A%20%20%20box-shadow:%200%200%201px%203px%20black;%0A%7D%0A%0A%0A/*%20CSS6%20*******************************************/%0A.CSS6,%20#cssBTN6%0A%7B%0A%20%20%20%20background-color:yellow;%0A%7D%20%0A%0A.CSS6%20#theImage%0A%7B%0A%20%20%20box-shadow:%200%200%203px%206px%20black;%0A%7D%0A%0A#cssPRE6%0A%7B%0A%20%20%20box-shadow:%200%200%201px%203px%20black;%0A%7D%0A%0A/*%20CSS7%20*******************************************/%0A.CSS7,%20#cssBTN7%0A%7B%0A%20%20%20%20background-color:black;%0A%7D%20%0A%0A/*%20CSS8%20*******************************************/%0A.CSS8,%20#cssBTN8%0A%7B%0A%20%20%20%20background-color:darkgray;%0A%7D%0A%0A/*%20CSS9%20*******************************************/%0A.CSS9,%20#cssBTN9%0A%7B%0A%20%20%20%20background-color:lightblue;%0A%7D%0A%0A/*%20PREVIEW%20BUTTONS%20**********************************/%0A.CSS1%20#cssBTN1,%20.CSS2%20#cssBTN2,.CSS3%20#cssBTN3,%20.CSS4%20#cssBTN4,%20.CSS5%20#cssBTN5,%20.CSS6%20#cssBTN6,%20.CSS7%20#cssBTN7,%20.CSS8%20#cssBTN8,%20.CSS9%20#cssBTN9%0A%7B%0A%20%20%20%20border-color:%20red!important;%0A%20%20%20%20box-shadow:%200%200%201px%204px%20yellow;%0A%7D%0A%0A.CSS1%20#cssPRE1,%20.CSS2%20#cssPRE2,.CSS3%20#cssPRE3,%20.CSS4%20#cssPRE4,%20.CSS5%20#cssPRE5,%20.CSS6%20#cssPRE6,%20.CSS7%20#cssPRE7,%20.CSS8%20#cssPRE8,%20.CSS9%20#cssPRE9%20%20%0A%7B%0A%20%20%20%20color:black;%0A%20%20%20%20font-weight:%20900;%0A%7D%0A%0A.cssPRE%0A%7B%0A%20%20%20%20%20background-image:%20linear-gradient%20(orange,yellow,white,yellow,orange);%0A%7D%0A%0A/*%20THIS%20WINDOW%20**********************************/%0A#GIVStyler%0A%7B%0A%20%20%20%20position:fixed;%20%0A%20%20%20%20width:40%25;%20%0A%20%20%20%20height:80%25;%0A%20%20%20%20right:10px;%0A%20%20%20%20top:10%25;%0A%20%20%20%20background-color:%20black;%0A%20%20%20%20border:2px%20ridge%20white;%0A%20%20%20%20box-shadow:%200%200%202px%204px%20black;%0A%7D%0A%0A#GIVStyler%20%3E%20textarea%0A%7B%0A%20%20%20%20background-color:#FFFFFA;%0A%7D%0A%0A#GIVStyler%20%3E%20section%0A%7B%0A%20%20%20%20padding:%203px%205px;%20text-align:right;%0A%7D';
            GM_setValue("CSS", css);
        }
        TSL.addStyle("GIViewerCSS", decodeURI(css));

        if (ControlHQ.flash || ControlHQ.video)
        {
            TSL.addStyle("CSS-LinkPanelFV", "#LinkPanel {position:static; display:block; height:28px;}");
        }
    },

    displayImage: function ()
    {
        for (var i = document.head.children.length - 1; i >= 0; i--)
        {
            var child = document.head.children[i];
            if (child.tagName != "TITLE") document.head.removeChild(child);
        }

        for (var i = document.body.children.length - 1; i >= 0; i--)
        {
            var child = document.body.children[i];
            //document.body.removeChild(child);
            //if (child.id != "USOUpdaterMenu") document.body.removeChild(child);
            if (child.tagName != "IMG") document.body.removeChild(child);
        }

        /* Add Image
        ********************/
        var img = document.querySelector("img");
        img.id = "theImage";

        ControlHQ.data.imgSrc = img.src;
        img.onload = ControlHQ.readjustImageSize;
        setTimeout(ControlHQ.readjustImageSize, 500);

        var a = document.createElement("a");
        a.href = img.src.replace(/(\?\d+$|\?[^\\\.\/]+$)/, "");
        a.href = a.href.replace(/\?\d+$/, "");
        a.title = "***IMAGE***";
        document.body.appendChild(a);

        ControlHQ.createControlPanel();
        ControlHQ.readjustImageSize();

        window.addEventListener("keydown", ControlHQ.keyDownCallback, true);
        window.onresize = ControlHQ.readjustImageSize;

        /* Set favourite icon
        **********************/
        var link = document.createElement('link');
        link.type = 'image/x-icon';
        link.rel = 'shortcut icon';
        link.href = img.src;
        document.head.appendChild(link);
    },

    createLinkPanel: function ()
    {
        console.log("createLinkPanel");
        //if (document.location.protocol.match("file:")) return;
        TSL.removeNode("LinkPanel");

        var img = document.getElementById("theImage");
        if (img) ControlHQ.data.imgTitle += " (" + img.naturalWidth + "×" + img.naturalHeight + ")";

        var panel,
            linkPanel = document.createElement("div");

        linkPanel.id = "LinkPanel";
        document.body.insertBefore(linkPanel, document.body.firstElementChild);

        var data = ControlHQ.data;
        if (data.imgURL)
        {
            panel = CreatePanelMeta(data.imgTitle, data.imgURL);
            panel.title = "Illustration Page";
            linkPanel.appendChild(panel);
        }
        if (data.userHome)
        {
            if (!data.userIcon) data.userIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABW0lEQVR42mNkwAECAoNZGBkYVgKZCv8ZGFw2rF/7Hps6RmyCvn7+TIwMjIuAstFggf8MJ/4z/HfZvGnjV6IM8Pb2nQakMtGE9wBN8tm6dctPvAZ4eHh1AAXLsRkM9Mo6IBm+Y8f2P1gNcHN1rwBS7Qz4wYL///8n796z6x+KAc5OzkAnM05jIAr8n7h3394CuAEO9g7AwGJcjCtMcBjScODggUZGWxtbb6C+DUARFuI1ww3JZrSxslEEsuSB/nIH0hVE6lzAyMi4EEi/gTvZwsw8AUjNJ9KAxhOnTjagBKKpsQlJBpw+ewbVACMDQxQDGEHhwshwEeJVoBcZ/icgG3DuwnlUAwx09dBdkHjh8qUFUDkHILUf2QCgHKoBulraGAZcvnZ1AVQOwwCgHKoBWuoaGAZcu3ljAVQOwwCgHKoB6iqqIEW7gJgVZsDNO7cXIMnBDPgPlQNFIwMAOj56D6356V8AAAAASUVORK5CYII";
            panel = CreatePanelImage(data.userHome, data.userIcon, "User Homepage");
            panel.id = "UserHome";

            var image = panel.getElementsByTagName("IMG")[0];
            linkPanel.appendChild(panel);
        }

        if (data.userGallery)
        {
            panel = CreatePanelMeta(data.userName, data.userGallery);
            panel.title = "User Gallery";
            linkPanel.appendChild(panel);
        }

        if (ControlHQ.flash)
        {
            document.body.appendChild(linkPanel);
            //TSL.addStyle("","#LinkPanel {position:fixed;top:0;left:0;width:100%;z-index:100;}");

            var flash = document.getElementsByTagName("Embed")[0];
            panel = CreatePanelMeta("[SWF]", flash.src);
            panel.firstElementChild.style.marginLeft = "10px";
            linkPanel.appendChild(panel);
        }
        else if (ControlHQ.video)
        {
            var video = document.getElementsByTagName("video")[0];
            video.loop = true;

            panel = CreatePanelMeta("[VIDEO]", video.baseURI);
            panel.firstElementChild.style.marginLeft = "10px";
            linkPanel.appendChild(panel);


            var loopOff = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQpSURBVFhHrVZLa1NREBaS1OZ50xgbG6MhIsHYRavupAuxO3XhQt21gq+NLxBpXYi/QXxsxYW4rKDiRlHwhYIL3al/Rr9vMnM6994kNsXFx5zvzDNz5pybLVFUySoyipzjlIO42ZKbjhjb1wqwzbEDOL4p3y3lcilDgOQgs8opB3GzJTcdIcl0bbZJbraS3Dg7IMm5qWuptjDTPlxo7b1RaHZuCXZ3V8BXZU1Jrro8OOH4iuOXS9PNPS625RHOAmLJK1E0OdnuPcr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+gAWU9UDxCJzgpu3ANIqLLQsYi3sgQytPwku+B5JcNZxgyh5IBAm3GFByBAKnrcPiLv9EvAUNLgv4Az0gz5v8XuLOF0NeqUDGcAscr1Rc7Ca/gGgu4b3NxHcuEn+xLDmC3Pt44B0lXgsdcsoF8hzwPNjGLdfx4jXMKG68bzPx7Uk8Zf9G8dPEr8wrxpIELwhHYDwqlsXXYHz3qZSHMWMxZ/GFVMBONM53sbCASBCacJrFAzKKlXHY8oJ7FR8mkTb8lAhu2xEoLxHEfJrFi9xigiTXOVUwXiCut4m8IOZZxWJuueC78O44jAaMtOpwgnw/OvYF9bkJSniVxQUXtgFoxihXiRN04rpcu0K8Ha9aP4HFqy1eCwzgI2f8KnELXnBRbvgpEQgO1hPfzeMVjc/pcXykFoDcZXwvYJwEZBQu/gkgD1v4KOwxjQlEO4ojHcOubn1a50+Ly6gOV9y4rLwZV2Y9vhEEjY8Tv/YYvoBgtyqXUXgL/E3gltssHBC7Ad8WmbuUcOe0hCw+9QQpt1zhFhNU1irxgpg/uOLCncOcnj/Y4rx81r/EYrM5l2tVVAAAAABJRU5ErkJggg==";

            panel = CreatePanelImage("", loopOn, "Video Repeat");
            panel.firstElementChild.setAttribute("style", "cursor:pointer; margin-left:30px;");
            linkPanel.appendChild(panel);

            linkPanel.querySelector("img").style.backgroundColor = "gray";
            panel.firstElementChild.onclick = function ()
            {
                if (video.loop == true)
                {
                    video.loop = false;
                    linkPanel.querySelector("img").src = loopOff;
                }
                else
                {
                    video.loop = true;
                    linkPanel.querySelector("img").src = loopOn;
                    video.play();
                }
            }
        }
        else //Image
        {
            panel = CreatePanelImage("https://www.iqdb.org/?url=" + data.imgSrc + "&"
                , "data:image/x-icon;base64,AAABAAEAMDAAAAEAIACoJQAAFgAAACgAAAAwAAAAYAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1PEb/t8nc/8vi/v+cwPv/XXKU/z5off9nyv7/P6H5/ylPcf82gr3/VLv7/ypjl/8PDxH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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
                , "IQDB");
            linkPanel.appendChild(panel);

            panel = CreatePanelImage("https://saucenao.com/search.php?db=999&url=" + data.imgSrc + "&"
                , "data:image/bmp;base64,Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAADAADEDgAAxA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////////////////AAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAAAA////AAAA////////AAAAAAAAAAAAAAAAAAAAAAAA////////AAAA////AAAAAAAAAAAAAAAA////////////AAAAAAAAAAAAAAAA////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAAAAAA////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAAAAAA////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAAAAAAAAAAAAAA////////////AAAAAAAAAAAAAAAA////AAAA////////AAAAAAAAAAAAAAAAAAAAAAAA////////AAAA////AAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AAAAAAAA////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                , "SauceNAO");
            linkPanel.appendChild(panel);

            panel = CreatePanelImage("https://imgops.com/" + data.imgSrc.replace("http://", "") + "&"
                , "data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAA/wAAAP///wAA7v8AAP8VAC8A/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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Child(panel);

            panel = CreatePanelImage("https://encrypted.google.com/searchbyimage?image_url=" + data.imgSrc + "&safe"
                , "data:image/x-icon;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAEAAASCwAAEgsAAAAAAAAAAAAA9IVCSvSFQuf0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hULk9IVCSvSFQub0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQuf0hUL/9IVC//SFQv/0hUL/9Y1O//rIq//+7+f//eXX//vUvf/7z7X/96Fu//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//vYwv/97OH/9ZRZ//SFQv/0hUL/9IhG//zbx//3om7/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/97uX/+buW//SFQv/0hUL/9IVC//SFQv/5upT/+9O6//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/+b6b//zezP/0iEf/9IVC//SFQv/1klf//ezh//vPtP/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/3qXr/+siq//m8lv/5wqD//vTu//3t4//1klb/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0h0b//vbx//zi0//1j1H/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/2nmn/+bmS/////v/4sIX/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/5uJH///v5//eoef/1jU//+82y//afav/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL//vXw//vOs//0hUL/9IVC//ekcf/96+D/9IVC//SFQv/0hUL/9IVC//SFQv/0h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//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQvP0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9YtL//i2jv/828f//vLr///7+P///Pv//vTu//3n2v/6zbH/96Nw//SFQ//0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//ekcv/+8+z////////////+9fD/+9K5//m9mf/4to7/+buV//vSuf/++PT//OPT//aYYP/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/2l13///r3/////////fv/+b2Z//SIRv/0hUL/9IVC//SFQv/0hUL/9IVC//WNT//84M///vXv//aZYf/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//vPtP////////////i0i//0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//WQUv///Pr//OPU//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL//eTV///////+9O7/9IVD//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//3m2P//////9ppi//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/718H///////3s4f/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL//vDn///////4soj/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//erff////////38//WTWP/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//iziv////////////iwhf/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//rMsP///////eXW//WSVv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/4sYb///z7/////////Pv/9ZFV//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//ixhv/+8Of//vn1//rMsP/4rH//9plh//WQUv/1j1L/+s2x//////////////////m9mf/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SGQ//2nmn/+buW//vNsv/82sb//e3j/////////////////////v/5wZ//9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/83Mj////////////++fb/+K+C//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9ZRZ/////////////vTt//aaYv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/1lFr////////////6xqf/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//ehbf/70bj//end//3o2////v3///////3l1//0iEb/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/5wqD////////////96t7/96Z2//WOUP/2nWf//NvH//zcyP/1i0z/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/96l6/////////////vLr//WPUf/0hUL/9IVC//SFQv/0h0b//end//3k1f/0iUn/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/8387////////////4sYf/9IVC//SFQv/0hUL/9IVC//SFQv/6w6L///////nBn//0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC///69////////vj1//SIR//0hUL/9IVC//SFQv/0hUL/9IVC//m+mv///////e3j//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL///r3///////8387/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/+syw///////++fb/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/95NX///////vUvP/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/97OH///////7y6//0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//i2jv///////N/O//SFQv/0hUL/9IVC//SFQv/0hUL/96Nx////////////+s2x//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IdF//zh0P//+/j/9ZJW//SFQv/0hUL/9IVC//SKSv/96t7///////738v/1k1f/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9YxN//vUvf/96+D/96Z0//WNT//3om///ebY/////////Pv/+LKI//WVW//0h0X/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//agbP/7zbL//enc//749P////////////////////////////3r4P/3p3f/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hULx9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC8/SFQq30hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUKt9IVCJ/SFQu/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC7/SFQif0hUIA9IVCJfSFQq30hULx9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC//SFQv/0hUL/9IVC8fSFQq30hUIl9IVCAIAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAB"
                , "Google");
            linkPanel.appendChild(panel);

            panel = CreatePanelImage("https://www.tineye.com/parse?url=" + data.imgSrc + "&"
                , "data:image/x-icon;base64,AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAACxeDVItHk157iAO//WtW7/482G/+XOhv/lzYL/1L98/5mTcf8UKUP/CwsM/xwcG/8AAAD/AAAA/wAAAOcAAA5ItHo25LV7Nv+1ezb/tXs2/8GPSf/EoGj/s5hw/6KPdf93bWT/ZFdK/2daTP9hVEj/XU9C/zIpH/8EAgH/AAAA5LV7Nv+1ezb/tXs2/7V7Nv+1ezb/uIA+/8eea//Wtof/48eU/+PKkv/iyJP/4MeV/9u/kf/HqHz/rI1p/3tmT/+1ezb/tXs2/7V7Nv+1ezb/zKV0/+PKlP/hxXr/zbFk/8esYf/VuW7/3sFz/+LFdf/gw3P/48Z3/+nPjv/dwJD/tXs2/7V7Nv+1ezb/y6Nx/9/Gg/+NekT/V0wv/5uSfP95cmH/JiES/zAqGv86Mh3/W08v/3lpQP+Wg03/zLFn/7V7Nv+1ezb/uoVH/8myg/+VgUr/AAAA/2xpZf/i4+X/+fn5/0JAO/8AAAD/LCkl/768uf+/vr3/Mi8q/x0ZEP+2fDf/tXs2/6WGX/+pklP/JyES/0dFQP96eHX/W1tc//////9ua2X/DAoH/6Wim/+EhIX//////6ejnP8AAAD/wo1F/8GLQ//Conf/tZ1e/wYDAP9pZmH/6+vs/9/f3/////3/Pjoz/zo2Lf/Jycb/UlJT//////+xraX/AAAA/8OORv/Djkb/1bF+/821cf83MSD/MC4s//n49P//////l5OJ/wMCAP9IRDr/////////////////ZGBW/wAAAP/Djkb/w45G/8qkcP+sllr/wKtw/zw5Mf9MSUb/VlNM/wIBAP8AAAD/FxUP/9PQyv/8+/j/rKig/wkHA/8AAAD/w45G/8OORv+1jlj/l4hm/8etZv/QuHf/m4xk/21hSP9PRjX/Mi0j/xsYFf87NzD/VFBK/xUVFf8FBwz/CQsQ/8OORv/Djkb/g2I1/8Oea//Mt4z/uJxU/56hhv92nLj/l6ut/56poP+gpJL/mJeC/5aMbP+bjmv/m49t/52Qbv/Djkb/uItP/05PUP+zjlv/yptc/9C3jP9gYFP/ABVH/wAzc/8IP4T/FUuM/xhSmP99lZ3/5sRv/9S6cf/Lsmr/w45G/1B7rv8bbdT/LWy5/8OORv/Djkf/yqRw/zswIP8AAAD/AAAA/wAAAP8AAAD/Fyk8/5CKZ/+ahU3/modW/8GNReeEj5r/L37g/0Jxqf/Cjkf/w45G/8OORv/Fllb/clYw/zoqFf8hGQ3/IhwU/x4ZFf9HRUD/vaJ5/86pdee+ikU/woxEyZ6HZ/+8jEz/w45G/8OORv/Djkb/w45G/8OORv/Djkb/v4tF/8ORTf/GlFD/xJBJ/8KMRMm+ikU/gAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAE="
                , "TinEye");
            linkPanel.appendChild(panel);

            setTimeout(ControlHQ.setPanelVisibility, DELAY, document.getElementById("LinkPanel"), false);

            HideLinks();
            linkPanel.onmouseenter = ShowLinks;
            linkPanel.onmouseleave = HideLinks;
        }

        function HideLinks()
        {
            var links = linkPanel.querySelectorAll("[data-href]");
            for (var i = 0; i < links.length; i++) links[i].href = "";
        }

        function ShowLinks()
        {
            var links = linkPanel.querySelectorAll("[data-href]");
            for (var i = 0; i < links.length; i++) links[i].href = links[i].getAttribute("data-href");
        }
    },


    createControlPanel: function ()
    {
        var btn, panel = document.createElement("div");
        panel.id = "ControlPanel";

        var keys = ["a", "s", "z", "x", "d", "f", "c", "v"]
        for (var i = 0; i < 4; i++)
        {
            btn = document.createElement("div");
            btn.className = "resizeBTN";
            btn.onclick = ControlHQ.resizeButtonClick;
            btn.setAttribute("style", "position:relative");
            panel.appendChild(btn);
        }

        var btns = panel.getElementsByClassName("resizeBTN");
        btns[0].style.backgroundImage = "URL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAgklEQVR42mNkGGDAOOoAcjWeOXPmPzLfxMSELLNGHTC0HIBuKS5AimNIdjUhR5AaEmQFGy5HkBMNQysN4HIEuZZT7ABqgKHrAGDwL0bmA6MhdiAcEAPlLhmxDoADujuAWmBoO2BAC6IBLYoHtDIa0Op4UDRIcDlmZLQJRx1ACzDqAABrqFohocSl/AAAAABJRU5ErkJggg==')";
        btns[0].title = "Auto-Fit Height (a)";
        btns[1].style.backgroundImage = "URL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAeElEQVR42u3UbQqAIAwG4HanHcdOV8fZnbLAQERzLnIE7/4I6l4e8IMW5yIAAAAAAACeFkXkYOZXyF5GF3CNVoSmXwWwILS91GqqVR507t2KtdWSMwTImxMgpOn9Boxk/A/w+RGUNf0StkJcn6HrRzSjAAAAAAAAiN9oYiGanAXaAAAAAElFTkSuQmCC')";
        btns[1].title = "Auto-Fit Width (z)";
        btns[2].style.backgroundImage = "URL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAs0lEQVR42u2XYQqAIAyF804ep05Xx/FOlZAgw7k5zSW5P4L43j5zyjKLcpgJUCN2zp1+tNaKfcTCkDyEFEIkgslrIIoFWHIpRNFiKrkEYswa+A+AT4IZcwFyHlmAFo8Mx4fcXSsAzMvkBKkIJve6HcxvJfokAOeeA4D1mT64ABDiWwAln/CVI0hBdC9CKFS5hrFY7SHi7owCoGICjNeQqLZkFESXphSD6F6EMYTKj0mrmAAX79KqIbEwc3wAAAAASUVORK5CYII=')";
        btns[2].title = "Stretch (z)";
        btns[3].style.backgroundImage = "URL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAChSURBVFhH7Y7RCsAgCEX79P58Q0kQuXPWKhnbgfNS6r3l5+0czRQkPKWEDRe3gIK1S0GByC2khGq+UcA7HC3g/bncHY4ydEeWZhYI39ILSKbWemjbM2HnrS5owcq0ULazAHkJGrYyqwoQaEHLUKi2PRN23hqie8Fh+NbsAkN4i3L4LsD7e0S0wDK+WcCGXrkUFKjdAgomt5IaLqSG/0yglBOoVtk5dyQmaAAAAABJRU5ErkJggg==')";
        btns[3].title = "Fill Client Area while keeping ratio (x)";


        for (var i = 0; i < 4; i++)
        {
            btn = document.createElement("div");
            btn.className = "transformBTN";
            btn.value = 0;
            btn.onclick = ControlHQ.transformButtonClick;
            panel.appendChild(btn);
        }

        TSL.addStyle("SpinMeRightRound", ".rotate90 {-webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg);}"
            + ".reflectMe {-webkit-transform: scaleX(-1) ; -moz-transform: scaleX(-1) ; -o-transform: scaleX(-1) ; -ms-transform: scaleX(-1) ; transform: scaleX(-1);}"
            );

        btn = document.createElement("button");
        btn.textContent = "Edit";
        btn.setAttribute("style", "width:100%;margin-top: 5px;");
        btn.onclick = Styler;
        panel.appendChild(btn);

        var btns = panel.getElementsByClassName("transformBTN");
        btns[0].style.backgroundImage = btns[1].style.backgroundImage = "URL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgj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xSjgqM+Q2NIygA3UjFJhaeq5Qii39zEOUJj8CE5qVM066WnvpehRe3fMVboASGxQVIyUTjD2qtqCyV2P2p5BfLIEAPucesalIJVT2KTXkpkoPdDBWEirIZ3XYOxQrm4PNSIR7tHb7aadgkERkCzfRy7TA2CkgoMDHTs7LStSikFWIzD2mdh4qgAQjHNovwmAXce4csrsOK0rVhE6oPE2EhZQbUN2JNGSvw1GvoPxf3t1InmpFwNVK6f9NOMWSbzsJ30XKDyKqX1yUQNBxYa6ZPr6wRgAKDcajzGk2CPIawtnQJF87ZIyQxGk23USAya+2Ch8QtlwQzMyxExpSg1Fs7nV/SyjVoxngE347FL3moVhktYYxCD8D+O8dmSsS7k1AAAAAElFTkSuQmCC')";
        TSL.addClass(btns[0], "reflectMe");

        btns[2].style.backgroundImage = "URL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAeCAYAAABNChwpAAAACXBIWXMAAIhIAACISAFlEbUFAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoB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oSQE6YArmYR1G51ibDi0JQArTsB4r0Tefl4sB6Bq+XIHFKC9kk0IAOmMR1qA6/hcs+QD0x9y48fxiD84HoAJbsAAT0amUKZMLYAB2YzWGJZCqqbYAJkXFqsZglCVQK7qF/gPoHCbeiQnh7yTlSctKOAuHMRwfok7/yZiphGYvwyvsR0M2wA3MwG80JXz732hsrRL+Ck0nDNCUfUYGoApH0AvvA6SlC1Kxviw2aC4w8p/jIH7gQwagHrXYiHHo3cYmDfHbvYj4mI5REYQ1GYDPEYTHopttCKtkZ0MjruBq9IHyTCq1UxoxEkuih3xrrQ404XLoJGzHcvRBl3h2DxfxooDbT4mM65YJ9lxF5iE2R3acwhuMCUs9xpmwVu88AMrjIs3tAcguGtvCJXtxM/rB+nBJLVZhUDv2SrcsxfmU2dc4GkPljhgsxcxXi/MBktdcUEid/xouWR4HXsqqpmdRh0MY0UYqFg2QkY+4EN2yOgK3IyZjH27jBIZkvdNcSoDsCbcuBpU5YZ1PERO7cAeno8+8i/U523ExINdwHSdjTtwRA80mzMZb9Iua0JTUd8EfPAu9gGUx2AwNzWRDl1K5IJe8xHGMx1rcjecPcD8pC7RmkS84h6dYGnHxHf4OAC4xiB00QTv4AAAAAElFTkSuQmCC')";
        TSL.addClass(btns[2], "rotate90");
        btns[3].style.backgroundImage = "URL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAeCAYAAABNChwpAAAACXBIWXMAAIhIAACISAFlEbUFAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDL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mTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAnJJREFUeNq810uIjWEYwPHfGfc7ydCQexZuoZEFahRhXBpEyL2EhCgLykopQsrGRknGwkIW1CQllJJxDRtySyHCwtAw5tg8R6dp5jTn8nnq6XS+3u99/+9z/1LpdFplZaX/JBWowSM01NfXP+z4nw7ugenYGgC38BnLkgboiYXYg6lZz2fiCyQBkMJAVOEAxray5mdoSQE6YArmYR1G51ibDi0JQArTsB4r0Tefl4sB6Bq+XIHFKC9kk0IAOmMR1qA6/hcs+QD0x9y48fxiD84HoAJbsAAT0amUKZMLYAB2YzWGJZCqqbYAJkXFqsZglCVQK7qF/gPoHCbeiQnh7yTlSctKOAuHMRwfok7/yZiphGYvwyvsR0M2wA3MwG80JXz732hsrRL+Ck0nDNCUfUYGoApH0AvvA6SlC1Kxviw2aC4w8p/jIH7gQwagHrXYiHHo3cYmDfHbvYj4mI5REYQ1GYDPEYTHopttCKtkZ0MjruBq9IHyTCq1UxoxEkuih3xrrQ404XLoJGzHcvRBl3h2DxfxooDbT4mM65YJ9lxF5iE2R3acwhuMCUs9xpmwVu88AMrjIs3tAcguGtvCJXtxM/rB+nBJLVZhUDv2SrcsxfmU2dc4GkPljhgsxcxXi/MBktdcUEid/xouWR4HXsqqpmdRh0MY0UYqFg2QkY+4EN2yOgK3IyZjH27jBIZkvdNcSoDsCbcuBpU5YZ1PERO7cAeno8+8i/U523ExINdwHSdjTtwRA80mzMZb9Iua0JTUd8EfPAu9gGUx2AwNzWRDl1K5IJe8xHGMx1rcjecPcD8pC7RmkS84h6dYGnHxHf4OAC4xiB00QTv4AAAAAElFTkSuQmCC')";


        for (var i = 0, preview; i < 9; i++)
        {
            btn = document.createElement("div");
            btn.className = "cssBTN";
            btn.id = "cssBTN" + (i + 1);
            btn.title = "Sets CSS" + (i + 1) + "style";
            btn.onclick = changeCSS;
            //btn.onmouseenter = previewCSS;
            //btn.onmouseleave = savedCSS;

            preview = document.createElement("div");
            preview.textContent = (i + 1);
            preview.className = "cssPRE";
            preview.id = "cssPRE" + (i + 1);
            btn.appendChild(preview);
            btn.value = i + 1;
            panel.appendChild(btn);
        }

        function changeCSS(e)
        {
            clearTimeout(this.tid);
            GM_setValue("CSS-Selection", this.value);
            document.body.className = "CSS" + this.value;
        }

        function previewCSS(e)
        {
            clearTimeout(this.tid);
            var value = this.value;
            if (GM_getValue("CSS-Selection") != value)
                document.tid = setTimeout(function ()
                {
                    document.body.className = "CSS" + value;
                }, 500)
        }

        function savedCSS(e)
        {
            clearTimeout(this.tid);
            document.body.className = "CSS" + GM_getValue("CSS-Selection");
        }


        document.body.appendChild(panel);
    },

    showControlsPanel: function ()
    {
        var panel = document.getElementById("ControlPanel");
        clearTimeout(panel.timeoutID);

        panel.style.visibility = null;

        var btns = document.getElementsByClassName("resizeBTN");
        btns[0].style.backgroundColor = (ResizeMode & 2) ? "yellow" : null;
        btns[1].style.backgroundColor = (ResizeMode & 4) ? "yellow" : null;
        btns[2].style.backgroundColor = (ResizeMode & 8) ? "yellow" : null;
        btns[3].style.backgroundColor = (ResizeMode & 16) ? "red" : null;

        panel.timeoutID = setTimeout(function () { document.getElementById("ControlPanel").style.visibility = "hidden"; }, DELAY);
    },

    resizeButtonClick: function ()
    {
        var btns = document.getElementsByClassName("resizeBTN");
        for (var i = 0; i < btns.length; i++)
        {
            if (btns[i] == this)
            {
                ControlHQ.adjustSizeMode(i + 1);
                return;
            }
        }
    },

    transformButtonClick: function (e)
    {
        var img = document.getElementById("theImage");
        var css = "";

        var btns = document.getElementsByClassName("transformBTN");

        if (btns[0] == this) btns[0].value--;
        else if (btns[1] == this) btns[0].value++;
        else this.value++;

        if (btns[0].value == -1) btns[0].value = 3;

        if (btns[0].value == 1) css = "rotate(90deg)";
        else if (btns[0].value == 2) css = "rotate(180deg)";
        else if (btns[0].value == 3) css = "rotate(270deg)";
        else btns[0].value = 0;

        if (btns[2].value == 1) css += " scaleX(-1)";
        else btns[2].value = 0;

        if (btns[3].value == 1) css += " scaleY(-1)";
        else btns[3].value = 0;

        css = css.trim() + "; ";
        css = "transform: " + css + "-webkit-transform: " + css + "-moz-transform: " + css + "-o-transform: " + css + "-ms-transform: " + css;

        TSL.addStyle("RobotsinDisguise", "#theImage {" + css + "}");

        if (this.value == 0) this.style.backgroundColor = null;
        else this.style.backgroundColor = "yellow";

        btns[0].style.backgroundColor = (btns[0].value) ? "yellow" : null;
        btns[1].style.backgroundColor = btns[0].style.backgroundColor;

        ControlHQ.readjustImageSize();
    },

    readjustImageSize: function ()
    {
        var img = document.getElementById("theImage");
        img.removeAttribute("class");
        img.removeAttribute("width");
        img.removeAttribute("height");

        var reverse = (document.getElementsByClassName("transformBTN")[0].value % 2 == 1);

        // 2=Height, 4=Width, 8=Stretch, 16=Fit
        if (!reverse)
        {
            img.style.maxHeight = (ResizeMode & 2) ? window.innerHeight + "px" : null;
            img.style.maxWidth = (ResizeMode & 4) ? window.innerWidth + "px" : null;
        }
        else
        {
            img.style.maxWidth = (ResizeMode & 2) ? window.innerHeight + "px" : null;
            img.style.maxHeight = (ResizeMode & 4) ? window.innerWidth + "px" : null;
        }

        if (ResizeMode & 16) //Fit image
        {
            var imageRatio = (reverse) ? (img.naturalHeight / img.naturalWidth) : (img.naturalWidth / img.naturalHeight);
            var clientRatio = window.innerWidth / window.innerHeight;
            if (!reverse)
            {
                img.style.width = (imageRatio >= clientRatio) ? window.innerWidth + "px" : null;
                img.style.height = (imageRatio < clientRatio) ? window.innerHeight + "px" : null;
            }
            else
            {
                img.style.height = (imageRatio >= clientRatio) ? window.innerWidth + "px" : null;
                img.style.width = (imageRatio < clientRatio) ? window.innerHeight + "px" : null;
            }
        }
        else if (ResizeMode & 8) //Stretch
        {
            if (!reverse)
            {
                img.style.height = (ResizeMode & 2) ? window.innerHeight + "px" : null;
                img.style.width = (ResizeMode & 4) ? window.innerWidth + "px" : null;
                //Resize taking into account ScrollBars
                if (ResizeMode & 2 && document.body.scrollWidth > document.body.clientWidth) img.style.height = (window.innerHeight - ScrollBarThickness) + "px";
                if (ResizeMode & 4 && document.body.scrollHeight > document.body.clientHeight) img.style.width = (window.innerWidth - ScrollBarThickness) + "px";
            }
            else
            {
                img.style.width = (ResizeMode & 2) ? window.innerHeight + "px" : null;
                img.style.height = (ResizeMode & 4) ? window.innerWidth + "px" : null;
                //Resize taking into account ScrollBars
                if (ResizeMode & 2 && document.body.scrollWidth > document.body.clientWidth) img.style.width = (window.innerHeight - ScrollBarThickness) + "px";
                if (ResizeMode & 4 && document.body.scrollHeight > document.body.clientHeight) img.style.height = (window.innerWidth - ScrollBarThickness) + "px";
            }
        }
        else //Height & Width
        {
            img.style.height = null;
            img.style.width = null;

            if (ResizeMode & 2 && document.body.scrollWidth > document.body.clientWidth) img.style.maxHeight = (window.innerHeight - ScrollBarThickness) + "px";
            if (ResizeMode & 4 && document.body.scrollHeight > document.body.clientHeight) img.style.maxWidth = (window.innerWidth - ScrollBarThickness) + "px";
        }


        //Image placement algorithm
        var w = img.clientWidth,
            h = img.clientHeight;
        console.log(w / h, h / w);
        img.style.position = "absolute";
        img.style.left = 0;
        img.style.top = 0;
        if (reverse)
        {
            var offsetW = ((h - w) / 2);
            var offsetH = ((w - h) / 2);

            if (h < window.innerWidth) img.style.marginLeft = (((window.innerWidth - h) / 2) + offsetW) + "px";
            else img.style.marginLeft = (offsetW) + "px";

            if (w < window.innerHeight) img.style.marginTop = (((window.innerHeight - w) / 2) + offsetH) + "px";
            else img.style.marginTop = (offsetH) + "px";
        }
        else
        {
            if (w < window.innerWidth) img.style.marginLeft = ((window.innerWidth - w) / 2) + "px";
            else img.style.marginLeft = "0px";

            if (h < window.innerHeight) img.style.marginTop = ((window.innerHeight - h) / 2) + "px";
            else img.style.marginTop = "0px";
        }



        ControlHQ.showControlsPanel();
    },

    adjustSizeMode: function (mode)
    {
        var n = Math.pow(2, mode);
        var enabled = (ResizeMode & n);
        if (enabled) ResizeMode -= n; else ResizeMode += n;

        var msg = "";
        switch (mode)
        {
            case 1:
                msg = "Auto-height";
                break;
            case 2:
                msg = "Auto-width";
                break;
            case 3:
                msg = "Stretch";
                break;
            case 4:
                msg = "Fill Area";
                break;
        }

        ControlHQ.readjustImageSize();
        GM_setValue("ResizeMode", ResizeMode);
    },


    keyDownCallback: function (e)
    {
        var key = e.which || e.keyCode;
        if (document.stopCapture) return false;

        console.log("KEY", key);
        //Load Styles
        if (key == 82 || key == 84 || key == 106 || key == 111) // [r] [t] [Num *] [Num /]
        {
            var n = document.body.className.match(/CSS(\d)/)[1];
            if (key == 82 || key == 111) n++; else n--;
            if (n > 9) n = 1; else if (n < 1) n = 9;

            document.body.className = "CSS" + n;
            GM_setValue("CSS-Selection", n);
            ControlHQ.showControlsPanel();
            return false;
        }


        if (key == 81 || key == 96) //Reset Size [Q] [Num .]
        {
            e.stopImmediatePropagation();
            var btns = document.querySelectorAll('.resizeBTN[style*=background-color]');
            for (var i = 0; i < btns.length; i++) btns[i].click();
            return false;
        }

        if (key == 87 || key == 101) //Reset Rotation [W] [Num 5]
        {
            e.stopImmediatePropagation();
            btns = document.querySelectorAll('.transformBTN');
            btns[0].value = -5; btns[0].click();
            return false;
        }

        if (key == 69 || key == 104) //Reset Mirror [E] [Num 8]
        {
            e.stopImmediatePropagation();
            btns = document.querySelectorAll('.transformBTN');
            btns[2].value = -5; btns[2].click();
            btns[3].value = -5; btns[3].click();
            return false;
        }

        var hk = [65, 83, 90, 88, 68, 70, 67, 86]; // a s z x d f c v
        var hkNum = [97, 98, 99, 110, 100, 102, 103, 105]; // Num Keys: 1 2 3 . 4 6 7 9
        var btns = document.querySelectorAll(".resizeBtn, .transformBtn");
        for (var i = 0; i < hk.length; i++)
        {
            if (hk[i] == key || hkNum[i] == key)
            {
                e.stopImmediatePropagation();
                btns[i].click();
                return false;
            }
        }
    },

    monitorMouse: function (e)
    {
        isMouseOverPanel(e, "ControlPanel");
        isMouseOverPanel(e, "LinkPanel");
        isMouseOverPanel(e, "YoutubeThumbs");

        function isMouseOverPanel(e, id)
        {
            var panel = document.getElementById(id);
            if (!panel) return;
            if (TSL.isMouseEventInClientArea(e, panel))
            {
                panel.clean = true;
                clearTimeout(panel.timeoutID);
                if (panel.style.visibility) ControlHQ.setPanelVisibility(panel, true);
            }
            else if (!panel.style.visibility && panel.clean)
            {
                panel.clean = false;
                panel.timeoutID = setTimeout(ControlHQ.setPanelVisibility, DELAY, panel, false);
            }
        }
    },

    setPanelVisibility: function (panel, visible)
    {
        panel.style.visibility = (visible) ? null : "hidden";
    }
};

(function ()
{
    var start = setInterval(function ()
    {
        if (document.readyState != "loading")
        {
            clearInterval(start);
            ScrollBarThickness = TSL.getScrollBarThickness();
            LoadGIV();
        }
    }, 50);

    function LoadGIV()
    {
        console.info("Generic Image Viewer");

        //Removes old settings
        var Version = 1002;
        if (GM_getValue("Version", 0) != Version)
        {
            var names = GM_listValues();
            for (var i = 0; name = names[i], i < names.length; i++)
            {
                var skipNames = ["USO-Updater"];
                var found = false;
                for (var j = 0; j < skipNames.length; j++) found = found || (name.indexOf(skipNames[j]) == 0);
                if (!found) GM_deleteValue(name);
                GM_setValue("Version", Version)
            }

            ResizeMode = 0;
            GM_setValue("ResizeMode", 0)
        }

        //Cleans the URL links of the postfix "?timidscript_". This tag is used in a personal script that is still in beta phase (2015/06)
        if (document.URL.match(/[\?&]timidscript_[_a-z]+$/i))
        {
            console.log("GIViewer: Removed URL search tag");
            window.history.pushState(null, "", document.URL.replace(/[\?&]timidscript_[_a-z]+$/i, ""));
            var imgs = document.getElementsByTagName("img");
            for (var i = 0; i < imgs.length; i++) imgs[i].src = imgs[i].src.replace(/[\?&]timidscript_[_a-z]+$/i, "");
        }

        var hostname = document.location.hostname,
            pathname = document.location.pathname;
        if (document.body.children.length == 1 && document.querySelector('embed[type="application/x-shockwave-flash"]'))
        {
            console.info("GIViewer: FLASH");
            ControlHQ.flash = true;
        }
        else if (document.body.children.length == 1 && document.body.children[0].tagName == "VIDEO")
        {
            console.info("GIViewer: VIDEO");
            ControlHQ.video = true;
        }
        else if (document.body.children[0].tagName == "IMG" && (
                    document.URL.match(/.+\.(jpg|gif|jpeg|png|bmp)(\?\d+|:large|:orig|\?[^\\\.\/]+)?$/i)
                    || document.URL.match(/\/[a-zA-Z0-9]+$/)
                    || document.URL.match(/\/\/www\.pixiv\.net.+mode=manga_big.*&illust_id=(\d+)/i)
                    || hostname.match(/^thumbs\..+\.com/i)
                    ))
        {
            var imgs = document.getElementsByTagName("img");
            if (!document.URL.match("img.youtube") && (imgs.length == 0 || imgs.length > 1 || document.body.children.length > 2)) return;
            ControlHQ.displayImage();
        }
        else if (hostname == "gfycat.com" && document.location.pathname.match(/\/\w+$/))
        {
            console.info("GIViewer: gfycat");

            var name = document.location.pathname.substr(1);
            url = "https://gfycat.com/ifr/" + name;

            GM_xmlhttpRequest(
            {
                url: url,
                method: "GET",
                headers: { "User-agent": navigator.userAgent, "Accept": "text/html", Referer: "" },
                timeout: 10000,
                onload: function (response)
                {
                    if (response.status == 200)
                    {
                        var doc = new DOMParser().parseFromString(response.responseText, "text/html");
                        var links = doc.querySelectorAll(".iframe-video .mp4-source, .iframe-video .webm-source");

                        if (links.length > 0)
                        {
                            var el = document.getElementById("small-gif")
                            if (el) el.href += "?hide";

                            el = document.getElementById("large-gif");
                            if (el) el.href += "?hide";
                        }

                        var sizes = { thumbs: 0, zippy: 1, fat: 2, giant: 3 }, largestSize = 0;
                        for (var i = 0; i < links.length; i++) if (sizes[links[i].src.match(/\/\/(\w+)/)[1]] > largestSize) largestSize = sizes[links[i].src.match(/\/\/(\w+)/)[1]];

                        var holder = document.querySelector("#controls-container .left");

                        for (var i = 0; i < links.length; i++)
                        {
                            console.log(links[i].src);
                            if (sizes[links[i].src.match(/\/\/(\w+)/)[1]] != largestSize) continue;
                            var a = document.createElement("a");
                            a.href = links[i].src;
                            a.textContent = (links[i].className.match("webm")) ? "WebM" : "MP4";
                            a.setAttribute("style", "margin: 0 5px");
                            holder.appendChild(a);
                        }
                    }
                    else console.warn("ERROR: ", url);
                }
            });

            return;
        }
        else return;

        if (hostname.match(/^[a-z0-9]+\.pixiv\.net$/i))  //Pixiv Site
        {
            console.info("GIViewer: Pixiv");

            var id = document.querySelector("img").src.match(/\/(\d+)(?:_p\d+|_big_p\d+|_.*master.+)?\.(?:jpg|gif|jpeg|png|bmp)/i);

            if (!id) return;

            id = id[1];
            if (document.URL.match("/profile/"))
            {
                ControlHQ.data.userName = "Gallery [" + id + "]";
                ControlHQ.data.userHome = "http://www.pixiv.net/member.php?id=" + id;
                ControlHQ.data.userGallery = "http://www.pixiv.net/member_illust.php?id=" + id;
                ControlHQ.data.userIcon = document.URL;
                ControlHQ.createLinkPanel();
            }
            else
            {
                ControlHQ.data.imgTitle = "Illustration Page";
                ControlHQ.data.imgURL = "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=" + id;
                ControlHQ.createLinkPanel();

                GM_xmlhttpRequest({
                    url: "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=" + id,
                    method: "GET",
                    timeout: 15000,
                    headers: { "User-agent": navigator.userAgent, "Accept": "text/html", Referer: "http://www.pixiv.net" },
                    onload: function (response)
                    {
                        if (response.status == 200)
                        {
                            var doc = new DOMParser().parseFromString(response.responseText, "text/html");
                            var script = doc.evaluate("//div[@id='wrapper']//script[contains(text(),'pixiv.context.illustId')]", doc, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
                            if (script)
                            {
                                unsafeWindow.eval("pixiv = {}; pixiv.context= {};");
                                unsafeWindow.eval(script.innerHTML);
                                ControlHQ.data.imgTitle = unsafeWindow.pixiv.context.illustTitle;
                                ControlHQ.data.userIcon = doc.querySelector(".user-image").src.replace(".jpg", "_s.jpg");
                                ControlHQ.data.userHome = "http://www.pixiv.net/member.php?id=" + unsafeWindow.pixiv.context.userId;
                                ControlHQ.data.userName = unsafeWindow.pixiv.context.userName;
                                ControlHQ.data.userGallery = "http://www.pixiv.net/member_illust.php?id=" + unsafeWindow.pixiv.context.userId;
                                ControlHQ.createLinkPanel();
                            }
                        }
                    }
                });
            }
        }
        else if (hostname.match(/^\w+\.deviantart\.net$/i)) //deviantart
        {
            console.info("GIViewer: DeviantArt");

            var id = pathname.match(/-(d\w{6})\.(?:jpg|bmp|png|gif|swf)/i),
                user = pathname.match(/_by_(\w+)(?:-d\w{6})?\.(?:jpg|bmp|png|gif|swf)/i);

            if (id)
            {
                ControlHQ.data.imgTitle = "Illustration Page";
                ControlHQ.data.imgURL = "http://www.deviantart.com/gallery/#/" + id[1];
            }

            if (user)
            {
                user = user[1].replace("_", "-");
                ControlHQ.data.userName = user;
                ControlHQ.data.userHome = "http://" + user + ".deviantart.com";
                ControlHQ.data.userGallery = "http://" + user + ".deviantart.com/gallery/?catpath=/";
            }

            ControlHQ.createLinkPanel();
        }
        else if (hostname.match(/^(i\.)?imgur.com$/i)) //imgur
        {
            console.info("GIViewer: imgur");
            var id = pathname.match(/\w+/)[0];

            ControlHQ.data.imgTitle = "Image Page";
            ControlHQ.data.imgURL = "http://imgur.com/" + id;

            ControlHQ.createLinkPanel();
        }
        else if (hostname.match(/^pic\d+\.nijie\.info$/i)) //nijie.info
        {
            console.info("GIViewer: nijie.info");

            var user, name = pathname.match(/([\d+|_]+)\.(?:jpg|bmp|png|gif)/i);
            if (!name) return;
            name = name[1];
            //Timestamp appears to be always 14 digits long
            user = name.match(/\d+_(\d+)_(\d+)_\d{14}/);          //<count>_<imgID>_<userID>_<time>
            if (user)
            {
                ControlHQ.data.imgTitle = "Illustration Page";
                ControlHQ.data.imgURL = "http://nijie.info/view.php?id=" + user[1];
                user = user[2];
            }
            else
            {
                if (!user) user = name.match(/(\d+)_\d{14}_\d+/);   //<userID>_<time>_<count>
                if (!user) user = name.match(/(\d+)_\d{14}/);       //<userID>_<time>
                if (!user) user = name.match(/\d{14}(\d+)(?:_\d)?/); //<time><userid> <time><userid>_<num>
                user = user[1];
            }

            if (!user) return;

            ControlHQ.data.userName = "Gallery [" + user + "]";
            ControlHQ.data.userGallery = "http://nijie.info/members_illust.php?id=" + user;
            ControlHQ.data.userHome = "http://nijie.info/members.php?id=" + user;

            ControlHQ.createLinkPanel();
        }
        else if (hostname.match(/^\w+\.nicoseiga\.jp/i)) //Nico Nico Seiga
        {
            console.info("GIViewer: Nico Nico Seiga");

            var id = pathname.match(/\d+$/)[0];
            ControlHQ.data.imgTitle = "Illustration Page";
            ControlHQ.data.imgURL = "http://seiga.nicovideo.jp/seiga/im" + id;

            ControlHQ.createLinkPanel();
        }
        else if (document.URL.match(/https?:\/\/img\.youtube\..+\/vi\//i)) //Nico Nico Seiga
        {
            console.info("GIViewer: Youtube");

            var id = document.URL.match(/\/vi\/([^\/]+)/i)[1];
            ControlHQ.data.imgTitle = "Video Page";
            ControlHQ.data.imgURL = "https://www.youtube.com/watch?v=" + id;

            ControlHQ.createLinkPanel();
            if (pathname.match(/(maxresdefault|hqdefault|\d)\.jpg/i))
            {
                var thumbnails = document.createElement("section");
                thumbnails.id = "YoutubeThumbs";
                document.body.appendChild(thumbnails);

                for (var i = 0, img; i < 3; i++)
                {
                    img = document.createElement("img");

                    img.src = document.URL.replace(/(maxresdefault|hqdefault|\d)\.jpg/i, i + ".jpg");
                    img.style.width = "120px";
                    thumbnails.appendChild(img);
                }
                thumbnails.timeoutID = setTimeout(function () { document.getElementById("YoutubeThumbs").style.visibility = "hidden" }, DELAY);
            }
        }
        else ControlHQ.createLinkPanel();

        ControlHQ.addStyles();

        if (!ControlHQ.flash && !ControlHQ.video) window.addEventListener("mousemove", ControlHQ.monitorMouse);
    }
})();



/* Helpful information (Reverse image search)
********************************************************************************************
http://saucenao.com/search.php?db=999&url=
http://www.tineye.com/parse?url=
http://google.com/searchbyimage?hl=en&site=search&image_url=
http://imgops.com/<url-without-http>
http://www.iqdb.org/?url=


999 	All Databases
0	H-Magazines
1	H-Anime
2	H-Game CG
3	DoujinshiDB
4	pixiv Images
5	Anime
6	Nico Nico Seiga
7	Danbooru
8	drawr Images
9	Nijie Images
10	yande.re
TBA...



    https://greasyfork.org/en/forum/discussion/comment/12162/#Comment_12162
    image search on "ascii2d.net"?


    GM_xmlhttpRequest({
      method: 'POST',
      url: 'http://ascii2d.net/imagesearch/search',
      data: 'uri=https://i.imgur.com/RqikjW1.jpg',
      headers: {'Content-Type': 'multipart/form-data'},
      onload: function(r) {
        //parse r.responseText
      }
    });


********************************************************************************************/