Cufon.replace('h1', { fontFamily: 'Dax-Light' });
Cufon.replace('span.colored', { fontFamily: 'Dax-Regular' });
Cufon.replace('h2', { fontFamily: 'Dax-Regular' });
Cufon.replace('div#contentblock div#newsblock div.newsbox h3', { fontFamily: 'Dax-Regular' });
Cufon.replace('div#contentblock div#newsblock div.newsbox h2', { fontFamily: 'Dax-Light' });
//Cufon.replace('div.newsbox_content p', { fontFamily: 'Dax-Regular' });
Cufon.replace('#bomb span', { fontFamily: 'Dax-Regular' });

/*
Cufon.replace('div#inner_nav a', {
	hover: true
});
Cufon.replace('#top_nav a', {
	hover: true
});
*/

$(document).ready(function(){
	$("img.team-padA").hover(function(){
		$(this).stop().animate({"opacity": "0"}, 150);
	},
	function(){
		$(this).stop().animate({"opacity": "1"}, 150);
	});
});

$(document).ready(function(){
	
	$('div#newstext.typography a').addClass('transition'); //Add transition class to links inside newstext
	
	$("img.padA").hover(function(){
		$(this).stop().animate({"opacity": "0"}, 300);
	},
	function(){
		$(this).stop().animate({"opacity": "1"}, 300);
	});
});

$(document).ready(function() {
	// Set up page transition code
	// Avoid having fade-ins on MSIE; looks wierd
	if ($.browser.msie) {
		//$("div#wrapper").css("display", "none").delay(200);
		//$('div#wrapper').show();
	}
	else {
		//$("div#wrapper").css("display", "none");
		$("div#wrapper").hide();
		$("div#wrapper").fadeIn(700);


	    $("a.transition").click(function(event){
	        event.preventDefault();
	        linkLocation = this.href;
	        $("div#wrapper").fadeOut(350, redirectPage);
	    });
	 
	    function redirectPage() {
	        window.location = linkLocation;
	    }
	}
});

$(document).ready(function() {
	/* OWN CODE */
	//$('div#wrapper').delay(250).show('fade',{duration:1500});
	$('div.newsbox p:last').css({'padding-bottom': '0', 'margin-bottom': '0'});
	
	if ($.browser.msie) {
	}
	else{
		$('div#newsblock div.newsbox').hide().show('fade',{duration:1500, queue: true});
		$('div#bomb').hide().delay(500).show('clip',{queue: false, direction: "right"},700);
	
		$('div#fakta_container img').css({'margin-left': '-30px', 'opacity': '0'});
		$('div#fakta_container img').animate({'margin-left': '0px', 'opacity': '1'}, 1000);
	}
	
	$('div#inner_nav ul li a.link').css( {backgroundPosition: "0px 36px"} );
	
	$(function(){
		$('div#top_nav ul li.team-pad a.team-pad')
			.css( {"background": "no-repeat url('../images/bike.png');"} )
			.mouseover(function(){
			$(this).stop().animate({"background": "no-repeat url('../images/bike_hover.png');"}, {queue: false, duration:250})
		})
		.mouseout(function(){
			$(this).stop().animate({"background": "no-repeat url('../images/bike.png');"}, {queue: false, duration:250})
			$(this).css( {"background": "no-repeat url('../images/bike.png');"} )
		})
	});
	
	
	$(function(){
		$('div#inner_nav ul li a.link')
			.css( {backgroundPosition: "0px 36px", "color": "#000000"} )
			.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0px 95px)"}, {queue: false, duration:250}).delay(70).animate({"color": "#fff"},{queue: false, duration:250})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0px 36px)"}, {queue: false, duration:150}).delay(70).animate({ "color": "#000"},{queue: false, duration:250, complete:function(){
			$(this).css({backgroundPosition: "0px 36px"})
		}})})
	});
	
	/* INITIALIZE jQUERY PLUGINS */
	$(function()
	{
		$('.scroll-pane').jScrollPane();
	});
	
	$(function(){
		var a = function(self){
		  self.anchor.fancybox({
				'titlePosition'	: 'inside',
				'opacity'		: true,
				'overlayShow'	: true,
				'overlayOpacity': 0.4,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'
			});
	   };
		$("#galleri").PikaChoose({buildFinished:a});
		$("#galleri").jcarousel({scroll:4,					
			initCallback: function(carousel) 
			{
				$(carousel.list).find('img').click(function() {
					//console.log($(this).parents('.jcarousel-item').attr('jcarouselindex'));
					carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
				});
			}
		});
	});
	
	   var a = function(self){
		  self.anchor.fancybox();
	   };
	   $("#pikame").PikaChoose({buildFinished:a});
	   
});
