(function() { var widthExoLayer; var heightExoLayer; var positionMaxExoLayer; var positionMinExoLayer; var positionExoLayer; var marginExoLayer; var leftExoLayer; var topExoLayer; var scrollTopExoLayer = 0; var bodyHeightExoLayer; var bodyWidthExoLayer; widthExoLayer = 250; heightExoLayer = 150;; positionMaxExoLayer = heightExoLayer; positionMinExoLayer = 0; positionExoLayer = heightExoLayer; var exoDocumentProtocol = (document.location.protocol != "https:" && document.location.protocol != "http:") ? "https:" : document.location.protocol; var codeExoLayer = '' + '
' + '
' + '' + '
' + '
'; function writeExoLayer() { document.write(codeExoLayer); } function closeExoLayer() { document.getElementById('divExoLayerWrapper').style.display = "none"; } function initExoLayer() { if ( window.outerHeight ) { // FireFox bodyHeightExoLayer = window.innerHeight; bodyWidthExoLayer = window.innerWidth; } else if (document.documentElement.clientHeight) { // IE 6+ bodyHeightExoLayer = document.documentElement.clientHeight; bodyWidthExoLayer = document.documentElement.clientWidth; } else { // IE bodyHeightExoLayer = document.body.clientHeight; bodyWidthExoLayer = document.body.clientWidth; } // Layer Position marginExoLayer = 20; leftExoLayer = bodyWidthExoLayer - widthExoLayer - marginExoLayer; topExoLayer = bodyHeightExoLayer; document.getElementById('divExoLayer').style.left = 0 + "px"; document.getElementById('divExoLayer').style.top = heightExoLayer + "px"; positionExoLayer = heightExoLayer; //positionMinExoLayer = bodyHeightExoLayer - heightExoLayer; //positionMaxExoLayer = bodyHeightExoLayer; } function showExoLayer() { if ( document.getElementById('divExoLayerWrapper').style.visibility == "hidden" ) { document.getElementById('divExoLayerWrapper').style.visibility = "visible"; } if ( positionExoLayer > positionMinExoLayer ) { positionExoLayer = positionExoLayer - 2; document.getElementById('divExoLayer').style.top = positionExoLayer + 0 + "px"; showExoLayerTimeout = window.setTimeout(showExoLayer, 10); } else { window.clearTimeout(showExoLayerTimeout); hideAgainExoLayer(); } } function hideExoLayer() { if ( positionExoLayer < positionMaxExoLayer ) { positionExoLayer = positionExoLayer + 2; document.getElementById('divExoLayer').style.top = positionExoLayer + scrollTopExoLayer + "px"; hideExoLayerTimeout = window.setTimeout(hideExoLayer, 10); } else { window.clearTimeout(hideExoLayerTimeout); showAgainExoLayer(); document.getElementById('divExoLayerWrapper').style.visibility = "hidden"; } } function moveExoLayer() { scrollTopExoLayer = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; document.getElementById("divExoLayerWrapper").style.left = bodyWidthExoLayer - widthExoLayer - marginExoLayer + document.body.scrollLeft + "px"; document.getElementById("divExoLayerWrapper").style.top = bodyHeightExoLayer - heightExoLayer + scrollTopExoLayer + "px"; positionMinExoLayer = 0 - 0 + 0; positionMaxExoLayer = 0 + heightExoLayer; window.setTimeout(moveExoLayer, 10); } function showAgainExoLayer() { initExoLayer(); window.setTimeout(showExoLayer, 5000); } function hideAgainExoLayer() { window.setTimeout(hideExoLayer, 7000); } function loadExoLayer() { initExoLayer(); showExoLayer(); moveExoLayer(); } writeExoLayer(); window.setTimeout(loadExoLayer,3000); })();