function cautareValidare()
{	
	valoare=true;
	var str=document.getElementById("expresie_cautare").value;
	if(str.length<3 || /[^A-Za-z ]/.test(str)) 
		valoare=false;	
		
	if(!valoare) 
	{
		alert("Introduceti un criteriu valid pentru cautare de minim 3 litere\n"+
		"Sunt acceptate expresii formate din cuvinte ce contin doar litere");
		return valoare;
	}
	else 
		return valoare;
}






function validareCantitateModificare(cant,idd) {
	if (document.getElementById(idd).style.backgroundImage=="none")return false;
	else 
	{
		valid=true;
		s = cant.replace(/^(\s)*/, '');
	    s = s.replace(/(\s)*$/, '');
		if(!isInteger(s)|| parseInt(s)<1 || s=="") {
			valid=false;
			window.alert("Introduceti cantitatea in limitele 1-999");
		}
		return valid;
	}
}



function validareCantitate(cant) 
{
	valid=true;
	s = cant.replace(/^(\s)*/, '');
    s = s.replace(/(\s)*$/, '');
	if(!isInteger(s)|| parseInt(s)<1 || s=="") 
	{
		valid=false;
		window.alert("Introduceti cantitatea in limitele 1-999");
	}
	return valid;
}


function validareEmail(myForm) 
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(myForm.emailAddr.value))
	{
		return (true)
	}
	alert("E-mail invalidAddress! Reintroduceti e-mailul.")
	return (false)
}


