    // *************** GOLI.AT ******************
    //
    //   Script � by DI Philipp Michael Metzler
    //          URL: http://www.goli.at
    //
    // *************** GOLI.AT ******************

    myFilepath = '/fileadmin/images/';

    function ChangeOver(object)
    {
        tmp = document.getElementById(object);
        tmp.src = myFilepath + 'de_' + object + '-over.gif';
//        document[object].src = 'images/'+object+'_on.gif';
    }

    function ChangeOut(object)
    {
        tmp = document.getElementById(object);
        tmp.src = myFilepath + 'de_' + object + '-normal.gif';
//        document[object].src = 'images/'+object+'_off.gif';
    }

    function ChangeObject(object, picture)
    {
        tmp = document.getElementById(object);
        tmp.src = myFilepath + picture;
//        alert(tmp.src);
//        document[object].src = 'images/'+picture;
    }

    function openWindow(theURL, winName, features)
    { //v2.0
        window.open(theURL, winName, features);
    }

    // JS function for uncrypting spam-protected emails:
    function myUnCryptMailto(s)
    {
        var n = 0;
        var r = "";
        for(var i = 0; i < s.length; i++)
        {
            n=s.charCodeAt(i);
            if (n >= 8364)
            {
                n = 128;
            }
            r += String.fromCharCode(n-(2));
        }
        return r;
    }

    // JS function for uncrypting spam-protected emails:
    function linkTo_myUnCryptMailto(s)
    {
        location.href = myUnCryptMailto(s);
    }



    var myFormErrors = new Array();
    var myCountFormErrors = 0;
    var mySpecialCountFormErrors = 0;

    function chkFormular()
    {
        myCountFormErrors = 0 + mySpecialCountFormErrors;

        elementFormSent = document.getElementById("FormSent");
        elementFormSent.style.display = 'none';

        elementFormError = document.getElementById("FormError");

        for ( myKey in myFields )
        {
            myTmp = eval('document.' + myFormName + '.' + myKey + '.value');

            if (myTmp == '')
            {
                myFormErrors[myKey] = 'Bitte f&uuml;llen Sie dieses Feld aus: "' + myFields[myKey] + '"';
                myCountFormErrors += 1;
            }
            else
            {
                myFormErrors[myKey] = null;
            }
        }

        if (myCountFormErrors > 0)
        {
//            elementFormErrorText = document.getElementById("FormErrorText");
//            elementFormErrorText.firstChild.nodeValue = myFormError;
//            elementFormErrorText.innerHTML = myFormError;
/*
                document.userData.street.focus();
                scrollBy(0, -20);
*/

            elementFormError.innerHTML = '';

            elementFormError.style.display = '';

            var myDisplayFormErrors = '<table cellpadding="0" cellspacing="0" border="0">';
            for ( myKey in myFormErrors )
            {
                if (myFormErrors[myKey] != null)
                {
                    myDisplayFormErrors += '<tr>' + "\n";
                    myDisplayFormErrors += '  <td valign="top"><img src="/fileadmin/images/missing-fields.png" height="16" width="16"></td>' + "\n";
                    myDisplayFormErrors += '  <td width="5"></td>' + "\n";
                    myDisplayFormErrors += '  <td valign="bottom" height="20">' + "\n";
                    myDisplayFormErrors += '    <span class="FormError">' + myFormErrors[myKey] + '</span>';
                    myDisplayFormErrors += '  </td>' + "\n";
                    myDisplayFormErrors += '</tr>' + "\n";
                }
            }
            myDisplayFormErrors += '</table>' + "\n";

            elementFormError.innerHTML = myDisplayFormErrors;

            return false;
        }
        else
        {
            elementFormError.style.display = 'none';
            return true;
        }
    }

    function getURLParam(strParamName)
    {
        var strReturn = "";
        var strHref = window.location.href;
        if ( strHref.indexOf("?") > -1 )
        {
            var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
            var aQueryString = strQueryString.split("&");
            for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
            {
                if ( aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 )
                {
                    var aParam = aQueryString[iParam].split("=");
                    strReturn = aParam[1];
                    break;
                }
            }
        }
        return unescape(strReturn);
    }
    
    // Focus auf das erste aktive Formular-Element
    function FocusFirst()
    {
//      alert('hi');
  
        // Based on http://www.codeproject.com/KB/scripting/FocusFirstInput.aspx
        var bFound = false;
        //for each form
        for (f=0; f < document.forms.length; f++)
        {
            //for each form element
            for (i=0; i < document.forms[f].length; i++)
            {
                el = document.forms[f][i]
                if (el.disabled != true)
                {
                    if (el.type != undefined)
                    {
                        switch (el.type.toLowerCase())
                        {
                            case "text" : el.focus(); bFound = true; break;
                            case "textarea" : el.focus(); bFound = true; break;
                            case "checkbox" : el.focus(); bFound = true; break;
                            case "radio" : el.focus(); bFound = true; break;
                            case "file" : el.focus(); bFound = true; break;
                            case "password" : el.focus(); bFound = true; break;
                            case "select-one" : el.focus(); bFound = true; break;
                            case "select-multiple" : el.focus(); bFound = true; break;
                        } // switch el.type
                    } //if (el.type != undefined)
                } //if (el.disabled != true)
                if (bFound == true) break;
            } //for each form element
            if (bFound == true) break;
        } //for each form
    }
