Difference between revisions of "MediaWiki:Vector.js"

From The Infosphere, the Futurama Wiki
Jump to navigation Jump to search
(more images)
m
Line 1: Line 1:
function columnAreaImage(){
function columnAreaImage(){
  if(document.title.split(" ")[0] == "Preferences")
  {
    return;
  }
   var divFooter;
   var divFooter;
   if (document.getElementById ) {
   if (document.getElementById ) {

Revision as of 07:29, 22 August 2009

function columnAreaImage(){
  if(document.title.split(" ")[0] == "Preferences")
  {
    return;
  }

  var divFooter;
  if (document.getElementById ) {
    divFooter= document.getElementById("footer");
  } else if (document.all ) {
    divFooter= document.all["footer"];
  } else {
    return;
  }
  
  var newdiv = document.createElement('div');
  newdiv.setAttribute('id', 'columnAreaImage');
  
  var footHeight = (divFooter.offsetHeight)+(divFooter.offsetTop);
  if(footHeight > 900)
  {
    newdiv.style.top = footHeight - 408+"px";
  }
  else
  {
    return;
  }

  newdiv.style.backgroundImage = "url(/images/a/aa/VectorSidebarInfosphere.png)";
  newdiv.style.backgroundPosition = "bottom left";
  newdiv.style.backgroundRepeat = "no-repeat";
  
  newdiv.style.position = "absolute";
  
  newdiv.style.left = "0px";
  newdiv.style.width = "377px";
  newdiv.style.height = "408px";
  newdiv.style.zIndex = "-1"
  
  document.body.appendChild(newdiv);
}
 
addOnloadHook(columnAreaImage);


function randomiseMainPics(){
  if(wgTitle == "Main Page")
  {
    var rand = Math.random();
    if(rand>0.6666)
    {
      var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox");
      mainRightBox[0].style.backgroundImage = "url(/images/4/45/VectorMainRightLeela.png)";
    }
    else if(rand>0.3333)
    {
      var mainRightBox = getElementbyClass(document.getElementsByTagName("td"), "mainRightBox");
      mainRightBox[0].style.backgroundImage = "url(/images/0/03/VectorMainRightProf.png)";
    }
    rand = Math.random();
    if(rand>0.6666)
    {
      var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox");
      mainBottomBox[0].style.backgroundImage = "url(/images/5/57/VectorMainBottomHedonism.png)";
    }
    else if(rand>0.3333)
    {
      var mainBottomBox = getElementbyClass(document.getElementsByTagName("td"), "mainBottomBox");
      mainBottomBox[0].style.backgroundImage = "url(/images/a/aa/VectorMainBottomHermes.png)";
    }
    rand = Math.random();
    if(rand>0.6666)
    {
      var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox");
      mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftZoidberg.png)";
    }
    else if(rand>0.3333)
    {
      var mainLeftBox = getElementbyClass(document.getElementsByTagName("td"), "mainLeftBox");
      mainLeftBox[0].style.backgroundImage = "url(/images/0/0b/VectorMainLeftAmy.png)";
    }
  }
}
 
addOnloadHook(randomiseMainPics);