/* popup window */ function chatOpenPopup(url, name, nw, nh) { var w_w = nw ? nw : 750, w_h = nh ? nh : 500; var w = window.open(url, name, 'width=' + w_w + ',height=' + w_h + ',location=1,status=1,resizable=yes,scrollbars=1'); var coords = getCenteredCoords(w_w, w_h); var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; if (is_chrome) setTimeout(function() { try {w.moveTo(coords[0],coords[1]);} catch(err) {} }, 100); else try {w.moveTo(coords[0],coords[1]);} catch(err) {} return false; }; function getCenteredCoords(width, height) { var xPos = null; var yPos = null; var parentSize; var parentPos; if (window.ActiveXObject) { parentSize = [document.documentElement.clientWidth, document.documentElement.clientHeight]; parentPos= [window.screenLeft, window.screenTop]; } else { parentSize = [window.outerWidth, window.outerHeight]; parentPos= [window.screenX, window.screenY]; } xPos = parentPos[0] + Math.max(0, Math.floor((parentSize[0] - width) / 2)); yPos = parentPos[1] + Math.max(0, Math.floor((parentSize[1] - (height*1.25)) / 2)); return [xPos, yPos]; }; document.write(''); document.write('
Сейчас в чате 0 чел.