//<![CDATA[
	// Initialise Superfish plugin - Navigation (main)
	jQuery(function(){
		jQuery('ul.sf-menu').superfish();
	});

	// Initialise Cycle plugin - Banner
	jQuery(function() {
		jQuery('#cycleBanner').cycle({
			fx:'fade',
			prev:'#prevBanner',
			next:'#nextBanner',
			pause:1,
			random:0,
			timeout:12000,
			pager:'#navBannerPager',
			pagerEvent:'mouseover',
			pauseOnPagerHover:true
		});
	});
	
	// Initialise Cycle plugin - News
	jQuery(function() {
		jQuery('#cycleNews').cycle({
			fx:'scrollHorz',
			prev:'#prevNews',
			next:'#nextNews',
			pause:1,
			random:1,
			timeout:6000,
			pager:'#navNewsPager',
			pagerEvent:'mouseover',
			pauseOnPagerHover:true
		});
	});
	
	// Initialise Cycle plugin - InfoScreens
	jQuery(function() {
		jQuery('#cycleInfoScreen').cycle({
			fx:'scrollHorz',
			prev:'#prevNews',
			next:'#nextNews',
			pause:1,
			random:1,
			timeout:6000,
			pager:'#navInfoScreenPager',
			pagerEvent:'mouseover',
			pauseOnPagerHover:true
		});
	});

	// Initialise Cycle plugin - Testimonials
	jQuery(function() {
		jQuery('.testimonials').cycle({
			cleartype:1, // Enable cleartype correction in IE
			fx:'fade',
			pause:1,
			random:1,
			timeout:15000
		});
	});
	
	// Initialise Truncator plugin - Blog: http://github.com/henrik/jquery.truncator.js/tree/master
	jQuery(function() {
		jQuery('.blogPost').truncate({
			max_length:400,
			more:'Visa mer',
			less:'Visa mindre',
			expandable:true
		});
	});
	
	// Slider - Feedback
	jQuery(document).ready(function(){
		var button = $('.feedback'), slideObject = jQuery('#containerFeedback'), slideContent = jQuery('#contentFeedback'), closedWidth = 30, openWidth = 500, speed = 400;
		/*jQuery(slideContent).css({ width:'30px', display:'none' });*/
		jQuery(button).toggle(
			function(){
				// Show content before animating
				jQuery(slideContent).show();
				// Animate - open
				jQuery(slideObject).animate({
					width: openWidth}, {duration: speed});
					return false;
			},
			function(){
				// Animate - close and on completion hide content
				jQuery(slideObject).animate({
					width: closedWidth}, {duration: speed, complete: function(){slideContent.hide();}});
					return false;
			}
		);
	});
	
	// Slider - Comments
	jQuery(document).ready(function() {
		jQuery('.containerCommentsForm').hide(); // Hide div on load so that div is visible if javascript disabled
		jQuery('.comment').click(function() {
			jQuery('.containerCommentsForm').toggle(400); // Speed in millisecond - can use predefined 'fast' or 'slow'
			return false;
		});
	});
	
	// Initialise Scroll to top plugin
	jQuery(function() {
		jQuery('#containerToTop').scrollToTop({
			speed:800, // Speed in millisecond - can use predefined 'fast' or 'slow'
			ease:'easeInOutExpo'
		});
	});

	// AddThis - custom variables
	var addthis_language = "sv";
	
	// Map - animation
	jQuery('#aerial').ready(function(){ // Waits for img with specific id to load before animating, can also use jQuery(window)
		jQuery('#aerial').animate({
			opacity: 1,
			marginLeft:'-800'
		}, 3000, 'easeInOutQuad');
	});
	
	// IE z-index buggfix. Places superfish menu above. http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/comment-page-1/
	jQuery(function() {
		var zIndexNumber = 1000;
		jQuery('#containerHead div').each(function() {
			jQuery(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
		});
	});
	

	// Prevent default behavior eg. <a href="#">
	/*$('.noDefaultBehavior').click(function(){
		return false;
	});*/
//

Shadowbox.init({ // http://www.shadowbox-js.com/usage.html
	skipSetup:true,
	animate:true,
	continuous:true, // Allows looping backwards and forwards
	counterType:'skip', // 'default' (1 of 3) or 'skip' (1 2 3)
	displayCounter:true,
	displayNav:true,
	language:'sv',
	handleOversize:'resize', // 'none', 'resize' or 'drag'
	overlayColor:'#000000',
	overlayOpacity:0.8,
	slideshowDelay:0 // Delay for each slide in seconds. If set to 0 then no auto slideshow
});
window.onload = function(){
	// set up all anchor elements with a "movie" class to work with Shadowbox
	Shadowbox.setup(".lightbox a", {
		gallery:'Construct IT - Lightbox',
		autoplayMovies:true
	});
};
