/**
 * Function Bonaldi
 *
 * @author Michele Bertoletti
 * 
 *
 */
 function ie8SafePreventEvent(e){ 
    if(e.preventDefault){ e.preventDefault()} 
    else{e.stop()}; 
    e.returnValue = false; 
    e.stopPropagation();  
} 

function aggiorna_tb_showcase() {
	$('.showcase-thumbnail-restriction').css('width', 980+'px');
   $('.showcase-thumbnail-restriction').css('margin-left', 0+'px');
   $('.showcase-thumbnail-wrapper-horizontal').css('width', 980+'px');
   $('.showcase-thumbnail').css('overflow', 'visible');
}

$(document).ready(function()
{
	$("#showcase").awShowcase(
	{
		content_width:			980,
		content_height:			540,
		fit_to_parent:			false,
		auto:					true,
		interval:				3000,
		continuous:				true,
		loading:				true,
		tooltip_width:			200,
		tooltip_icon_width:		32,
		tooltip_icon_height:	32,
		tooltip_offsetx:		18,
		tooltip_offsety:		0,
		arrows:					false,
		buttons:				false,
		btn_numbers:			true,
		keybord_keys:			true,
		mousetrace:				false, /* Trace x and y coordinates for the mouse */
		pauseonover:			true,
		stoponclick:			true,
		transition:				'fade', /* hslide/vslide/fade */
		transition_delay:		300,
		transition_speed:		500,
		show_caption:			'onhover', /* onload/onhover/show */
		thumbnails:				true,
		thumbnails_position:	'outside-last', /* outside-last/outside-first/inside-last/inside-first */
		thumbnails_direction:	'horizontal', /* vertical/horizontal */
		thumbnails_slidex:		0, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
		dynamic_height:			false, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
		speed_change:			false, /* Set to true to prevent users from swithing more then one slide at once. */
		viewline:				false /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */
	});

   aggiorna_tb_showcase();
   $.backstretch("images/sfondo.png");
 });
 
 $(window).load(function() {
	$('#news-primopiano').orbit({
     animation: 'vertical-slide',                  // fade, horizontal-slide, vertical-slide, horizontal-push
     animationSpeed: 800,                // how fast animtions are
     timer: true, 			 // true or false to have the timer
     advanceSpeed: 3500, 		 // if timer is enabled, time between transitions 
     pauseOnHover: true, 		 // if you hover pauses the slider
     startClockOnMouseOut: true, 	 // if clock should start on MouseOut
     startClockOnMouseOutAfter: 500, 	 // how long after MouseOut should the timer start again
	 captionAnimation: 'none', 			// fade, slideOpen, none
     captionAnimationSpeed: 0,
     directionalNav: false,
     bullets: true			 // true or false to activate the bullet navigation
	});
});
  


