function sendFAQ() {
	var errorMessage = "";
	if(checkFieldData(document.getElementById("name").value)) {
		errorMessage += "<li>" + jsnoname + "</li>";
	}
	
	if(checkFieldData(document.getElementById("query").value)) {
		errorMessage += "<li>" + jsnoquery + "</li>";
	}
	
	if(checkFieldData(document.getElementById("mail").value) || checkEmailFormat(document.getElementById("mail").value)) {
		errorMessage += "<li>" + jsnomail + "</li>";
	}
	
	if(errorMessage) {
		showWarningScreen(errorMessage);
	} else {
		document.getElementById("sendFormID").action = BASE_URL + LANG + "/contacts.html";
		document.getElementById("sendFormID").submit();
	}
}

function showWarningScreen (message) {
	setTransparentPosition("popupBoxContainer");
	document.getElementById("blanket").style.display = "block";
	document.getElementById("popupBoxContainer").style.display = "block";
	document.getElementById("warrningPopUpButtons").style.display = "none";
	document.getElementById("popupWindowTitle").innerHTML = jsinformation;
	document.getElementById("warrningMessage").innerHTML = "<ul>" + message + "</ul>";
	document.getElementById("popupLoader").style.display = "none";
	document.getElementById("successPopUpButtons").style.display = "none";
	document.getElementById("warrningOneButtonPopUpButtons").style.display = "block";
	document.getElementById("closePopUpTopButton").style.display = "none";	
	
}

function closeWarningWindow() {
	document.getElementById("blanket").style.display = "none";
	document.getElementById("popupBoxContainer").style.display = "none";
}

function checkFieldData(fieldName) {
	if ((fieldName.replace(/^\s+|\s+$/g,"") == "") || (fieldName.length < 3)) {
		return true;
	}
	return false;
}

function checkEmailFormat(email) {
    re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/g;
    re_two = /^([a-zA-Z0-9_\.\-])+@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/g;

    if (email.replace(/^\s+|\s+$/g,"") == "") {
            return -1;
    } else if(email.match(re) || !email.match(re_two)) {
            return -2;
    } else {
            return (false);
    }
}