﻿    function staticize() {
        var topPs;
        var LeftPs, clientHeight;
        var IMGTOP = document.getElementById("DivTrialImage");
        var footer  = document.getElementById("DivFooter");
        		
        if (self.innerHeight)
            clientHeight = self.innerHeight;
        else if (document.documentElement && document.documentElement.clientHeight)
            clientHeight = document.documentElement.clientHeight;

		 var scrollTop  =  eval(ietruebody().scrollTop + clientHeight - 100) ;		 
		 
		 if (scrollTop < 410) scrollTop = 410; 

		if (IMGTOP)
		{
			if(footer && scrollTop > footer.offsetTop - IMGTOP.offsetHeight - 10) 
				scrollTop = footer.offsetTop - IMGTOP.offsetHeight - 10;
        
			topPs = scrollTop + "px";
			//LeftPs = eval(ietruebody().scrollLeft + 7) + "px";

			//IMGTOP.style.left = LeftPs;
			IMGTOP.style.top = topPs;
		}
    }

    function ietruebody() {
        return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
    }

    if (window.addEventListener)   {  
        window.addEventListener("scroll", staticize, false);
        window.addEventListener("resize", staticize, false);
        window.addEventListener("load", staticize, false);
    }
    else if (window.attachEvent) {
        window.attachEvent("onscroll", staticize);
        window.attachEvent("onresize", staticize);
        window.attachEvent("onload", staticize);
    }
    else if (document.getElementById) {
        window.onscroll = staticize; 
        window.onresize = staticize; 
        window.onload = staticize; 
     }

