<!-- ;
function check_contact ()
{
	var theForm = document.forms['contact'];
	if (!theForm.elements['name'].value) { alert("Você deve informar seu nome!"); return false; }
	if (!theForm.elements['email'].value) {	alert("Você deve informar seu e-mail!"); return false; }
	if (!/[A-Za-z0-9_.-]+@([A-Za-z0-9_]+\.)+[A-Za-z]{2,4}/.test(theForm.elements['email'].value)) { alert("O e-mail informado é inválido!"); return false; }
	if (theForm.elements['topic'].value == '') { alert("Você deve selecionar um assunto!"); return false; }
	if (!theForm.elements['message'].value) { alert("Você deve digitar uma mensagem!"); return false; }
	theForm.elements['btnSub'].disabled = true;
	return true;
}
function check_reg ()
{
	var theForm = document.forms['register'];
	theForm.elements['btnSub'].disabled = true;
	return true;
}
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
function rm_join_check ()
{
	var theForm = document.forms['join'];
	if (!theForm.elements['nick'].value) { alert("Você deve informar um nick."); return false; }
	return true;
}
function change_url (obj)
{
	var URL = obj.options[obj.selectedIndex].value;
	if (URL) window.location.href = URL;
}
function opn_opt () 
{
	opt_window = window.open('/chatroom/options/','opt_window','toolbar=0,scrollbars=1,height=420px,width=430px,top=0'); opt_window.focus();
}
function opn_coc ()
{
	coc_window = window.open('/conduct/win/', 'coc_win','toolbar=0,scrollbars=1,height=470px,width=500px,top=0'); coc_window.focus();
	//window.showModalDialog("/index.php/conduct_win.html",window,"status:0;help:0;center:1;resizable:0;dialogHeight:470px;dialogWidth:500px");
}
function addToFavorites() {

 title = "Brasil Chat"; 
 url = (document.location.href?document.location.href:'http://chat.millenares.com');
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
}
function CreateFavoritesLink(b,text,a) {
	if (window.external) {
	  document.write(b+'<a href="#" onclick="addToFavorites(); return false;">'+text+'</a>'+a); 
	  } else  if (window.sidebar) {
	  document.write(b+'<a href="#" onclick="addToFavorites(); return false;">'+text+'</a>'+a); 
	 } else if (window.opera && window.print) {	
	  document.write(b+'<a href="#" onclick="addToFavorites(); return false;">'+text+'</a>'+a); 
	 } 
}

function myChatsAdd(rm) {
	//ajax_load('/accounts/mychats?action=mng', '_blank', 'post', 0, myChatsParse, 'room='+rm);
	/*$j.ajax(
	{
		url:'/accounts/mychats?action=mng',
		data:{r:'ajax',rm:rm},
		dataType:'json',type:'post',
		success:function(x,y) {
			if (x.response.code == 1)
				$("mychats").className = x.response.status;
			else
				alert(x.response.message);
		},
		error:function(x,y,z) { alert("Error: "+x+y); }
	});*/
	if ($j == undefined) { alert("Não foi possível executar a ação solicitada."); return; }
	$j.getJSON('/profile/me/chats?action=mng',{r:'json',rm:rm},function(x) {
			if (x.response.code == 1)
				$j("#mychats")[0].className = x.response.status;
			else
				alert(x.response.message);
		}
	);
}
