$(document).ready(function(){ 
	//Sitespecific javascript here
	//Searchbox clear and fill
	function search_input_values()
	{	
		var searchBox = $('#search input');
		$('#search input').focus(function(){
			if (searchBox.val() != "") {
				var theValue = "";
				searchBox.val('');
			};
		
		});
		$('#search input').blur(function(){
			if (searchBox.val() == "") {
				var theValue = "Fyll i sökord";
				searchBox.val(theValue);
			};
			
		});
	}
	search_input_values();
	
	 //Even and odd rows in tables
        /* if Environment is NOT Editor */
        $("table tr").mouseover(function() {
        $(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");
        });
        $("table tr:even").addClass("even");
        $("table tr:odd").addClass("odd");
        var th = $("table tr:first-child");
        $(th).removeClass('even')
        $(th).addClass("th");
        $('table tr td:first-child').addClass('first');

	
	/*Accordion menu*/
	//Hide submenus
	$('#sub_nav li ul').hide();
	//If menu option is current, show sub menu
	if ($('#sub_nav li:first-child').hasClass('current'))
		{
			$('#sub_nav ul:first-child > li > ul').slideToggle('slow');
		};
	//When clicking the top level, show submenu, but not sub sub menus
	$('#sub_nav ul:first-child > li > a').click(function() {
		
			$(this).parent().toggleClass('current');
		
		$(this).next().slideToggle('slow');
		return false;
	});
	




});
