
// COPY THIS FILE INTO THE HTML DIRECTORY OF THE WEB-SERVER !!!!!!!!!
// ==================================================================

// all scripts copyrighted by Dr. Mathias D. Mueller, meteoblue TM



 function checkemail(which){

  if (which.indexOf("@")!=-1&&which.indexOf(".")!=-1&&which.indexOf(" ")==-1&&which.indexOf(",")==-1){
     aa= true;}
   else{
    alert("Please enter a valid email address!");
    aa= false;}
    
   ok=document.forms[1].disclaimer.checked;
   if (ok){bb= true;}
   else{alert("Please agree with our disclaimer!");
   bb= false;}
   
   if (aa && bb){return true;}
   else return false;
 }




  function email2userid(which){
     var userfile;
     userfile=which;
     userfile=userfile.replace(".","");
     userfile=userfile.replace(".","");
     userfile=userfile.replace(".","");
     userfile=userfile.replace(".","");
     userfile=userfile.replace(".","");
     userfile=userfile.replace(".","");
     userfile=userfile.replace("@","_at_");
     return userfile;
}


//*************** switching the language ******************************************

// INPUT: newLang = the new language to switch to e.g. ".dt." ".fr."
 function toggle_lang(newLang)
  {
    
    qmpos = parent.frames[2].location.href.indexOf("????");
    if (qmpos > 0)
    {
       alert("Sorry, no translation available")
    }
    else 
    {
      hrefp0 = parent.frames[0].location.href;
      hrefp1 = parent.frames[1].location.href;
      hrefp2 = parent.frames[2].location.href;

      enpos = hrefp2.indexOf(".en.");
      dtpos = hrefp2.indexOf(".dt.");
      frpos = hrefp2.indexOf(".fr.");
      itpos = hrefp2.indexOf(".it.");

      if (enpos >= 0) { /* Seems to be english  */
        current = ".en."; 
      }

      if (dtpos >= 0) { /* Seems to be german */
        current = ".dt."; 
      }

      if (frpos >= 0) { /* Seems to be french  */
        current = ".fr."; 
      }

      if (frpos >= 0) { /* Seems to be italian */
        current = ".fr."; 
      }


        dtstr = hrefp0.split(current);
        enstr = dtstr[0];
        for (i=1;i<dtstr.length;i++) 
        {
          enstr = enstr+newLang+dtstr[i];
        }   
        href = enstr;
        parent.frames[0].location.replace(href);

        dtstr = hrefp1.split(current);
        enstr = dtstr[0];
        for (i=1;i<dtstr.length;i++) 
        {
          enstr = enstr+newLang+dtstr[i];
        }   
        href = enstr;
        parent.frames[1].location.replace(href);
           
        dtstr = hrefp2.split(current);
        enstr = dtstr[0];
        for (i=1;i<dtstr.length;i++) 
        {
          enstr = enstr+newLang+dtstr[i];
        }   
        href = enstr;
        parent.frames[2].location.replace(href);
     
   } //endelse

  } 


