/**
 * @author vmlinuz
 */

	$(document).ready(function(){
		$("input[name=datum]").datepicker({dateFormat: 'yy/mm/dd'});
		$("tr.tipp").hover(function(){
				if($(this).hasClass("sor2")){
					$(this).removeClass("sor2");
					$(this).addClass("xsor2");
				}
				$(this).addClass("ui-state-hover");
			},function(){
				if($(this).hasClass("xsor2")){
					$(this).removeClass("xsor2");
					$(this).addClass("sor2");
				}
				$(this).removeClass("ui-state-hover");
			});
		$("span[title=info]").parent().toggle(function(){
			$(this).parents("tr").next().show();
			sleep(100);
		},function(){
			$(this).parents("tr").next().hide();
			sleep(100);
		});
		
		$("#tipp_datum [name=datum]").change(function(){
			$(this).parents("form").submit();
		});
		$("#top_datum [name=honap]").change(function(){
			$(this).parents("form").submit();
		});
		
		$(".toplista tbody tr").hover(function(){
				if($(this).hasClass("sor2")){
					$(this).removeClass("sor2");
					$(this).addClass("xsor2");
				}
				$(this).addClass("ui-state-hover");
			},function(){
				if($(this).hasClass("xsor2")){
					$(this).removeClass("xsor2");
					$(this).addClass("sor2");
				}
				$(this).removeClass("ui-state-hover");
			});
	});