function checkForm(w)
{
	if (w.nume.value=='')
    {
    	alert('Va rugam sa introduceti numele');
        return false;
    }
	if (w.adresa.value=='')
    {
    	alert('Va rugam sa introduceti adresa');
        return false;
    }
	
	if (w.telefon.value=='')
    {
    	alert('Va rugam sa introduceti numarul de telefon');
        return false;
    }
   	
	if (w.mesaj.value=='')
    {
    	alert('Va rugam sa introduceti mesajul');
        return false;
    }
	if (w.cod.value=='')
    {
    	alert('Va rugam sa introduceti codul de securitate');
        return false;
    }
	return true;
}
function checkFormEn(w)
{
	if (w.nume.value=='')
    {
    	alert('Please insert your name');
        return false;
    }
   	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(w.email.value) && w.email.value.length>0 ))
	{
   		alert('Please insert a valid email adress');
		return false;
	}
	if (w.mesaj.value=='')
    {
    	alert('Please insert a message');
        return false;
    }
	if (w.cod.value=='')
    {
    	alert('Please insert the security code');
        return false;
    }
	return true;
}


function checkRez(w)
{

	
	if (w.nume.value=='')
    {
    	alert('Va rugam sa introduceti numele');
        return false;
    }
   	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(w.email.value) && w.email.value.length>0 ))
	{
   		alert('Va rugam sa introduceti o adresa de email valida');
		return false;
	}
	if (w.cod.value=='')
    {
    	alert('Va rugam sa introduceti codul de securitate');
        return false;
    }
	
	return true;
}


function checkRezEn(w)
{
	if ((parseInt(w.an_plecare.options[w.an_plecare.selectedIndex].value)<parseInt(w.an_sosire.options[w.an_sosire.selectedIndex].value)) ||
	((parseInt(w.an_plecare.options[w.an_plecare.selectedIndex].value)==parseInt(w.an_sosire.options[w.an_sosire.selectedIndex].value)) && (parseInt(w.luna_plecare.options[w.luna_plecare.selectedIndex].value)<parseInt(w.luna_sosire.options[w.luna_sosire.selectedIndex].value)) ) ||
	((parseInt(w.an_plecare.options[w.an_plecare.selectedIndex].value)==parseInt(w.an_sosire.options[w.an_sosire.selectedIndex].value)) && (parseInt(w.luna_plecare.options[w.luna_plecare.selectedIndex].value)==parseInt(w.luna_sosire.options[w.luna_sosire.selectedIndex].value)) && (parseInt(w.zi_plecare.options[w.zi_plecare.selectedIndex].value)<parseInt(w.zi_sosire.options[w.zi_sosire.selectedIndex].value)) )
	
)
	{
		alert("The departure date can't be previous to the arrival date");
		return false;
	}
	if (w.nume.value=='')
    {
    	alert('Please insert your name');
        return false;
    }
   	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(w.email.value) && w.email.value.length>0 ))
	{
   		alert('Please insert a valid email adress');
		return false;
	}
	
	if (w.cod.value=='')
    {
    	alert('Please insert the security code');
        return false;
    }
	return true;
}
function nextImg()
{
	var first=document.getElementById('first').value;
	var last=parseInt(first)+3;
	var max=document.getElementById('last').value;
	if (last<=max)
	{
		document.getElementById('img'+first).style.display="none";
		document.getElementById('img'+last).style.display="inline";
		document.getElementById('first').value=parseInt(first)+1;
		//alert(document.getElementById('first').value);
	}
}
function prevImg()
{
	var first=document.getElementById('first').value;
	var last=parseInt(first)+2;
	var max=document.getElementById('last').value;
	if ((first-1)>=1)
	{
		document.getElementById('img'+(first-1)).style.display="inline";
		document.getElementById('img'+last).style.display="none";
		document.getElementById('first').value=parseInt(first)-1;
		//alert(document.getElementById('first').value);
	}
}

//cariere

function checkFormCar(w)
{
	if (w.nume.value=='')
    {
    	alert('Va rugam sa introduceti numele');
        return false;
    }
	if (w.nastere.value=='')
    {
    	alert('Va rugam sa introduceti data nasterii');
        return false;
    }
	if (w.telefon.value=='')
    {
    	alert('Va rugam sa introduceti numarul de telefon');
        return false;
    }
   	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(w.email.value) && w.email.value.length>0 ))
	{
   		alert('Va rugam sa introduceti o adresa de email valida');
		return false;
	}
	if (w.adresa.value=='')
    {
    	alert('Va rugam sa introduceti adresa');
        return false;
    }
	if (w.studii.value=='')
    {
    	alert('Va rugam sa introduceti studiile');
        return false;
    }
	if (w.experienta.value=='')
    {
    	alert('Va rugam sa introduceti experienta');
        return false;
    }
	if (w.cod.value=='')
    {
    	alert('Va rugam sa introduceti codul de securitate');
        return false;
    }
	return true;
}

function checkFormCarEn(w)
{
	if (w.nume.value=='')
    {
    	alert('Please insert your name');
        return false;
    }
	if (w.nastere.value=='')
    {
    	alert('Please insert your birth date');
        return false;
    }
	if (w.telefon.value=='')
    {
    	alert('Please insert your phone number');
        return false;
    }
   	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(w.email.value) && w.email.value.length>0 ))
	{
   		alert('Pleas insert a valid email adress');
		return false;
	}
	if (w.adresa.value=='')
    {
    	alert('Please insert your adress');
        return false;
    }
	if (w.studii.value=='')
    {
    	alert('Please insert your education');
        return false;
    }
	if (w.experienta.value=='')
    {
    	alert('Please insert your experience');
        return false;
    }
	if (w.cod.value=='')
    {
    	alert('Please insert the security code');
        return false;
    }
	return true;
}
function checkComm(w)
{
	if (w.name.value=='')
    {
    	alert('Va rugam sa introduceti numele');
        return false;
    }
	if (w.localitate.value=='')
    {
    	alert('Va rugam sa introduceti localitatea');
        return false;
    }
	if (w.continut.value=='')
    {
    	alert('Va rugam sa introduceti comentariul dumneavoastra');
        return false;
    }
	if (w.cod_securitate.value=='')
    {
    	alert('Va rugam sa introduceti codul de securitate');
        return false;
    }
	return true;

}