ask_div = document.getElementById('ask-chat-button');
if (ask_div) {
if (jabber_resources[0].show == 'available') {				
	update_div = document.createElement('a');
	update_div.setAttribute('href', '#');
	update_div.onclick = function() {
		window.open('http://libraryh3lp.com/chat/askuwlibrary@chat.libraryh3lp.com?skin=10121&amp;theme=jsf-text&amp;title=Ask%20a%20Librarian&amp;identity=librarian','chat','resizable=1,width=350,height=350'); 
		return false;
	}
	online_img = document.createElement('img');
	online_img.setAttribute('src', 'http://library.wisc.edu/images/chat-now.png');
	online_img.setAttribute('alt', 'Click here to chat now.');
	update_div.appendChild(online_img);
} else {				
	update_div = document.createElement('img');
	update_div.setAttribute('src', 'http://library.wisc.edu/images/chat-now-offline.png');
	update_div.setAttribute('alt', 'Chat is offline.');
}
ask_div.innerHTML = '';
ask_div.appendChild(update_div);
}
