// Flash-Player-Check
function flashCheck(){
         flash = false;
         if ((navigator.mimeTypes) && (navigator.mimeTypes.length > 0)){
                 for (a = 0; a < navigator.mimeTypes.length; a++){
                        if (navigator.mimeTypes[a].type.indexOf("application/x-shockwave-flash")>= 0){
                                 flash = true;
                        }
                 }
        }
}

////////////////////////////////////////////////////////
/* Formular auf E-Mail checken *** ENGLISH *////////////
////////////////////////////////////////////////////////
function checkformEnglishEmail(formular){
         if (document.getElementById("mail" + formular).value == '' || document.getElementById("mail" + formular).value == 'email-address'){
                 alert('Please enter your email-address!');
                 document.getElementById("mail" + formular).focus();
                 return(false);
         }
         //email adresse auf leerzeichen überprüfen
         if(document.getElementById("mail" + formular).value.search(/ /) != '-1'){
                 alert('Space characters are not alowed in email-addresses!');
                 document.getElementById("mail" + formular).focus();
                 return(false);
         }
         //email-Format überprüfen
         s = document.getElementById("mail" + formular).value.split(/@/);
         //bei einem @ kann es nur 2 teile geben
         if((s.length !=2) || s[0] == '' || s[1] == ''){
                 alert('The email-address has a wrong format!');
                 document.getElementById("mail" + formular).focus();
                 return(false);
         }
         //nach dem @ zeichen ein punkt
         if (s[1].indexOf(".") == '-1'){
                 alert('The email-address must include at least one dot after the @ !');
                 document.getElementById("mail" + formular).focus();
                 return(false);
         }
         var a,b;
         a = document.getElementById("mail" + formular).value.split(/[.]/);
         b = a.reverse();
         if (b[0].length != "2" &&  b[0].length != "3" && b[0].length != "4"){
                 alert('The TopLevelDomain of the e-Mail is not valid!');
                 document.getElementById("mail" + formular).focus();
                 return(false);
         }
}
////////////////////////////////////////////////////////
/* decrypt helper function *////////////////////////////
////////////////////////////////////////////////////////
function decryptCharcode(n,start,end,offset){
        n = n + offset;
        if (offset > 0 && n > end){
                n = start + (n - end - 1);
                } else if (offset < 0 && n < start){
                n = end - (start - n - 1);
        }
        return String.fromCharCode(n);
}
////////////////////////////////////////////////////////
/* decrypt string */////////////////////////////////////
////////////////////////////////////////////////////////
function decryptString(enc,offset){
        var dec = "";
        var len = enc.length;
        for(var i=0; i < len; i++){
                var n = enc.charCodeAt(i);
                if (n >= 0x2B && n <= 0x3A){
                        dec += decryptCharcode(n,0x2B,0x3A,offset);        // 0-9 . , - + / :
                } else if (n >= 0x40 && n <= 0x5A){
                        dec += decryptCharcode(n,0x40,0x5A,offset);        // A-Z @
                } else if (n >= 0x61 && n <= 0x7A){
                        dec += decryptCharcode(n,0x61,0x7A,offset);        // a-z
                } else {
                        dec += enc.charAt(i);
                }
        }
        return dec;
}
////////////////////////////////////////////////////////
/* decrypt spam-protected emails *//////////////////////
////////////////////////////////////////////////////////
function linkTo_UnCryptMailto(s){
        location.href = decryptString(s,-2);
}
