$(document).ready(function(){

	$('#main-news-slider').show();

	$('body').css('background-position', 'center 178px');
	
	//Instantiates the tab wrapper
	$( "#tab-wrapper" ).tabs({ 
		fx: { opacity: 'toggle' }
	});
	
	//Instantiates the slider
	$('#main-news-slider').bxSlider({ 
		controls: false, 
		auto: true,
		speed: 500,
		pause: 10000,
		pager: true 
	});
	
	//Instantiates the game slider
	$('#upcoming-game-slider').nivoSlider({
		effect:'fold',
		slices:1,
		animSpeed:400,
		pauseTime:60000,
		directionNav: true,
		directionNavHide: false, 
		controlNav: false, 
		controlNavThumbs: false 
	});	
	
	//Sets the news menu item to active
	if($('body').hasClass('archive') || $('body').hasClass('single-post')){
		$('.main-navigation li.news').addClass('active');
	}
	
	//
    $('input#name').focus( function() {
    	if($(this).attr('value') == 'Namn') {
        	$(this).attr('value', '');
        }       
    });
    $('input#name').blur( function() {
    	if($(this).attr('value') == '') {
        	$(this).attr('value', 'Namn');
        }       
    });
    $('input#email').focus( function() {
    	if($(this).attr('value') == 'Mail') {
        	$(this).attr('value', '');
        }       
    });
    $('input#email').blur( function() {
    	if($(this).attr('value') == '') {
        	$(this).attr('value', 'Mail');
        }       
    });  
    
});

