$(document).ready(function() {
	
	// Upprops-bild - vänsterkant
	$(function() {
			$("#fixed-highlight")
				.mouseover(function() { 
					var src = $(this).attr("src").substring(0, $(this).attr("src").lastIndexOf('.')) + "_mo.png";
					$(this).attr("src", src);
				})
				.mouseout(function() {
					var src = $(this).attr("src").replace("_mo.png", ".png");
					$(this).attr("src", src);
				});
		});
		
	
	// Arkiv
	$('#archive ul.years li.year').click(function() {
		var $this = $(this);
		var $years = $this.closest('li.year').siblings().removeClass('active');
		var $months = $years.find('ul.months').hide(500);
	
		$this.closest('li').toggleClass('active');
		$this.find('ul').toggle(500, function() {});
	});
	
	$('#archive ul.years li:first').click();
	
	
	// A+ popup
	$("a#inline").fancybox();
	
		
	// Fixa height på sidebar-border
	setTimeout(function(){
		var hl = $('#body-left').height();
		var hr = $('#body-right').height();

		if (hr > hl) {
			$('#body-left').css('height', hr);
		}
	}, 1000);
	
	
	// Skribenter-dropdown menu
	$("#link").mouseover(function() {
		$('#triangle').toggle();
		$('#menuList').toggle();
	});
	
});

function clearText(thefield) {
	if (thefield.defaultValue == thefield.value)
		thefield.value = ""
} 

function addText(thefield) {
	if (thefield.value == "")
		thefield.value = thefield.defaultValue
}
