function validateQ()
{


var a=document.getElementById("q").value;
if (a.length<3) {alert("Expresia cautata trebuie sa aiba minim 3 caractere!"); return false;}

return true;
}



function validate()
{


var a=document.getElementById("email").value;
if (a=="") {alert("Trebuie sa introduceti un email!"); return false;}
else {
apos=a.indexOf("@");
dotpos=a.lastIndexOf(".");
if ( (apos<1) || (dotpos-apos<2) )
  {alert("Email invalid!");return false;}
	}

var a=document.getElementById("tel").value;
if (a.length<6) {alert("Numarul de telefon trebuie sa aiba minim 6 caractere!"); return false;}
if (a=="") {alert("Trebuie sa introduceti un telefon!"); return false;}
else
{
var testName =/^([0-9]|\-|\.| )*$/;
    if(!testName.test(a)) 
    { 
      alert("Numarul de telefon poate contine doar cifre de la 0 la 9, si caracterele \".\", \"-\" si spatiu.");  return false; 
    } 
	

}




var a=document.getElementById("agree").checked;
if (a==false) {alert("Trebuie sa fiti de acord cu Termenii si conditiile!"); return false;}



var an=document.getElementById("Alt_oras").value;

if ((an.indexOf('<') !=-1) || (an.indexOf('>') !=-1) || (an.indexOf('http') !=-1) || (an.indexOf('www') !=-1) || (an.indexOf('.ro') !=-1) || (an.indexOf('. ro') !=-1) ||(an.indexOf('.com') !=-1) || (an.indexOf('. com') !=-1) || (an.indexOf('.eu') !=-1) || (an.indexOf('. eu') !=-1) || (an.indexOf('.de') !=-1) || (an.indexOf('. de') !=-1)) {alert("Orasul contine caractere nepermise!"); return false;}




return true;


}



function validateContinutAnunt()
{

var an=document.getElementById("anunt").value;
if (an=="") {alert("Continutul anuntului nu poate fi gol!"); return false;}
if (an.length<3) {alert("Anuntul contine prea putine caractere!"); return false;}

if ((an.indexOf('<') !=-1) || (an.indexOf('>') !=-1)) {alert("Anuntul contine caractere nepermise!"); return false;}




return true;


}


function validateFirma()
{


var a=document.getElementById("nume").value;
if (a=="") {alert("Trebuie sa introduceti numele firmei!"); return false;}

var a=document.getElementById("adresa").value;
if (a=="") {alert("Trebuie sa introduceti adresa firmei!"); return false;}


var a=document.getElementById("tel").value;
if (a=="") {alert("Trebuie sa introduceti un telefon!"); return false;}
else
if (a.length<6) {alert("Numarul de telefon trebuie sa aiba minim 6 caractere!"); return false;}

{
var testName =/^([0-9]|\-|\.| )*$/;
    if(!testName.test(a)) 
    { 
      alert("Numarul de telefon poate contine doar cifre de la 0 la 9, si caracterele \".\", \"-\" si spatiu.");  return false; 
    } 
	

}

var a=document.getElementById("email").value;
if (a=="") {}
else {
apos=a.indexOf("@");
dotpos=a.lastIndexOf(".");
if ( (apos<1) || (dotpos-apos<2) )
  {alert("Email invalid!");return false;}
	}


var an=document.getElementById("webpage").value;

if ((an.indexOf('<') !=-1) || (an.indexOf('>') !=-1) || (an.indexOf('http') !=-1) || (an.indexOf('www') !=-1) || (an.indexOf('.ro') !=-1) || (an.indexOf('. ro') !=-1) ||(an.indexOf('.com') !=-1) || (an.indexOf('. com') !=-1) || (an.indexOf('.eu') !=-1) || (an.indexOf('. eu') !=-1) || (an.indexOf('.de') !=-1) || (an.indexOf('. de') !=-1)) {alert("Adresa site-ului caractere nepermise!"); return false;}

var an=document.getElementById("Alt_oras").value;

if ((an.indexOf('<') !=-1) || (an.indexOf('>') !=-1) || (an.indexOf('http') !=-1) || (an.indexOf('www') !=-1) || (an.indexOf('.ro') !=-1) || (an.indexOf('. ro') !=-1) ||(an.indexOf('.com') !=-1) || (an.indexOf('. com') !=-1) || (an.indexOf('.eu') !=-1) || (an.indexOf('. eu') !=-1) || (an.indexOf('.de') !=-1) || (an.indexOf('. de') !=-1)) {alert("Orasul contine caractere nepermise!"); return false;}


var an=document.getElementById("descriere").value;

if ((an.indexOf('<') !=-1) || (an.indexOf('>') !=-1) || (an.indexOf('http') !=-1) || (an.indexOf('www') !=-1) || (an.indexOf('.ro') !=-1) || (an.indexOf('. ro') !=-1) ||(an.indexOf('.com') !=-1) || (an.indexOf('. com') !=-1) || (an.indexOf('.eu') !=-1) || (an.indexOf('. eu') !=-1) || (an.indexOf('.de') !=-1) || (an.indexOf('. de') !=-1)) {alert("Descrierea contine caractere nepermise!"); return false;}


return true;


}

function validateSubiect()
{


var a=document.getElementById("subiect").value;
if (a=="") {alert("Trebuie sa introduceti un subiect!"); return false;}

var a=document.getElementById("mesaj").value;
if (a=="") {alert("Trebuie sa introduceti un mesaj!"); return false;}


return true;
}

function validateMesaj()
{


var a=document.getElementById("mesaj").value;
if (a=="") {alert("Trebuie sa introduceti un mesaj!"); return false;}


return true;
}
