var pic='';
var pleft = 0;
var ptop = 0;
var incr = 0;
var bwidth = 0;
var show = 1;
function showpicture(file, bw, pos, mwidth) {
bwidth = bw;
picturediv = document.getElementById("bigpic");
pleft = pos.x;
ptop = pos.y;
if (navigator.userAgent.indexOf("MSIE 7.0")!=-1) { pleft -= 11; }
picturediv.style.left = pleft + 'px';
picturediv.style.top = ptop + 'px';
picturediv.innerHTML = "
Загружается...
";
bpic = new Image();
bpic.onload = function () {
document.getElementById("loading-pic").innerHTML = "";
pic.src = bpic.src;
}
bpic.src = file;
pic = document.getElementById("001");
pic.width = mwidth;
// pic.height = 60;
picturediv.style.display = "block";
increase();
}
function hidepicture() {
show = 0;
setTimeout('starthide()', 20);
}
function starthide()
{
if (show == 0)
{ document.getElementById("noshow").style.display = "none";
pic.width = pic.width - 10;
// pleft = pleft + 5;
// ptop = ptop + 5;
picturediv.style.left = pleft + 'px';
picturediv.style.top = ptop + 'px';
if (pic.width > 100)
setTimeout('starthide()', 0);
else picturediv.style.display = "none";
}
}
function increase() {
if ((pic.width + incr)>bwidth)
incr = (bwidth-pic.width);
else incr = 10;
pic.width = pic.width + incr;
// pleft = pleft - Math.round(incr/2);
// ptop = ptop - Math.round(incr/2);
picturediv.style.left = pleft + 'px';
picturediv.style.top = ptop + 'px';
if (pic.width < bwidth)
setTimeout('increase()', 0);
else
{ if (bpic.complete) pic.src = bpic.src;
document.getElementById("noshow").style.display = "block";
}
if (pic.width > 100) document.getElementById("loading-pic").style.display = "block";
}
function absPosition(obj) {
var x = y = 0;
while(obj) {
x += obj.offsetLeft;
y += obj.offsetTop;
obj = obj.offsetParent;
}
return {x:x, y:y};
}