document.writeln("<style type='text/css'>");
document.writeln("html, body {");
document.writeln("margin:0px;");
document.writeln("padding:0px;");
document.writeln("border: 0 none;");
document.writeln("height: 100%;");
document.writeln("width: 100%; }");
document.writeln("body {visibility:hidden;}");
document.writeln("</style>");
 
      //create onDomReady Event
      window.onDomReady = initReady;
      
      // Initialize event dpending on browser
      function initReady(fn)
      {
      	//W3C-compliant browser
      	if(document.addEventListener) {
          document.addEventListener("DOMContentLoaded", fn, false);
        }
      	//IE
      	else {
          document.onreadystatechange = function(){readyState(fn)}
        }
      }
      
      //IE execute function
      function readyState(func)
      {
      	// DOM is ready
      	if(document.readyState == "interactive" || document.readyState == "complete")
      	{
      		func();
      	}
      }
/* library code until here */
 
function  center() {
var my = document.getElementById('xr_xr');
var b=parseInt(my.style.width);
var h=parseInt(my.style.height);
var bheight = window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight);
b=(b/2)-b;
my.style.marginLeft = b + "px";
h=(h/2)-h;
if(parseInt(bheight) <= parseInt(my.style.height))
{
my.style.marginTop = "0px";
my.style.top="0px"
 
} else {
my.style.marginTop = h + "px";
my.style.top="50%"
}
 
my.style.left="50%"
my.style.textAlign="left";
my.style.position="absolute";
my.style.padding="0px";
}
 
function center_ () {
center();
document.body.style.visibility = "visible";
 
 
}
 
window.onDomReady(center_);
window.onresize=center;
