function fullscreen()
{
  var fwidth =  document.documentElement.clientWidth;
  var fheight = document.documentElement.clientHeight;
  if(!elem.style.width){elem.style.width = "0px";}
  if(!elem.style.height){elem.style.height = "0px";}
  var xpos = parseInt(elem.style.width);
  var ypos = parseInt(elem.style.height);
  if(xpos >= fwidth && ypos >= fheight)
  {
    clearTimeout(ment);
    return true;
  }

  if(xpos < fwidth)
  {
    var dist = Math.ceil((fwidth - xpos)/5);
    xpos = xpos + dist;
  }

  if(ypos < fheight)
  {
    var dist = Math.ceil((fheight - ypos)/5);
    ypos = ypos + dist;
   }

  elem.style.width = xpos+"px";
  elem.style.height = ypos+"px";
  
  var mainAd =  document.getElementById('mainAd');
  mainAd.style.left = (xpos - parseInt(mainAd.style.width))/2 + 'px';
  mainAd.style.top = (ypos - parseInt(mainAd.style.height))/2 + 'px';

  ment = setTimeout("fullscreen()",30);
}

var flastScrollY = 0;
function scroll()//函数，对联动态春联
{
    var div = document.getElementById('again');
	var scrollY = document.documentElement.scrollTop;//得到竖的滚动条的间距
	var percent = 0.1*(scrollY - flastScrollY);//将每次变化数据为现有距离，减去已有数据，取这个数据的10%作为每次移动的距离
	
	//当percent == 0 的时候，就是对联不再动的时候，其实每秒都在动，只不过是静止的动

	if(percent > 0){ percent = Math.ceil(percent);}
	else{ percent = Math.floor(percent);}//取得整值

    div.style.top = parseInt(div.style.top)+percent;//将现有top距离加上取得的值
  	flastScrollY = flastScrollY + percent;//将每次取得的值记录起来
	
    var div1 = document.getElementById('again1');
	//当percent == 0 的时候，就是对联不再动的时候，其实每秒都在动，只不过是静止的动
    
    var div2 = document.getElementById('again2');
	//当percent == 0 的时候，就是对联不再动的时候，其实每秒都在动，只不过是静止的动
    

	if(percent > 0){ percent = Math.ceil(percent);}
	else{ percent = Math.floor(percent);}//取得整值

    div1.style.top = parseInt(div1.style.top)+percent;//将现有top距离加上取得的值
    div2.style.top = parseInt(div2.style.top)+percent;//将现有top距离加上取得的值
	
	div.mert = setTimeout("scroll()",10);//每毫秒移动一次
}

function click_close(a)
{
  var again = document.getElementById(a);
  again.style.display = 'none';
}

window.onload = function()
{
 scroll();
}