﻿// JScript 文件 
// 备案图片显示
var shieldCollection;
var deltaSpace = 0.8;
var TopSpace = 4;   //上端位置

function makeShield()
{
	this.shields = new Array;
}
makeShield.prototype.insertShield =  function(id,left,top,divInnerHtml,index)
{   
    document.write('<DIV id='+id+' style="Z-INDEX: 20; POSITION: absolute; width:45px; height:45px;left:'+(typeof(left)=='string'?eval(left):left)+';top:'+(typeof(top)=='string'?eval(top):top)+'">'
                 +'<div align="center">' +divInnerHtml+'</div></DIV>');
	var shieldItem = {};
	shieldItem.shield = document.getElementById(id);
	shieldItem.left = left;
	shieldItem.top = top;
	shieldItem.index =index;
	this.shields[this.shields.length]	= shieldItem;	
}
makeShield.prototype.playShield = function()
{
    shieldCollection = this.shields;
    setInterval("playShield()",10);  
}
function playShield()
{
	if(screen.width <= 800)
	{
		for(var index =0;index < shieldCollection.length;index ++)
	    {
	    	shieldCollection[index].shield.style.display ="none";
	    } 
		return;
	}
	for(var index =0 ; index < shieldCollection.length;index++)
    {
       if(shieldCollection[index].index==-1)
          continue;
    	var shield = shieldCollection[index].shield;
    	var left = typeof(shieldCollection[index].left)=="string"?eval(shieldCollection[index].left):shieldCollection[index].left;
    	var top = typeof(shieldCollection[index].top)=="string"?eval(shieldCollection[index].top):shieldCollection[index].top;
    	if(shield.offsetLeft !=(document.body.scrollLeft+left))
    	{
    		var dx =(document.body.scrollLeft+left-shield.offsetLeft)*deltaSpace;
    		dx =(dx>0?1:-1)*Math.ceil(Math.abs(dx));
    		shield.style.left =(shield.offsetLeft +dx)+"px";
    	}
        shield.style.top =document.documentElement.scrollTop+TopSpace+"px";;
    	shield.style.display="";
    }
}



