
var elEditor;      // declaracion necesaria para el funcionamiento de la libreria editor.js


function negrita() {

    if(!_lector()) {
        _insertar(elEditor, '<b>'+prompt("Texto en negrita:", _lector())+'</b>');
    } else {
        _insertar(elEditor, '<b>'+_lector()+ '</b>');
    }

}

function cursiva() {

    if(!_lector()) {
        _insertar(elEditor, '<i>'+prompt("Texto en cursiva:", _lector())+'</i>');
    } else {
        _insertar(elEditor, '<i>'+_lector()+ '</i>');
    }
}

function subrayado() {

    if(!_lector()) {
        _insertar(elEditor, '<u>'+prompt("Texto subrayado:", _lector())+'</u>');
    } else {
        _insertar(elEditor, '<u>'+_lector()+ '</u>');
    }
}

function colortexto() {


    var capaColorTexto=document.getElementById("capaColorTexto");
    var capaColorTextoS=document.getElementById("capaColorTextoS");

    capaColorTexto.className="capaColorTexto";
    capaColorTextoS.className="capaColorTextoS";

    capaColorTexto.innerHTML="<table width=100% border=0 cellspacing=0 style=font-size:9pt;><tr><td width=100% align=center><b>Color de texto:</b></td></tr><tr><td width=100%><table width=120 border=0 align=center cellspacing=2 cellpadding=0><tr><td width=30 style=background-color:black; onclick=javascript:seleccionarColor('black');>&nbsp;</td><td width=30 style=background-color:blue; onclick=javascript:seleccionarColor('blue');>&nbsp;</td><td width=30 style=background-color:red; onclick=javascript:seleccionarColor('red');>&nbsp;</td><td width=30 style=background-color:green; onclick=javascript:seleccionarColor('green');>&nbsp;</td></tr><tr><td width=30 style=background-color:orange; onclick=javascript:seleccionarColor('orange');>&nbsp;</td><td width=30 style=background-color:purple; onclick=javascript:seleccionarColor('purple');>&nbsp;</td><td width=30 style=background-color:#730606; onclick=javascript:seleccionarColor('#730606');>&nbsp;</td><td width=30 style=background-color:#0F4507; onclick=javascript:seleccionarColor('#0F4507');>&nbsp;</td></tr><tr><td width=30 style=background-color:#88FF01; onclick=javascript:seleccionarColor('#88FF01');>&nbsp;</td><td width=30 style=background-color:#6ABCFF; onclick=javascript:seleccionarColor('#6ABCFF');>&nbsp;</td><td width=30 style=background-color:#7221FF; onclick=javascript:seleccionarColor('#7221FF');>&nbsp;</td><td width=30 style=background-color:#888888; onclick=javascript:seleccionarColor('#888888');>&nbsp;</td></tr></table></td></tr><tr><td width=100% align=right><table width=70% border=0 cellspacing=5 cellpadding=5 style=font-size:9pt;><tr><td width=100% align=center class=btnCnclr onmouseover='this.style.fontWeight=\"bold\";' onmouseout='this.style.fontWeight=\"normal\";' onclick=javascript:cancelar();>Cancelar</td></tr></table></td></tr></table>";

}

function seleccionarColor(color) {

    _insertar(elEditor, "<font color="+color+">"+_lector()+"</font>");

    var capaColorTexto=document.getElementById("capaColorTexto");
    var capaColorTextoS=document.getElementById("capaColorTextoS");

    capaColorTexto.className="";
    capaColorTexto.innerHTML="";
    capaColorTextoS.className="";

}

function cancelar() {
    var capaColorTexto=document.getElementById("capaColorTexto");
    var capaColorTextoS=document.getElementById("capaColorTextoS");

    capaColorTexto.className="";
    capaColorTexto.innerHTML="";
    capaColorTextoS.className="";
}

function enviarMarq() {
	var mensaje = document.getElementById("cmpmensaje");

	if(mensaje.value != "") {
		cargarContenidoPOST('guardarMarq.php', 'mensaje', 'admin');
	}
}

