 $(function(){

	//Tar bort title attributet på kategorier
    $("#blogg-meta li a").each(function(){
        jQuery(this).removeAttr('title');
    })
	
    $(".wp-pagenavi a").each(function(){
        jQuery(this).removeAttr('title');
    })
		
    $(".tagcloud a").each(function(){
        jQuery(this).removeAttr('title');
    })
	
    $("#sidepanel ul li a").each(function(){
        jQuery(this).removeAttr('title');
    })	
	
    $(".number-comments a").each(function(){
        jQuery(this).removeAttr('title');
    })	

	$(".social a").easyTooltip();
	$("div").easyTooltip();
	$(".related-post a").easyTooltip();
	$("#sidepanel img").easyTooltip();
	$("#sidepanel img a").easyTooltip();
	$("#sidepanel .flickr a").easyTooltip();
	$("#footer a").easyTooltip();
	//$("#portfolio .portfolio-item a").easyTooltip();	

	$("a[href$='.pdf']").addClass("pdf");
	$("a[href$='.zip']").addClass("download");
	$("a[href$='.rar']").addClass("download");


	var IE7 = (navigator.userAgent.indexOf("MSIE 7")>=0) ? true : false;
	if(IE7){
		
	}
	else{
	    $("#sidepanel ul li a, #footer ul li a")
			.mouseover(function(){
		        $(this)
				.stop()
				.animate(
					{
						backgroundPosition:"(-5px -336px)",
						paddingLeft: 21
					},
					{
						duration: 150
					}
				)
			.mouseout(function(){ 
				$(this)
				.stop()
				.animate(
					{
						backgroundPosition:"(-35px -336px)",
						paddingLeft: 5
					}, 
					{
						duration: 220
					}
				)
			})		
	    })		
	}



	$('#main-navigation a').each(function(i) {
		var ypos = i * -200;
		if (!$(this).parent().hasClass('current_page_item')){
			$(this).css({
				backgroundPosition: ("0 " + (ypos - 100) + "px")
			})
			.mouseover(function(){
				$(this)
				.stop()
				.animate(
					{
						backgroundPosition:"(0 " + (ypos - 20) +"px)",
						paddingTop: 19
					}, 
					{duration: 300}
				)
			})
			.mouseout(function(){ 
				$(this)
				.stop()
				.animate(
					{
						backgroundPosition:"(0 " + (ypos - 100) + "px)",
						paddingTop:9
					}, 
					{
						duration: 200, 
						complete:function(){ 
							$(this).css({backgroundPosition: ("0 " + (ypos - 100) + "px")})
						}
					}
				)
			});
		} 
		else {
			$(this)
			.css({backgroundPosition: ("0 " + (ypos - 20) + "px")})

			.mouseover(function(){
					$(this).stop().animate({backgroundPosition:"(0 " + (ypos - 100) + "px)"}, {duration: 600})
					})
			.mouseout(function(){ 
				$(this)
				.stop()
				.animate(
					{
						backgroundPosition:"(0 " + (ypos - 20) + "px)",
						paddingTop: 19
					}, 
					{
						duration: 600,
						complete:function(){ 
							$(this).css({backgroundPosition: ("0 " + (ypos - 20) + "px")})
						}
					}
				)
			});						
		}
	});	
				

})