﻿function updateDiv()
{
    var flashDiv = document.getElementById("flashDiv");
    
    //calculate size of window
    var myWidth = 0;
    var myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
      
      var scrOfX = 0, scrOfY = 0;
      if( typeof( window.pageYOffset ) == 'number' ) {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
      }
    

    var top = myHeight - height;
    top = top + scrOfY;
    var left = myWidth - width;
    left = left + scrOfX;
//    var left = 0;
    
    flashDiv.style.top = top + "px";
    flashDiv.style.left = left + "px";
    
}

function endVideo()
{    
    var flashDiv = document.getElementById("flashDiv");
    
    flashDiv.style.display = "none";
}

var height = 300;
var width = 533;
var filename = 'PaulCapitalAllowances533x300.swf';
window.onscroll = updateDiv;
window.onresize = updateDiv;
document.write('<div id="flashDiv" style="position: absolute; z-index: 100; top: 0px; left: 0px;">');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"');
document.write('width="' + width + '" height="' + height + '" id="Object2">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="Video/' + filename + '" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="loop" value="false">');
document.write('<embed src="Video/' + filename + '" quality="high" wmode="transparent" width="' + width + '" height="' + height + '" name="test" align="bottom" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
document.write('</div>');
updateDiv();