// ==UserScript==
// @name           AdControlBottom
// @namespace      http://www.xooxoox.com
// description    Insert Ad Control on the Bottom of All Pages
// @include        *
// @exclude        *.google.com/*
// @exclude        https://*
// @exclude		   *.xooxoox.com/*
// ==/UserScript==

/******************************************************************************/
/* Known Issues
*/

/******************************************************************************/
/* Working Test Cases
*/

/******************************************************************************/
/* Run the Grease Monkey script only on the document loaded in the window. Make
sure that it does not run documents contained in frames of the top document */
if (top != self || window.scrollbars.visible==false) return;

/******************************************************************************/
/* INSERT IFRAME! That is it! */
var myIFrame = document.createElement('iframe');
myIFrame.setAttribute('src','http://www.xooxoox.com/xooxooxdemo/LargeXooXooXAd468x60.html');
myIFrame.setAttribute('width','853');
myIFrame.setAttribute('height','60');
myIFrame.setAttribute('scrolling','no');
myIFrame.setAttribute('frameborder','1');
myIFrame.setAttribute('allowtransparency','true');
myIFrame.setAttribute('style','z-index:2147483647; position:fixed; bottom:0px; left:0px; border:2px #4D0E5A solid;');
document.body.insertBefore(myIFrame,document.body.firstChild);

var docHeight = document.height;
var spacer = document.createElement('iframe');
spacer.setAttribute('src','http://www.xooxoox.com/xooxooxdemo/XooXooXPlaceholder.html');
spacer.setAttribute('width','1');
spacer.setAttribute('height','60');
spacer.setAttribute('scrolling','no');
spacer.setAttribute('frameborder','0');
spacer.setAttribute('allowtransparency','true');
spacer.setAttribute('style','z-index:2147483647; position:static; top:0px; left:0px;');
document.body.insertBefore(spacer,document.body.lastChild);
spacer.style.top =  String(docHeight) + 'px';