$(document).ready( function(){

	//First and last childs, lists
	$('ul li:first-child').addClass('fli');
	$('ul li:last-child').addClass('lli');

	//Zebra-striped tables
	$('table.zebra tr:even').addClass('even');

	//Kategori-meny
		//Skjul underkategorier onload
		$("ul#kategorier li:not('.selected') ul").css({ display: "none" });
		$('ul#kategorier li.selected:last').addClass('chosen');

		//Meny-dynamikk
		/*
		$("ul#kategorier > li a.parent").click( function(){

			$("ul#kategorier > li a").removeClass("active");
			$(this).addClass("active");

			if($(this).next().css("display") == "none") {
				$(this).next().show("slow");
				//return false;
			} else {
				$(this).next().hide("slow");
				//return false;
			}
		});
		*/

	//Label-switcher for forms
	$('form.labelswitch .swl').each( function(){

		$(this).prev().hide();
		if($(this).val() == ''){
			$(this).val($(this).prev().text().slice(0, -1));
			if($(this).attr('type') == 'password'){
				//$(this).attr('type', 'text');
			}
		}

	});

	$('form.labelswitch .swl').click( function(){
		$(this).val('');
		if($(this).prev().text() == 'Passord:'){
			$(this).attr('type', 'password');
		}
	});


	$('ul#bestsellers li').click( function(){
		var yo = $(this).children('a').attr('href');
		window.location = yo;
	});

});