function check_email(e)
 {
    ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
    for(i=0; i < e.length ;i++)
     {
        if(ok.indexOf(e.charAt(i))<0)
         {
           return (false);
         }
     }
    re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
    re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
    if (!e.match(re) && e.match(re_two))
     {
         return (-1);
     }
   return false;
}

function check_form(f)
 {
   if(!check_email(f.email.value))
      {
        alert("Adresa de e-mail incorecta.");
        f.email.focus();
       // if the browser is Netscape 6 or IE
        if(document.all || document.getElementByID)
         {
           // change the color of text field
           f.email.style.background = "yellow";
         }
       // make sure the form is not submitted
       return false;
      }

    if(f.parola.value.length < 4)
     {
       alert("Dimensiunea parolei este de minim 4 caractere! Reintroduceti parola ");
       f.parola.focus(); // put the prompt in the name field
       // if the browser is Netscape 6 or IE
       if(document.all || document.getElementByID)
        {
         // change the color of text field
          f.parola.style.background = "yellow";
        }
        // make sure the form is not submitted
        return false;
     }
    if(f.cod.value.length < 1)
     {
       alert("Introduceti codul !");
       f.parola.focus(); // put the prompt in the name field
       // if the browser is Netscape 6 or IE
       if(document.all || document.getElementByID)
        {
         // change the color of text field
          f.cod.style.background = "yellow";
        }
        // make sure the form is not submitted
        return false;
     }
     if (!f.ok.checked)
      {
         alert('Pentru a va inscrie este necesar sa fiti de acord cu Regulamentul de inscriere !');
         return false;
      }

}


function on(name,id,tip)
 {
    var b = "rollover/fata" + id +"_"+tip+"_mouse_over.jpg";
    image1on = new Image();
    image1on.src=b;
    document[name].src = image1on.src;

 }
function off(name,id,tip)
 {
    var b = "rollover/fata" + id +"_"+tip+"_mouse_out.jpg";
    image1on = new Image();
    image1on.src=b;
    document[name].src = image1on.src;
 }

 function openPage(filename, width, height) {

        winStats='resizable=yes,toolbar=no,location=no,directories=no,menubar=no,';
        winStats+='scrollbars=yes,width='+width+',height=';
        winStats+=height;
        if (navigator.appName.indexOf("Microsoft")>=0) {
           winStats+=',left=10,top=25';
         }else{
           winStats+=',screenX=10,screenY=25';
         }
        winLoc =  filename;
        floater=window.open(winLoc,"", winStats)
     }
function popUp(windowname){
        window.open(windowname,"_newWindow","toolbar=no,location=no,menubar=no,directories=no,status=no,scrollbars=no,titlebar=no,resizable=yes,width=260,height=350");
}


