function zoom(srcfile) {
	var m = screen.availWidth/2;
	zw = window.open("","zoomwin","width=200,height=200,top=20,left=20,resizable=yes,location=no,scrollbars=no,status=no,toolbar=no,directories=no");
	zwdata = "<html><head><title>Компания Милфуд</title><script type='text/javascript'> function rwin() { self.resizeTo(document.images['imgfile'].width+12, document.images['imgfile'].height+80); var sleva = " + m + " - ((document.getElementById('imgfile').width)/2); self.moveTo(sleva,50); } </script></head><body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0' marginheight='0' marginwidth='0' onload='rwin()'><table border='0' cellpadding='0' cellspacing='0' width='100%' height='100%'><tr><td align='center'><a href='javascript:self.close()'><img id='imgfile' src=" + srcfile +" alt='закрыть окно' title='закрыть окно' border='0'></a></td></tr></table></body></html>";
	zw.document.open();
	zw.document.write(zwdata);
	zw.document.close();
}


function getElementPosition(elemId){
    var elem = document.getElementById(elemId);
	
    var w = elem.offsetWidth;
    var h = elem.offsetHeight;
	
    var l = 0;
    var t = 0;
	
    while (elem)    {
        l += elem.offsetLeft;
        t += elem.offsetTop;
        elem = elem.offsetParent;
    }

    return {"left":l, "top":t, "width": w, "height":h};
}
