strABC="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV WXYZ&";

str123="0123456789";

strABC123=strABC + str123 + "/();.";

strABC123_=strABC123 + "_";

strABC123ext=strABC123_ + "@.-";



function check(string1,string2)

{

   var ok=true;

   if (string1.length==0){ok=false;}

   for (var i=0; i<string1.length; i++)

   {                 

	 if (string2.indexOf(string1.charAt(i))==-1){ok=false;}

   }

   return ok;

}



function checkemail(em)

{

	var ok=true;

	if (em.length==0){ok=false;};

	check(em , strABC123ext);

	if ( (em != "") && ((em.indexOf('@', 0) == -1) || (em.indexOf('.', 0) == -1) || (em.lastIndexOf('@') == em.length-1) ||(em.lastIndexOf('.') == em.length-1) ||(em.indexOf('@', 0) != em.lastIndexOf('@'))) ) {ok=false};

	return ok;

}



function check_form_user()

{

	var frm = window.document.add_client;

	var ok = true;



	var prenume = frm.prenume.value;

	var nume = frm.nume.value;

	var email = frm.email.value;

	var datanastere = frm.datanastere.value;

	var telefon = frm.telefon.value;

	var mobil = frm.mobil.value;

	var adresa = frm.adresa.value;

	var oras = frm.oras.value;

	var nivel_profesional = frm.nivel_profesional.value;





	if (ok) 

		if (!checkemail(email))

		{

			alert("Introduceti o adresa de e-mail valida.");

			ok=false;

		}



	var pass = frm.parola.value;

	var repass = frm.cparola.value;



	if (ok) 

		if (pass.length<4)

		{

			alert("Introduceti o parola.");

			ok=false;

		}

	if (ok) 

		if (pass!=repass)

		{

			alert("Parolele nu coincid.");

			ok=false;

		}





	if(ok)

		if(nume.length<3)

		{

			alert("Introduceti un nume valid!");

			ok = false;

		}

	if(ok)

		if(prenume.length<3)

		{

			alert("Introduceti un prenume valid!");

			ok = false;

		}

	if(ok)

		if(datanastere.length<3)

		{

			alert("Introduceti data nasterii valida!");

			ok = false;

		}

	if(ok)

		if((telefon.length<5)&&(mobil.length<5))

		{

			alert("Trebuie sa introduceti cel putin un telefon valid!");

			ok = false;

		}

	if(ok)

		if(adresa.length<8)

		{

			alert("Nu ati introdus adresa!");

			ok = false;

		}

	if(ok)

		if(oras.length<3)

		{

			alert("Nu ati introdus orasul!");

			ok = false;

		}

	if(ok)

		if(nivel_profesional=="selecteaza")

		{

			alert("Este necesar sa specificati nivelul profesional!");

			ok = false;

		}	

		

	return ok;

}



	



function check_login(frm)

{

	

	var ok = true;



	var msg;



	var parola = frm.parola.value;

	var email = frm.email.value;



	if (ok) 

		if (!checkemail(email))

		{

			ok=false;

			msg="Introduceti o adresa de e-mail valida.";

			

		}

	

	if(ok)

	{

		if(parola.length<4)

		{

			ok=false;

			msg="Introduceti o parola valida!";

			

		}

	}





	if(ok)

	{

		

		frm.submit();

	}

	else

	{

		alert(msg);

	}



}









function parola_uitata()

{

	f=window.open("parola_uitata.php","Parola","menubars=no ,width=350, height=200, scrollbars=no");

	return false;

}







function check_form_firma()

{

	var frm = window.document.add_firma;

	var ok = true;



	

	var email = frm.email.value;

	if (ok) 

		if (!checkemail(email))

		{

			alert("Introduceti o adresa de e-mail valida.");

			ok=false;

		}



	var pass = frm.parola.value;

	var repass = frm.cparola.value;



	if (ok) 

		if (pass.length<4)

		{

			alert("Introduceti o parola.");

			ok=false;

		}

	if (ok) 

		if (pass!=repass)

		{

			alert("Parolele nu coincid.");

			ok=false;

		}



	var numef = frm.numef.value;

	var codf = frm.codf.value;

	var regcom = frm.regcom.value;

	var descriere = frm.descriere.value;

	var telefon = frm.telefon.value;

	var adresa = frm.adresa.value;

	var oras = frm.oras.value;

	var nr_angajati = frm.nr_angajati.value;

	var vanzari = frm.vanzari.value;

	





	if(ok)

		if(numef.length<3)

		{

			alert("Introduceti un nume de firma valid!");

			ok = false;

		}

	if(ok)

		if(codf.length<6)

		{

			alert("Introduceti un cod fiscal valid!");

			ok = false;

		}

	if(ok)

		if(regcom.length<8)

		{

			alert("Introduceti nr. reg. com. valid!");

			ok = false;

		}



	if(ok)

		if(descriere.length<8)

		{

			alert("Este necesar sa introduceti descrierea firmei!");

			ok = false;

		}

	if(ok)

		if(telefon.length<5)

		{

			alert("Introduceti un nr. de telefon valid!");

			ok = false;

		}	

	

	if(ok)

		if(adresa.length<8)

		{

			alert("Nu ati introdus adresa!");

			ok = false;

		}

	if(ok)

		if(oras.length<3)

		{

			alert("Nu ati introdus orasul!");

			ok = false;

		}

	if(ok)

		if(nr_angajati=="selecteaza")

		{

			alert("Este necesar sa specificati numarul de angajati!");

			ok = false;

		}

	if(ok)

		if(vanzari=="selecteaza")

		{

			alert("Este necesar sa specificati cifra vanzarilor!");

			ok = false;

		}		

		

	return ok;

}





