

self.setTimeout("setPosition();",1000);


function getViewportSize()
{
  var size = [0, 0];

  if (typeof window.innerWidth != 'undefined')
  {
    size = [
        window.innerWidth,
        window.innerHeight
    ];
  }
  else if (typeof document.documentElement != 'undefined'
      && typeof document.documentElement.clientWidth != 'undefined'
      && document.documentElement.clientWidth != 0)
  {
    size = [
        document.documentElement.clientWidth,
        document.documentElement.clientHeight
    ];
  }
  else
  {
    size = [
        document.getElementsByTagName('body')[0].clientWidth,
        document.getElementsByTagName('body')[0].clientHeight
    ];
  }

  return size;
}

function setPosition(){

this.scrollY = 0; this.scrollX = 0;

if(document.documentElement && document.documentElement.scrollLeft) this.scrollX = document.documentElement.scrollLeft;
if(document.documentElement && document.documentElement.scrollTop) this.scrollY = document.documentElement.scrollTop;
if(document.body && document.body.scrollLeft) this.scrollX = document.body.scrollLeft;
if(document.body && document.body.scrollTop) this.scrollY = document.body.scrollTop;
if(window.pageXOffset) this.scrollX = window.pageXOffset;
if(window.pageYOffset) this.scrollY = window.pageYOffset;
if(window.scrollX) this.scrollX = window.scrollX;
if(window.scrollY) this.scrollY = window.scrollY;


x = getViewportSize();


dialogWidth=image_width;
dialogHeight=image_height;

dialogTop = ((x[1]/2) + this.scrollY) - (dialogHeight/2);
dialogLeft = ((x[0] + this.scrollX)/2) - (dialogWidth/2);

//d.style.top = dialogTop+"px";
//d.style.left = dialogLeft+"px";
var d = document.getElementById('__mid');
d.style.top = dialogTop + "px";
d.style.left = dialogLeft + "px";

doshow(1);

//Cookie Code

}

