/**
 * @author Juuso
 */

 $( function() {
 	
		$("#etusivu").hover(
			function() {
				$("#etusivu .white").stop()
					.animate({ width: '67px', height: '0px' }, 400).hide();
				$("#etusivu .black").stop().show()
					.animate({ width: '67px', height: '12px' }, 400);
			},
			function() {
				$("#etusivu .white").stop().show()
					.animate({ width: '67px', height: '12px' }, 400);
				$("#etusivu .black").stop()
					.animate({ width: '67px', height: '0px' }, 400).hide();
			}
		);
		
		$("#miehet").hover(
			function() {
				$("#miehet .white").stop()
					.animate({ width: '59px', height: '0px' }, 400).hide();
				$("#miehet .black").stop().show()
					.animate({ width: '59px', height: '12px' }, 400);
			},
			function() {
				$("#miehet .white").stop().show()
					.animate({ width: '59px', height: '12px' }, 400);
				$("#miehet .black").stop()
					.animate({ width: '59px', height: '0px' }, 400).hide();
			}
		);
		
		$("#uutiset").hover(
			function() {
				$("#uutiset .white").stop()
					.animate({ width: '67px', height: '0px' }, 400).hide();
				$("#uutiset .black").stop().show()
					.animate({ width: '67px', height: '12px' }, 400);
			},
			function() {
				$("#uutiset .white").stop().show()
					.animate({ width: '67px', height: '12px' }, 400);
				$("#uutiset .black").stop()
					.animate({ width: '67px', height: '0px' }, 400).hide();
			}
		);
		
		$("#ottelut").hover(
			function() {
				$("#ottelut .white").stop()
					.animate({ width: '71px', height: '0px' }, 400).hide();
				$("#ottelut .black").stop().show()
					.animate({ width: '71px', height: '12px' }, 400);
			},
			function() {
				$("#ottelut .white").stop().show()
					.animate({ width: '71px', height: '12px' }, 400);
				$("#ottelut .black").stop()
					.animate({ width: '71px', height: '0px' }, 400).hide();
			}
		);
		
		$("#palsta").hover(
			function() {
				$("#palsta .white").stop()
					.animate({ width: '159px', height: '0px' }, 400).hide();
				$("#palsta .black").stop().show()
					.animate({ width: '159px', height: '12px' }, 400);
			},
			function() {
				$("#palsta .white").stop().show()
					.animate({ width: '159px', height: '12px' }, 400);
				$("#palsta .black").stop()
					.animate({ width: '159px', height: '0px' }, 400).hide();
			}
		);
		
		$("#kuvasatoa").hover(
			function() {
				$("#kuvasatoa .white").stop()
					.animate({ width: '95px', height: '0px' }, 400).hide();
				$("#kuvasatoa .black").stop().show()
					.animate({ width: '95px', height: '12px' }, 400);
			},
			function() {
				$("#kuvasatoa .white").stop().show()
					.animate({ width: '95px', height: '12px' }, 400);
				$("#kuvasatoa .black").stop()
					.animate({ width: '95px', height: '0px' }, 400).hide();
			}
		);
		
		$("#tahtikisa").hover(
			function() {
				$("#tahtikisa .white").stop()
					.animate({ width: '84px', height: '0px' }, 400).hide();
				$("#tahtikisa .black").stop().show()
					.animate({ width: '84px', height: '14px' }, 400);
			},
			function() {
				$("#tahtikisa .white").stop().show()
					.animate({ width: '84px', height: '14px' }, 400);
				$("#tahtikisa .black").stop()
					.animate({ width: '84px', height: '0px' }, 400).hide();
			}
		);
		
		$("#vieraskirja").hover(
			function() {
				$("#vieraskirja .white").stop()
					.animate({ width: '103px', height: '0px' }, 400).hide();
				$("#vieraskirja .black").stop().show()
					.animate({ width: '103px', height: '12px' }, 400);
			},
			function() {
				$("#vieraskirja .white").stop().show()
					.animate({ width: '103px', height: '12px' }, 400);
				$("#vieraskirja .black").stop()
					.animate({ width: '103px', height: '0px' }, 400).hide();
			}
		);
		
		$("#juniorit").hover(
			function() {
				$("#juniorit .white").stop()
					.animate({ width: '74px', height: '0px' }, 400).hide();
				$("#juniorit .black").stop().show()
					.animate({ width: '74px', height: '12px' }, 400);
			},
			function() {
				$("#juniorit .white").stop().show()
					.animate({ width: '74px', height: '12px' }, 400);
				$("#juniorit .black").stop()
					.animate({ width: '74px', height: '0px' }, 400).hide();
			}
		);
		
		
 });
