User:Gamedezyner/slowDownModal.js

var slowdownCookie = { get: function(cookie_name,pos) { var x, y, cookie_array = document.cookie.split(";"); for (var i=0; i < cookie_array.length; i++) { x = cookie_array[i].substr(0,cookie_array[i].indexOf("=")); y = cookie_array[i].substr(cookie_array[i].indexOf("=")+1); x = x.replace(/^\s+|\s+$/g,""); if (x == cookie_name) { return y;				} }		},		set: function (cookie_name,data) { var domain = wgServer.split("//")[1]; document.cookie = cookie_name + "=" + data + "; max-age=" + 60*60*24*150 + "; path=/; domain=" + domain; }	} if (typeof(slowdownCookie.get("slowDownModalClosed"))=="undefined"){ slowdownCookie.set("slowDownModalClosed","0"); } if (slowdownCookie.get("slowDownModalClosed")=="0") { $("head").append(' #slowDownCover{width:100%;height:100%;background-color:black;opacity:0;z-index:999998;position: absolute;top: 0;}#slowDownModal{position:absolute;z-index:999999;margin:auto;left:50%;top:25px;}#slowDownModal iframe{width: 750px; height: 467px;}#slowDownModal div{position:relative;left:-50%;text-align:center;color:grey;}') $("body").append(' ') $("body").append('  Click here to close  '); $("#slowDownCover").animate({opacity:0.75}); $("#slowDownCover, #slowDownClose").click(function{	$("#slowDownModal").animate({opacity:0},function{$("#slowDownModal").remove;});	$("#slowDownCover").animate({opacity:0},function{$("#slowDownCover").remove;});	slowdownCookie.set("slowDownModalClosed","1");	}); }