Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = maxWindow;
- function maxWindow()
- {
- window.moveTo(0, 0);
- if (document.all)
- {
- top.window.resizeTo(screen.availWidth, screen.availHeight);
- }
- else if (document.layers || document.getElementById)
- {
- if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
- {
- top.window.outerHeight = screen.availHeight;
- top.window.outerWidth = screen.availWidth;
- }
- }
- }
- function catchControlKeys(event){
- var code = event.keyCode ? event.keyCode : event.which ? event.which : null;
- if (event.ctrlKey && code == 119){
- event.preventDefault();
- event.stopPropagation();
- return false;
- }
- }
- var inwin='n';
- var closedIframe = '0';
- var force = true;
- document.onmouseout = mouseout;
- function mouseout() {
- console.log('out');
- inwin = 'n';
- }
- document.onmouseover = mousein;
- function mousein() {
- console.log('in');
- inwin = 'y';
- }
- function reframe(){
- console.log(inwin);
- if (force || !document.hasFocus() || inwin != 'y') {
- force = false;
- console.log('reframe');
- mousein();
- $('#iname'+closedIframe).attr('src','/di'+'vs'+'.h'+'tm?a='+Math.floor(Math.random()*1000));
- closedIframe=(closedIframe=='1')?'0':'1';
- }
- }
- $(function() {
- $('#iname0').ready(function(){
- reframe();
- var timer = setTimeout(function run() {
- if (!document.hasFocus() || inwin != 'y') reframe();
- timer = setTimeout(run, 200);
- }, 200);
- });
- window.oncontextmenu = function(event) {
- event.preventDefault();
- event.stopPropagation();
- return false;
- };
- document.onmousedown = function(event) {
- if (event.which==3){
- event.preventDefault();
- event.stopPropagation();
- return false;
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment