// Keep it in an anonymous function to avoid setting global variables everywhere (function(){ /*! * contentloaded.js * * Author: Diego Perini (diego.perini at gmail.com) * Summary: cross-browser wrapper for DOMContentLoaded * Updated: 20101020 * License: MIT * Version: 1.2 * * URL: * http://javascript.nwbox.com/ContentLoaded/ * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE * */ if(document.URL.indexOf("http://assets.txmblr.com/") >= 0){ // Don't wrap on Tumblr preview. //console.log("Not inserting."); } else { if(top != self) top.location.replace(location); } // var fixed = '
\ // Powered by Us Vs Th3m \ //
'; // var tiheader = '
\ // \ //
\ //
\ // More from UsVsTh3m\ //
'; function shuffle_wrapper_links(array) { var counter = array.length, temp, index; // While there are elements in the array while (counter--) { // Pick a random index index = (Math.random() * counter) | 0; // And swap the last element with it temp = array[counter]; array[counter] = array[index]; array[index] = temp; } return array; } // var wrapperlinks = shuffle_wrapper_links( // [{"title":"The North-o-Meter","description":"100%-accurate test works out where in the country you belong","url":"http:\/\/games.usvsth3m.com\/north-o-meter\/","image-url":"http:\/\/i.imgur.com\/d4CmUwb.jpg"},{"title":"Make Your Own 2048","description":"Now you can customise the tile-merging game phenomenon.","url":"http:\/\/games.usvsth3m.com\/2048\/","image-url":"http:\/\/i.imgur.com\/cW0jlNt.jpg"},{"title":"GAME: Fight!","description":"Star Trek, sport, politics - settle ALL your arguments definitively","url":"http:\/\/games.usvsth3m.com\/fight\/","image-url":"http:\/\/i.imgur.com\/uI9GiTV.jpg"},{"title":"The Luis Suarez Biting Game","description":"Drain as much blood as you can!","url":"http:\/\/games.usvsth3m.com\/the-luis-suarez-biting-game\/","image-url":"http:\/\/i.imgur.com\/OIBuhgj.png"},{"title":"Which Genius Do You Sleep Like?","description":"Our quiz matches you with a sleepy mind from history.","url":"http:\/\/games.usvsth3m.com\/which-genius-do-you-sleep-like\/","image-url":"http:\/\/i.imgur.com\/41lgqpU.png"},{"title":"Game: Slap George Osborne","description":"See how many other people are are joining in at the same time","url":"http:\/\/games.usvsth3m.com\/slap-george-osborne\/","image-url":"http:\/\/usvsth3m.co.uk\/sidebar-images\/65eeec2dc63d4c0a7e7a07c6aea83a5b.jpg"},{"title":"George Osborne Can't Do Simple Maths Under Pressure","description":"George can\u2019t get past level two, you?","url":"http:\/\/games.usvsth3m.com\/george-osborne-cant-do-simple-maths-under-pressure\/","image-url":"http:\/\/usvsth3m.co.uk\/sidebar-images\/cdcd0e2c7e8f83fd88016ce241e86253.jpg"},{"title":"NEW GAME: Tweets & Ladders","description":"The social media board game phenomenon","url":"http:\/\/usvsth3m.com\/post\/91343316848","image-url":"http:\/\/usvsth3m.co.uk\/sidebar-images\/83a71cffe97eb7b91ab088bd668a1b8d.jpg"},{"title":"PLAY: Slap Michael Gove!","description":"Give him a virtual beating","url":"http:\/\/games.usvsth3m.com\/slap-michael-gove\/","image-url":"http:\/\/usvsth3m.co.uk\/sidebar-images\/8769d710707f2495b3f47684d8c153f9.jpg"},{"title":"The Cabinet Reshuffle Game","description":"Go on - have a shuffle on David's face","url":"http:\/\/games.usvsth3m.com\/the-cabinet-reshuffle-game\/","image-url":"http:\/\/usvsth3m.co.uk\/sidebar-images\/96ed8a8b15663990e3ebed8baf9352bb.jpg"},{"title":"Who Were You In Your Past Life?","description":"Which celeb died on your birthday and was reincarnated as you?","url":"http:\/\/games.usvsth3m.com\/who-were-you-in-your-past-life\/","image-url":"http:\/\/imgur.com\/uB2zvZm.jpg"},{"title":"GAME: Spot the Tory!","description":"Can you guess the party an MP belongs to just by looking at their face?","url":"http:\/\/games.usvsth3m.com\/spot-the-tory\/","image-url":"http:\/\/imgur.com\/mSKZfwt.jpg"},{"title":"Is this quip Morrissey or UKIP?","description":"It's not always easy to tell...","url":"http:\/\/games.usvsth3m.com\/quiz\/morrissey-or-ukip","image-url":"http:\/\/imgur.com\/INg1iES.jpg"},{"title":"Pi: is the next digit higher or lower?","description":"How far can you get?","url":"http:\/\/games.usvsth3m.com\/pi-game\/","image-url":"http:\/\/i.imgur.com\/yRnuwMq.jpg"},{"title":"GAME: Not-So-Super Bros","description":"Sometimes things can get you down, so climb your way back into the sunshine!","url":"http:\/\/games.usvsth3m.com\/not-so-super-bros\/","image-url":"http:\/\/i.imgur.com\/04bCEGQ.jpg"},{"title":"Robin Williams Soundboard","description":"\"Good morning Vietnam!!!\"","url":"http:\/\/games.usvsth3m.com\/soundboard\/robin-williams\/","image-url":"http:\/\/i.imgur.com\/HQLMtfE.jpg"},{"title":"Who\u2019s Your Celebrity A-Level Twin?","description":"Enter your grades to find your famous examalike","url":"http:\/\/games.usvsth3m.com\/celebrity-a-level-twin\/","image-url":"http:\/\/i.imgur.com\/y4MIWeV.jpg"},{"title":"Around the World in 80 Million Clicks","description":"Click to help power our skyboat around the world!","url":"http:\/\/games.usvsth3m.com\/around-the-world\/","image-url":"http:\/\/i.imgur.com\/JmyYiiW.png"},{"title":"Don't Click Ian Botham's Dick!","description":"Can you avoid seeing worst thing on Twitter?","url":"http:\/\/games.usvsth3m.com\/dont-click-ian-bothams-dick\/","image-url":"http:\/\/i.imgur.com\/UbTEZ2h.jpg"},{"title":"Westminster Shredder","description":"Help the MP get rid of embarrassing files before a press leak!","url":"http:\/\/games.usvsth3m.com\/westminster-shredder\/","image-url":"http:\/\/i.imgur.com\/9hKDgYZ.jpg"},{"title":"What would you look like as a Star Wars character?","description":"Jedi Knight or Lord of the Dark Side?","url":"http:\/\/games.usvsth3m.com\/ultimate-star-wars-character\/","image-url":"http:\/\/i.imgur.com\/47tdEL4.jpg"},{"title":"Working From Home Simulator","description":"Can you actually get any work done?","url":"http:\/\/games.usvsth3m.com\/choose-your-own\/working-from-home\/","image-url":"http:\/\/i.imgur.com\/u8kYItG.png"},{"title":"Richard Dawkins' Apology Generator","description":"Help Dawko apologise for his latest gaffe!","url":"http:\/\/games.usvsth3m.com\/generator\/richard-dawkins-apology-generator\/","image-url":"http:\/\/i.imgur.com\/Slififm.jpg"},{"title":"The Scotchland Postcode Referendum","description":"How do people near you feel about Scottish Independence?","url":"http:\/\/games.usvsth3m.com\/scotchland-postcode-referendum\/","image-url":"http:\/\/i.imgur.com\/IBwG4f2.png"},{"title":"How Clean Is Your Screen?","description":"Can you tell our real dirt from your fake dirt?","url":"http:\/\/games.usvsth3m.com\/how-clean-is-your-screen\/","image-url":"http:\/\/i.imgur.com\/A74OEgB.jpg?1"},{"title":"Whac-A-Gif","description":"Whack anything you like! From Daleks to George Osborne!","url":"http:\/\/games.usvsth3m.com\/whac-a-gif\/","image-url":"http:\/\/i.imgur.com\/kTt9Tw5.jpg?1"},{"title":"How Old Is Your Hearing?","description":"Find out the true age of your lugholes!","url":"http:\/\/games.usvsth3m.com\/how-old-is-your-hearing\/","image-url":"http:\/\/i.imgur.com\/RNT5Xne.jpg?1"},{"title":"Make your own games and quizzes!","description":"Customize our games to make your own special version!","url":"http:\/\/community.usvsth3m.com\/","image-url":"http:\/\/i.imgur.com\/UI32IPG.png"},{"title":"Apple Watch Simulator","description":"Open as many apps as you can before the battery runs out","url":"http:\/\/games.usvsth3m.com\/apple-watch\/","image-url":"http:\/\/i.imgur.com\/ChOCnRx.png"},{"title":"iQueue","description":"Quick, line up for the new Apple product!","url":"http:\/\/games.usvsth3m.com\/iqueue\/","image-url":"http:\/\/i.imgur.com\/FKOiG4m.png"},{"title":"Kick The Tories Out Of Scotland","description":"Can you give Cameron the boot, literally?","url":"http:\/\/games.usvsth3m.com\/kick-the-tories-out-of-scotland\/","image-url":"http:\/\/i.imgur.com\/mrsj1s8.jpg"},{"title":"Tube Runnings","description":"Can you run faster than the Tube in our super commuting game?","url":"http:\/\/games.usvsth3m.com\/tube-runnings\/","image-url":"http:\/\/i.imgur.com\/XpMyC2x.png"},{"title":"How Skanky Are You?","description":"No-one cares whether you're posh or not, we want to know how gross you are.","url":"http:\/\/community.usvsth3m.com\/your-test\/how-skanky-are-you\/","image-url":"http:\/\/i.imgur.com\/BzCRMxZ.jpg"},{"title":"UVT OddFood","description":"Get ready for a crap British bake-off with our amazingly odd dessert generator!","url":"http:\/\/games.usvsth3m.com\/odd-food\/","image-url":"http:\/\/i.imgur.com\/iMEkJ4o.png"},{"title":"The Assassination of Margaret Thatcher","description":"Change history by writing a short story that annoys people.","url":"http:\/\/games.usvsth3m.com\/choose-your-own\/thatcher-assassination\/","image-url":"http:\/\/i.imgur.com\/RilLiGq.png"},{"title":"Card Clash - The Game","description":"We've brought the 21st century's biggest fight to life!","url":"http:\/\/games.usvsth3m.com\/card-clash\/","image-url":"http:\/\/i.imgur.com\/NXZ8eSY.png"},{"title":"Connect One","description":"A Game For Complete Winners! ","url":"http:\/\/games.usvsth3m.com\/easy-games\/connect-one\/","image-url":"http:\/\/i.imgur.com\/PG8fmZ1.png"}] // ); // var toinsert = tiheader + "
  • " + wrapperlinks[0]['title'] + "
  • " + "
  • " + wrapperlinks[1]['title'] + "
  • " + "
  • " + wrapperlinks[2]['title'] + "
  • " + tifooter; // var contents = [toinsert, toinsert, // '
    Be the first to know when we make new stuff. Follow @UsVsTh3m on Twitter:
    \ //
    Follow @UsVsTh3m \ //
    \ // ', // '
    Be the first to know when we make new stuff. Like Us Vs Th3m on Facebook:
    \ //
    \ // ', // '
    Be the first to know when we make new stuff. Join our mailing list:
    \ //
    \ // ' // ]; function contentLoaded(win, fn) { var done = false, top = true, doc = win.document, root = doc.documentElement, add = doc.addEventListener ? 'addEventListener' : 'attachEvent', rem = doc.addEventListener ? 'removeEventListener' : 'detachEvent', pre = doc.addEventListener ? '' : 'on', init = function(e) { if (e.type == 'readystatechange' && doc.readyState != 'complete') return; (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false); if (!done && (done = true)) fn.call(win, e.type || e); }, poll = function() { try { root.doScroll('left'); } catch(e) { setTimeout(poll, 50); return; } init('poll'); }; if (doc.readyState == 'complete') fn.call(win, 'lazy'); else { if (doc.createEventObject && root.doScroll) { try { top = !win.frameElement; } catch(e) { } if (top) poll(); } doc[add](pre + 'DOMContentLoaded', init, false); doc[add](pre + 'readystatechange', init, false); win[add](pre + 'load', init, false); } } function uvt_wrap() { if(top != self) top.location.replace(location); var body = document.body; var uvt_over = document.createElement('div'); uvt_over.id = 'uvt_over'; var uvt_box = document.createElement('div'); uvt_box.id = 'uvt_box'; var node; while (node = body.firstChild) { uvt_box.appendChild(node); } uvt_over.appendChild(uvt_box); body.appendChild(uvt_over); // var uvt_credits = document.createElement('div'); // uvt_credits.id = 'uvt_credits'; // Sometimes, we might want to override which panel is shown, based on JS on the parent page if (typeof whichpanel === 'function') { //console.log("Panel preselected."); var boselecta = whichpanel(); } else { //console.log("Choosing random panel."); var boselecta = Math.floor(Math.random() * contents.length); } uvt_credits.innerHTML = fixed; body.appendChild(uvt_credits); // if(document.getElementById('uvt_apply_twitter') != null) { // !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs'); // } } if(document.URL.indexOf("http://assets.txmblr.com/") >= 0){ // Don't wrap on Tumblr preview. } else { contentLoaded(window,uvt_wrap); } })();