
function intSportId_check() {

    var intSportId = $('intSportId').value;

    if ($('intNoDcId').checked == false) {
        if (intSportId > 0) {

            new Ajax.Request('skapasida-do-2.html', {
                method: 'post', parameters: 'intSportId=' + intSportId,
                onSuccess: function(transport) {
                    var response = transport.responseText || "no response text";

                    $('intDfId').update(response);
                    $('intDcId').update('<option value="">-- Välj först ett förbund --</option>');


                },
                onFailure: function() { alert('Ett fel har uppstått') }
            });

        }
        else {
            $('intDfId').update('<option value="">-- Välj först en sport --</option>');
            $('intDcId').update('<option value="">-- Välj först ett förbund --</option>');

        }
    }

}


function intDfId_check() {

    var intSportId = $('intSportId').value;
    var intDfId = $('intDfId').value;

    if (intDfId > 0) {

        new Ajax.Request('skapasida-do-3.html', {
            method: 'post', parameters: 'intSportId=' + intSportId + '&intDfId=' + intDfId,
            onSuccess: function(transport) {
                var response = transport.responseText || "no response text";
                $('intDcId').update(response);
            },
            onFailure: function() { alert('Ett fel har uppstått') }
        });
    }
    else {
        $('intDcId').update('<option value="">-- Välj först ett förbund --</option>');
    }
}

function intNoDcId_check() {
    if ($('intNoDcId').checked == true) {
        $('intDfId').update('<option value="">Ingen förening</option>');
        $('intDcId').update('<option value="">Ingen förening</option>');
    }
    else {
        intSportId_check();
    }
}



function intCountyId_check() {

    var intCountyId = $('intCountyId').value;

    if (intCountyId > 0) {


        new Ajax.Request('skapasida-do-4.html', {
            method: 'post', parameters: 'intCountyId=' + intCountyId,
            onSuccess: function(transport) {
                var response = transport.responseText || "no response text";

                $('intMunicipalityId').update(response);

            },
            onFailure: function() { alert('Ett fel har uppstått') }
        });

    }
    else {
        $('intMunicipalityId').update('<option value="">-- Välj först ett län --</option>');
    }

}

function popup(url, intWidth, intHeight) {
    window.open(url, "namn", "width=" + intWidth + ",height=" + intHeight + ",scrollbars=yes,status=no,toolbar=no,resizable=yes,location=no,menubar=no,directories=no")
}