function popup(p_url, p_name, p_w, p_h)
{
	w = window.open(p_url, p_name, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=' + p_w + ',height=' + p_h);
	w.focus();
}
function send_message(to_user)
{
	w = window.open('/popups/send_message.html?action=send&to=' + to_user, 'message', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,left=10,top=10,width=400,height=450');
	w.focus();
}

function mOvr(src, clOver)
{
	if (!src.contains(event.fromElement)) { src.style.cursor = 'hand'; src.className = clOver;}
}

function mOut(src, clIn)
{
	if (!src.contains(event.toElement)) { src.style.cursor = 'default'; src.className = clIn; }
} 

function mClk(src)
{
	if(event.srcElement.tagName=='TD') { src.children.tags('A')[0].click(); }
}

function setCheckboxes(the_form, the_cb, do_check)
{
	if (typeof(document.forms[the_form].elements[the_cb]) != 'undefined')
	{
		var elts = document.forms[the_form].elements[the_cb];
		var elts_cnt  = (typeof(elts.length) != 'undefined') 
			? elts.length
			: 0;
		
		if (elts_cnt)
		{
			for (var i = 0; i < elts_cnt; i++)
			{
				elts[i].checked = do_check;
			}
		} 
		else 
		{
			elts.checked        = do_check;
		}
	}
	return true;
}