function check_cv()

{

	var frm = window.document.add_cv;

	var ok = true;



	var nivel_studii = frm.nivel_studii.value;

	var studii = frm.studii.value;

	var aptitudini = frm.aptitudini.value;

	var obiectiv = frm.obiectiv.value;





	if(ok)

	{

		if(nivel_studii=="selecteaza")

		{

			alert("Selectati va rog nivelul studiilor!");

			ok = false;

		}

	}



	if(ok)

	{

		if(studii.length<10)

		{

			alert("Introduceti va rog studiile!");

			ok = false;

		}

	}



	if(ok)

	{

		if(aptitudini.length<10)

		{

			alert("Introduceti va rog aptitudinile!");

			ok = false;

		}

	}



	if(ok)

	{

		if(obiectiv.length<10)

		{

			alert("Introduceti va rog obiectivul!");

			ok = false;

		}

	}

	

			

	return ok;

}





function clean()

{



	if (document.form1.mesaj.value=="intrebare:")

	{

		document.form1.mesaj.value="";

	}

}



function check_intrebare()

{

	var frm = window.document.form1;

	var ok = true;



	var nume = frm.nume.value;

	var prenume = frm.prenume.value;

	var email = frm.email.value;



	var mesaj = frm.mesaj.value;



	if(ok)

		if(nume.length<3)

		{

			alert("Introduceti va rog numele!");

			ok=false;

		}



	if(ok)

		if(prenume.length<3)

		{

			alert("Introduceti va rog prenumele!");

			ok=false;

		}



	if(ok)

	{

		if((mesaj=="intrebare:")||(mesaj.length<10))

		{

			

			

				alert("Introduceti va rog intrebarea!");

				ok=false;

			

		}

	}



	if(ok)

		if (!checkemail(email))

		{

			alert("Introduceti o adresa de e-mail valida!");

			ok=false;

		}



		return ok;





}

function check_program()

{

	var frm = window.document.form2;

	var ok = true;



	var nume = frm.nume.value;

	var prenume = frm.prenume.value;

	var email = frm.email.value;
	
	var numef = frm.numef.value;
	
	var telefon = frm.telefon.value;



	if(ok)

		if(nume.length<3)

		{

			alert("Introduceti va rog numele!");

			ok=false;

		}



	if(ok)

		if(prenume.length<3)

		{

			alert("Introduceti va rog prenumele!");

			ok=false;

		}
		



	if(ok)

		if (!checkemail(email))

		{

			alert("Introduceti o adresa de e-mail valida!");

			ok=false;

		}

	if(ok)

		if(numef.length<3)

		{

			alert("Introduceti va rog numele firmei!");

			ok=false;

		}
	if(ok)

		if(telefon.length<3)

		{

			alert("Introduceti va rog nr de telefon!");

			ok=false;

		}

		return ok;





}
function dictionar_cauta(frm)

{

//	var frm = window.document.form1;

	var ok = true;



	var cauta = frm.cauta.value;



	if(ok)

		if(cauta.length<3)

		{

			alert("Introduceti cel putin 3 litere pentru cautare!");

			ok=false;

		}



		return ok;





}
function concurs(frm)
{


//	var frm = window.document.form1;

	var ok = true;
	var email = frm.email.value;

if(ok)
	if(email.length<3)
	{
	alert("Introduceti email!");
		ok=false;
	}

	buton=(frm.radiobutton[0].checked||frm.radiobutton[1].checked||frm.radiobutton[2].checked||frm.radiobutton[3].checked);
if(!buton)
{
alert ("Alegeti o varianta");
}
ok=ok&&buton;

return ok;
}
function concurs1(frm)
{


//	var frm = window.document.form1;

	var ok = true;
	var email = frm.email.value;
//	var raspuns = frm.raspuns.value;
	
if(ok)
	if(email.length<3)
	{
	alert("Introduceti email!");
		ok=false;
	}



return ok;
}


function forum_login(frm)

{

//	var frm = window.document.form1;

	var ok = true;



	var UserName = frm.UserName.value;
var PassWord = frm.PassWord.value;



	if(ok)

		if ((UserName.length==0) || (PassWord.length==0 ))

		{

			alert("Introduceti datele de conectare!");

			ok=false;

		}
		


		return ok;





}