function anadirCestaFoto(ref) {
     $.post("rsproyectos.php?controlador=Proyectos&accion=anadirJPG", {referencia: ""+ref+""}, function(elementos){
            if(elementos.length >0) {
                $("#cesta").text("Cesta (" + elementos + ")");
            }
        });
}
function eliminarRef(ref) {
     $.post("rsproyectos.php?controlador=Proyectos&accion=eliminarRef", {referencia: ""+ref+""}, function(elementos){
            if(elementos.length >0) {
                $("#cesta").text("Cesta (" + elementos + ")");
            }
			alert(elementos);
        });
 	document.location = "cesta.php?KeepThis=true&TB_iframe=true&height=400&width=500&modal=true";
}
function anadirCestaDxf(ref) {
     $.post("rsproyectos.php?controlador=Proyectos&accion=anadirDXF", {dxf: ""+ref+""}, function(elementos){
            if(elementos.length >0) {
                $("#cesta").text("Cesta (" + elementos + ")");
            }
        });
    
}
function anadirCatalogo(refers) {
     $.post("rsproyectos.php?controlador=Proyectos&accion=anadirCatalogo", {referencia: ""+refers+""}, function(elems){
            if(elems.length >0) {
                $("#micatalogo").text("Mi Catalogo (" + elems + ")");
            }
        });  
}

function actualizarContenido(){
	var valor = $("#familia").val();	
	document.location = "rsproyectos.php?controlador=Proyectos&accion=listarCatalogos&familia=" + valor;
}

function limpiarTexto(){
		document.getElementById('ref').value='';
}

function PonerTexto(){
//		document.getElementById('ref').value='N Referencia';
}		

function desplegarCesta(){
    if ($("#PANELTOOLCESTA").is(":hidden")) {
        $("#PANELTOOLCESTA").slideDown("slow");
        $("#PANELTOOLCESTA").show();
    } else {
        $("#PANELTOOLCESTA").hide();
    }
}
function mostrarImagen(imagen){
	$("#PRINCIPALENCABEZADO div").hide();
    $(("#"+imagen)).slideDown("fast");
}
function ocultarImagen(){
	$("#PRINCIPALENCABEZADO div").hide();
}
function ocultarEmpresa(){
	var act = $("#actividad").val();
	if (act == 'Particular') {
        $("#capaempresa").hide();
    } else {
        $("#capaempresa").show();
    }
}