$(document).ready(function(){
	// hilighting valittu
	$(".valittu").css("background-position", "0 -" + $(".valittu").css('height'));
	$(".hilight:not(.valittu)").hover(
		function(){
			$(this).css("background-position", "0 -" + $(this).css('height'));
		},
		function(){
			$(this).css("background-position", "0 0");
		}
	);
});

function checkRequired()
{
	var valid;
	valid = false;

	$(".required").each(function(){
		if(this.value == undefined || this.value == ''){
			valid = false;
			alert("Arvo puuttuu: " + $(this).attr('rel'));
			return false;
		}

		valid = true;
		return true;
	});

	return valid;
}



$(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("h3.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});

});
