/* [Функции - общие] */ /* Функция изменения загружаемой картинки */ var id_img = 0; function imgminimum(obj) {var imgmax = 90; // максимальный размер картинки var h = obj.height; var w = obj.width; if (h>imgmax||w>imgmax){if (h>w) {obj.height=imgmax}else {obj.height=imgmax}}; if (!obj.id){var scr=parent.chat.document.body; if(parent.chat.document.compatMode != 'BackCompat') scr=parent.chat.document.documentElement; scr.scrollTop=scr.scrollHeight; obj.id=id_img++;}} /* [Функция - вывода сообщений и команд] */ } if (text.split('src=tmp').length>1&&parent.chat.document.getElementById('kartinka').checked) {text=text.replace(/.br..img.src.(tmp.(.+\.jpg)).border.0..br./igm, "<a href=$1 onclick=\"parent.wo(this.href,'','690','500','yes');return false;\" target="+nick+"><img onload=parent.imgminimum(this) src=$1 border=0></a>");} else {text=text.replace(/.br..img.src.(tmp.(.+\.jpg)).border.0..br./igm, "<a href=$1 target=_blank><img src=http://mpchat.com/blank/img/ftp/img.gif border=0>$2</a>")};
if (document.images){ (function(){ var cos, a = /Apple/.test(navigator.vendor), times = a? 20 : 40, speed = a? 40 : 20; var expConIm = function(im){ im = im || window.event; if (!expConIm.r.test (im.className)) im = im.target || im.srcElement || null; if (!im || !expConIm.r.test (im.className)) return; var e = expConIm, widthHeight = function(dim){ return dim[0] * cos + dim[1] + 'px'; }, resize = function(){ cos = (1 - Math.cos((e.ims[i].jump / times) * Math.PI)) / 2; im.style.width = widthHeight (e.ims[i].w); im.style.height = widthHeight (e.ims[i].h); if (e.ims[i].d && times > e.ims[i].jump){ //alert(e.ims[i].w); ++e.ims[i].jump; e.ims[i].timer = setTimeout(resize, speed); } else if (!e.ims[i].d && e.ims[i].jump > 0){ --e.ims[i].jump; e.ims[i].timer = setTimeout(resize, speed); } }, d = document.images, i = d.length - 1; for (i; i > -1; --i) if(d[i] == im) break; i = i + im.src; if (!e.ims[i]){ im.title = ''; e.ims[i] = {im : new Image(), jump : 0}; e.ims[i].im.onload = function(){ if( e.ims[i].im.width > 700 || e.ims[i].im.height>700) if( e.ims[i].im.width > e.ims[i].im.height) { e.ims[i].im.height = e.ims[i].im.height*700/e.ims[i].im.width; e.ims[i].im.width = 700; } else { e.ims[i].im.width = e.ims[i].im.width*700/e.ims[i].im.height; e.ims[i].im.height = 700; } e.ims[i].w = [e.ims[i].im.width - im.width, im.width]; e.ims[i].h = [e.ims[i].im.height - im.height, im.height]; e (im); }; e.ims[i].im.src = im.src; return; } if (e.ims[i].timer) clearTimeout(e.ims[i].timer); e.ims[i].d = !e.ims[i].d; resize (); }; expConIm.ims = {}; expConIm.r = new RegExp('\\bexpando\\b'); if (document.addEventListener){ document.addEventListener('mouseover', expConIm, false); document.addEventListener('mouseout', expConIm, false); } else if (document.attachEvent){ document.attachEvent('onmouseover', expConIm); document.attachEvent('onmouseout', expConIm); } })(); }