<html>
    <head> 
        <script type="text/javascript">
            function showKlub(str) {
                if (str == "") {
                    document.getElementById("klubHint").innerHTML = "";
                    return;
                }
                if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera
                    xmlhttp = new XMLHttpRequest();
                }
                else { // code for IE6, IE5 
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function() {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                        document.getElementById("klubHint").innerHTML = xmlhttp.responseText;
                    }
                }
                xmlhttp.open("GET", "klubovi.php?grad=" + str, true);
                xmlhttp.send();
            }

            function showGrad(str) {
                if (str == "") {
                    document.getElementById("gradHint").innerHTML = "";
                    return;
                }
                if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera
                    xmlhttp = new XMLHttpRequest();
                }
                else { // code for IE6, IE5 
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function() {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                        document.getElementById("gradHint").innerHTML = xmlhttp.responseText;
                        document.getElementById("klubHint").innerHTML = "";
                    }
                }
                xmlhttp.open("GET", "gradovi.php?zemlja=" + str, true);
                xmlhttp.send();
            }


        </script> 
    </head> 
    <body>

        <?php
        require_once("funk.inc.php");

        echo "<h1>Fudbalski klubovi Evrope</h1>";

        echo "Zemlja:";
        echo "<form name='forma1'> <select name='zemlje' onchange='showGrad(this.value)'>";
        zemljeUpit();
        echo "</select> </form> <br>";

        echo 'Gradovi: <div id="gradHint"><b>Informacije o gradovima ce biti prikazane ovde.</b></div>';

        echo 'Klubovi: <div id="klubHint"><b>Informacije o klubovima ce biti prikazane ovde.</b></div>';
        ?>
    </body>
</html>