// JavaScript Document

function validateNewsSearch() {
	var monthSelect = document.getElementById("month");
	var yearSelect = document.getElementById("year");
	var technologySelect = document.getElementById("technology");
	var countrySelect = document.getElementById("country");
	var searchQuery = document.getElementById("news_search_query");
	/*if ((monthSelect.selectedIndex > 0 && yearSelect.selectedIndex == 0) || (yearSelect.selectedIndex > 0 && monthSelect.selectedIndex == 0)) {
		alert("You must select both a month and a year");
		return false;
	}*/
	if (monthSelect.selectedIndex == 0 && yearSelect.selectedIndex == 0 && technologySelect.selectedIndex == 0 && countrySelect.selectedIndex == 0 && (searchQuery.value == "" || searchQuery.value == "Enter keywords")) {
		alert("You must select a criteria to search for");
		return false;
	}
}

function clearKeywordField() {
	document.getElementById("news_search_query").value = "";
}
