setTimeout("startExChat();", 1000); var updateExChatValue = 0; var wasClosed = false; function startExChat() { window.document.getElementById('indFrame').src = 'http://res.videochatdemo.com/externalChat.php?giveOnline=89467279'; window.document.getElementById('indDiv').innerHTML = ""; setTimeout("exChat_continueLoad();", 5000); } function exChat_continueLoad() { var online = (window.document.getElementById('indImageHidden').width > 1); //alert(online); if (online) { window.document.getElementById('indPic').src = "http://res.videochatdemo.com/images/livehelp.gif"; var closedBefore = exChat_getCookie(); if (wasClosed == false && closedBefore == null) { //alert("wasClosed: " + wasClosed + ", closedBefore: " + closedBefore); setTimeout("placeFloatChat();", 0); } } else { window.document.getElementById('indPic').src = "http://res.videochatdemo.com/images/livehelpOff.gif"; hideFloatChat(); } updateExChatValue = setTimeout("startExChat();", 10000); } function placeFloatChat() { if (window.document.getElementById("chatContainer").style.display == "none") { window.document.getElementById("chatContainer").style.display = ""; window.document.getElementById('extChat').innerHTML = ''; // windowID,tabs,windowHeight,windowWidth,leftPos,topPos,noScrollbars,noResize,noStatusBar,noCloseButton,noMinimizeButton initFloatingWindowWithTabs('extChatContainer',Array('blabla'),310,680,200,100,true,false,false,false,true); } } function closeFloatChat() { exChat_setCloseCookie(); hideFloatChat(); wasClosed = true; } var cookieName = "exChatWasClosed"; var cookieValue = "true"; function exChat_setCloseCookie() { var curCookie = cookieName + "=" + cookieValue; document.cookie = curCookie; //alert("cookie closed"); } function exChat_getCookie() { var prefix = name + "="; var cookieStartIndex = document.cookie.indexOf(prefix) if (cookieStartIndex == -1) { //alert('null'); return null } var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length); if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length; //alert(unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))); return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)); } function hideFloatChat() { window.document.getElementById("extChat").innerHTML=""; window.document.getElementById("chatContainer").style.display = "none"; }