﻿// JScript 文件

//常数定义    
  self.onError = null;          
  currentX = currentY   =   0;          
  whichIt = null;          
  lastScrollX = 0;   //最后离左边距离的负值  
  lastScrollY = 0;   //最后离顶部的高度的负值  
       
  //----------------------start   fun秒执行一次  
  //根据想显示几张图片，调用不同参数函数      
  //function   heartBeat(id1)   
   function   heartBeat(id2)  
  //function   heartBeat(id1,id2)
  {  
  
      if (document.all)
      {
         if (!document.documentElement.scrollLeft)
            diffX = document.body.scrollLeft;
         else
            diffX = document.documentElement.scrollLeft;
               
         if (!document.documentElement.scrollTop)
            diffY = document.body.scrollTop;
         else
            diffY = document.documentElement.scrollTop;
      }   
      else
      {
         diffX = window.pageXOffset;
         diffY = window.pageYOffset;
      }     
      //定时调整Y坐标
      if(diffY   !=   lastScrollY)   {          
      percent   =   .1   *   (diffY   -   lastScrollY);          
      if(percent   >   0)   percent   =   Math.ceil(percent);          
      else   percent   =   Math.floor(percent);          
      //id1.style.pixelTop   +=   percent;  
      id2.style.pixelTop   +=   percent;        
      lastScrollY   =   lastScrollY   +   percent;          
      }     
      //定时调整X坐标
      if(diffX   !=   lastScrollX)   {          
      percent   =   .1   *   (diffX   -   lastScrollX);          
      if(percent   >   0)   percent   =   Math.ceil(percent);          
      else   percent   =   Math.floor(percent);          
      //id1.style.pixelTop   +=   percent;  
      id2.style.pixelTop   +=   percent;              
      lastScrollX   =   lastScrollX   +   percent;          
      }          
  }          
  //-----------------------end   fun  
  scr=screen.width  
  left_1=(scr>800)?10:145  
  //right_1=(scr>800)?880:580  
  right_1=(scr>800)?1050:580  
  //左侧图片  
  //document.write("<DIV   id=f1   style='left:   "+left_1+"px;   top:   100px;   POSITION:   absolute;z-index:2'><a   href=../PlanInvestigate/default.asp   target=_blank title=大连市城市总体规划调查2008-2020社会调查><img   src=../images/ad/ghad.gif   border=0   width=180   height=120 ></a></div>")  
   
 //右侧图片 宣传图片
 //document.write("<DIV   id=f2   style='left:   "+right_1+"px;   top:  10px;   POSITION:   absolute;z-index:999'> <img   src=../images/ad/ad.jpg   border=0   width=70   height=530 ></div>")  
  
  //document.write("<DIV   id=f2   style='left:   "+right_1+"px;   top:   215px;   POSITION:   absolute;'><a   href=../PlanInvestigate/default.asp   target=_blank><img   src=../images/ad/ghad.gif    border=0   width=150   height=47></a></div>")  
   
  //根据具体显示几张图片，决定调用哪个函数
  //action   =   window.setInterval("heartBeat(f1,f2)",50);     
  //action = window.setInterval("heartBeat(f1)",50);   
  //action = window.setInterval("heartBeat(f2)",50);   