var oBookAppointment = null; var oLiveChat = null; var chatStatus = new Array(); oBookAppointment = new ChatObject(); oBookAppointment.init("book", "fr", ""); oBookAppointment.writeImage(); oLiveChat = new ChatObject(); oLiveChat.init("chat", "fr", ""); oLiveChat.writeImage(); // called onload of the check live chat images function updateStatus(sImageId) { var oImage = document.getElementById(sImageId); var blnReturn = false; blnReturn = (oImage.width > 1) ? true : false; chatStatus[sImageId] = blnReturn; checkLiveLinks(sImageId); } // check to see if Book an Appointment and Live Chat are online, disable if they aren't. function checkLiveLinks(sImageId) { if (sImageId.substr(0,4) == "book" && chatStatus[sImageId]) { $(".rbcbook").css("display","block"); } }