connid = 0; function flashchat_DoFSCommand() { } function setFocus() { window.focus(); var chatui = document.getElementById('flashchat'); if(chatui && chatui.focus) chatui.focus(); } function doLogout() { if(connid == 0) return; width = 220; height = 30; wleft = (screen.width - width) / 2; wtop = (screen.height - height) / 2 - 20; window.open("dologout.php?id=" + connid, "logout", "width=" + width + ",height=" + height + ",left=" + wleft + ",top=" + wtop + ",location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no"); } function setConnid(newconnid) { connid = newconnid; } //------------------------------------------------------------------------------------------------ ////add 19.09.2007 ajax logout flashchat(close browser, refresh) //------------------------------------------------------------------------------------------------ function SendLogout(index,rand) { if(index==0) { var data = "rand=" + rand + "&id=" + connid; } else { var data = "rand=" + index; } // Firefox, Opera 8.0+, Safari var xmlHttp = null; if (window.XMLHttpRequest) { //создание объекта для всех браузеров кроме IE xmlHttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { //для IE xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); if (!xmlHttp) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { //document.myForm.time.value=xmlHttp.responseText; } if(xmlHttp.readyState == 1) { } } xmlHttp.open("POST","ajax_logout.php?" + data,true); xmlHttp.send(data); } function SendClose() { if(connid == 0) return; var my_rand = Math.floor(Math.random()*10000000000); if( window.XMLHttpRequest ) { for(var i=0 ; i < 300 ; i++ ) SendLogout(i,my_rand); } else { SendLogout(0,my_rand); } } window.onload = setFocus; window.onunload = SendClose;//doLogout; //------------------------------------------------------------------------------------------------ ////add 19.09.2007 ajax logout flashchat(close browser, refresh) //------------------------------------------------------------------------------------------------ //------------------------------ //---open share file window //------------------------------ var win_popup = null; function openWindow( url, name, params, w, h ) { var ah = window.screen.availHeight; var aw = window.screen.availWidth; var l = (aw - w) / 2; var t = (ah - h) / 2; params += params == "" ? "" : ","; params += "left="+l+",top="+t+",screenX="+l+",screenY="+t+",height="+h+",width="+w+",resizable=yes,status=yes,scrollbars=no"; //close previous opened popup if (win_popup && win_popup.open && !win_popup.closed) { win_popup.close(); } //--- win_popup = window.open( "", name, params ); win_popup.location.href = url; } //--- end open window function /* function fileDownload(fname) { if(window.frames['dataframe'].window && fname) { window.frames['dataframe'].window.location.href = fname; } else { alert('File download error.'); } }*/