function IsEmail(strEmail) 
{
	if (strEmail != null && strEmail != "") 
	{
		a = strEmail.lastIndexOf("@");
		b = strEmail.lastIndexOf(".");
		c = strEmail.indexOf(":");
		d = strEmail.indexOf("/");
		e = strEmail.substring(0,a);
		f = e.indexOf("@");
		g = strEmail.substring(a+1,strEmail.length);
		h = g.indexOf("[");
		i = g.indexOf("]");
		j = g.indexOf("<");
		k = g.indexOf(">");
		l = strEmail.substring(a+1,b);
		m = strEmail.substring(b+1,strEmail.length);
		n = strEmail.substring(0,a);
		o = 0;
		if (a > b) {o++};
		if (c != -1) {o++};
		if (d != -1) {o++};
		if (f != -1) {o++};
		if (h != -1) {o++};
		if (i != -1) {o++};
		if (j != -1) {o++};
		if (k != -1) {o++};
		if (l.length < 1) {o++};
		if (m.length < 2) {o++};
		if (n.length < 1) {o++};
		if (o == 0) 
		{
			return true;
		}
		else 
		{
			return false;
		}
	}
	else 
	{
		return false;
	}
}

function verifica(){
	if (document.suport.nume.value=="") {
		alert('Trebuie sa complectati campul Nume. Mai incercati o data!');
		document.suport.nume.focus();
		return false;
	}
	if (document.suport.firma.value=="") {
		alert('Trebuie sa complectati campul Firma. Mai incercati o data!');
		document.suport.firma.focus();
		return false;
	}
	if (document.suport.email.value=="") {
		alert('Trebuie sa complectati campul Email. Mai incercati o data!');
		document.suport.email.focus();
		return false;
	}
	if (!IsEmail(document.suport.email.value)) {
		alert('Nu ati introdus un Email valid!');
		document.suport.email.select();
		document.suport.email.focus();
		return false;
	}
	if (document.suport.problema.value=="") {
		alert('Trebuie sa complectati campul Problema. Mai incercati o data!');
		document.suport.problema.focus();
		return false;
	}
	if (document.suport.descriere.value=="") {
		alert('Trebuie sa complectati campul Descriere. Mai incercati o data!');
		document.suport.descriere.focus();
		return false;
	}
	return true;
}

function sterge(){
	document.suport.nume.value=''; 
	document.suport.firma.value=''; 
	document.suport.email.value=''; 
	document.suport.problema.value=''; 
	document.suport.descriere.value=''; 
	document.suport.nume.focus();
}

