// JavaScript Document
var loggedIn = false;

function available()
{
		document.getElementById('im_yes').style.display = 'block';
		document.getElementById('im_no').style.display = 'none';
}

function notAvailable()
{
 	document.getElementById('im_no').style.display = 'block';
 	document.getElementById('im_yes').style.display = 'none';
}

function openChat()
{
	xmlHttp = false;
 
 // branch for native XMLHttpRequest object
 if (window.XMLHttpRequest) {
   try {
		 xmlHttp = new XMLHttpRequest();
     boolNativeObj = true;
   } catch (e) {
			xmlHttp = false;
   }
 // branch for IE/Windows ActiveX version
 } else if (window.ActiveXObject) {
 	 try {
     xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
  	 try {
  		 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
     } catch (e) {
   	   xmlHttp = false;
     }
	 }
 }
 
 if (xmlHttp) {
   var boolAsynchronous = true;

   xmlHttp.open("GET", "/IMChat.aspx", boolAsynchronous);
   xmlHttp.onreadystatechange=openChatWindow;
   xmlHttp.send(null);
 } 
}

function openChatWindow()
{
  var newwin = window.open("http://admin.instantservice.com/servlet/Customer?ai=5892&di=14641","custclient","width=500,height=350,scrollbars=0");
  newwin.focus();
 }