function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openWin( windowURL, windowName, windowFeatures ){
	return window.open( windowURL, windowName, windowFeatures );
}





//------------old stuff----------


function Form_Validator_DE_OLD(theForm) {
    var err = false;
    var field;
    var msg = 'Folgender Fehler ist aufgetreten\n';
    var alpha = /\w/;
    var numeric = /[^0-9^\s]/;
    var invalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
    var valid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;

    if (theForm.from_name.value == '') {
        msg += '\n Eingabe Ihres Namens fehlt.';
        if (!err) {
            field = theForm.from_name;
            err = true;
        }
    }

    if (theForm.bt2$$Firma.value == '') {
        msg += '\n Eingabe Ihrer Firma/Organisation fehlt.';
        if (!err) {
            field = theForm.bt2$$Firma;
            err = true;
        }
    }

    if (theForm.bt3$$Telefonnummer.value == '') {
        msg += '\n Eingabe Ihrer Telefonnummer fehlt.';
        if (!err) {
            field = theForm.bt3$$Telefonnummer;
            err = true;
        }
    }

    if (invalid.test(theForm.from_email.value) || !valid.test(theForm.from_email.value)) {
        msg += '\n Eingabe Ihrer E-mail Adresse fehlt.';
        if (!err) {
            field = theForm.from_email;
            err = true;
        }
    }


    if (theForm.todaysNo.value != '<%=todaysNo%>') {
        msg += '\nBitte geben Sie den rechts angezeigten Code ein, um das Formular abzusenden.".';
        if (!err) {
            field = theForm.todaysNo;
            err = true;
        }
    }
    /*	
    if(theForm.bt5$$Adresse.value == ''){
    msg += '\n Eingabe Ihrer Adresse fehlt.';
    if (!err){
    field = theForm.bt5$$Adresse;
    err = true;
    }
    }
    */
    if (!err) {
        return true;
    }
    else {
        alert(msg);
        field.focus();
        return false;
    }
}


function Form_Validator_OLD_ES(theForm) {
    var err = false;
    var field;
    var msg = 'Please correct the following to continue...\n';
    var alpha = /\w/;
    var numeric = /[^0-9^\s]/;
    var invalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
    var valid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;

    if (theForm.name.value == '') {
        msg += '\nEscriba su nombre.';
        if (!err) {
            field = theForm.name;
            err = true;
        }
    }
    if (invalid.test(theForm.email.value) || !valid.test(theForm.email.value)) {
        msg += '\nIndique un E-mail válido.';
        if (!err) {
            field = theForm.email;
            err = true;
        }
    }
    if (theForm.comments.value == '') {
        msg += '\nEscriba sus comentarios.';
        if (!err) {
            field = theForm.comments;
            err = true;
        }
    }

    if (theForm.todaysNo.value != '<%=todaysNo%>') {
        msg += '\nPlease copy the correct security code into the textbox".';
        if (!err) {
            field = theForm.todaysNo;
            err = true;
        }
    }

    if (!err) {
        return true;
    }
    else {
        alert(msg);
        field.focus();
        return false;
    }
}


function Form_Validator_OLD_IT(theForm) {
    var err = false;
    var field;
    var msg = 'Please correct the following to continue...\n';
    var alpha = /\w/;
    var numeric = /[^0-9^\s]/;
    var invalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
    var valid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;

    if (theForm.name.value == '') {
        msg += '\nInserire il vostro nome.';
        if (!err) {
            field = theForm.name;
            err = true;
        }
    }


    if (theForm.todaysNo.value != '<%=todaysNo%>') {
        msg += '\nRiscrivere il numero di sicurezza.".';
        if (!err) {
            field = theForm.todaysNo;
            err = true;
        }
    }

    if (invalid.test(theForm.email.value) || !valid.test(theForm.email.value)) {
        msg += '\nInserire una e-mail attiva.';
        if (!err) {
            field = theForm.email;
            err = true;
        }
    }
    if (theForm.comments.value == '') {
        msg += '\nInserire il vostro messaggio.';
        if (!err) {
            field = theForm.comments;
            err = true;
        }
    }
    if (!err) {
        return true;
    }
    else {
        alert(msg);
        field.focus();
        return false;
    }
}

function Form_Validator_OLD_FR(theForm) {
    var err = false;
    var field;
    var msg = 'Pouvez-vous assurer de l exactitude des etapes suivantes:\n';
    var alpha = /\w/;
    var numeric = /[^0-9^\s]/;
    var invalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
    var valid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;

    if (theForm.from_name.value == '') {
        msg += '\n Entrez votre nom.';
        if (!err) {
            field = theForm.from_name;
            err = true;
        }
    }

    if (theForm.bt2$$societe.value == '') {
        msg += '\n Entrez votre societe.';
        if (!err) {
            field = theForm.bt2$$societe;
            err = true;
        }
    }

    if (theForm.bt3$$telephone.value == '') {
        msg += '\n Entrez votre telephone.';
        if (!err) {
            field = theForm.bt3$$telephone;
            err = true;
        }
    }

    if (invalid.test(theForm.from_email.value) || !valid.test(theForm.from_email.value)) {
        msg += '\n Entrez votre adresse e-mail.';
        if (!err) {
            field = theForm.from_email;
            err = true;
        }
    }

    if (theForm.todaysNo.value != '<%=todaysNo%>') {
        msg += '\nVeuillez retaper le code de vérification ŕ droite afin de permettre l\'envoi du formulaire.';
        if (!err) {
            field = theForm.todaysNo;
            err = true;
        }
    }

    /*
    if(theForm.bt6$$Commentaires.value == ''){
    msg += '\n Ecrivez bien votre commentaire.';
    if (!err){
    field = theForm.bt6$$Commentaires;
    err = true;
    }
    }
    */
    if (!err) {
        return true;
    }
    else {
        alert(msg);
        field.focus();
        return false;
    }
}
