function openLiveChat(windowid, deptid){ var wleft = (screen.width - 580-32) / 2;var wtop = (screen.height - 420 - 96) / 2; window.open('http://www.livehelpnow.net/lhn/livechatvisitor.aspx?lhnid=28248&zzwindow=' + windowid + '&d=' + deptid, 'lhnchat', 'left=' + wleft + ',top=' + wtop +',width=580,height=435,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes'); } $(function () { $('.chatbox').on('click', function () { openLiveChat(31716, 35179); }); $('.quotebox').on('click', function () { openLiveChat(34085, 35415); }); });