function addFavorite(url, title) { if (!url) url = location.href; if (!title) title = document.title; if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, ""); else if (typeof window.external == "object") window.external.AddFavorite(url, title); else if (window.opera && document.createElement) { var a = document.createElement('A'); if (!a) return false; a.setAttribute('rel','sidebar'); a.setAttribute('href',url); a.setAttribute('title',title); a.click(); } } function o_i ($file, $width, $height) { window.open("/file.php?img="+$file,'Tip','menubar=no,location=no,toolbar=no,resizable=no,scrollbars=no,status=no,width='+$width+',height='+$height+''); } function goFromLeftToRight(_id, _xFinish, _sm, _pos) { _this = document.getElementById(_id); _xTo=parseInt(_xFinish)+parseInt(_sm); _x=_this.offsetLeft+(_sm)/100*50; _xFinishIf=_xTo-parseInt(4); if (_x > document.body.offsetWidth) { clearTimeout(m); backToStart(_this); } else if (_x <= _xFinishIf) { _this.style.left=_x; m=setTimeout("goFromLeftToRight(\""+_id+"\",\""+_xFinish+"\",\""+_sm+"\",\""+_pos+"\")", 1); } else { _this.style.left=_xTo; clearTimeout(m); if (_sm > 1 ) { _sm=_sm/100*50; goFromRightToLeft(_id, _xFinish, _sm, _pos); } else { galaryHidden(); } } } function backToStart(_this) { galaryHidden(); _this.style.visibility="hidden"; _this.style.left="-100%"; } function goFromRightToLeft(_id, _xFinish, _sm, _pos) { _this = document.getElementById(_id); _xTo=parseInt(_xFinish)-parseInt(_sm); _x=_this.offsetLeft-(_sm)/100*50; _xFinishIf=_xTo+parseInt(4); if (_x > document.body.offsetWidth) { clearTimeout(m); backToStart(_this); } else if (_x >= _xFinishIf) { _this.style.left=_x; m=setTimeout("goFromRightToLeft(\""+_id+"\",\""+_xFinish+"\",\""+_sm+"\",\""+_pos+"\")", 1); } else { _this.style.left=_xTo; clearTimeout(m); if (_sm > 1 ) { _sm=_sm/100*50; goFromLeftToRight(_id, _xFinish, _sm, _pos); } else { galaryHidden(); if (_pos == "start") { _this.style.left="-100%"; } } } } function hidImg(_id) { galaryShow("", _hidImg_height); _this = document.getElementById(_id); _objWidth = _this.offsetWidth; _objHeight = _this.offsetHeight; _xCenter = document.body.offsetWidth/2; _yCenter = document.body.offsetHeight/2; _xFinish = _xCenter-_objWidth/2; _yFinish = _yCenter-_objHeight/2; _xStart = _this.offsetLeft; _yStart = _this.offsetTop; goFromLeftToRight(_id, _xCenter*2, 100, "start"); } function showImg(_id, _img, _src, _width, _height) { _hidImg_height=_height; _this = document.getElementById(_id); _this.style.visibility="visible"; _thisImg = document.getElementById(_img); _thisImg.src=_src; _thisImg.width = _width; _thisImg.height = _height; _xCenter = document.body.offsetWidth/2; _yCenter = document.body.offsetHeight/2; _objWidth = _this.offsetWidth; _objHeight = _this.offsetHeight; _xFinish = _xCenter-_objWidth/2; _yFinish = _yCenter-_objHeight/2; _xStart = _this.offsetLeft; _yStart = _this.offsetTop; _top=document.body.scrollTop+_yCenter-_height/2; _tWindow = document.getElementById("tWindow"); _tWindowY =_tWindow.offsetTop; _tImage = document.getElementById("tImage"); _tImageY=_tImage.offsetTop+_top; if (_tImageY > _tWindowY) _top=_top-(_tImageY-_tWindowY)/100*250; if (_top < 0) _top=0; if (_xFinish < 0) _xFinish=0; galaryShow(_top, _height); goFromLeftToRight(_id, _xFinish, 100, ""); } function galaryShow(_top, _height) { _galary = document.getElementById("galary"); if (_top) _galary.style.top=_top; if (_height) { _height=_height/100*130; _galary.style.height=_height; } _galary.style.overflow="hidden"; } function galaryHidden() { _galary = document.getElementById("galary"); _galary.style.height=1; _galary.style.overflow="visible"; }