// equal heights
function setEqualHeight(columns) 
{
	var tallestcolumn = 0;
	columns.each(
	function() 
	 {
		  currentHeight = $(this).height();
		  if(currentHeight > tallestcolumn) 
		  {
				tallestcolumn = currentHeight;
		  }
	}
	);
	columns.height(tallestcolumn);
}


$(document).ready(function() {
	setEqualHeight($(".entryarea_col"));

});

// equal heights
function setEqualHeight(columns) 
{
	var tallestcolumn = 0;
	columns.each(
	function() 
	 {
		  currentHeight = $(this).height();
		  if(currentHeight > tallestcolumn) 
		  {
				tallestcolumn = currentHeight;
		  }
	}
	);
	columns.height(tallestcolumn);
}


$(document).ready(function() {
	setEqualHeight($("a.linklists"));

});

// link animation footer links
  $('.footer_col a').mouseover(function() {
    $(this).css().animate({paddingLeft:"37px"}, {queue:false, duration:300});
  }).mouseout(function() {
    $(this).css().animate({paddingLeft:"30"}, {queue:false, duration:300});
  });    

// link animation linklists
  $('ul.linklists li a').mouseover(function() {
    $(this).css().animate({paddingLeft:"10px"}, {queue:false, duration:300});
  }).mouseout(function() {
    $(this).css().animate({paddingLeft:"0px"}, {queue:false, duration:300});
  });   
  
// link animation tooltip
  $('strong').mouseover(function() {
    $(this).css().animate({paddingTop:"7px"}, {queue:false, duration:300});
  }).mouseout(function() {
    $(this).css().animate({paddingTop:"0px"}, {queue:false, duration:300});
  });   
  
// link animation medlem
  $('#medlem').mouseover(function() {
    $(this).css().animate({paddingTop:"7px"}, {queue:false, duration:300});
  }).mouseout(function() {
    $(this).css().animate({paddingTop:"0px"}, {queue:false, duration:300});
  });  
  
// link animation medlem_se
  $('#medlem_se').mouseover(function() {
    $(this).css().animate({paddingTop:"7px"}, {queue:false, duration:300});
  }).mouseout(function() {
    $(this).css().animate({paddingTop:"0px"}, {queue:false, duration:300});
  });  

// link animation flags
  $('#flags_language_selector a img').mouseover(function() {
    $(this).css().animate({paddingTop:"17px"}, {queue:false, duration:300});
  }).mouseout(function() {
    $(this).css().animate({paddingTop:"10px"}, {queue:false, duration:300});
  });  

// bookmark
function bookmark_us(url, title){

if (window.sidebar) // firefox
    window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();
}
else if(document.all)// ie
    window.external.AddFavorite(url, title);
}


$(document).ready(function(){
 
//Specify even and odd selectors
	$("table.dokumentlist tbody tr:even").addClass("even");
 
});


/*******

	***	Anchor Slider by Cedric Dugas   ***
	*** Http://www.position-absolute.com ***
	
	Never have an anchor jumping your content, slide it.

	Don't forget to put an id to your anchor !
	You can use and modify this script for any project you want, but please leave this comment as credit.
	
*****/
		


$(document).ready(function() {
	$("a.totop").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 800
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}


// tabs otbor
var TabbedContent = {
	init: function() {	
		$(".tab_item").mouseover(function() {
		
			var background = $(this).parent().find(".moving_bg");
			
			$(background).stop().animate({
				left: $(this).position()['left']
			}, {
				duration: 300
			});
			
			TabbedContent.slideContent($(this));
			
		});
	},
	
	slideContent: function(obj) {
		
		var margin = $(obj).parent().parent().find(".slide_content").width();
		margin = margin * ($(obj).prevAll().size() - 1);
		margin = margin * -1;
		
		$(obj).parent().parent().find(".tabslider").stop().animate({
			marginLeft: margin + "px"
		}, {
			duration: 300
		});
	}
}

$(document).ready(function() {
	TabbedContent.init();
});

// JavaScript Document

//tabs effects sidebar

var TabbedContent2 = {
	init: function() {	
		$(".tab_item2").mouseover(function() {
		
			var background = $(this).parent().find(".moving_bg2");
			
			$(background).stop().animate({
				left: $(this).position()['left']
			}, {
				duration: 300
			});
			
			TabbedContent2.slideContent($(this));
			
		});
	},
	
	slideContent: function(obj) {
		
		var margin = $(obj).parent().parent().find(".slide_content2").width();
		margin = margin * ($(obj).prevAll().size() - 1);
		margin = margin * -1;
		
		$(obj).parent().parent().find(".tabslider2").stop().animate({
			marginLeft: margin + "px"
		}, {
			duration: 300
		});
	}
}

$(document).ready(function() {
	TabbedContent2.init();




});
