$("#btProductos").click(function () {
    $("#barraCategorias").slideToggle(function () {
        if($.browser.msie && $.browser.version == '8.0'){
            $("#barraSubCategorias").show();
        }else{
            $("#barraSubCategorias").slideToggle();
        }
    })
    $("#btTQuirurgicaDiv").hide();
    $("#btCertificacionesDiv").hide();
    $("#btProductosDiv").show();
})

$("#btTQuirurgica").click(function () {
    $("#barraCategorias").slideUp(function () {
        $("#barraSubCategorias").slideUp();
    })
    $("#btProductosDiv").hide();
    $("#btCertificacionesDiv").hide();
    $("#btTQuirurgicaDiv").show();
    
    $.post("tq/tq1.php", { }, function(data){
        $("#contenedorTexto").html(data); 
        document.getElementById("cuerpo").style.backgroundImage='url(img/tq/aviosBg.jpg)';
        document.getElementById("cuerpo").style.height='auto';
        document.getElementById("contenedorTexto").style.height='auto';
});
});

$("#btCertificaciones").click(function () {
    $("#barraCategorias").slideUp(function () {
        $("#barraSubCategorias").slideUp();
    })
    $("#btProductosDiv").hide();
    $("#btTQuirurgicaDiv").hide();
    $("#btCertificacionesDiv").show();
    document.getElementById("cuerpo").style.backgroundImage='url(img/certificadosConFondo.jpg)';
    document.getElementById("cuerpo").style.height='545px';
    $("#contenedorTexto").html('');
})

$("#btContactenos").click(function () {
    $("#barraCategorias").slideUp(function () {
        $("#barraSubCategorias").slideUp();
    })
    $("#btProductosDiv").hide();
    $("#btCertificacionesDiv").hide();
    $("#btTQuirurgicaDiv").hide();
    
    $.post("contactenos.php", { }, function(data){
        $("#contenedorTexto").html(data); 
        document.getElementById("cuerpo").style.backgroundImage='url(img/contactenos/contactenos.jpg)';
        document.getElementById("cuerpo").style.height='480px';
});
});

function verCat(cual,bg,left){
    $("#barraCategorias").slideToggle();
    $("#btProductosDiv").show();
    $.post("textos/"+cual+".php", { }, function(data){
        $("#contenedorTexto").html(data);
    });  
    document.getElementById("cuerpo").style.backgroundImage='url(img/productos/'+bg+'.jpg)';
    document.getElementById("cuerpo").style.height='auto';
    document.getElementById("contenedorTexto").style.height='auto';
    document.getElementById("barraSubCategorias").style.visibility='hidden';
    document.getElementById("flechitaCategorias").style.marginLeft=left;

}

function verSubCat(subCat,left){
    if(subCat=='micro'){
        var botonesSubCat = '<span onclick="cierraMenu(\'MT2000F\',\'MT2000F\')">Micromotor 2000F</span> | <span onclick="cierraMenu(\'MT3000F\',\'MT3000F\')">Micromotor 3000F</span> | <span id="confProgramada">Micromotor 6000F</span>';
        var left = '78px';
    }
    if(subCat=='avios'){
        var botonesSubCat = '<span onclick="cierraMenu(\'avioPrimerCirugia\',\'aviosBg\')">Avio Primer Cirugia</span> | <span onclick="cierraMenu(\'avioSegundaCirugia\',\'aviosBg\')">Avio Segunda Cirugia</span> | <span onclick="cierraMenu(\'avioExpansionOsea\',\'aviosBg\')">Avio Expanción Osea</span>';
        var left = '210px';
    }
    if(subCat=='sistemaImplantes'){
        var botonesSubCat = '<span onclick="cierraMenu(\'sistemaImplantes3\',\'aviosBg\')">Implantes Serie 3</span> | <span onclick="cierraMenu(\'sistemaImplantes4\',\'aviosBg\')">Implantes Serie 4</span> | <span onclick="cierraMenu(\'sistemaImplantes5\',\'aviosBg\')">Implantes Serie 5</span> | <span onclick="cierraMenu(\'sistemaImplantes6\',\'aviosBg\')">Implantes Serie 6</span> | <span onclick="cierraMenu(\'caja\',\'aviosBg\')">Presentación</span>';
        var left = '380px';
    }
    if(subCat=='supra'){
        var botonesSubCat = 'Tipo Ucla (<span onclick="cierraMenu(\'destapeUclaCDI\',\'aviosBg\')">CDI</span> - <span onclick="cierraMenu(\'destapeUclaCDIR\',\'aviosBg\')">CDIR</span> - <span onclick="cierraMenu(\'destapeUclaCDIRT\',\'aviosBg\')">CDIRT</span>) | <span onclick="cierraMenu(\'destapeMunionCementable\',\'aviosBg\')">Muñon Cementable</span> | <span onclick="cierraMenu(\'destapeMunionCementableA\',\'aviosBg\')"> Muñon Cementable Antirrotacional</span> | <span onclick="cierraMenu(\'destapeMunionAngulado\',\'aviosBg\')"> Muñon Angulado</span> | <span onclick="cierraMenu(\'destapeBallAtach\',\'aviosBg\')"> Ball Atach</span>';
        var left = '665px';
    }
    if(subCat=='acces'){
        var botonesSubCat = '<span onclick="cierraMenu(\'accesoriosPrimerCirugia\',\'aviosBg\')">Accesorios Primer Cirugia</span> | <span onclick="cierraMenu(\'accesoriosSegundaCirugia\',\'aviosBg\')">Accesorios Segunda Cirugia</span> | <span onclick="cierraMenu(\'accesoriosDidacticos\',\'aviosBg\')">Accesorios Didácticos</span>';
        var left = '913px';
    }

if(subCat!=""){
    $("#barraSubCategorias").slideUp(function () {
        if($.browser.msie && $.browser.version == '8.0'){
            $("#barraSubCategorias").show();
        }else{
            $("#barraSubCategorias").slideDown();
        }
        $("#barraSubCategorias").html(botonesSubCat);
        document.getElementById("barraSubCategorias").style.visibility='visible';
        document.getElementById("flechitaCategorias").style.marginLeft=left;
    })
}else{
    $("#barraSubCategorias").html('');
    document.getElementById("barraSubCategorias").style.visibility='hidden';
    document.getElementById("flechitaCategorias").style.marginLeft=left;
}
}

function cierraMenu(cual,bg){
    $("#barraCategorias").slideToggle(function () {
        $("#barraSubCategorias").slideToggle();
    })
    $("#btProductosDiv").show();
    $.post("textos/"+cual+".php", { }, function(data){
        $("#contenedorTexto").html(data);
    });  
    document.getElementById("cuerpo").style.backgroundImage='url(img/productos/'+bg+'.jpg)';
    document.getElementById("cuerpo").style.height='auto';
    document.getElementById("contenedorTexto").style.height='auto';
}

$("#confProgramada").click(function () {
    $("#contenedorTexto").html('');
    document.getElementById("cuerpo").style.backgroundImage='url(img/productos/confProgramada.jpg)';
    document.getElementById("cuerpo").style.height='2400px';
    document.getElementById("contenedorTexto").style.height='auto';
    
    $("#barraCategorias").slideToggle(function () {
        if($.browser.msie && $.browser.version == '8.0'){
            $("#barraSubCategorias").hide();
        }else{
            $("#barraSubCategorias").slideToggle();
        }
    })
})
