function checkmail()
{
	nume = document.getElementById('nume');
	if (nume.value == '')
	{
		alert("Va rugam completati numele");
		nume.focus();
		return false;
	}
	
	email = document.getElementById('email');
	telefon = document.getElementById('telefon');

	if (email.value == '' && telefon.value == '')
	{
  		alert("Va rugam completati telefonul sau adresa de e-mail");
		email.focus();		
		return false;	
	}
	
	if (email.value != '')
	{
		if(!check_email(email.value))
		{
			alert("Adresa de e-mail este incorecta");
		 	email.focus();
			return false;
		}	
	}
	
	mesaj = document.getElementById('mesaj');

	if (mesaj.value == '')
	{
		alert("Va rugam completati mesajul");
		mesaj.focus();
		return false;
	}	
		

}

function check_email(e) 
{
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++)
	{
		if(ok.indexOf(e.charAt(i))<0)
		{ 
			return (false);
		}
	} 
	
	if (document.images) 
	{
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) 
		{
			return (-1);		
		} 
	}
}

function onPag(obi)
{
	culoare = obi.style.backgroundColor;
	if(culoare == "#efefef")
	{	obi.style.backgroundColor = "#e0e0e0";}
}

function offPag(obi)
{
	if(obi.style.backgroundColor == "#e0e0e0")
	{	obi.style.backgroundColor = "#efefef";}
}

function actPag(nr,toate)
{
	for(i=1;i<=toate;i++)
	{
		document.getElementById('pagina'+i).style.backgroundColor= "#efefef";
	}
	document.getElementById('pagina'+nr).style.backgroundColor= "#dc6808";

}

function scrollto(nr,cat)
{
	z = nr;
	c = cat;
	y = document.getElementById(c).style.left;
	y = y.replace('px','');
	x = Number(y);
	xbun = (1-nr)*907;
	if(x>xbun)
	{
		if(x<(xbun+70))
		{
			x=x-1;
		}
		else if(x>(xbun+1240))
		{
			x=x-100;
		}
		else
		{
			x=x-50;
		}
		document.getElementById(c).style.left=x+"px";
		t=setTimeout("scrollto(z,c)",1);
	}
	if(x<xbun)
	{
		if(x>(xbun-70))
		{
			x=x+1;
		}
		else if(x<(xbun-940))
		{
			x=x+100;
		}
		else
		{
			x=x+50;
		}
		document.getElementById(c).style.left=x+"px";
		t=setTimeout("scrollto(z,c)",1);
	}
	
}

function h5up(obi)
{
	h = obi;
	y = document.getElementById(h).style.top;
	y = y.replace('px','');
	x = Number(y);
	if(x>156)
	{
		x=x-5;
		document.getElementById(h).style.top=x+"px";
		t=setTimeout("h5up(h)",2);
	}
}

function h5down(obi)
{
	h = obi;
	y = document.getElementById(h).style.top;
	y = y.replace('px','');
	x = Number(y);
	if(x<216)
	{
		x=x+5;
		document.getElementById(h).style.top=x+"px";
		t=setTimeout("h5down(h)",2);
	}
}
