﻿$(document).ready(function(){
	// TOPNEWS SLIDER
	$('#slider-topNews').smallslider({
		time: ' 10000',
		autostart:true, 		
		onImageStop:true, 
		switchMode: 'hover', 
		switchEffect:'fadeOut',
		//switchEase: 'easeOutSine',
		switchPath: 'left', 
		switchTime: '2000',
		actionGap: '200',
		showButtons:true,
		
		buttonOffsetX: '10',
		buttonOffsetY: '65',
		buttonSpace: '2',		
		showText:true, 
		textLink:true,
		textPosition: 'bottom',
		buttonPosition: 'rightBottom',
		textAlign: 'left',		
		textSwitch:1
	});
	// ZAPPING NEWS SLIDER
	$('#zapping_news').bxSlider({
		mode: 'vertical',
		displaySlideQty: 5,
		moveSlideQty: 4,
		ticker: true,
		tickerHover: true,			
		tickerSpeed: 5000
	});
	var slider = $('#webTV').bxSlider({
		controls: false,
		mode: 'fade',
		captions: true,
		captionsSelector: '#webTV_overlay', 
		speed: 500,
		pause: 5000,
		auto: false
		
	});
	$('.thumbs a').click(function(){
		var thumbIndex = $('.thumbs a').index(this);
		slider.goToSlide(thumbIndex);
		$('.thumbs a').removeClass('pager-active');
		$(this).addClass('pager-active');
		return false;
	});        
	$('.thumbs a:first').addClass('pager-active');
	// GUIDA AZIENDE SLIDER
	$('#scroller_Aziende').bxSlider({
		mode: 'vertical',
		displaySlideQty: 6,
		ticker: true,
		tickerHover: true,
		tickerSpeed: 1500
	});
	// GUIDASHOP EDITORIA SLIDER
	$('#shop_editoria').bxSlider({
		displaySlideQty: 5,
		moveSlideQty: 1,
		infiniteLoop: true,
		hideControlOnEnd: true
	});
	// GUIDASHOP SOFTWARE SLIDER
	$('#shop_software').bxSlider({
		displaySlideQty: 5,
		moveSlideQty: 1,
		infiniteLoop: true,
		hideControlOnEnd: true
	});
	// FLOWPLAYER WEB TV
	// GENERO UN RANDOM ID
	var currentDate = new Date();
	var RandID = currentDate.getTime();
	// setup player without "internal" playlists
	$(function() {			
		$f("player2", "/swf/flowplayer-3.2.5.swf?id="+RandID, {
		plugins: {
			controls: {
				url: '/swf/flowplayer.controls-3.2.3.swf',			
				backgroundColor: "transparent",
				backgroundGradient: "none",
				sliderColor: '#FFFFFF',
				sliderBorder: '1.5px solid rgba(160,160,160,0.7)',
				volumeSliderColor: '#FFFFFF',
				volumeBorder: '1.5px solid rgba(160,160,160,0.7)',
				timeColor: '#ffffff',
				durationColor: '#535353',
				tooltipColor: 'rgba(255, 255, 255, 0.7)',
				tooltipTextColor: '#000000',					
				borderRadius:"0px",
				timeColor:"#ffffff",
				bufferGradient:"none",
				slowForward:true,
				backgroundColor:"rgba(0, 0, 0, 0)",
				volumeSliderGradient:"none",
				slowBackward:false,
				timeBorderRadius:20,
				time:true,
				progressGradient:"none",
				height:26,
				volumeColor:"rgba(255, 102, 0, 1)",
				tooltips:{
					stop:"Stop",
					slowMotionFBwd:"Fast backward",
					previous:"Previous",
					next:"Next",
					play:"Play",
					buttons:true,
					slowMotionFwd:"Slow forward",
					unmute:"Unmute",
					fullscreen:"Fullscreen",
					pause:"Pause",
					slowMotionFFwd:"Fast forward",
					marginBottom:5,
					fullscreenExit:"Exit fullscreen",
					scrubber:true,
					volume:true,
					slowMotionBwd:"Slow backward",
					mute:"Mute"
				},
				fastBackward:false,
				opacity:1,
				timeFontSize:12,
				border:"0px",
				volumeSliderColor:"#ffffff",
				bufferColor:"#a3a3a3",
				buttonColor:"rgba(255, 102, 0, 1)",
				mute:true,
				autoHide:{
					enabled:false,
					hideDelay:500,
					mouseOutDelay:500,
					hideStyle:"fade",
					hideDuration:400,
					fullscreenOnly:true
				},
				backgroundGradient:"none",
				width:"100pct",
				display	:"block",
				sliderBorder:"1px solid rgba(128, 128, 128, 0.7)",
				buttonOverColor:"#ffffff",
				fullscreen:false,
				timeBgColor:"rgb(0, 0, 0, 0)",
				scrubberBarHeightRatio:0.2,
				bottom:0,
				stop:false,
				sliderColor:"#000000",
				zIndex:1,
				scrubberHeightRatio:0.6,
				tooltipTextColor:"#ffffff",
				sliderGradient:"none",
				spacing:{
					time:6,
					volume:8,
					all:2
				},
				timeBgHeightRatio:0.8,
				volumeSliderHeightRatio:0.6,
				timeSeparator:" ",
				name:"controls",
				volumeBarHeightRatio:0.2,
				left:"50pct",
				tooltipColor:"rgba(0, 0, 0, 0)",
				playlist:false,
				durationColor:"rgba(255, 102, 0, 1)",
				play:true,
				fastForward:true,
				timeBorder:"0px solid rgba(0, 0, 0, 0.3)",
				progressColor:"rgba(255, 102, 0, 1)",
				scrubber:true,
				volume:true,
				volumeBorder:"1px solid rgba(128, 128, 128, 0.7)",
				builtIn:false,
				margins:[2,6,2,12]
			},				
		},
		clip: {baseUrl: 'http://www.guidaedilizia.it/public/Video',autoBuffering: true,autoPlay: true}
		// use playlist plugin. again loop is true
		}).playlist("div.clips", {loop:false});
	});			
});
function JSFX_FloatTopLeft() { 
 var width = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
 var startX = ((width/2)+480), startY = 12 
 var ns = (navigator.appName.indexOf("Netscape") != -1); 
 var d = document; 
 var px = document.layers ? "" : "px"; 
 function ml(id) 
 { 
	 var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; 
	 if(d.layers)el.style=el; 
	 el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;}; 
	 el.x = startX; el.y = startY; 
	 return el; 
 } 
 window.stayTopLeft=function() 
 { 
	 var pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; 
	 var dY = (pY > startY) ? pY : startY; 
	 ftlObj.y += (dY - ftlObj.y)/8; 
	 ftlObj.sP(ftlObj.x, ftlObj.y); 
	 setTimeout("stayTopLeft()", 20); 
 } 
 ftlObj = ml("Skyscraper"); 
 stayTopLeft(); 
} ;		
