var comefrom = document.referrer; var str = ""; document.write( str ); var welcomestr = ""; document.write(welcomestr); setInterval( "checkAvailable()", 60000 ); function checkAvailable() { var obj = document.getElementById( "livechatAvailable" ); if( obj ) { obj.src = "http://www.51chat.org//images/alive/livechat_1.jpg?id=" + new Date(); } var frameUrl = "/visit/visit.jsp?companyId=1&url=" + location.href + "&comefrom=" + comefrom + "&id=" + Math.random(); var livechatframe = document.getElementById( "livechatframe" ); if( livechatframe ) livechatframe.src = frameUrl; } function gohome() { window.open( 'http://www.51chat.org'); } function liveChat( url ) { if( !url ) url = location.href; window.open( "http://www.51chat.org//chat/customer.do?companyId=1&url=" + escape(url),null,"height=328,width=494,left=100,top=50,scrollbars=auto,status=no" ); nexttimeWelcome(); clearTimeout( ts ); } function acceptWelcome() { liveChat(); nexttimeWelcome(); } function nexttimeWelcome() { var obj = document.getElementById( "welcomeDiv" ); if( obj ) obj.style.display = "none"; } function getCookie(cookieName) { var cookieString = document.cookie; var start = cookieString.indexOf(cookieName + '='); if (start == -1) return null; start += cookieName.length + 1; var end = cookieString.indexOf(';', start); if (end == -1) return unescape(cookieString.substring(start)); return unescape(cookieString.substring(start, end)); } function welcome() { var welcomeDiv = document.getElementById( "welcomeDiv" ); var left = document.body.clientWidth / 2 - 200; var top = document.body.clientHeight / 2 - 100; if( left > 0 ) { welcomeDiv.style.left = left; welcomeDiv.style.top = top; } else { welcomeDiv.style.left = left; welcomeDiv.style.top = top; } welcomeDiv.style.display = "block"; } var ts = setTimeout( "welcome()", 30*1000 );