
function FinCargarArchivo_SemCms(data) {
    if (navigator.appName == 'Microsoft Internet Explorer' || navigator.userAgent.indexOf('Safari') != -1) {
        $('#divContArchiInicio').css('display', 'none');
        //$('#fuExaminarSemCms' ).val('');
    }

    var nombreDoc = $('input[type="file"]').val();
    var extensionDoc = nombreDoc.substr(nombreDoc.lastIndexOf('.'));

	//FUNCION PARA CALCULAR TAMANIO
	var input = $('#fuExaminarSemCms');
	var tamBytes = input[0].files[0].size;
	$('.cont_file_size input').val(tamBytes);
	
	////////////////////
    OcultarUpdateProgress();
    OcultarLoadingArchivo();
    $('#fuExaminarSemCms').val('');

    var docID = documentoID;
    
    if (docID == null || docID == '') {
        docID = document.URL.substring(0, document.URL.lastIndexOf('/'));
        docID = docID.substring(docID.lastIndexOf('/') + 1);
    }
    var txtHackID = 'txtHackArchivoSelecc';
    var idCampoControl = $('#' + txtHackID).val().split('|')[0];
    var entProp = ObtenerEntidadPropiedadSegunID(idCampoControl, TxtRegistroIDs);
    var docRecExtID = GetDocRecExtSelecEntEditable(entProp[0], entProp[1], true);

    if (docRecExtID != null) {
        docID = docRecExtID;
    }

    if (!formSemVirtual) {
        var rutaImg = 'imagenes/Documentos/imgsem/';
        var rutaVideosSem = 'VideosSemanticos/';
        var rutaDocLinks = 'doclinks/';

        var datosJCrop = GetCaracteristicaPropiedad(entProp[0], entProp[1], TxtCaracteristicasElem, 'UsarJcrop');
        if (datosJCrop != null) {
            var txtHack = $('#' + txtHackID).val();
            var fileUpload = txtHack.split('|')[1];
            var elementoID = txtHack.split('|')[2];

            var urlContent = $('input.inpt_baseURLContent').val();

            var valorProp = urlContent + '/' + rutaImg + "temp/" + docID.substring(0, 2) + '/' + docID.substring(0, 4) + '/' + docID + '/' + elementoID + extensionDoc;

            valorProp = valorProp + '?v=' + Math.round(Math.random() * 10000);

            var idCampoControl = txtHack.split('|')[0];
            var entProp = ObtenerEntidadPropiedadSegunID(idCampoControl, TxtRegistroIDs);

            MontarJCROP($('#panContenedorJcrop'), valorProp, entProp[1] + ',' + entProp[0], docID, datosJCrop);
        }
        else {
            AgregarArchivoComoPropiedad(txtHackID, docID, 'txtHackValorImgRepresentante', rutaImg, rutaVideosSem, rutaDocLinks, data, extensionDoc);
        }
    }
    else {
        var ontologiaID = document.URL.substring(document.URL.lastIndexOf('/') + 1);
        AgregarArchivoComoPropiedad('txtHackArchivoSelecc', docID, 'txtHackValorImgRepresentante', 'documentosvirtuales/' + ontologiaID + '/', 'documentosvirtuales/' + ontologiaID + '/', 'documentosvirtuales/' + ontologiaID + '/', data, extensionDoc);
    }

    if ((typeof CompletadaCargaSubidaArchivo_SemCms != 'undefined')) {
        CompletadaCargaSubidaArchivo_SemCms();
    }
}







