switch (Math.floor(Math.random() * 10))
{
case 0:
case 3:
$("body").append("<div class='flashlight'></div><div class='modtoggle fl'></div>");
modToggle = $(".modtoggle");
fl = $(".flashlight");
$("body").mousemove(function(e) {
if (fl.is(":visible"))
fl.css('background-position', (e.pageX - 1280) + 'px ' + (e.pageY - 720 - $(document).scrollTop()) + 'px');
});
$(".fl").click(function(e) { fl.toggle(); });
case 1:
case 3:
$("body").append("<div class='modtoggle hd'></div>");
modToggle = $(".modtoggle");
$("a").addClass("hiddenA");
$(".hd").click(function() { $("a").toggleClass("hiddenA"); });
break;
}
3/10 chance of HD (case 0,1, or 3) per page load
1/5 chance of FL(case 0,3) per page load
since the first case 3 is missing a break; (not sure if intentional) FL always appears with HD cause it falls through the cases
clever use of a background image + jquery for flashlight
hd hides links only by setting opacity to 0.01 so they still take up space