﻿

				
				// función que crea los adjuntos donde se le diga
function cajaAdjunto(ruta, nombrearchivo, divdestino) {
    var extension = nombrearchivo.substring(nombrearchivo.lastIndexOf("."));
    var nombreRuta = ruta + nombrearchivo;
    var nombreRutaMin100 = ruta + "min100_" + nombrearchivo;
    divdestino.html("");
    switch (extension) {
    case ".mp3":
        divdestino.append(nombrearchivo);
        divdestino.jmp3({
            showfilename: "false",
            showdownload: "true",
            backcolor: "ffffff",
            forecolor: "000000",
            width: 100,
            filepath: ruta
        });

        break;
    case ".png":
    case ".jpg":
    case ".gif":
        divdestino.append("<a target='_blank' href='" + nombreRuta + "'> <img src='" + nombreRutaMin100 + "' /></a>");
        break;
    case ".doc":
    case ".odt":
    case ".pdf":
    case ".rtf":
        divdestino.append("<a target='_blank' href='" + nombreRuta + "'> <img src='rebelarte/aplicacion/images/doc100.png' /></a>");
        break;
    case ".zip":
    case ".rar":
    case ".7z":
    default:
        divdestino.append("<a target='_blank' href='" + nombreRuta + "'> <img src='rebelarte/aplicacion/images/zip100.png' /></a>");
        break;

    };

    divdestino.prepend("<a class='enlace-adjuntos' target='_blank' href='" + nombreRuta + "'>" + nombrearchivo + "</a>");

};
function limpiar(text)
{  
  var text = text.toLowerCase(); // a minusculas

  text = text.replace(/[áàäâå]/g, 'a');
  text = text.replace(/[éèëê]/g, 'e');
  text = text.replace(/[íìïî]/g, 'i');
  text = text.replace(/[óòöô]/g, 'o');
  text = text.replace(/[úùüû]/g, 'u');
  text = text.replace(/[ýÿ]/g, 'y');
  text = text.replace(/[ñ]/g, 'n');
  text = text.replace(/[ç]/g, 'c');
  text = text.replace(/['"]/g, '');
  text = text.replace(/[^a-zA-Z0-9-]/g, ' '); //text = text.replace(/\W/g, ' ');
  text = text.replace(/\s+/g, '-');
  text = text.replace(/(_)$/g, '');
  text = text.replace(/^(_)/g, '');  

  return text;
}
(function ($) {
    $.fn.unUploadify = function () {

	this.next("#"+this.attr("id")+"Uploader").remove();
	this.css("display","inline");
	};
	
})(jQuery);

Object.size = function(obj) {
    var size = 0, key;
    for (key in obj) {
        if (obj.hasOwnProperty(key)) size++;
    }
    return size;
};
function emptyObject (object) {
for(var i in object) {
	delete object[i];
	};
};


function arrayLowerCase(arrayName){
var i=0;
for (i=0;i<=arrayName.length;i++){
arrayName[i] = arrayName[i].toLowerCase();

};

};











