== as conditional operators ... = as assignments 
Code:
function show_chat() {
var chat = document.getElementById('chat_div'); // It is NOT 'chat' - your div is called 'chat_div'!!
if(chat.style.display == 'block') {
chat.style.display = 'none';
}
else if(chat.style.display == 'none') {
chat.style.display = 'block';
}
}
You can also make this more reusable ...
Code:
var ie = (document.all) ? true : false;
var moz = (document.getElementById) ? true : false;
function toggleDiv (divID) {
if (ie) {
document.all[divID].style.display = (document.all[divID].style.display == "block") ? "none" : "block";
}
if (moz) {
document.getElementById(divID).style.display = (document.getElementById(divID).style.display == "block") ? "none" : "block";
}
}
Code:
<button onclick="toggleDiv ('chat_div'); return false;">show chat</button>
<div id="chat_div">
Bookmarks