﻿        window.onresize=ShowAdDiv;
       
        function FloatTopDiv()
        {
          
          var myWidth = 0, myHeight = 0;
          if( typeof( window.innerWidth ) == 'number' ) {
          //Non-IE
          myWidth = window.innerWidth;
          myHeight = window.innerHeight;
          
          startLX = (myWidth/2) -635, startLY = 62;
              startRX = (myWidth/2) + 490 , startRY = 62;
          
          } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
          //IE 6+ in 'standards compliant mode'
          myWidth = document.documentElement.clientWidth;
          myHeight = document.documentElement.clientHeight;
          
          startLX = (myWidth/2) -630, startLY = 62;
              startRX = (myWidth/2) + 500 , startRY = 62;
          } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
          //IE 4 compatible
          myWidth = document.body.clientWidth;
          myHeight = document.body.clientHeight;
          
          startLX = (myWidth/2) -545, startLY = 62;
              startRX = (myWidth/2) + 435 , startRY = 62;
          }
               
           startLX=startLX+5;
            var d = document;
            function ml(id)
            {
                var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
                el.sP=function(x,y){this.style.left=x+'px';this.style.top=y+'px';};
                el.x = startRX;
                el.y = startRY;
             
                return el;
            }
            function m2(id)
            {
                var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
                e2.sP=function(x,y){this.style.left=x+'px';;this.style.top=y+'px';};
                e2.x = startLX;
                e2.y = startLY;
                return e2;
            }
            window.stayTopLeft=function()
            {
             
             
          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;
          }
          pY=scrOfY;
          //   alert(scrOfY);
       
            startLY = 35;
            startRY = 35;
             
                ftlObj.y += (pY+startRY-ftlObj.y)/16;
                ftlObj.sP(ftlObj.x, ftlObj.y);
                ftlObj2.y += (pY+startLY-ftlObj2.y)/16;
                ftlObj2.sP(ftlObj2.x, ftlObj2.y);
                 setTimeout("stayTopLeft()", 1);
           
            }
           
            ftlObj = ml("divAdRight");
          
            //stayTopLeft();
            ftlObj2 = m2("divAdLeft");
            stayTopLeft();
        }
       
        function ShowAdDiv()
        {
            var objAdDivRight = document.getElementById("divAdRight");
          
          
            var objAdDivLeft = document.getElementById("divAdLeft");       
          objAdDivRight.style.display = "block";
          objAdDivLeft.style.display = "block";
          FloatTopDiv();
           
        }
       
        ShowAdDiv();



////-----------------


    function fcClose(id)
    {
        $("#" + id).html("");
    }
    
    $(document).ready(function () 
    { 
        if($(window).width() < 1000)
        {
            $("#divAdLeft").css("display","none");
            $("#divAdRight").css("display","none");
            
        }else
        {
            $("#divAdLeft").css("display","block");
            $("#divAdRight").css("display","block");
        }
       
    });
    
    $(window).resize(function() 
    {
        if($(window).width() < 1000)
        {
            $("#divAdLeft").css("display","none");
            $("#divAdRight").css("display","none");
        }else
        {
            $("#divAdLeft").css("display","block");
            $("#divAdRight").css("display","block");
        }
    
    });
