/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function enviar(x, id)
{
    var id_registro = document.getElementById('id_registro');
    id_registro.setAttribute("value", id);
    var pagina = document.getElementById('pagina');
    pagina.setAttribute("value", x);

    if(confirm("Esta seguro que desea eliminar"))
    {
        var formulario = document.getElementById('tablaDatos');
        formulario.submit();
    }else
        return false;
}

function borrarTodo(nombreTabla,tipo)
{
    var tabla = document.getElementById('nombreTabla');
    var tipoa = document.getElementById('tipo');
    tabla.setAttribute("value", nombreTabla);
    tipoa.setAttribute("value", tipo);
       if(confirm("Esta seguro que desea eliminar"))
    {
        var formulario = document.getElementById('formTabla').submit();
    }else
        return false;
}

function crearPanel(textArea)
{
    window.onload = function()
    {
        panel = CKEDITOR.replace( textArea,
        {
            uiColor : '#EAEDF4',
            toolbar :[
            ['Source'],
            ['Undo','Redo','-','Find','SelectAll','Image','PageBreak'],
            ['Maximize', 'ShowBlocks'],
            ['Link','Unlink','Anchor'],
            ['Bold','Italic','Underline','Strike'],
            ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],			
            '/',
            ['Styles','Format','Font','FontSize'],
            ['TextColor','BGColor'],
            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']			
            ]
        });
        CKFinder.SetupCKEditor( panel, '../clases/CK_editor_and_finder/ckfinder/' );
    }
}

function BrowseServer(data)
{
    var finder = new CKFinder();
    finder.BasePath = '../clases/CK_editor_and_finder/ckfinder/';
    finder.SelectFunction = SetFileField;
    finder.SelectFunctionData = data;
    finder.Popup() ;
}

function SetFileField(fileUrl, data)
{
    document.getElementById(data['selectFunctionData']).value = fileUrl ;
}


//------------------------------- paginas de contenido ------------------------------
function mostrarCompleto(id)
{
    var ident = "#"+id+"_vinculo";
    $("#"+id+"_parrafo").slideToggle();
    if($(ident).attr('name') == "mas"){
        $(ident).attr('name','ocultar')
        $(ident).html("Ocultar");
    }else{
        $(ident).attr('name','mas')
        $(ident).html("Leer m&aacute;s");
    }
            
}
