
function isFormCompleted(siteIndex)
{
    var mandatoryList = new Array();
    var ok = true;
    
    if ( siteIndex==1 )
    {
        // personal information
        mandatoryList = new Array("firstname", "name", "city", "street" );
    }
    
    if ( siteIndex==2 )
    {
        mandatoryList = new Array("q51","q52","q53","q54","q55","q56","q57","q58","q59","q60","q62" );
    }
    if ( siteIndex==6)
    {
        mandatoryList = new Array("q97","q98" );
        bSet = true;
        for (i=0; i<mandatoryList.length; i++)
        {
            // yes/no, if the third (index #2) is checked, it is not a valid mandatory entry (=keine Angabe)
            if (! ( document.forms[0].elements[ mandatoryList[i] ].item(0).checked || document.forms[0].elements[ mandatoryList[i] ].item(1).checked ))
            {
                bSet = false;
            }
        }
        if ( !bSet ) ok = false;
    }

    for (i=0; i<mandatoryList.length; i++)
    {
        if ( document.forms[0].elements[ mandatoryList[i] ].length > 1 )
        {
            var bSet = false;
            for (j=0; j<document.forms[0].elements[ mandatoryList[i] ].length; j++)
            {
              if ( document.forms[0].elements[ mandatoryList[i] ].item(j).checked ) {  bSet = true; }
            }
            if ( !bSet ) { ok = false; }
        }
        else
        {
            valu = document.forms[0].elements[ mandatoryList[i] ].value;
            
            if ( valu == "" )
            {
                ok = false;
            }
        }
    }

    if ( !ok )
    {
        alert("Bitte füllen Sie alle mit * markierten Felder aus.");
    }

    return ok;
}


function openPopupWindow( name, link )
{
 wnd = window.open(link, name, "left=300,top=100,width=400,height=500,status=yes,scrollbars=yes,resizable=no");
 wnd.focus();
}

