User:Gerbrant/hidePane.js
document.write("");
var os, bg, fg, sbg, sfg, bc;
try{ bg = Gerbrant.hidePane.background; }catch(x){} if(! bg) bg = "#f9f9f9 url(/skins-1.5/monobook/headbg.jpg) 0 0 no-repeat";
try{ fg = Gerbrant.hidePane.color; }catch(x){} if(! fg) fg = "#000000";
try{sbg = Gerbrant.hidePane.selBackground;}catch(x){} if(!sbg) sbg = "#3168b8";
try{sfg = Gerbrant.hidePane.selColor; }catch(x){} if(!sfg) sfg = "#ffffff";
try{ bc = Gerbrant.hidePane.borderColor; }catch(x){} if(! bc) bc = "#c0c0c0";
try{os = Gerbrant.hidePane.ownStyle;}catch(x){}
if(!os)
{
document.write("");
}
function setSize()
{
var tb = document.getElementById("p-lang");
if(!tb) tb = document.getElementById("p-tb");
document.getElementById("content").style.marginTop = tb.offsetTop + tb.offsetHeight + "px";
}
function myContains(e)
{
do if(this === e) return true;
while(e = e.parentNode);
return false;
}
$(function()
{
var h;
function hideMenu()
{
h.className = h.className.replace(/ hotportlet\b/, "");
h = null;
}
function showMenu(e)
{
if(h)
{
if(h === e) return;
hideMenu();
}
h = e;
e.className += " hotportlet";
}
setSize();
(function(orig)
{
window.onresize = orig ? function()
{
setSize();
orig.apply(this, arguments);
} : setSize;
})(window.onresize);
var co = document.getElementById("column-one").childNodes;
for(var i = 0; i < co.length; i++)
{
var p = co[i];
if (/(?:^| )portlet(?:$| )/.test(p.className))
{
if(!p.contains) p.contains = myContains;
p.onmouseover = function(e)
{
if(!e) e = event;
f = e.fromElement;
if(!f) f = e.relatedTarget;
if(!f || !this.contains(f)) showMenu(this);
};
p.onmouseout = function(e)
{
if(!e) e = event;
t = e.toElement;
if(!t) t = e.relatedTarget;
if(h && (!t || !this.contains(t))) hideMenu();
};
}
}
var co = document.getElementById("bodyContent").getElementsByTagName("DIV");
for(var i = 0; i < co.length; i++)
{
if(co[i].className == "usermessage")
{
var a = document.createElement("IMG");
a.src = "http://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Mail-closed.svg/24px-Mail-closed.svg.png";
a.style.cssText = "right:2;top:2;z-index:256;position:absolute";
document.body.appendChild(a);
break;
}
}
});