var
cssHidechromeheader = <><![CDATA[
#viewer-header, #viewer-footer { display: none; }
]]></>.toString();
var
cssShowchromeheader = <><![CDATA[
#viewer-header, #viewer-footer { display: inline; }
]]></>.toString();
var
cssHideNav= <><![CDATA[
#chrome-lhn-toggle { display: none; }
]]></>.toString();
function
getElementPosition(element) {
var
pos = {x:0, y:0};
if
(element.offsetParent) {
while
(element.offsetParent) {
pos.x += element.offsetLeft;
pos.y += element.offsetTop;
element = element.offsetParent;
}
}
else
if
(element.x) {
pos.x += element.x;
pos.y += element.y;
}
return
pos;
}
function
InfoMouseClick(e) {
var
gei = document.getElementById,
header = gei(
'viewer-header'
),
hDisplay = header.style.display,
footer = gei(
'viewer-footer'
),
entries = gei(
'entries'
),
entriesStatus = gei(
'entries-status'
);
if
((hDisplay ==
"none"
)||(hDisplay ==
null
)||(hDisplay ==
""
)) {
header.style.display = footer.style.display =
"inline"
;
entriesStatus.style.right =
"0.5em"
;
}
else
{
header.style.display = footer.style.display =
"none"
;
}
entries.style.height = String(d.documentElement.clientHeight - getElementPosition(entries).y - footer.offsetHeight) +
"px"
;
}
(
function
() {
GM_addStyle( cssHidechromeheader );
GM_addStyle( cssHideNav );
var
chrome = document.getElementById(
'chrome-header'
);
var
buttonStr =
" <div class="
\"goog-button-base-inner-box
" goog-inline-block\"="
"><div class="
\"goog-button-base-pos\"
"><div class="
\"goog-button-base-top-shadow\"
"> </div><div class="
\"goog-button-base-content\"
"><div class="
\"goog-button-body\"
">Info</div></div></div></div>"
;
var
googbutton=document.createElement(
'div'
);
googbutton.className=
'goog-button-base goog-button-base-outer-box goog-inline-block'
;
googbutton.style.margin =
"0px 0px 0px 6px"
;
googbutton.innerHTML=buttonStr;
chrome.appendChild(googbutton);
googbutton.addEventListener(
'click'
, InfoMouseClick,
false
);
})();