function editor_html(id)
{
	var oFCKeditor = new FCKeditor(id) ;
	oFCKeditor.BasePath = base_url+"fckeditor/" ;
	oFCKeditor.Config["CustomConfigurationsPath"] = base_url+"newconfigfck.js"  ;
	oFCKeditor.ToolbarSet = 'page_edit';
	oFCKeditor.Height = '500px';
	oFCKeditor.ReplaceTextarea() ;
}
var send_flag =0;
function send_news(form){
    if(send_flag==0)
    {
        send_flag = 1;
         var REmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,3})+$/ ;
        if (form.mail.value.length < 1) alert('Preencha corretamente seu email!');
        else if ( !REmail.test(form.mail.value) ) alert('Preencha corretamente seu email!');
        else {
            J.ajax({
                url : base_url+'newsletter/send',
                type : "POST",
                data : "mail="+form.mail.value,
                dataType : "json",
                success  : function(data)
                {
                    if(data ==  'false_ip') alert('Você ja se cadastrou, aguarde um momento!');
                    else if (data == 'false') alert('Ocorreu um erro ao se cadastrar, aguarde um moment.');
                    else alert('Cadastro efetuado com sucesso!');
                }
            });
        }
    }
}

