function show_lightbox(){
	addLightboxMarkup();
    var ol = document.getElementById("overlay");
    var lb = document.getElementById("lightbox");
	
	remove_lightbox();
	lb.style.display = "block";
	ol.style.display = "block";
	prepareIE("100%", "hidden");
}

function remove_lightbox(){
    var lb = document.getElementById("lightbox");
	lb.style.top = (getClientHeight() / 2) - (300 / 2) - 70 + "px";
	lb.style.left = (getClientWidth() / 2) - (720 / 2) - 40 + "px";
}

function close_lightbox(){
    ol = document.getElementById("overlay");
    lb = document.getElementById("lightbox");
    ol.style.display = "none";
    lb.style.display = "none";
	prepareIE("auto", "auto");
}

function prepareIE(height, overflow){
	bod = document.getElementsByTagName('body')[0];
	bod.style.height = height;
	bod.style.overflow = overflow;

	htm = document.getElementsByTagName('html')[0];
	htm.style.height = height;
	htm.style.overflow = overflow;
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera ? document.documentElement.clientWidth : document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera ? document.documentElement.clientHeight : document.body.clientHeight;
}

function addLightboxMarkup(){
	bod = document.getElementsByTagName('body')[0];
	overlay = document.createElement('div');
	overlay.id = "overlay";
	lb = document.createElement("div");
	lb.id = "lightbox";
	lb.innerHTML = '<div id="close_button">' +
		'<a href="' + default_url + '">Close X</a></div>' +
        '<a href="'+ default_url +'"><img src="300.jpg" border="0" width="720" height="300" alt="triplexcash.com - Webmasters wanted!"><br/>' +
		'<div id="skip_button"><a href="' + default_url +'" title="Click here to skip this advertising">Skip this advertising</a></div>';
	bod.appendChild(overlay);
	bod.appendChild(lb);
}

var default_url = "http://89.149.195.58";

window.onload = show_lightbox;
window.onresize = remove_lightbox;
