function showMenu(el){
	document.getElementById(el).style.display="block";
}

function hideMenu(el){
	document.getElementById(el).style.display="none";
}

function showMenuColor(el){
	document.getElementById(el).style.backgroundColor="#f4fff8";
}

function hideMenuColor(el){
	document.getElementById(el).style.backgroundColor="#dcecc7";
}

//yhteydenotto
function checkFields(){
	if(document.form1.nimi.value==""){
		alert("Nimi on pakollinen");
	}
	else if(document.form1.viesti.value==""){
		alert("Viesti on pakollinen");
	}
	else{
		document.form1.submit();
	}
}

//infolaatikon haku sisältöinen
function haeInfoLaatikko(id,el,status){

	if(status==0){
		document.getElementById(el).innerHTML =" ";
	}
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Selaimessasi tapahtui virhe!");
				return false;
			}
		}
	}

	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			if(ajaxRequest.responseText!="" && status==1){
				document.getElementById(el).innerHTML = ajaxRequest.responseText+" ";			
			}
		}
	}
	var queryString = "?pageid=" + id + "&r="+Math.round(Math.random() * 10000);
	ajaxRequest.open("GET", "ajax_query.php" + queryString, true);
	ajaxRequest.send(null); 

}