var txt=""
var flag=0
function count(){
txt=document.getElementById('intrebare').value;
var mySplitResult=txt.split(" ")
document.getElementById("counter").innerHTML=mySplitResult.length-1
if (mySplitResult.length>100){
document.getElementById('trimite').disabled=true
}else{
document.getElementById('trimite').disabled=false
}
window.setTimeout('count()',500);
	}

function formValidator(){
	var intrebare = document.getElementById('intrebare');
	var email = document.getElementById('email');
	
	// Check each input in the order that it appears in the form!
	if(notEmpty(email, "Ne trebuie emailul dumneavoastra ca sa va putem raspunde")){
		if(emailValidator(email, "Emailul are greseli")){
			if(notEmpty(intrebare, "Nu uitati sa treceti textul dorit.")){
							return true;
			}
		}
	}
	
	
	return false;
	
}

function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}

}

function alltext(){
document.getElementById('intrebare').value=txt
}
function showdate(param1){
if (param1==0){
alert("Contactati-ne maine pentru noi intrebari")
document.getElementById('intrebare').disabled=true;
}
}
function myselected(){
document.getElementById("ab17").style.color="red";
}
function confirmation(){
	var answer=confirm("Ti-ai trecut emailul? Fara o adresa de email nu putem raspunde.")
if (answer){
return true;
}
return false;
}