function DoChatBoxClickGXH(Chatdomian,UID) { var strUrlReferrer = location.href; var curProtocol = window.location.protocol.split(':')[0]; var chatUrl = Chatdomian+'/Chat/ChatIndex/' + UID + '?Weburl=' + strUrlReferrer; var u = navigator.userAgent; if (!!u.match(/AppleWebKit.*Mobile.*/)) { chatUrl = Chatdomian + '/Chat/MobileChatIndex/' + UID + '?Weburl=' + strUrlReferrer; } OpenChatBoxGXH(chatUrl); } function OpenChatBoxGXH(url) { var iHeight = 698; var iWidth = 980; if (window.screen.availWidth >= 1920) { iWidth = 980; iHeight = 740; } else if (window.screen.availWidth > 1599 && window.screen.availWidth < 1920) { iWidth = 790; iHeight = 620; } else if (window.screen.availWidth > 1439 && window.screen.availWidth < 1600) { iWidth = 710; iHeight = 620; } else if (window.screen.availWidth > 1365 && window.screen.availWidth < 1440) { iWidth = 670; iHeight = 530; } var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置; var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置; window.open(url, '_blank', 'height=' + iHeight + ', width=' + iWidth + ', top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no,resizable=no, location=no, status=no'); }