
  function MM_preloadImages() { //preload images
  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 mareste_poza(sPicURL) { 
  	window.open( "display.html?"+sPicURL, "poza", "resizable=0,HEIGHT=200,WIDTH=200,left=30,top=30"); 
  }
  
  function numeralsOnly(evt) {
  // 0=48; 9=57
    evt = (evt) ? evt : event; 
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));         
    var str = evt.srcElement.value; 
    if (charCode < 48 || charCode > 57)
      return false;
    return true;
  }
  
  function hasLetters(edit){
    var str= edit.value; 
    var charCode;
    for(i= 0; i< str.length; i++)
    {
      charCode= str.charCodeAt(i);
      if (charCode < 48 || charCode > 57)
  	{
        edit.value= '';
        return false;
      }
    }
    return true;
  }
  
  function check_rent(val) {
  var em = val.email.value;
  
    if (val.nume.value == "") {
    alert("Nu ati introdus numele!"); 
    val.nume.focus();
    return false;
    }
    if (val.prenume.value == "") {
    alert("Nu ati introdus prenumele!"); 
    val.prenume.focus();
    return false;
    }
    if (val.adresa.value == "") {
    alert("Nu ati introdus adresa!"); 
    val.adresa.focus();
    return false;
    }
    if (val.oras.value == "") {
    alert("Nu ati introdus orasul!"); 
    val.oras.focus();
    return false;
    }
    if (val.tel.value.length < 6) {
    alert("Numarul de telefon trebuie sa aiba cel putin 6 numere!"); 
    val.tel.value="";
    val.tel.focus();
    return false;
    }
    if(em != "") {
      if ((em.indexOf('@', 0) == -1) || (em.indexOf('.', 0) == -1) || (em.lastIndexOf('@') == em.length-1) ||(em.lastIndexOf('.') == em.length-1) ||(em.indexOf('@', 0) != em.lastIndexOf('@'))) {
      alert("Nu ati introdus o adresa VALIDA de email!");
      val.email.value = "";
      val.email.focus();
      return false;
      }
    }
    if (val.categorie.selectedIndex == 0) {
    alert("Nu ati selectat categoria masinei!"); 
    val.categorie.focus();
    return false;
    }
    if (val.destinatie.value == "") {
    alert("Nu ati introdus destinatia!"); 
    val.destinatie.focus();
    return false;
    }
    if (val.preluare.value == "") {
    alert("Nu ati introdus locul preluarii!"); 
    val.preluare.focus();
    return false;
    }
    if (val.datap.value == "") {
    alert("Nu ati introdus data preluarii!"); 
    val.datap.focus();
    return false;
    }
    if (val.orap.value == "") {
    alert("Nu ati introdus ora preluarii!"); 
    val.orap.focus();
    return false;
    }
    if (val.returnare.value == "") {
    alert("Nu ati introdus locul returnarii!"); 
    val.returnare.focus();
    return false;
    }
    if (val.datar.value == "") {
    alert("Nu ati introdus data returnarii!"); 
    val.datar.focus();
    return false;
    }
    if (val.orar.value == "") {
    alert("Nu ati introdus ora returnarii!"); 
    val.orar.focus();
    return false;
    }
    if (val.plata.selectedIndex == 0) {
    alert("Nu ati selectat modalitatea de plata!"); 
    val.plata.focus();
    return false;
    }
  }
  
  
  function check_hotel(val) {
  var em = val.email.value;
  
    if (val.nume.value == "") {
    alert("Nu ati introdus numele!"); 
    val.nume.focus();
    return false;
    }
    if (val.prenume.value == "") {
    alert("Nu ati introdus prenumele!"); 
    val.prenume.focus();
    return false;
    }
    if (val.adresa.value == "") {
    alert("Nu ati introdus adresa!"); 
    val.adresa.focus();
    return false;
    }
    if (val.oras.value == "") {
    alert("Nu ati introdus orasul!"); 
    val.oras.focus();
    return false;
    }
    if (val.tel.value.length < 6) {
    alert("Numarul de telefon trebuie sa aiba cel putin 6 numere!"); 
    val.tel.value="";
    val.tel.focus();
    return false;
    }
    if(em != "") {
      if ((em.indexOf('@', 0) == -1) || (em.indexOf('.', 0) == -1) || (em.lastIndexOf('@') == em.length-1) ||(em.lastIndexOf('.') == em.length-1) ||(em.indexOf('@', 0) != em.lastIndexOf('@'))) {
      alert("Nu ati introdus o adresa VALIDA de email!");
      val.email.value = "";
      val.email.focus();
      return false;
      }
    }
    if (val.orasd.value == "") {
    alert("Nu ati introdus orasul de destinatie!"); 
    val.orasd.focus();
    return false;
    }
    if (val.tarad.value == "") {
    alert("Nu ati introdus tara de destinatie!"); 
    val.tarad.focus();
    return false;
    }
    if (val.hotelul.value == "") {
    alert("Nu ati introdus numele hotelului!"); 
    val.hotelul.focus();
    return false;
    }
    if (val.nopti.value == "") {
    alert("Nu ati introdus numarul de nopti!"); 
    val.nopti.focus();
    return false;
    }
    if (val.data1.value.length < 10) {
    alert("Data de plecare trebuie sa fie de forma zz-ll-aaaa!"); 
    val.data1.value = "";
    val.data1.focus();
    return false;
    }
    if (val.data2.value.length < 10) {
    alert("Data de oprire trebuie sa fie de forma zz-ll-aaaa!"); 
    val.data2.value = "";
    val.data2.focus();
    return false;
    }
    if (val.tip_camera.selectedIndex == 0) {
    alert("Nu ati selectat tipul de camera!"); 
    val.tip_camera.focus();
    return false;
    }
    if (val.nrcamere.selectedIndex == 0) {
    alert("Nu ati selectat numarul de camere!"); 
    val.nrcamere.focus();
    return false;
    }
    if (val.adulti.value == "" && val.copii.value == "") {
    alert("Nu ati introdus numarul de persoane!"); 
    //val.adulti.focus();
    return false;
    }
    if (val.plata.selectedIndex == 0) {
    alert("Nu ati selectat modalitatea de plata!"); 
    val.plata.focus();
    return false;
    }
  }
  
  
  function check_avion(val) {
  var em = val.email.value;
  
    if (val.nume.value == "") {
    alert("Nu ati introdus numele!"); 
    val.nume.focus();
    return false;
    }
    if (val.prenume.value == "") {
    alert("Nu ati introdus prenumele!"); 
    val.prenume.focus();
    return false;
    }
    if (val.adresa.value == "") {
    alert("Nu ati introdus adresa!"); 
    val.adresa.focus();
    return false;
    }
    if (val.oras.value == "") {
    alert("Nu ati introdus orasul!"); 
    val.oras.focus();
    return false;
    }
    if (val.tel.value.length < 6) {
    alert("Numarul de telefon trebuie sa aiba cel putin 6 numere!"); 
    val.tel.value="";
    val.tel.focus();
    return false;
    }
    if(em != "") {
      if ((em.indexOf('@', 0) == -1) || (em.indexOf('.', 0) == -1) || (em.lastIndexOf('@') == em.length-1) ||(em.lastIndexOf('.') == em.length-1) ||(em.indexOf('@', 0) != em.lastIndexOf('@'))) {
      alert("Nu ati introdus o adresa VALIDA de email!");
      val.email.value = "";
      val.email.focus();
      return false;
      }
    }
    if (val.companie.selectedIndex == 0) {
    alert("Nu ati selectat compania dorita!"); 
    val.companie.focus();
    return false;
    }
    if (val.calatorie.selectedIndex == 0) {
    alert("Nu ati selectat tipul de calatorie!"); 
    val.calatorie.focus();
    return false;
    }
    if (val.clasa.selectedIndex == 0) {
    alert("Nu ati selectat clasa dorita!"); 
    val.clasa.focus();
    return false;
    }
    if (val.destinatie.value == "") {
    alert("Nu ati introdus destinatia!"); 
    val.destinatie.focus();
    return false;
    }
    if (val.adult.value == "" && val.um.value == "" && val.copil.value == "" && val.infant.value == "" && val.tanar.value == "" && val.senior.value == "" && val.student.value == "") {
    alert("Nu ati introdus numarul de pasageri!"); 
    //val.destinatie.focus();
    return false;
    }
    if (val.plata.selectedIndex == 0) {
    alert("Nu ati selectat modalitatea de plata!"); 
    val.plata.focus();
    return false;
    }
  }
  
  
  
  

