\n'); } function closeI() { document.getElementById("overlay").style.display="none"; document.getElementById("LayerView").style.display="none"; } function Show2() { var ViewID = document.getElementById("LayerView"); ViewID.style.display=""; document.getElementById("overlay").style.display="block"; var v_top=(document.body.clientHeight-ViewID.clientHeight)/2+document.body.scrollTop; //alert(document.body.clientHeight); ViewID.style.top=v_top; } function doScroll() { var ViewID = document.getElementById("LayerView"); var v_top=(document.body.clientHeight-ViewID.clientHeight)/2+document.body.scrollTop; ViewID.style.top=v_top; } window.onscroll = doScroll // 当拉动滚动条时候调用doScroll函数定位LayerView的位置 function AdjustLayerPos() { var oLayer = document.getElementById('LayerView'); oLayer.style.top =Math.round((document.body.clientHeight - 374) / 2) + 'px'; oLayer.style.left = Math.round((document.body.clientWidth - 460) / 2) + 'px'; } window.onresize = AdjustLayerPos; window.onload = function() { var oOverlay = document.getElementById('overlay'); oOverlay.style.height = document.body.scrollHeight; oOverlay.style.width = document.body.scrollWidth; AdjustLayerPos(); } function TrunPic(obj) { var id = document.getElementById("ChangePic").src = "images/" +obj+".png"; } //-->