<!DOCTYPE html>
<html>
<head>
    <title>Artesanos</title>

    <script src="jquery/dist/jquery.min.js">
    </script>


</head>
<body>

    <ons-toolbar>
        <div class="left">
            <ons-back-button>Back</ons-back-button>
        </div>
    </ons-toolbar>



    <script type="text/javascript">
    function getUrlVars() {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for(var i = 0; i < hashes.length; i++)
        {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    }

    nombre = decodeURIComponent(getUrlVars()["nombre"]);
    renglon = "json/MADERA.json";
    

    $.getJSON(renglon, function(json) {
        for (i = 0; i < json.length; i++) {
            if (json[i].Nombre == nombre) {
                break;
            }
        }

        console.log("entre a artesano.html...???");

        document.write("<h1 align='center'>" + json[i].Nombre + "</h1>");

        document.write("<h2 align='center'>" + json[i].Municipio + "</h1>");

        document.write("<h2 align='center'>" + json[i].Especificaciones + "</h2>");

        document.write("<a class='button' href='tel://" + json[i]["Teléfono 1"] + "'>" + "<h2 align='center'>" + json[i]["Teléfono 1"] + "</h2>" + "</a>");

        document.write("<a href='mailto:" + json[i]["E-mail"] + "'>" + "<h2 align='center'>" + json[i]["E-mail"] + "</h2>" + "</a>");



    });




    
    </script>

</body>
</html>