/* generated javascript */
if (!window.skin) {
	var skin = 'monaco';
	var stylepath = 'http://images.wikia.com/common/releases_200912.2/skins';
}

/* MediaWiki:Common.js */
/* Any JavaScript here will be loaded for all users on every page load. */

/* background switcher from CD Projekt */

function setBackground(time) { 

  if (time>="00:00" && time<"04:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/0000.jpg') no-repeat left top";
  }

  else if (time>="04:00" && time<"06:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/0400.jpg') no-repeat left top";
  }

  else if (time>="06:00" && time<"06:30"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/0600.jpg') no-repeat left top";   
  }

  else if (time>="06:30" && time<"06:45"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/0630.jpg') no-repeat left top";
  }

  else if (time>="06:45" && time<"08:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/0645.jpg') no-repeat left top";
  }

  else if (time>="08:00" && time<"11:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/0800.jpg') no-repeat left top";
  }

  else if (time>="11:00" && time<"13:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/1100.jpg') no-repeat left top";
  }

  else if (time>="13:00" && time<"15:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/1300.jpg') no-repeat left top";
  }

  else if (time>="15:00" && time<"16:30"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/1500.jpg') no-repeat left top";
  }

  else if (time>="16:30" && time<"18:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/1630.jpg') no-repeat left top";
  }

  else if (time>="18:00" && time<"19:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/1800.jpg') no-repeat left top";
  }

  else if (time>="19:00" && time<"20:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/1900.jpg') no-repeat left top";
  }

  else if (time>="20:00" && time<"23:00"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/2000.jpg') no-repeat left top";
  }

  else if (time>="23:00" && time<="23:59"){
    document.body.style.background = "url('http://images.wikia.com/witcher/images/background/2300.jpg') no-repeat left top";
  }

}

function addonBackgroundSwitcher() {

    var date = new Date();

    var hour = date.getHours();

    var min = date.getMinutes();

    var now = ""+((hour<10)?"0":"")+hour+((min<10)?":0":":")+min;

    setBackground(now);
    
    doneOnloadHook = true;

}

addOnloadHook(addonBackgroundSwitcher);

/* MediaWiki:Monaco.js */
function setBackground(time) { 

  if (time>="00:00" && time<"04:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/0000.jpg') no-repeat left top");
  }

  else if (time>="04:00" && time<"06:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/0400.jpg') no-repeat left top");
  }

  else if (time>="06:00" && time<"06:30"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/0600.jpg') no-repeat left top");   
  }

  else if (time>="06:30" && time<"06:45"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/0630.jpg') no-repeat left top");
  }

  else if (time>="06:45" && time<"08:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/0645.jpg') no-repeat left top");
  }

  else if (time>="08:00" && time<"11:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/0800.jpg') no-repeat left top");
  }

  else if (time>="11:00" && time<"13:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/1100.jpg') no-repeat left top");
  }

  else if (time>="13:00" && time<"15:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/1300.jpg') no-repeat left top");
  }

  else if (time>="15:00" && time<"16:30"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/1500.jpg') no-repeat left top");
  }

  else if (time>="16:30" && time<"18:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/1630.jpg') no-repeat left top");
  }

  else if (time>="18:00" && time<"19:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/1800.jpg') no-repeat left top");
  }

  else if (time>="19:00" && time<"20:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/1900.jpg') no-repeat left top");
  }

  else if (time>="20:00" && time<"23:00"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/2000.jpg') no-repeat left top");
  }

  else if (time>="23:00" && time<="23:59"){
    YAHOO.util.Dom.setStyle('background_strip','background', "url('http://images.wikia.com/witcher/images/background/2300.jpg') no-repeat left top");
  }
}

function addonBackgroundSwitcher() {

    var date = new Date();

    var hour = date.getHours();

    var min = date.getMinutes();

    var now = ""+((hour<10)?"0":"")+hour+((min<10)?":0":":")+min;

    setBackground(now);
    
    doneOnloadHook = true;

}

addOnloadHook(addonBackgroundSwitcher)