var inW var inH var scrT var objImage var tinW var tinH function bigShow(pic) { object = document.getElementById("canc"); while (object.hasChildNodes()) { object.removeChild(object.firstChild); } if (window.innerWidth) { tinW=document.body.offsetWidth tinH=document.body.offsetHeight; } else { tinW=document.body.clientWidth tinH=document.body.clientHeight+document.body.scrollTop } if (window.innerHeight && window.scrollMaxY) {// Firefox tinW=document.body.offsetWidth tinH=document.body.offsetHeight; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac tinH = document.body.scrollHeight; tinW = document.body.scrollWidth; } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari tinH = document.body.offsetHeight; tinW = document.body.offsetWidth; } document.getElementById('transDiv').style.width=tinW+"px" document.getElementById('transDiv').style.height=tinH+"px" document.getElementById('transDiv').style.display="block" if (window.innerHeight) { inW = window.innerWidth-16; inH = window.innerHeight-16; } else if (document.body) { inW = document.body.offsetWidth-20; inH = document.body.offsetHeight-20; } scrT=dgetScrollTop() //alert(scrT) scrT=parseInt(scrT) leftX=(inW-10)/2 topX=inH/2-10/2+scrT document.getElementById('loading').style.left=leftX+"px" document.getElementById('loading').style.top=topX+"px" document.getElementById('loading').style.display="block" objImage = new Image(); objImage.src=pic objImage.id="test" objImage.onLoad=loadImage(); } function closeThis() { document.getElementById('transDiv').style.display="none" document.getElementById('loading').style.display="none" document.getElementById('canc').style.display='none' } function loadImage() { if (objImage.complete) { w=objImage.width h=objImage.height if (h+60>inH) { oldh=h h=inH-60 objImage.height=h koef=oldh/h w=w/koef objImage.width=w } leftX=(inW-w)/2-10 topX=inH/2-h/2+scrT-10 document.getElementById('canc').appendChild(objImage) document.getElementById('canc').style.left=leftX+'px' document.getElementById('canc').style.top=topX+'px' document.getElementById('loading').style.display='none' document.getElementById('canc').style.display='block' } else { setTimeout('loadImage()', 200) } } function dgetScrollTop(){ if (typeof window.pageYOffset != 'undefined') { position = window.pageYOffset } else if (typeof document.documentElement.scrollTop!= 'undefined' && document.documentElement.scrollTop > 0) { position = document.documentElement.scrollTop } else if (typeof document.body.scrollTop != 'undefined') { position = document.body.scrollTop } return position; } function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; }