// Code to get the width and height of the screen
var x, y, x1, y1;

// for all browsers except InternetExplorer
if (self.innerHeight) {
x = self.innerWidth;
y = self.innerHeight;

// Internet Explorer 6 Strict Mode
} else if (document.documentElement
&& document.documentElement.clientHeight) {
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;

// other Browsers
} else if (document.body) {
x = document.body.clientWidth;
y = document.body.clientHeight;
}


// Code to place the image on the screen
x1 = x - 195;
y1 = 0;

(document.getElementById && !document.all) ? dom = true : dom = false;

function typeStart() {
  if (dom) {

    document.write('<div id="logoBox" style="position:absolute; left:' + (x1) + 'px; visibility:visible">') }
  if (document.all) {
    document.write('<div id="logoBox" style="position:absolute; left:' + (x1) + 'px; visibility:visible">') }
 }

function typeEnd() {
  if (document.all || dom) { document.write('</div>') }
 }

function placeIt() {
  if (dom) {document.getElementById("logoBox").style.top = window.pageYOffset + y1 + "px"; document.getElementById("logoBox").style.left = window.pageXOffset + x1 + "px";}
  if (document.all) {document.all["logoBox"].style.top = document.documentElement.scrollTop + y1 + "px"; document.all["logoBox"].style.left = document.documentElement.scrollLeft + x1 + "px";}
  window.setTimeout("placeIt()", 10);
 }

// Multiple onload function

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  placeIt();
});
